State of Santa Modesta
santamodestawiki
https://santamodesta.miraheze.org/wiki/Main_Page
MediaWiki 1.40.1
first-letter
Media
Special
Talk
User
User talk
State of Santa Modesta
State of Santa Modesta talk
File
File talk
MediaWiki
MediaWiki talk
Template
Template talk
Help
Help talk
Category
Category talk
Module
Module talk
Template:Service record/doc
10
274
657
2010-11-30T17:19:02Z
wikipedia>Mhiji
0
moved [[Template:Service record/doc]] to [[Template:Infobox service record/doc]]
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox service record/doc]]
38cb0b93fc4900e0c498c2a21ceaf5575b9d3853
Template:Command structure/doc
10
270
649
2010-11-30T17:20:18Z
wikipedia>Mhiji
0
moved [[Template:Command structure/doc]] to [[Template:Infobox command structure/doc]]
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox command structure/doc]]
72133518cc1e5fc21c0f32cd8a42ae6c98d84e28
Template:Infobox settlement/pref
10
191
482
2013-10-19T11:16:10Z
wikipedia>WOSlinker
0
Changed protection level of Template:Infobox settlement/pref: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))
wikitext
text/x-wiki
<includeonly>{{#switch:{{ucfirst:{{{1}}}}}
|Imperial
|English
|UK|US|U.S.
|US Customary|U.S. Customary
|Standard = impus
|{{#switch:{{{2}}}
|[[United Kingdom]]|United Kingdom
|[[United States]]|United States
|[[United States of America]]|United States of America
|[[United States|United States of America]]
|[[Image:Flag of the United States.svg|20px]] [[United States]] = impus
|{{#ifeq:{{{3}}}_{{lc:{{{1}}}}}|area_dunam|dunam|metric}}
}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
7f7165e08b34afaaf9f84a31965beb8f3e8a21b8
Template:Infobox settlement/link
10
190
480
2013-10-19T11:19:36Z
wikipedia>WOSlinker
0
Changed protection level of Template:Infobox settlement/link: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))
wikitext
text/x-wiki
{{#if:{{{link|}}}<!--
-->|[[{{{link}}}|{{{type}}}]]<!--
-->|{{#ifexist:{{{type}}} of {{PAGENAME}}<!--
-->|[[{{{type}}} of {{PAGENAME}}|{{{type|}}}]]<!--
-->|{{#if:{{{name|}}}<!--
-->|{{#ifexist:{{{type}}} of {{{name}}}<!--
-->|[[{{{type}}} of {{{name}}}|{{{type|}}}]]<!--
-->|{{{type}}}<!--
-->}}<!--
-->|{{{type}}}<!--
-->}}<!--
-->}}<!--
-->}}<noinclude>
{{documentation}}
</noinclude>
7f1193f6be51d8bf296df176cd7c49b5d819202e
Template:Collapsible list
10
208
516
2013-11-02T05:07:45Z
wikipedia>Fuhghettaboutit
0
Changed protection level of Template:Collapsible list: Enable access by template editors ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:collapsible list|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
aff61df28bcc6c3457d6aa36ada4fffe68c409a9
Template:Userbox
10
114
323
2014-01-09T17:16:29Z
wikipedia>Mr. Stradivarius
0
switch to Lua version at [[Module:Userbox]]
wikitext
text/x-wiki
{{#invoke:userbox|userbox}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
43f31821f815f586868b4e5ea3e7116d7b972f58
Template:Pagetype
10
238
583
2014-07-09T08:29:38Z
wikipedia>Callanecc
0
Changed protection level of Template:Pagetype: [[WP:High-risk templates|Highly visible template]]: With more than 5.5 million transclusions and cascade protections this should be full protected as well ([Edit=Allow only administrators] (indefinite) [Move=
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:pagetype|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
b8e6aa66678cd57877ea2c607372a45070f030a7
Template:WPMILHIST Infobox style
10
261
631
2014-10-07T15:24:52Z
wikipedia>Jackmcbarn
0
make main_box piggyback off of main_box_raw
wikitext
text/x-wiki
<includeonly>{{#switch:{{{1|}}}
|main_box=class="{{#if:{{{2|}}}|infobox {{{2}}}|infobox}}" style="{{#invoke:Data|Module:WPMILHIST Infobox style|main_box_raw}}"
|{{#invoke:Data|Module:WPMILHIST Infobox style|{{{1|}}}}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
b117547056afc703e2f1371497b0a53fa5a22751
Template:Icon
10
90
275
2015-01-23T10:29:55Z
wikipedia>Mr. Stradivarius
0
switch this to use [[Module:Icon]]
wikitext
text/x-wiki
{{#invoke:Icon|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
bd5b855953c5eec9d9c48400aa39315cb4218558
Template:Comma separated entries
10
134
367
2015-05-26T18:05:33Z
wikipedia>Izkala
0
Switch to using [[Module:Separated entries]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|comma}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
f9811ed089bab742e4aad8b8463eddcc7607f062
Template:Br separated entries
10
129
357
2015-05-26T18:06:33Z
wikipedia>Izkala
0
Switch to using [[Module:Separated entries]]; leading and trailing whitespace and newlines are now trimmed
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|br}}<noinclude>
{{documentation}}
</noinclude>
2019f7fc383259e70d66e43cbd97a43d20889f1b
Template:Hlist
10
259
627
2015-07-04T15:13:14Z
wikipedia>Penwhale
0
Changed protection level of Template:Hlist: [[WP:High-risk templates|Highly visible template]] ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|horizontal}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
9e3824c2e3c0e0dbef2f37556ac0b994987fecf9
Template:Div col end
10
70
217
2015-10-03T15:58:07Z
wikipedia>NeilN
0
Changed protection level of Template:Div col end: per request at [[WP:RFPP]] ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))
wikitext
text/x-wiki
<includeonly></div></includeonly><noinclude>
{{Documentation|Template:Div col/doc}}
</noinclude>
78088d41c21d779e3722f220fcc9773dfbbc1e4f
Template:Spaces
10
168
436
2015-10-25T11:38:26Z
wikipedia>Edokter
0
use class
wikitext
text/x-wiki
<span class="nowrap">{{#iferror:{{#expr:{{{1|1}}}}}
|{{#switch:{{{1}}}
|fig= 
|en= 
|em= 
|thin= 
|hair= 
|
}}
|{{#invoke:String|rep|{{#switch:{{{2}}}
|fig= 
|en= 
|em= 
|thin= 
|hair= 
|
}}|{{{1|1}}}}}
}}</span><noinclude>
{{documentation}}
</noinclude>
a9ed762825e7579f15dcb9b171b0c1c3bf524b3f
Template:Cite encyclopedia
10
174
448
2015-11-13T02:17:24Z
wikipedia>Fuhghettaboutit
0
Changed protection level of Template:Cite encyclopedia: when I changed this to add template editors, I didn't realize it had cascding protection—so all my change did was make it appear as if it could be edited by them ([Edit=Allow only administrators...
wikitext
text/x-wiki
<includeonly>{{#invoke:citation/CS1|citation
|CitationClass=encyclopaedia
}}</includeonly><noinclude>
{{documentation}}
[[Category:Lua-based templates]]
</noinclude>
a5fbaa0493d06b11ef4dd711383f9fd5174a4238
Template:Diff
10
282
678
2016-04-10T08:58:51Z
wikipedia>Edokter
0
Add title= to easy copy/paste of diff links
wikitext
text/x-wiki
<span class="plainlinks">[{{#if:{{{title|{{{page|{{{1|}}}}}}}}}
|{{fullurl:{{{title|{{{page|{{{1}}}}}}}}}|{{#if:{{{diff|{{{2|}}}}}}
|diff={{trim|{{{diff|{{{2}}}}}}}}&
}}oldid={{trim|{{{oldid|{{{3|}}}}}}}}}}
|{{SERVER}}{{SCRIPTPATH}}/index.php?title={{#if:{{{diff|{{{2|}}}}}}
|&diff={{trim|{{{diff|{{{2}}}}}}}}
}}&oldid={{trim|{{{oldid|{{{3|}}}}}}}}
}}{{#ifeq:{{{diffonly|}}}|yes|&diffonly=1}} {{{label|{{{4|}}}}}}]</span><noinclude>
{{documentation}}
</noinclude>
32a6320b7d9c2652396a60306875ca9c97d3273e
Template:Str left
10
136
371
2016-09-30T07:01:19Z
wikipedia>Ymblanter
0
Changed protection level of Template:Str left: [[WP:High-risk templates|Highly visible template]]: RFPP request ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
<includeonly>{{safesubst:padleft:|{{{2|1}}}|{{{1}}}}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
2048b0d7b35e156528655b1d090e8b5ffab3f400
Template:Both
10
167
434
2016-12-04T04:31:50Z
wikipedia>JJMC89
0
make subst'able
wikitext
text/x-wiki
{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{SAFESUBST:<noinclude />#if:{{{2|}}}|1}}}}<noinclude>
{{documentation}}
</noinclude>
57c3c0ffa811a7f31c675b2d79aedf4382e9b88d
Template:Cite web
10
169
438
2016-12-05T05:36:52Z
wikipedia>Anthony Appleyard
0
Protected "[[Template:Cite web]]": restore old protection ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
<includeonly>{{#invoke:citation/CS1|citation
|CitationClass=web
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
ea1b0f38afd9728a1cf9f2e3f540887a402fab8e
Template:Location map
10
215
532
2017-03-16T00:55:26Z
wikipedia>Plastikspork
0
TFD closed as no consensus (using [[User:Evad37/TFDcloser|TFDcloser]])
wikitext
text/x-wiki
<includeonly>{{#invoke:Location map|main}}</includeonly><noinclude>{{documentation}}</noinclude>
732416b8068d2dc3549db5aa5ffa786beb502886
Template:Precision
10
212
526
2017-03-25T12:38:46Z
wikipedia>Jo-Jo Eumerus
0
Changed protection level for "[[Template:Precision]]": Allowing template editors on some templates with full protection dating back to pre-[[WP:TPROT|TPROT]] times which aren't too often or too sensitively used. ([Edit=Require template editor access] (...
wikitext
text/x-wiki
<includeonly>{{#invoke:Math|precision|{{{1|0}}}|check_fraction=true}}</includeonly><noinclude>
{{documentation}}
</noinclude>
944a0e5e6c5ace1e2a418c7969c645313b30395a
Template:Smallsup
10
135
369
2017-03-25T12:38:47Z
wikipedia>Jo-Jo Eumerus
0
Changed protection level for "[[Template:Smallsup]]": Allowing template editors on some templates with full protection dating back to pre-[[WP:TPROT|TPROT]] times which aren't too often or too sensitively used. ([Edit=Require template editor access] (i...
wikitext
text/x-wiki
<includeonly><sup><small>{{{1}}}</small></sup></includeonly><noinclude>
{{Documentation}}
</noinclude>
c174fb3247218273210500118556feb9f3c76d5a
Template:Max
10
213
528
2017-03-25T16:04:13Z
wikipedia>Jo-Jo Eumerus
0
Changed protection level for "[[Template:Max]]": Allowing template editors on some templates with full protection dating back to pre-[[WP:TPROT]] times which aren't too often or too sensitively used. ([Edit=Require template editor access] (indefinite)...
wikitext
text/x-wiki
<includeonly>{{#invoke:Math|max}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
f052e3a9b5b08740be624045e49f31d86e09f0ad
Template:Side box
10
180
460
2017-04-08T19:24:23Z
wikipedia>Jo-Jo Eumerus
0
Changed protection level for "[[Template:Side box]]": [[WP:High-risk templates|Highly visible template]]: Allowing template editors ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
{{#invoke:Side box|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
f02d48c7bd2f7bc64e2982d16b3578c99137d27e
Template:Navbar
10
33
339
2017-04-22T18:49:17Z
wikipedia>Plastikspork
0
Closed
wikitext
text/x-wiki
<includeonly>{{#invoke:Navbar|navbar}}</includeonly><noinclude>
{{documentation}}
</noinclude>
868e3566b7e8a9a5a7f3dac75cac429c47de10d3
Module:Lang/ISO 639 synonyms
828
157
414
2017-12-13T23:10:47Z
wikipedia>Trappist the monk
0
Scribunto
text/plain
-- File-Date: 2013-01-11
return {
["aar"] = "aa",
["abk"] = "ab",
["afr"] = "af",
["aka"] = "ak",
["amh"] = "am",
["ara"] = "ar",
["arg"] = "an",
["asm"] = "as",
["ava"] = "av",
["ave"] = "ae",
["aym"] = "ay",
["aze"] = "az",
["bak"] = "ba",
["bam"] = "bm",
["bel"] = "be",
["ben"] = "bn",
["bih"] = "bh",
["bis"] = "bi",
["bod"] = "bo",
["bos"] = "bs",
["bre"] = "br",
["bul"] = "bg",
["cat"] = "ca",
["ces"] = "cs",
["cha"] = "ch",
["che"] = "ce",
["chu"] = "cu",
["chv"] = "cv",
["cor"] = "kw",
["cos"] = "co",
["cre"] = "cr",
["cym"] = "cy",
["dan"] = "da",
["deu"] = "de",
["div"] = "dv",
["dzo"] = "dz",
["ell"] = "el",
["eng"] = "en",
["epo"] = "eo",
["est"] = "et",
["eus"] = "eu",
["ewe"] = "ee",
["fao"] = "fo",
["fas"] = "fa",
["fij"] = "fj",
["fin"] = "fi",
["fra"] = "fr",
["fry"] = "fy",
["ful"] = "ff",
["gla"] = "gd",
["gle"] = "ga",
["glg"] = "gl",
["glv"] = "gv",
["grn"] = "gn",
["guj"] = "gu",
["hat"] = "ht",
["hau"] = "ha",
["heb"] = "he",
["her"] = "hz",
["hin"] = "hi",
["hmo"] = "ho",
["hrv"] = "hr",
["hun"] = "hu",
["hye"] = "hy",
["ibo"] = "ig",
["ido"] = "io",
["iii"] = "ii",
["iku"] = "iu",
["ile"] = "ie",
["ina"] = "ia",
["ind"] = "id",
["ipk"] = "ik",
["isl"] = "is",
["ita"] = "it",
["jav"] = "jv",
["jpn"] = "ja",
["kal"] = "kl",
["kan"] = "kn",
["kas"] = "ks",
["kat"] = "ka",
["kau"] = "kr",
["kaz"] = "kk",
["khm"] = "km",
["kik"] = "ki",
["kin"] = "rw",
["kir"] = "ky",
["kom"] = "kv",
["kon"] = "kg",
["kor"] = "ko",
["kua"] = "kj",
["kur"] = "ku",
["lao"] = "lo",
["lat"] = "la",
["lav"] = "lv",
["lim"] = "li",
["lin"] = "ln",
["lit"] = "lt",
["ltz"] = "lb",
["lub"] = "lu",
["lug"] = "lg",
["mah"] = "mh",
["mal"] = "ml",
["mar"] = "mr",
["mkd"] = "mk",
["mlg"] = "mg",
["mlt"] = "mt",
["mon"] = "mn",
["mri"] = "mi",
["msa"] = "ms",
["mya"] = "my",
["nau"] = "na",
["nav"] = "nv",
["nbl"] = "nr",
["nde"] = "nd",
["ndo"] = "ng",
["nep"] = "ne",
["nld"] = "nl",
["nno"] = "nn",
["nob"] = "nb",
["nor"] = "no",
["nya"] = "ny",
["oci"] = "oc",
["oji"] = "oj",
["ori"] = "or",
["orm"] = "om",
["oss"] = "os",
["pan"] = "pa",
["pli"] = "pi",
["pol"] = "pl",
["por"] = "pt",
["pus"] = "ps",
["que"] = "qu",
["roh"] = "rm",
["ron"] = "ro",
["run"] = "rn",
["rus"] = "ru",
["sag"] = "sg",
["san"] = "sa",
["sin"] = "si",
["slk"] = "sk",
["slv"] = "sl",
["sme"] = "se",
["smo"] = "sm",
["sna"] = "sn",
["snd"] = "sd",
["som"] = "so",
["sot"] = "st",
["spa"] = "es",
["sqi"] = "sq",
["srd"] = "sc",
["srp"] = "sr",
["ssw"] = "ss",
["sun"] = "su",
["swa"] = "sw",
["swe"] = "sv",
["tah"] = "ty",
["tam"] = "ta",
["tat"] = "tt",
["tel"] = "te",
["tgk"] = "tg",
["tgl"] = "tl",
["tha"] = "th",
["tir"] = "ti",
["ton"] = "to",
["tsn"] = "tn",
["tso"] = "ts",
["tuk"] = "tk",
["tur"] = "tr",
["twi"] = "tw",
["uig"] = "ug",
["ukr"] = "uk",
["urd"] = "ur",
["uzb"] = "uz",
["ven"] = "ve",
["vie"] = "vi",
["vol"] = "vo",
["wln"] = "wa",
["wol"] = "wo",
["xho"] = "xh",
["yid"] = "yi",
["yor"] = "yo",
["zha"] = "za",
["zho"] = "zh",
["zul"] = "zu"
}
f3fb5374c9e0fdef6ce6ea22736b79468358ca19
Template:Lang-fr
10
175
450
2017-12-23T22:56:28Z
wikipedia>Trappist the monk
0
/* top */weaken initial style; see [[Template_talk:Lang#-Latn_stuff]]; using [[Project:AWB|AWB]]
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=fr
}}</includeonly><noinclude>
{{documentation|Template:Lang-x/doc}}
[[Category:Italic multilingual support templates]]
</noinclude>
d931674bb3f25747fd413f72d24d104de98129b6
Template:Tsh
10
108
311
2018-01-10T19:22:23Z
wikipedia>Primefac
0
Protected "[[Template:Tsh]]": [[WP:SEMI|semi-protecting]] highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indefinite))
wikitext
text/x-wiki
#REDIRECT [[Template:Template shortcut]]
{{rcatsh|
{{R msp}}
{{R tsh}}
}}
9fde60ec995035a7ff432aea9b23c316c236351d
Template:Remove first word
10
137
373
2018-02-13T20:10:27Z
wikipedia>WOSlinker
0
separate pp-template not needed
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:String|replace|source={{{1}}}|pattern=^[^{{{sep|%s}}}]*{{{sep|%s}}}*|replace=|plain=false}}<noinclude>{{Documentation}}</noinclude>
df7a9e692f68be1581be06af5f51eaed5483b4c8
Template:Yesno-no
10
71
219
2018-02-13T20:27:17Z
wikipedia>WOSlinker
0
separate pp-template not needed
wikitext
text/x-wiki
{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|¬={{{¬|no}}}|def={{{def|no}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1ad7b7800da1b867ead8f6ff8cef76e6201b3b56
Template:Yesno-yes
10
258
625
2018-03-11T01:06:35Z
wikipedia>JJMC89
0
allow subst
wikitext
text/x-wiki
{{SAFESUBST:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|yes}}}|¬={{{¬|yes}}}|def={{{def|yes}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1644b79058ef2cece539a411edc164d98bb11ebe
Module:Distinguish
828
55
181
2018-04-01T10:06:10Z
wikipedia>Galobtter
0
fixed with text and selfref
Scribunto
text/plain
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local mTableTools --initialize lazily
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
function p.distinguish(frame)
mArguments = require('Module:Arguments')
mTableTools = require('Module:TableTools')
local args = mArguments.getArgs(frame)
local selfref = args.selfref
local text = args.text
args = mTableTools.compressSparseArray(args)
return p._distinguish(args, text, selfref)
end
function p._distinguish(args, text, selfref)
checkType("_distinguish", 1, args, 'table')
if #args == 0 and not text then return '' end
local text = string.format(
'Not to be confused with %s.',
text or mHatlist.orList(args, true)
)
hnOptions = {selfref = selfref}
return mHatnote._hatnote(text, hnOptions)
end
return p
0364d14af01fc656ad1d898c5036fbd12a7ca938
Template:Further
10
280
674
2018-07-27T17:29:22Z
wikipedia>Galobtter
0
fix so that don't need [[Module:Further]] anymore
wikitext
text/x-wiki
<includeonly>{{#invoke:labelled list hatnote|labelledList|Further information{{#if:{{{topic|}}}| on {{{topic|}}}}}}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
dd29c6dfb3894a2dc3f20144a654b7012c9a9214
Template:Infobox
10
9
133
2018-08-15T18:33:36Z
wikipedia>Primefac
0
Undid revision 855063393 by [[Special:Contributions/Jdlrobson|Jdlrobson]] ([[User talk:Jdlrobson|talk]]) rather problematic change mentioned [[Template_talk:Infobox#Using_template_styles_to_reduce_technical_debt_inside_mobile_skin|on talk page]], reverting until it can be sorted
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
817a9f5b6524eced06a57bd1d5fd7179f9369bf2
Module:WPMILHIST Infobox style
828
264
637
2018-09-21T22:30:21Z
wikipedia>Frietjes
0
slightly larger for [[Operation Fritham]]
Scribunto
text/plain
local retval = {
main_box_raw_auto_width = 'border-spacing:2px;',
header_raw = 'background-color:#C3D6EF;text-align:center;vertical-align:middle;font-size:110%;',
sub_header_raw = 'background-color:#DCDCDC;text-align:center;vertical-align:middle;',
header_color = 'background-color:#C3D6EF;',
nav_box = 'margin:0;float:right;clear:right;width:25.5em;margin-bottom:0.5em;margin-left:1em;',
nav_box_child = 'margin:0;float:right;clear:right;width:25em;margin-bottom:0.5em;',
nav_box_wide = '',
nav_box_header = 'background-color:#C3D6EF;',
nav_box_wide_header = 'background-color:#C3D6EF;',
nav_box_label = 'background-color:#DCDCDC;',
image_box_raw = 'text-align:center;border-bottom:1px solid #aaa;line-height:1.5em;',
image_box_plain_raw = 'text-align:center;line-height:1.5em;',
internal_border = '1px dotted #aaa;',
section_border = '1px solid #aaa;'
}
retval.main_box_raw = 'width:25.5em;' .. retval.main_box_raw_auto_width
retval.header_bar = 'style="' .. retval.header_raw .. '"'
retval.sub_header_bar = 'style="' .. retval.sub_header_raw .. '"'
retval.image_box = 'style="' .. retval.image_box_raw .. '"'
retval.image_box_plain = 'style="' .. retval.image_box_plain_raw .. '"'
return retval
0f9ea47bc17e40cdabbae6de54f63e40ae502f8e
Template:Nobold
10
48
151
2018-10-23T17:15:13Z
wikipedia>Frietjes
0
wikitext
text/x-wiki
<templatestyles src="Nobold/styles.css"/><span class="nobold">{{{1}}}</span><noinclude>
{{documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
9c92b5951772bb26ca0fbe9256418b65e47700dd
Template:Nbsp
10
194
488
2018-11-19T18:04:40Z
wikipedia>Amorymeltzer
0
{{R from template shortcut}}
wikitext
text/x-wiki
#REDIRECT [[Template:Spaces]]
{{Redirect category shell|
{{R from move}}
{{R from alternative name}}
{{R from template shortcut}}
}}
13b85f36a53a9f13b06535afaa4c19339f1ea4b6
Template:Template other
10
34
173
2018-12-16T22:06:25Z
wikipedia>Amorymeltzer
0
Changed protection level for "[[Template:Template other]]": [[WP:High-risk templates|Highly visible template]]: Transclusion count has increased dramatically ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Module:Separated entries
828
132
363
2018-12-17T20:54:33Z
wikipedia>Amorymeltzer
0
Changed protection level for "[[Module:Separated entries]]": [[WP:High-risk templates|High-risk Lua module]]: Over 2M transclusions ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
Scribunto
text/plain
-- This module takes positional parameters as input and concatenates them with
-- an optional separator. The final separator (the "conjunction") can be
-- specified independently, enabling natural-language lists like
-- "foo, bar, baz and qux". The starting parameter can also be specified.
local compressSparseArray = require('Module:TableTools').compressSparseArray
local p = {}
function p._main(args)
local separator = args.separator
-- Decode (convert to Unicode) HTML escape sequences, such as " " for space.
and mw.text.decode(args.separator) or ''
local conjunction = args.conjunction and mw.text.decode(args.conjunction) or separator
-- Discard values before the starting parameter.
local start = tonumber(args.start)
if start then
for i = 1, start - 1 do args[i] = nil end
end
-- Discard named parameters.
local values = compressSparseArray(args)
return mw.text.listToText(values, separator, conjunction)
end
local function makeInvokeFunction(separator, conjunction, first)
return function (frame)
local args = require('Module:Arguments').getArgs(frame)
args.separator = separator or args.separator
args.conjunction = conjunction or args.conjunction
args.first = first or args.first
return p._main(args)
end
end
p.main = makeInvokeFunction()
p.br = makeInvokeFunction('<br />')
p.comma = makeInvokeFunction(mw.message.new('comma-separator'):plain())
return p
e80231ff3de01afd7f62a94e0a34dc1e67504085
Module:Color contrast
828
98
291
2019-01-06T22:38:25Z
wikipedia>Johnuniq
0
fix unintended color2lum global error which is causing errors; clean whitespace
Scribunto
text/plain
--
-- This module implements
-- {{Color contrast ratio}}
-- {{Greater color contrast ratio}}
-- {{ColorToLum}}
-- {{RGBColorToLum}}
--
local p = {}
local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' )
local function sRGB (v)
if (v <= 0.03928) then
v = v / 12.92
else
v = math.pow((v+0.055)/1.055, 2.4)
end
return v
end
local function rgbdec2lum(R, G, B)
if ( 0 <= R and R < 256 and 0 <= G and G < 256 and 0 <= B and B < 256 ) then
return 0.2126 * sRGB(R/255) + 0.7152 * sRGB(G/255) + 0.0722 * sRGB(B/255)
else
return ''
end
end
local function hsl2lum(h, s, l)
if ( 0 <= h and h < 360 and 0 <= s and s <= 1 and 0 <= l and l <= 1 ) then
local c = (1 - math.abs(2*l - 1))*s
local x = c*(1 - math.abs( math.fmod(h/60, 2) - 1) )
local m = l - c/2
local r, g, b = m, m, m
if( 0 <= h and h < 60 ) then
r = r + c
g = g + x
elseif( 60 <= h and h < 120 ) then
r = r + x
g = g + c
elseif( 120 <= h and h < 180 ) then
g = g + c
b = b + x
elseif( 180 <= h and h < 240 ) then
g = g + x
b = b + c
elseif( 240 <= h and h < 300 ) then
r = r + x
b = b + c
elseif( 300 <= h and h < 360 ) then
r = r + c
b = b + x
end
return rgbdec2lum(255*r, 255*g, 255*b)
else
return ''
end
end
local function color2lum(c)
if (c == nil) then
return ''
end
-- html '#' entity
c = c:gsub("#", "#")
-- whitespace
c = c:match( '^%s*(.-)[%s;]*$' )
-- unstrip nowiki strip markers
c = mw.text.unstripNoWiki(c)
-- lowercase
c = c:lower()
-- first try to look it up
local L = HTMLcolor[c]
if (L ~= nil) then
return L
end
-- convert from hsl
if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9%.]*[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9%.]*)[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100)
end
-- convert from rgb
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*%)$')
return rgbdec2lum(tonumber(R), tonumber(G), tonumber(B))
end
-- convert from rgb percent
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100)
end
-- remove leading # (if there is one) and whitespace
c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$')
-- split into rgb
local cs = mw.text.split(c or '', '')
if( #cs == 6 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[2])
local G = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[4])
local B = 16*tonumber('0x' .. cs[5]) + tonumber('0x' .. cs[6])
return rgbdec2lum(R, G, B)
elseif ( #cs == 3 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[1])
local G = 16*tonumber('0x' .. cs[2]) + tonumber('0x' .. cs[2])
local B = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[3])
return rgbdec2lum(R, G, B)
end
-- failure, return blank
return ''
end
-- This exports the function for use in other modules.
-- The colour is passed as a string.
function p._lum(color)
return color2lum(color)
end
function p._greatercontrast(args)
local bias = tonumber(args['bias'] or '0') or 0
local css = (args['css'] and args['css'] ~= '') and true or false
local v1 = color2lum(args[1] or '')
local c2 = args[2] or '#FFFFFF'
local v2 = color2lum(c2)
local c3 = args[3] or '#000000'
local v3 = color2lum(c3)
local ratio1 = -1;
local ratio2 = -1;
if (type(v1) == 'number' and type(v2) == 'number') then
ratio1 = (v2 + 0.05)/(v1 + 0.05)
ratio1 = (ratio1 < 1) and 1/ratio1 or ratio1
end
if (type(v1) == 'number' and type(v3) == 'number') then
ratio2 = (v3 + 0.05)/(v1 + 0.05)
ratio2 = (ratio2 < 1) and 1/ratio2 or ratio2
end
if css then
local c1 = args[1] or ''
if mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c1 = '#' .. c1
end
if mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c2 = '#' .. c2
end
if mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c3 = '#' .. c3
end
return 'background-color:' .. c1 .. '; color:' .. ((ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or '') .. ';'
end
return (ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or ''
end
function p._ratio(args)
local v1 = color2lum(args[1])
local v2 = color2lum(args[2])
if (type(v1) == 'number' and type(v2) == 'number') then
-- v1 should be the brighter of the two.
if v2 > v1 then
v1, v2 = v2, v1
end
return (v1 + 0.05)/(v2 + 0.05)
else
return args['error'] or '?'
end
end
function p._styleratio(args)
local style = (args[1] or ''):lower()
local bg, fg = 'white', 'black'
local lum_bg, lum_fg = 1, 0
if args[2] then
local lum = color2lum(args[2])
if lum ~= '' then bg, lum_bg = args[2], lum end
end
if args[3] then
local lum = color2lum(args[3])
if lum ~= '' then fg, lum_fg = args[3], lum end
end
local slist = mw.text.split(mw.ustring.gsub(mw.ustring.gsub(style or '', '&#[Xx]23;', '#'), '#', '#'), ';')
for k = 1,#slist do
local s = slist[k]
local k,v = s:match( '^[%s]*([^:]-):([^:]-)[%s;]*$' )
k = k or ''
v = v or ''
if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background%-color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_bg = v, lum end
elseif (k:match('^[%s]*(color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_fg = v, lum end
end
end
if lum_bg > lum_fg then
return (lum_bg + 0.05)/(lum_fg + 0.05)
else
return (lum_fg + 0.05)/(lum_bg + 0.05)
end
end
--[[
Use {{#invoke:Color contrast|somecolor}} directly or
{{#invoke:Color contrast}} from a wrapper template.
Parameters:
-- |1= — required; A color to check.
--]]
function p.lum(frame)
local color = frame.args[1] or frame:getParent().args[1]
return p._lum(color)
end
function p.ratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._ratio(args)
end
function p.styleratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._styleratio(args)
end
function p.greatercontrast(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._greatercontrast(args)
end
return p
1e399769117591366a63f62996c9a407077cc711
Module:Color contrast/colors
828
99
293
2019-01-24T12:30:11Z
wikipedia>Galobtter
0
Changed protection level for "[[Module:Color contrast/colors]]": [[WP:High-risk templates|High-risk Lua module]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
Scribunto
text/plain
return {
aliceblue = 0.92880068253475,
antiquewhite = 0.84646951707754,
aqua = 0.7874,
aquamarine = 0.8078549208338,
azure = 0.97265264954166,
beige = 0.8988459998705,
bisque = 0.80732327372979,
black = 0,
blanchedalmond = 0.85084439608156,
blue = 0.0722,
blueviolet = 0.12622014321946,
brown = 0.098224287876511,
burlywood = 0.51559844533893,
cadetblue = 0.29424681085422,
chartreuse = 0.76032025902623,
chocolate = 0.23898526114557,
coral = 0.37017930872924,
cornflowerblue = 0.30318641994179,
cornsilk = 0.93562110372965,
crimson = 0.16042199953026,
cyan = 0.7874,
darkblue = 0.018640801980939,
darkcyan = 0.20329317839046,
darkgoldenrod = 0.27264703559993,
darkgray = 0.39675523072563,
darkgreen = 0.091143429047575,
darkgrey = 0.39675523072563,
darkkhaki = 0.45747326349994,
darkmagenta = 0.07353047651207,
darkolivegreen = 0.12651920884889,
darkorange = 0.40016167026524,
darkorchid = 0.13413142174857,
darkred = 0.054889674531132,
darksalmon = 0.40541471563381,
darkseagreen = 0.43789249325969,
darkslateblue = 0.065792846227988,
darkslategray = 0.067608151928044,
darkslategrey = 0.067608151928044,
darkturquoise = 0.4874606277449,
darkviolet = 0.10999048339343,
deeppink = 0.23866895828276,
deepskyblue = 0.44481603395575,
dimgray = 0.14126329114027,
dimgrey = 0.14126329114027,
dodgerblue = 0.27442536991456,
firebrick = 0.10724525535015,
floralwhite = 0.95922484825004,
forestgreen = 0.18920812076002,
fuchsia = 0.2848,
gainsboro = 0.71569350050648,
ghostwhite = 0.94311261886323,
gold = 0.69860877428159,
goldenrod = 0.41919977809569,
gray = 0.2158605001139,
green = 0.15438342968146,
greenyellow = 0.80609472611453,
grey = 0.2158605001139,
honeydew = 0.96336535554782,
hotpink = 0.34658438169715,
indianred = 0.21406134963884,
indigo = 0.03107561486337,
ivory = 0.99071270600615,
khaki = 0.77012343394121,
lavender = 0.80318750514521,
lavenderblush = 0.90172748631046,
lawngreen = 0.73905893124963,
lemonchiffon = 0.94038992245622,
lightblue = 0.63709141280807,
lightcoral = 0.35522120733135,
lightcyan = 0.94587293494829,
lightgoldenrodyellow = 0.93348351018297,
lightgray = 0.65140563741982,
lightgreen = 0.69091979956865,
lightgrey = 0.65140563741982,
lightpink = 0.58566152734898,
lightsalmon = 0.4780675225206,
lightseagreen = 0.35050145117042,
lightskyblue = 0.56195637618331,
lightslategray = 0.23830165007287,
lightslategrey = 0.23830165007287,
lightsteelblue = 0.53983888284666,
lightyellow = 0.98161818392882,
lime = 0.7152,
limegreen = 0.44571042246098,
linen = 0.88357340984379,
magenta = 0.2848,
maroon = 0.045891942324215,
mediumaquamarine = 0.49389703310801,
mediumblue = 0.044077780212328,
mediumorchid = 0.21639251153773,
mediumpurple = 0.22905858091648,
mediumseagreen = 0.34393112338131,
mediumslateblue = 0.20284629471622,
mediumspringgreen = 0.70704308194184,
mediumturquoise = 0.5133827926448,
mediumvioletred = 0.14371899849357,
midnightblue = 0.02071786635086,
mintcream = 0.97834604947588,
mistyrose = 0.82183047859185,
moccasin = 0.80083000991567,
navajowhite = 0.76519682342785,
navy = 0.015585128108224,
oldlace = 0.91900633405549,
olive = 0.20027537200568,
olivedrab = 0.22593150951929,
orange = 0.4817026703631,
orangered = 0.25516243753416,
orchid = 0.31348806761439,
palegoldenrod = 0.78792647887614,
palegreen = 0.77936759006353,
paleturquoise = 0.76436077921714,
palevioletred = 0.28754994117889,
papayawhip = 0.87797100199835,
peachpuff = 0.74905589878251,
peru = 0.30113074877936,
pink = 0.63271070702466,
plum = 0.45734221587969,
powderblue = 0.68254586500605,
purple = 0.061477070432439,
rebeccapurple = 0.07492341159447,
red = 0.2126,
rosybrown = 0.32319457649407,
royalblue = 0.16663210743188,
saddlebrown = 0.097922285020521,
salmon = 0.36977241527596,
sandybrown = 0.46628543696283,
seagreen = 0.19734199706275,
seashell = 0.92737862206922,
sienna = 0.13697631337098,
silver = 0.52711512570581,
skyblue = 0.55291668518184,
slateblue = 0.14784278062136,
slategray = 0.20896704076536,
slategrey = 0.20896704076536,
snow = 0.96533341834849,
springgreen = 0.73052306068529,
steelblue = 0.20562642207625,
tan = 0.48237604163921,
teal = 0.16996855778968,
thistle = 0.56818401093733,
tomato = 0.30638612719415,
turquoise = 0.5895536427578,
violet = 0.40315452986676,
wheat = 0.74909702820482,
white = 1,
whitesmoke = 0.91309865179342,
yellow = 0.9278,
yellowgreen = 0.50762957208707,
}
6ae47fdb24de4eed5ec26d203faf5341a388987b
Module:ISO 3166/data/US
828
222
546
2019-01-24T21:20:05Z
wikipedia>MusikAnimal
0
Protected "[[Module:ISO 3166/data/US]]": [[Wikipedia:High-risk templates|High-risk module]] ([Edit=Require template editor access] (indefinite))
Scribunto
text/plain
return {
lang = "en",
["AK"] = {name="Alaska"},
["AL"] = {name="Alabama"},
["AR"] = {name="Arkansas"},
["AZ"] = {name="Arizona"},
["CA"] = {name="California"},
["CO"] = {name="Colorado"},
["CT"] = {name="Connecticut"},
["DE"] = {name="Delaware"},
["FL"] = {name="Florida"},
["GA"] = {name="Georgia"},
["HI"] = {name="Hawaii"},
["IA"] = {name="Iowa"},
["ID"] = {name="Idaho"},
["IL"] = {name="Illinois"},
["IN"] = {name="Indiana"},
["KS"] = {name="Kansas"},
["KY"] = {name="Kentucky"},
["LA"] = {name="Louisiana"},
["MA"] = {name="Massachusetts"},
["MD"] = {name="Maryland"},
["ME"] = {name="Maine"},
["MI"] = {name="Michigan"},
["MN"] = {name="Minnesota"},
["MO"] = {name="Missouri"},
["MS"] = {name="Mississippi"},
["MT"] = {name="Montana"},
["NC"] = {name="North Carolina"},
["ND"] = {name="North Dakota"},
["NE"] = {name="Nebraska"},
["NH"] = {name="New Hampshire"},
["NJ"] = {name="New Jersey"},
["NM"] = {name="New Mexico"},
["NV"] = {name="Nevada"},
["NY"] = {name="New York",altnames={"New York State"}},
["OH"] = {name="Ohio"},
["OK"] = {name="Oklahoma"},
["OR"] = {name="Oregon"},
["PA"] = {name="Pennsylvania"},
["RI"] = {name="Rhode Island"},
["SC"] = {name="South Carolina"},
["SD"] = {name="South Dakota"},
["TN"] = {name="Tennessee"},
["TX"] = {name="Texas"},
["UT"] = {name="Utah"},
["VA"] = {name="Virginia"},
["VT"] = {name="Vermont"},
["WA"] = {name="Washington"},
["WI"] = {name="Wisconsin"},
["WV"] = {name="West Virginia"},
["WY"] = {name="Wyoming"},
["DC"] = {name="District of Columbia",altnames={"Washington, D.C."}},
["AS"] = {name="American Samoa"},
["GU"] = {name="Guam"},
["MP"] = {name="Northern Mariana Islands"},
["PR"] = {name="Puerto Rico"},
["UM"] = {name="United States Minor Outlying Islands"},
["VI"] = {name="United States Virgin Islands",isoname="Virgin Islands, U.S.",altnames={"U.S. Virgin Islands","Virgin Islands"}}
}
f532f1d1b625073d0985d6aefc216c2d99fc851c
Module:Location map/data/USA
828
218
538
2019-02-10T18:47:41Z
wikipedia>Zyxw
0
update name used in automatic captions
Scribunto
text/plain
return {
name = 'the United States',
x = '50.0 + 124.03149777329222 * ((1.9694462586094064-($1 * pi / 180)) * sin(0.6010514667026994 * ($2 + 96) * pi / 180))',
y = '50.0 + 1.6155950752393982 * 124.03149777329222 * ( 0.02613325650382181 - (1.3236744353715044 - (1.9694462586094064 - ($1 * pi / 180)) * cos(0.6010514667026994 * ($2 + 96) * pi / 180)))',
image = 'Usa edcp location map.svg',
image1 = 'Usa edcp relief location map.png'
}
d2c98c333c13b7dc164dbaccae5a3365c15aa096
Template:Nobold/styles.css
10
49
153
2019-03-03T23:43:41Z
wikipedia>Pppery
0
Adding protection template
sanitized-css
text/css
/* {{pp-template}} */
/* Styling for Template:Nobold */
.nobold {
font-weight: normal;
}
83e5f0adacf8c7984251f1fd9d11ed82ebaadf03
Template:Lua
10
31
253
2019-03-20T22:04:45Z
wikipedia>RMCD bot
0
Removing notice of move discussion
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{Lua|Module:Lua banner}}
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
dba3962144dacd289dbc34f50fbe0a7bf6d7f2f7
Template:Lang-la
10
193
486
2019-04-03T12:06:16Z
wikipedia>WOSlinker
0
pp templates not needed here
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=la
}}</includeonly><noinclude>
{{Documentation|Template:Lang-x/doc}}
[[Category:Italic multilingual support templates]]
</noinclude>
e9fb23bc455a402a9643bb61d1c151a865c3ff66
Template:Clc
10
141
381
2019-04-24T04:30:59Z
wikipedia>JJMC89
0
actual template is in the category
wikitext
text/x-wiki
#REDIRECT [[Template:Category link with count]]
02280e2ab57b544236e11f913e3759c5781ca9d5
Module:ISO 3166
828
210
520
2019-04-28T16:52:10Z
wikipedia>Frietjes
0
restrict tracking to articlespace per request
Scribunto
text/plain
-- to enable us to replicate the current functioning of Country extract, we need to deal with:
-- 2 {{<name>}} DONE!
-- 3 [[<name>]] DONE!
-- 4 [[<name>|<junk>]] DONE!
-- 5 [[image:flag of <country>.[svg|gif|png|jpg]|\d+px]] DONE!
local p = {}
local getArgs = require("Module:Arguments").getArgs
local data = mw.loadData("Module:ISO 3166/data/National")
--[[----------F I N D N A M E----------]]-- -- Finds the name in the database
local function findname(code,cdata,qry)
local sqry = p.strip(qry)
if cdata["name"] and sqry==p.strip(cdata["name"])
or cdata["isoname"] and sqry==p.strip(cdata["isoname"])
or not cdata["nocode"] and sqry==code
or sqry==cdata["alpha3"] or sqry==cdata["numeric"]
then
return true
end
for _,tname in pairs(cdata["isonames"] or {}) do
if sqry==p.strip(tname) then
return true
end
end
for _,tname in pairs(cdata["altnames"] or {}) do
if sqry==p.strip(tname) then
return true
end
end
return false
end
--[[----------I S O N A M E----------]]-- -- Find the ISO name of a country/region
local function isoname(data,code,lang)
if data[code]["isonames"] then
local name = data[code]["isodisplaynames"] and data[code]["isodisplaynames"][lang]
or data[code]["isonames"][lang]
or data[code]["isodisplaynames"] and data[code]["isodisplaynames"][data[code]["defaultlang"] or data["defaultlang"]]
or data[code]["isonames"][data[code]["defaultlang"] or data["defaultlang"]]
or data[code]["isodisplaynames"] and data[code]["isodisplaynames"]["en"]
or data[code]["isonames"]["en"]
if name then return name end
for _,iname in pairs(data[code]["isonames"]) do return iname end
return data[code]["isodisplayname"] or data[code]["isoname"]
else
return data[code]["isodisplayname"] or data[code]["isoname"]
end
end
--[[----------S T R I P----------]]-- -- Removes junk from the input
function p.strip(text)
local accents = {["À"]="A",["Á"]="A",["Â"]="A",["Ã"]="A", -- accent list
["Ä"]="A",["Å"]="A",["Ç"]="C",["È"]="E",["É"]="E",
["Ê"]="E",["Ë"]="E",["Ì"]="I",["Í"]="I",["Î"]="I",
["Ï"]="I",["Ñ"]="N",["Ò"]="O",["Ó"]="O",["Ô"]="O",
["Õ"]="O",["Ö"]="O",["Ø"]="O",["Ù"]="U",["Ú"]="U",
["Û"]="U",["Ü"]="U",["Ý"]="Y"
}
local remove = {"NATION OF","COUNTRY OF","TERRITORY OF", -- text to be removed list
"FLAG OF","FLAG","KINGDOM OF","STATE OF"," STATE ",
"PROVINCE OF","PROVINCE","TERRITORY"
}
local patterns = {[".+:"]="",["|.+"]="",["%(.-%)"]="", -- patterns to follow (order may matter)
["%..*"]="",["^THE "]="",["%_"]=" ",["%-"]=" ",
["%d%d?%d?PX"]="",
}
text = mw.ustring.upper(text) -- Case insensitivity
text = mw.ustring.gsub(text,"[À-Ý]",accents) -- Deaccent
for pattern,value in pairs(patterns) do -- Follow patterns
text = mw.ustring.gsub(text,pattern,value)
end
for _,words in pairs(remove) do -- Remove unneeded words
text = mw.ustring.gsub(text,words,"")
end
text = mw.ustring.gsub(text,"%W","") -- Remove non alpha-numeric
return text
end
--[[----------P . C A L L S T R I P ---------]]-- -- Calls P.strip but using Module:Arguments
function p.callstrip(frame)
local args = getArgs(frame)
return p.strip(args[1]) or ""
end
--[[----------P . L U A C O D E---------]]-- -- Makes the ISO code of a country
function p.luacode(args)
if string.find(args[1] or '',"%-") then
args[1], args[2] = string.match(args[1] or '',"^([^%-]*)%-(.*)$")
end
if args[1] then args[1] = p.strip(args[1]) end
if args[2] then args[2] = p.strip(args[2]) end
if args["codetype"]=="3" then
args["codetype"]="alpha3"
end
local eot = args.error or ""
local catnocountry = (args.nocat and args.nocat == 'true') and ''
or '[[Category:Wikipedia page with obscure country]]'
local catnosubdivision = (args.nocat and args.nocat == 'true') and ''
or '[[Category:Wikipedia page with obscure subdivision]]'
if not args[1] then
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry = '' end
return catnocountry, '<span style="font-size:100%" class="error">"No parameter for the country given"</span>'
end
if not args[2] then --3166-1 code
for alpha2,cdata in pairs(data) do
if findname(alpha2,cdata,args[1]) then
if args["codetype"]=="numeric" or args["codetype"]=="alpha3" then
return cdata[args["codetype"]]
else
return alpha2
end
end
end
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry = '' end
return catnocountry
else --3166-2 code
for alpha2,cdata in pairs(data) do
if findname(alpha2,cdata,args[1]) then
if mw.ustring.match(alpha2,"GB") then -- For England, Wales etc.
alpha2 = "GB"
end
local sdata = mw.loadData("Module:ISO 3166/data/"..alpha2)
local empty = true
for scode,scdata in pairs(sdata) do
if type(scdata)=="table" then
empty = false
if findname(scode,scdata,args[2]) then
return alpha2.."-"..scode
end
end
end
if mw.title.getCurrentTitle().namespace ~= 0 then catnosubdivision = '' end
return catnosubdivision
end
end
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry = '' end
return catnocountry
end
end
--[[----------P . C O D E---------]]-- -- Calls P.Luacode but using Module:Arguments
function p.code(frame)
return p.luacode(getArgs(frame)) or ""
end
--[[----------P . N U M E R I C---------]]-- -- Calls P.Luacode but using Module:Arguments and setting it to output a numeric value
function p.numeric(frame)
local args = getArgs(frame)
args["codetype"]="numeric"
return p.luacode(args) or ""
end
--[[----------P . L U A N A M E---------]]-- -- Makes the ISO/common name of a country
function p.luaname(args)
local code1 = p.luacode(args)
local code2 = ''
if string.find(code1,"%-") then
code1, code2 = string.match(code1,"^([^%-]*)%-(.*)$")
end
if string.find(code1,"^%u%u$") then
if code2=="" then --3166-1 alpha-2 code
if data[code1] then
return (args.isoname or args.lang) and isoname(data,code1,args.lang)
or (data[code1]["displayname"] or data[code1]["name"])
else
return '[[Category:Wikipedia page with obscure country]]'
end
else --3166-2 code
local sdata
if data[code1] then
sdata = mw.loadData("Module:ISO 3166/data/"..code1)
else
return '[[Category:Wikipedia page with obscure country]]'
end
if sdata[code2] then
return (args.isoname or args.lang) and isoname(sdata,code2,args.lang)
or (sdata[code2]["displayname"] or sdata[code2]["name"])
else
return '[[Category:Wikipedia page with obscure country]]'
end
end
end
end
--[[----------P . N A M E---------]]-- -- Calls P.Luaname but using Module:Arguments
function p.name(frame)
return p.luaname(getArgs(frame)) or ""
end
--[[----------P . G E O C O O R D I N S E R T---------]]-- -- Wrapper for Module:Coordinates.coordinsert
function p.geocoordinsert(frame)
-- {{#invoke:ISO 3166|geocoordinsert|{{coord|...}}
-- |country=..|subdivision1=...|subdivision2=...
-- |type=...|scale=...|dim=...|source=...|globe=...
-- }}
local args = frame.args
local subdivisionqueried = false
local catnocountry = (args.nocat and args.nocat == 'true') and ''
or '[[Category:Wikipedia page with obscure country]]'
local catnosubdivision = (args.nocat and args.nocat == 'true') and ''
or '[[Category:Wikipedia page with obscure subdivision]]' or ''
local tracking = ''
local targs = {}
targs[1] = args[1] or ''
for i, v in pairs(args) do
if i == 'country' and not mw.ustring.find(targs[1], 'region:') then
local country = v
local k, region = 1, ''
-- look for a valid subdivision
while region == '' and k < 3 do
local subdivision = args['subdivision' .. k] or ''
if subdivision ~= '' then
region = p.luacode({country, subdivision, nocat = 'true'})
subdivisionqueried = true
end
k = k + 1
end
-- subdivision lookup failed or never attempted, try country only
if region == '' then
region = p.luacode({country, nocat = 'true'})
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry, catnosubdivision = '', '' end
if region == '' then
tracking = tracking .. catnocountry
elseif subdivisionqueried == true then
tracking = tracking .. catnosubdivision
end
end
-- something worked, add it to the targs
if region ~= '' then
targs[#targs + 1] = 'region:' .. region
end
elseif i == 'type' or i == 'scale' or i == 'dim'
or i == 'source' or i == 'globe' then
targs[#targs + 1] = i .. ':' .. v
end
end
-- call Module:Coordinates.coordinsert if there is something to insert
if #targs > 1 then
local coordinsert = require('Module:Coordinates').coordinsert
return coordinsert({args = targs}) .. tracking
end
-- otherwise, just return the coordinates
return targs[1] .. tracking
end
return p
6bc354f2610f29e712065cbe3ea814144fa3a600
Module:Military navigation
828
263
635
2019-07-11T13:06:26Z
wikipedia>Frietjes
0
Scribunto
text/plain
local p = { }
local Navbox = require('Module:Navbox')
local Styles = require('Module:WPMILHIST Infobox style')
local function isblank(s)
return (not s) or s == ''
end
local function isnotblank(s)
return s and s ~= ''
end
function p.main(frame)
local args = { }
local pargs = frame:getParent().args
local sargs = {}
local tcats = ''
-- process bodystyle and titlestyle
if (pargs['style'] or '') == 'wide' then
args['titlestyle'] = Styles['nav_box_wide_header']
args['bodystyle'] = Styles['nav_box_wide']
else
args['titlestyle'] = Styles['nav_box_header']
if (pargs['border'] or '') == 'child' or
(pargs['border'] or '') == 'subgroup' then
args['bodystyle'] = Styles['nav_box_child']
tcats = tcats .. '[[Category:Pages using military navigation subgroups without wide style]]'
else
args['bodystyle'] = Styles['nav_box']
end
end
sargs['titlestyle'] = 1
sargs['bodystyle'] = 1
-- process groupstyle, abovestyle, belowstyle
args['groupstyle'] = Styles['nav_box_label'] .. (pargs['groupstyle'] or '')
sargs['groupstyle'] = 1
args['abovestyle'] = Styles['nav_box_label'] .. (pargs['abovestyle'] or '')
sargs['abovestyle'] = 1
args['belowstyle'] = Styles['nav_box_label'] .. (pargs['belowstyle'] or '')
sargs['belowstyle'] = 1
-- process oddstyle, evenstyle
args['oddstyle'] = isnotblank(pargs['odd_color'])
and ('background:' .. pargs['odd_color']) or nil
sargs['oddstyle'] = 1
args['evenstyle'] = isnotblank(pargs['even_color'])
and ('background:' .. pargs['even_color']) or nil
sargs['evenstyle'] = 1
-- process name and rawname
args['name'] = (isnotblank(pargs['name']) and pargs['name']) or pargs['rawname']
if isblank(args['name']) then args['navbar'] = 'plain' end
sargs['name'] = 1
sargs['rawname'] = 1
-- copy the remaining args
for k, v in pairs(pargs) do
if v and v ~= '' and sargs[k] == nil then
args[k] = v
end
end
-- add allow wrap
if args['title'] and (pargs['style'] or '') ~= 'wide' then
if not mw.ustring.match(args['title'], '<span class="wrap">') then
-- probably a more efficient way to match 15 or more characters
local m = '[^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|]'
m = m .. m .. m
args['title'] = mw.ustring.gsub(args['title'],
'%[%[(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%1</span>]]')
args['title'] = mw.ustring.gsub(args['title'],
'%[%[([^%[%]<>|]*)|(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%2</span>]]')
end
end
-- add navbox-vertical for non-wide format
if (pargs['style'] or '') ~= 'wide' then
args['bodyclass'] = 'navbox-vertical' .. (args['bodyclass'] and (' ' .. args['bodyclass']) or '')
end
return tcats .. Navbox._navbox(args)
end
return p
26dd1b8952c65fbc4d05e418e8d7c3daed93fa49
Template:Infobox settlement/lengthdisp
10
189
478
2019-10-16T22:18:36Z
wikipedia>WOSlinker
0
avoid redirects
wikitext
text/x-wiki
<includeonly>{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}}}
|metv={{#if:{{{km|}}}{{{m|}}}
|{{{km|}}}{{{m|}}}
|{{#if:{{{mi|}}}
|{{round
|{{#expr:{{formatnum:{{{mi}}}|R}}*1.609344}}
|{{precision|{{formatnum:{{{mi}}}|R}}}}
}}
|{{round
|{{#expr:{{formatnum:{{{ft}}}|R}}*0.3048}}
|{{max
|{{precision|{{formatnum:{{{ft}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{ft}}}|R}}*0.3048}}}}
}}
}}
}}
}}
|metu={{#if:{{{km|}}}{{{mi|}}}|k}}m
|impv={{#if:{{{mi|}}}{{{ft|}}}
|{{{mi|}}}{{{ft|}}}
|{{#if:{{{km|}}}
|{{round
|{{#expr:{{formatnum:{{{km}}}|R}}/1.609344}}
|{{max
|{{precision|{{formatnum:{{{km}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{km}}}|R}}/1.609344}}}}
}}
}}
|{{round
|{{#expr:{{formatnum:{{{m}}}|R}}/0.3048}}
|{{precision|{{formatnum:{{{m}}}|R}}}}
}}
}}
}}
|impu={{#if:{{{km|}}}{{{mi|}}}|mi|ft}}
}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
8525c091822d9f317f267e88861faee9689a3a3f
Template:Infobox settlement/areadisp
10
184
468
2019-10-16T22:23:26Z
wikipedia>WOSlinker
0
avoid redirects
wikitext
text/x-wiki
<includeonly>{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}|area}}{{#if:{{{mag|}}}|/mag}}
|metv={{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{ha|}}}|{{{ha}}}|{{{km2}}}}}
|{{#if:{{{dunam|}}}
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<1E3
|{{round<!-- convert dunams to hectares -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/10}}
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+1)
}}<!-- end round -->
|{{round<!-- convert dunams to square kilometres -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/1E3}}
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+3)
}}<!-- end round -->
}}<!-- end #ifexpr:...{{{dunam}}}...<1E3 -->
|{{#if:{{{acre|}}}
|{{round<!-- convert acres to hectares -->
|{{#expr:{{formatnum:{{{acre}}}|R}}*0.4046856422}}
|{{max<!-- output at least one sig fig -->
|{{precision|{{formatnum:{{{acre}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{acre}}}|R}}*0.4046856422}}}}
}}<!-- end max -->
}}<!-- end round -->
|{{round<!-- convert square miles to square kilometres -->
|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2.589988110336}}
|{{max<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{sqmi}}}|R}}}}-1)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2.589988110336}}}}
}}<!-- end max -->
}}<!-- end rnd -->
}}<!-- end #if:{{{acre|}}} -->
}}<!-- end #if:{{{dunam|}}} -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
|metu={{#if:{{{ha|}}}{{#if:{{{km2|}}}
|
|{{#if:{{{dunam|}}}
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<1E3|X}}
|{{{acre|}}}
}}
}}
|ha
|km<sup>2</sup>
}}
|impv={{#if:{{{acre|}}}{{{sqmi|}}}
|{{#if:{{{acre|}}}|{{{acre}}}|{{{sqmi}}}}}
|{{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{ha|}}}
|{{round<!-- convert hectares to acres -->
|{{#expr:{{formatnum:{{{ha}}}|R}}/0.4046856422}}
|({{precision|{{formatnum:{{{ha}}}|R}}}})
}}<!-- end round -->
|{{round<!-- convert square kilometres to square miles -->
|{{#expr:{{formatnum:{{{km2}}}|R}}/2.589988110336}}
|{{max<!-- output at least one sig fig -->
|{{precision|{{formatnum:{{{km2}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{km2}}}|R}}/2.589988110336}}}}
}}<!-- end max -->
}}<!-- end round -->
}}<!-- end #if:{{{ha|}}} -->
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<2589
|{{round<!-- convert dunams to acres -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/4.046856422}}
|{{max<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{dunam}}}|R}}}})
|-{{Order of magnitude|{{#expr:{{formatnum:{{{dunam}}}|R}}/4.046856422}}}}
}}<!-- end max -->
}}<!-- end round -->
|{{round<!-- convert dunams to square miles -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/2589.988110336}}
|{{max<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+3)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{dunam}}}|R}}/2589.988110336}}}}
}}<!-- end max -->
}}<!-- end round -->
}}<!-- end #ifexpr:...{{{dunam}}}...<2589 -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
}}<!-- end #if:{{{acre|}}}{{{sqmi|}}} -->
|impu={{#if:{{{acre|}}}{{#if:{{{sqmi|}}}
|
|{{{ha|}}}{{#if:{{{km2|}}}
|
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<2589|X}}
}}
}}
|acre
|sq mi
}}
|dunv={{#if:{{#ifeq:{{lc:{{{pref}}}}}|dunam|{{{dunam|}}}|no dunams}}
|{{{dunam}}}
|{{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{km2|}}}
|{{round<!-- convert square kilometres to dunams -->
|{{#expr:{{formatnum:{{{km2}}}|R}}*1E3}}
|({{precision|{{formatnum:{{{km2}}}|R}}}}-3)
}}<!-- end round -->
|{{round<!-- convert hectares to dunams -->
|{{#expr:{{formatnum:{{{ha}}}|R}}*10}}
|({{precision|{{formatnum:{{{ha}}}|R}}}}-1)
}}<!-- end round -->
}}<!-- end #if:{{{km2|}}} -->
|{{#if:{{{sqmi|}}}
|{{round<!-- convert square miles to dunams -->
|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2589.988110336}}
|{{max<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{sqmi}}}|R}}}}-4)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2589.988110336}}}}
}}<!-- end max -->
}}<!-- end round -->
|{{round<!-- convert acres to dunams -->
|{{#expr:{{formatnum:{{{acre}}}|R}}*4.046856422}}
|{{max<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{acre}}}|R}}}}-1)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{acre}}}|R}}*4.046856422}}}}
}}<!-- end max -->
}}<!-- end round -->
}}<!-- end #if:{{{sqmi|}}} -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
}}
|dunu={{#if:{{{link|}}}|[[dunam]]|dunam}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
a6ccd372b44beed9525741b6fcd5317fb970eb89
Template:URL
10
198
496
2019-11-18T00:50:36Z
wikipedia>Jonesey95
0
Adding unknown parameter tracking through [[:Category:Pages using URL template with unknown parameters]] using [[Module:check for unknown parameters]]
wikitext
text/x-wiki
<includeonly>{{#invoke:URL|url}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using URL template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:URL]] with unknown parameter "_VALUE_"|ignoreblank=y | 1 | 2 }}<noinclude>{{documentation}}</noinclude>
5671474ce4656f07c5bdc47292d1dcbe9c70317e
Template:Unbulleted list
10
130
359
2019-12-09T17:31:16Z
wikipedia>Jonesey95
0
Undid revision 929522913 by [[Special:Contributions/MSGJ|MSGJ]] ([[User talk:MSGJ|talk]]). Reverted, as this change has been shown to have bugs. Discussion continues on talk page.
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|unbulleted}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
89815a491d3e05b20af446e34cda13f13c25fb4f
Template:Ombox
10
178
456
2020-04-01T06:12:36Z
wikipedia>MusikAnimal
0
1 revision imported
wikitext
text/x-wiki
{{#invoke:Message box|ombox}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
0e54065432d540737b9e56c4e3a8e7f74d4534ea
Module:Arguments
828
14
137
2020-04-01T06:12:40Z
wikipedia>MusikAnimal
0
1 revision imported
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Category handler
828
117
329
2020-04-01T06:12:40Z
wikipedia>MusikAnimal
0
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- --
-- CATEGORY HANDLER --
-- --
-- This module implements the {{category handler}} template in Lua, --
-- with a few improvements: all namespaces and all namespace aliases --
-- are supported, and namespace names are detected automatically for --
-- the local wiki. This module requires [[Module:Namespace detect]] --
-- and [[Module:Yesno]] to be available on the local wiki. It can be --
-- configured for different wikis by altering the values in --
-- [[Module:Category handler/config]], and pages can be blacklisted --
-- from categorisation by using [[Module:Category handler/blacklist]]. --
-- --
--------------------------------------------------------------------------------
-- Load required modules
local yesno = require('Module:Yesno')
-- Lazily load things we don't always need
local mShared, mappings
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function trimWhitespace(s, removeBlanks)
if type(s) ~= 'string' then
return s
end
s = s:match('^%s*(.-)%s*$')
if removeBlanks then
if s ~= '' then
return s
else
return nil
end
else
return s
end
end
--------------------------------------------------------------------------------
-- CategoryHandler class
--------------------------------------------------------------------------------
local CategoryHandler = {}
CategoryHandler.__index = CategoryHandler
function CategoryHandler.new(data, args)
local obj = setmetatable({ _data = data, _args = args }, CategoryHandler)
-- Set the title object
do
local pagename = obj:parameter('demopage')
local success, titleObj
if pagename then
success, titleObj = pcall(mw.title.new, pagename)
end
if success and titleObj then
obj.title = titleObj
if titleObj == mw.title.getCurrentTitle() then
obj._usesCurrentTitle = true
end
else
obj.title = mw.title.getCurrentTitle()
obj._usesCurrentTitle = true
end
end
-- Set suppression parameter values
for _, key in ipairs{'nocat', 'categories'} do
local value = obj:parameter(key)
value = trimWhitespace(value, true)
obj['_' .. key] = yesno(value)
end
do
local subpage = obj:parameter('subpage')
local category2 = obj:parameter('category2')
if type(subpage) == 'string' then
subpage = mw.ustring.lower(subpage)
end
if type(category2) == 'string' then
subpage = mw.ustring.lower(category2)
end
obj._subpage = trimWhitespace(subpage, true)
obj._category2 = trimWhitespace(category2) -- don't remove blank values
end
return obj
end
function CategoryHandler:parameter(key)
local parameterNames = self._data.parameters[key]
local pntype = type(parameterNames)
if pntype == 'string' or pntype == 'number' then
return self._args[parameterNames]
elseif pntype == 'table' then
for _, name in ipairs(parameterNames) do
local value = self._args[name]
if value ~= nil then
return value
end
end
return nil
else
error(string.format(
'invalid config key "%s"',
tostring(key)
), 2)
end
end
function CategoryHandler:isSuppressedByArguments()
return
-- See if a category suppression argument has been set.
self._nocat == true
or self._categories == false
or (
self._category2
and self._category2 ~= self._data.category2Yes
and self._category2 ~= self._data.category2Negative
)
-- Check whether we are on a subpage, and see if categories are
-- suppressed based on our subpage status.
or self._subpage == self._data.subpageNo and self.title.isSubpage
or self._subpage == self._data.subpageOnly and not self.title.isSubpage
end
function CategoryHandler:shouldSkipBlacklistCheck()
-- Check whether the category suppression arguments indicate we
-- should skip the blacklist check.
return self._nocat == false
or self._categories == true
or self._category2 == self._data.category2Yes
end
function CategoryHandler:matchesBlacklist()
if self._usesCurrentTitle then
return self._data.currentTitleMatchesBlacklist
else
mShared = mShared or require('Module:Category handler/shared')
return mShared.matchesBlacklist(
self.title.prefixedText,
mw.loadData('Module:Category handler/blacklist')
)
end
end
function CategoryHandler:isSuppressed()
-- Find if categories are suppressed by either the arguments or by
-- matching the blacklist.
return self:isSuppressedByArguments()
or not self:shouldSkipBlacklistCheck() and self:matchesBlacklist()
end
function CategoryHandler:getNamespaceParameters()
if self._usesCurrentTitle then
return self._data.currentTitleNamespaceParameters
else
if not mappings then
mShared = mShared or require('Module:Category handler/shared')
mappings = mShared.getParamMappings(true) -- gets mappings with mw.loadData
end
return mShared.getNamespaceParameters(
self.title,
mappings
)
end
end
function CategoryHandler:namespaceParametersExist()
-- Find whether any namespace parameters have been specified.
-- We use the order "all" --> namespace params --> "other" as this is what
-- the old template did.
if self:parameter('all') then
return true
end
if not mappings then
mShared = mShared or require('Module:Category handler/shared')
mappings = mShared.getParamMappings(true) -- gets mappings with mw.loadData
end
for ns, params in pairs(mappings) do
for i, param in ipairs(params) do
if self._args[param] then
return true
end
end
end
if self:parameter('other') then
return true
end
return false
end
function CategoryHandler:getCategories()
local params = self:getNamespaceParameters()
local nsCategory
for i, param in ipairs(params) do
local value = self._args[param]
if value ~= nil then
nsCategory = value
break
end
end
if nsCategory ~= nil or self:namespaceParametersExist() then
-- Namespace parameters exist - advanced usage.
if nsCategory == nil then
nsCategory = self:parameter('other')
end
local ret = {self:parameter('all')}
local numParam = tonumber(nsCategory)
if numParam and numParam >= 1 and math.floor(numParam) == numParam then
-- nsCategory is an integer
ret[#ret + 1] = self._args[numParam]
else
ret[#ret + 1] = nsCategory
end
if #ret < 1 then
return nil
else
return table.concat(ret)
end
elseif self._data.defaultNamespaces[self.title.namespace] then
-- Namespace parameters don't exist, simple usage.
return self._args[1]
end
return nil
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p = {}
function p._exportClasses()
-- Used for testing purposes.
return {
CategoryHandler = CategoryHandler
}
end
function p._main(args, data)
data = data or mw.loadData('Module:Category handler/data')
local handler = CategoryHandler.new(data, args)
if handler:isSuppressed() then
return nil
end
return handler:getCategories()
end
function p.main(frame, data)
data = data or mw.loadData('Module:Category handler/data')
local args = require('Module:Arguments').getArgs(frame, {
wrappers = data.wrappers,
valueFunc = function (k, v)
v = trimWhitespace(v)
if type(k) == 'number' then
if v ~= '' then
return v
else
return nil
end
else
return v
end
end
})
return p._main(args, data)
end
return p
b74dd63857b24904ac452429b11213f18647471f
Module:Category handler/config
828
119
333
2020-04-01T06:12:40Z
wikipedia>MusikAnimal
0
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- [[Module:Category handler]] configuration data --
-- Language-specific parameter names and values can be set here. --
-- For blacklist config, see [[Module:Category handler/blacklist]]. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- foo = 'parameter name', --
-- --
-- To add multiple names, you can use this format: --
-- --
-- foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'}, --
--------------------------------------------------------------------------------
cfg.parameters = {
-- The nocat and categories parameter suppress
-- categorisation. They are used with Module:Yesno, and work as follows:
--
-- cfg.nocat:
-- Result of yesno() Effect
-- true Categorisation is suppressed
-- false Categorisation is allowed, and
-- the blacklist check is skipped
-- nil Categorisation is allowed
--
-- cfg.categories:
-- Result of yesno() Effect
-- true Categorisation is allowed, and
-- the blacklist check is skipped
-- false Categorisation is suppressed
-- nil Categorisation is allowed
nocat = 'nocat',
categories = 'categories',
-- The parameter name for the legacy "category2" parameter. This skips the
-- blacklist if set to the cfg.category2Yes value, and suppresses
-- categorisation if present but equal to anything other than
-- cfg.category2Yes or cfg.category2Negative.
category2 = 'category2',
-- cfg.subpage is the parameter name to specify how to behave on subpages.
subpage = 'subpage',
-- The parameter for data to return in all namespaces.
all = 'all',
-- The parameter name for data to return if no data is specified for the
-- namespace that is detected.
other = 'other',
-- The parameter name used to specify a page other than the current page;
-- used for testing and demonstration.
demopage = 'page',
}
--------------------------------------------------------------------------------
-- Parameter values --
-- These are set values that can be used with certain parameters. Only one --
-- value can be specified, like this: --
-- --
-- cfg.foo = 'value name' -- --
--------------------------------------------------------------------------------
-- The following settings are used with the cfg.category2 parameter. Setting
-- cfg.category2 to cfg.category2Yes skips the blacklist, and if cfg.category2
-- is present but equal to anything other than cfg.category2Yes or
-- cfg.category2Negative then it supresses cateogrisation.
cfg.category2Yes = 'yes'
cfg.category2Negative = '¬'
-- The following settings are used with the cfg.subpage parameter.
-- cfg.subpageNo is the value to specify to not categorise on subpages;
-- cfg.subpageOnly is the value to specify to only categorise on subpages.
cfg.subpageNo = 'no'
cfg.subpageOnly = 'only'
--------------------------------------------------------------------------------
-- Default namespaces --
-- This is a table of namespaces to categorise by default. The keys are the --
-- namespace numbers. --
--------------------------------------------------------------------------------
cfg.defaultNamespaces = {
[ 0] = true, -- main
[ 6] = true, -- file
[ 12] = true, -- help
[ 14] = true, -- category
[100] = true, -- portal
[108] = true, -- book
}
--------------------------------------------------------------------------------
-- Wrappers --
-- This is a wrapper template or a list of wrapper templates to be passed to --
-- [[Module:Arguments]]. --
--------------------------------------------------------------------------------
cfg.wrappers = 'Template:Category handler'
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.
373cd107b13a5b00e6a1b7e66a749f12502c849d
Module:Category handler/data
828
118
331
2020-04-01T06:12:41Z
wikipedia>MusikAnimal
0
1 revision imported
Scribunto
text/plain
-- This module assembles data to be passed to [[Module:Category handler]] using
-- mw.loadData. This includes the configuration data and whether the current
-- page matches the title blacklist.
local data = require('Module:Category handler/config')
local mShared = require('Module:Category handler/shared')
local blacklist = require('Module:Category handler/blacklist')
local title = mw.title.getCurrentTitle()
data.currentTitleMatchesBlacklist = mShared.matchesBlacklist(
title.prefixedText,
blacklist
)
data.currentTitleNamespaceParameters = mShared.getNamespaceParameters(
title,
mShared.getParamMappings()
)
return data
abbc68048ff698e88dda06b64ecf384bbf583120
Module:Category handler/shared
828
120
335
2020-04-01T06:12:41Z
wikipedia>MusikAnimal
0
1 revision imported
Scribunto
text/plain
-- This module contains shared functions used by [[Module:Category handler]]
-- and its submodules.
local p = {}
function p.matchesBlacklist(page, blacklist)
for i, pattern in ipairs(blacklist) do
local match = mw.ustring.match(page, pattern)
if match then
return true
end
end
return false
end
function p.getParamMappings(useLoadData)
local dataPage = 'Module:Namespace detect/data'
if useLoadData then
return mw.loadData(dataPage).mappings
else
return require(dataPage).mappings
end
end
function p.getNamespaceParameters(titleObj, mappings)
-- We don't use title.nsText for the namespace name because it adds
-- underscores.
local mappingsKey
if titleObj.isTalkPage then
mappingsKey = 'talk'
else
mappingsKey = mw.site.namespaces[titleObj.namespace].name
end
mappingsKey = mw.ustring.lower(mappingsKey)
return mappings[mappingsKey] or {}
end
return p
d2d5de1a031e6ce97c242cbfa8afe7a92cb9eca5
Module:Namespace detect/config
828
116
327
2020-04-01T06:12:44Z
wikipedia>MusikAnimal
0
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect configuration data --
-- --
-- This module stores configuration data for Module:Namespace detect. Here --
-- you can localise the module to your wiki's language. --
-- --
-- To activate a configuration item, you need to uncomment it. This means --
-- that you need to remove the text "-- " at the start of the line. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. Values added --
-- here will work in addition to the default English parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- cfg.foo = 'parameter name' --
-- --
-- To add multiple names, you can use this format: --
-- --
-- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} --
--------------------------------------------------------------------------------
---- This parameter displays content for the main namespace:
-- cfg.main = 'main'
---- This parameter displays in talk namespaces:
-- cfg.talk = 'talk'
---- This parameter displays content for "other" namespaces (namespaces for which
---- parameters have not been specified):
-- cfg.other = 'other'
---- This parameter makes talk pages behave as though they are the corresponding
---- subject namespace. Note that this parameter is used with [[Module:Yesno]].
---- Edit that module to change the default values of "yes", "no", etc.
-- cfg.subjectns = 'subjectns'
---- This parameter sets a demonstration namespace:
-- cfg.demospace = 'demospace'
---- This parameter sets a specific page to compare:
cfg.demopage = 'page'
--------------------------------------------------------------------------------
-- Table configuration --
-- These configuration items allow customisation of the "table" function, --
-- used to generate a table of possible parameters in the module --
-- documentation. --
--------------------------------------------------------------------------------
---- The header for the namespace column in the wikitable containing the list of
---- possible subject-space parameters.
-- cfg.wikitableNamespaceHeader = 'Namespace'
---- The header for the wikitable containing the list of possible subject-space
---- parameters.
-- cfg.wikitableAliasesHeader = 'Aliases'
--------------------------------------------------------------------------------
-- End of configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.
0e4ff08d13c4b664d66b32c232deb129b77c1a56
Module:Namespace detect/data
828
115
325
2020-04-01T06:12:45Z
wikipedia>MusikAnimal
0
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect data --
-- This module holds data for [[Module:Namespace detect]] to be loaded per --
-- page, rather than per #invoke, for performance reasons. --
--------------------------------------------------------------------------------
local cfg = require('Module:Namespace detect/config')
local function addKey(t, key, defaultKey)
if key ~= defaultKey then
t[#t + 1] = key
end
end
-- Get a table of parameters to query for each default parameter name.
-- This allows wikis to customise parameter names in the cfg table while
-- ensuring that default parameter names will always work. The cfg table
-- values can be added as a string, or as an array of strings.
local defaultKeys = {
'main',
'talk',
'other',
'subjectns',
'demospace',
'demopage'
}
local argKeys = {}
for i, defaultKey in ipairs(defaultKeys) do
argKeys[defaultKey] = {defaultKey}
end
for defaultKey, t in pairs(argKeys) do
local cfgValue = cfg[defaultKey]
local cfgValueType = type(cfgValue)
if cfgValueType == 'string' then
addKey(t, cfgValue, defaultKey)
elseif cfgValueType == 'table' then
for i, key in ipairs(cfgValue) do
addKey(t, key, defaultKey)
end
end
cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.
end
local function getParamMappings()
--[[
-- Returns a table of how parameter names map to namespace names. The keys
-- are the actual namespace names, in lower case, and the values are the
-- possible parameter names for that namespace, also in lower case. The
-- table entries are structured like this:
-- {
-- [''] = {'main'},
-- ['wikipedia'] = {'wikipedia', 'project', 'wp'},
-- ...
-- }
--]]
local mappings = {}
local mainNsName = mw.site.subjectNamespaces[0].name
mainNsName = mw.ustring.lower(mainNsName)
mappings[mainNsName] = mw.clone(argKeys.main)
mappings['talk'] = mw.clone(argKeys.talk)
for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lower(ns.name)
local canonicalName = mw.ustring.lower(ns.canonicalName)
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
table.insert(mappings[nsname], canonicalName)
end
for _, alias in ipairs(ns.aliases) do
table.insert(mappings[nsname], mw.ustring.lower(alias))
end
end
end
return mappings
end
return {
argKeys = argKeys,
cfg = cfg,
mappings = getParamMappings()
}
d224f42a258bc308ef3ad8cc8686cd7a4f47d005
Module:Yesno
828
16
135
2020-04-01T06:27:55Z
wikipedia>MusikAnimal
0
Undid revision 948472533 by [[Special:Contributions/w>Vogone|w>Vogone]] ([[User talk:w>Vogone|talk]])
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Module:File link
828
58
187
2020-04-01T06:31:54Z
wikipedia>MusikAnimal
0
Undid revision 948472508 by [[Special:Contributions/w>IPad365|w>IPad365]] ([[User talk:w>IPad365|talk]])
Scribunto
text/plain
-- This module provides a library for formatting file wikilinks.
local yesno = require('Module:Yesno')
local checkType = require('libraryUtil').checkType
local p = {}
function p._main(args)
checkType('_main', 1, args, 'table')
-- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our
-- own function to get the right error level.
local function checkArg(key, val, level)
if type(val) ~= 'string' then
error(string.format(
"type error in '%s' parameter of '_main' (expected string, got %s)",
key, type(val)
), level)
end
end
local ret = {}
-- Adds a positional parameter to the buffer.
local function addPositional(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = val
end
-- Adds a named parameter to the buffer. We assume that the parameter name
-- is the same as the argument key.
local function addNamed(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = key .. '=' .. val
end
-- Filename
checkArg('file', args.file, 3)
ret[#ret + 1] = 'File:' .. args.file
-- Format
if args.format then
checkArg('format', args.format)
if args.formatfile then
checkArg('formatfile', args.formatfile)
ret[#ret + 1] = args.format .. '=' .. args.formatfile
else
ret[#ret + 1] = args.format
end
end
-- Border
if yesno(args.border) then
ret[#ret + 1] = 'border'
end
addPositional('location')
addPositional('alignment')
addPositional('size')
addNamed('upright')
addNamed('link')
addNamed('alt')
addNamed('page')
addNamed('class')
addNamed('lang')
addNamed('start')
addNamed('end')
addNamed('thumbtime')
addPositional('caption')
return string.format('[[%s]]', table.concat(ret, '|'))
end
function p.main(frame)
local origArgs = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:File link'
})
if not origArgs.file then
error("'file' parameter missing from [[Template:File link]]", 0)
end
-- Copy the arguments that were passed to a new table to avoid looking up
-- every possible parameter in the frame object.
local args = {}
for k, v in pairs(origArgs) do
-- Make _BLANK a special argument to add a blank parameter. For use in
-- conditional templates etc. it is useful for blank arguments to be
-- ignored, but we still need a way to specify them so that we can do
-- things like [[File:Example.png|link=]].
if v == '_BLANK' then
v = ''
end
args[k] = v
end
return p._main(args)
end
return p
66925f088d11530f2482f04181a3baaaa0ad3d0c
Template:Sandbox other
10
73
231
2020-04-03T00:08:09Z
wikipedia>Evad37
0
Also match subpage names beginning with "sandbox", per [[Template_talk:Sandbox_other#Template-protected_edit_request_on_28_March_2020|edit request]]
wikitext
text/x-wiki
{{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
91e4ae891d6b791615152c1fbc971414961ba872
Template:Tlf
10
75
237
2020-04-13T14:42:57Z
wikipedia>Primefac
0
Primefac moved page [[Template:Tlf]] to [[Template:Template link with link off]]: full name to indicate what it does
wikitext
text/x-wiki
#REDIRECT [[Template:Template link with link off]]
{{Redirect category shell|
{{R from move}}
}}
52759e1d3f7c9aa4a03d0b7d4f84f4c6adf53edf
Module:Category handler/blacklist
828
121
337
2020-04-18T08:48:05Z
wikipedia>Jo-Jo Eumerus
0
Per category talk page
Scribunto
text/plain
-- This module contains the blacklist used by [[Module:Category handler]].
-- Pages that match Lua patterns in this list will not be categorised unless
-- categorisation is explicitly requested.
return {
'^Main Page$', -- don't categorise the main page.
-- Don't categorise the following pages or their subpages.
-- "%f[/\0]" matches if the next character is "/" or the end of the string.
'^Wikipedia:Cascade%-protected items%f[/\0]',
'^User:UBX%f[/\0]', -- The userbox "template" space.
'^User talk:UBX%f[/\0]',
-- Don't categorise subpages of these pages, but allow
-- categorisation of the base page.
'^Wikipedia:Template index/.*$',
-- Don't categorise archives.
'/[aA]rchive',
"^Wikipedia:Administrators' noticeboard/IncidentArchive%d+$",
}
87469d7a9ef2a3c41b2bf04ae18f7c59a18fb855
Template:Sidebar with collapsible lists
10
278
670
2020-04-23T17:08:31Z
wikipedia>Plastikspork
0
TFD closed as oppose ([[WP:XFDC|XFDcloser]])
wikitext
text/x-wiki
{{#invoke: Sidebar | collapsible }}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
4bd1f39f9101790ed6e315752e377a8ac7a95869
Template:Sidebar
10
54
179
2020-06-04T02:43:13Z
wikipedia>Primefac
0
TFD closed as keep ([[WP:XFDC|XFDcloser]])
wikitext
text/x-wiki
{{#invoke:Sidebar|sidebar}}<noinclude>
{{documentation}}</noinclude>
ab2498000a99daf324f656b0badd187b4a3e2b42
Module:String
828
51
157
2020-08-02T15:49:42Z
wikipedia>RexxS
0
separate annotations for str.match from those for str._match
Scribunto
text/plain
--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters,
unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
automatically remove any leading or trailing whitespace from the parameter.
Depending on the intended use, it may be advantageous to either preserve or
remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in
an empty string being returned rather than an error message.
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String].
no_category: If set to 'true' or 1, no category will be added if an error
is generated.
Unit tests for this module are available at Module:String/tests.
]]
local str = {}
--[[
len
This function returns the length of the target string.
Usage:
{{#invoke:String|len|target_string|}}
OR
{{#invoke:String|len|s=target_string}}
Parameters
s: The string whose length to report
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string.
]]
function str.len( frame )
local new_args = str._getParameters( frame.args, {'s'} )
local s = new_args['s'] or ''
return mw.ustring.len( s )
end
--[[
sub
This function returns a substring of the target string at specified indices.
Usage:
{{#invoke:String|sub|target_string|start_index|end_index}}
OR
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
Parameters
s: The string to return a subset of
i: The fist index of the substring to return, defaults to 1.
j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j
is a negative value, it is interpreted the same as selecting a character by
counting from the end of the string. Hence, a value of -1 is the same as
selecting the last character of the string.
If the requested indices are out of range for the given string, an error is
reported.
]]
function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } )
local s = new_args['s'] or ''
local i = tonumber( new_args['i'] ) or 1
local j = tonumber( new_args['j'] ) or -1
local len = mw.ustring.len( s )
-- Convert negatives for range checking
if i < 0 then
i = len + i + 1
end
if j < 0 then
j = len + j + 1
end
if i > len or j > len or i < 1 or j < 1 then
return str._error( 'String subset index out of range' )
end
if j < i then
return str._error( 'String subset indices out of order' )
end
return mw.ustring.sub( s, i, j )
end
--[[
This function implements that features of {{str sub old}} and is kept in order
to maintain these older templates.
]]
function str.sublength( frame )
local i = tonumber( frame.args.i ) or 0
local len = tonumber( frame.args.len )
return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
end
--[[
_match
This function returns a substring from the source string that matches a
specified pattern. It is exported for use in other modules
Usage:
strmatch = require("Module:String")._match
sresult = strmatch( s, pattern, start, match, plain, nomatch )
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This sub-routine is exported for use in other modules
function str._match( s, pattern, start, match_index, plain_flag, nomatch )
if s == '' then
return str._error( 'Target string is empty' )
end
if pattern == '' then
return str._error( 'Pattern string is empty' )
end
start = tonumber(start) or 1
if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
return str._error( 'Requested start is out of range' )
end
if match_index == 0 then
return str._error( 'Match index is out of range' )
end
if plain_flag then
pattern = str._escapePattern( pattern )
end
local result
if match_index == 1 then
-- Find first match is simple case
result = mw.ustring.match( s, pattern, start )
else
if start > 1 then
s = mw.ustring.sub( s, start )
end
local iterator = mw.ustring.gmatch(s, pattern)
if match_index > 0 then
-- Forward search
for w in iterator do
match_index = match_index - 1
if match_index == 0 then
result = w
break
end
end
else
-- Reverse search
local result_table = {}
local count = 1
for w in iterator do
result_table[count] = w
count = count + 1
end
result = result_table[ count + match_index ]
end
end
if result == nil then
if nomatch == nil then
return str._error( 'Match not found' )
else
return nomatch
end
else
return result
end
end
--[[
match
This function returns a substring from the source string that matches a
specified pattern.
Usage:
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
OR
{{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index
|match=match_number|plain=plain_flag|nomatch=nomatch_output}}
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from each string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then
this function generates an error. An error is also generated if no match is found.
If one adds the parameter ignore_errors=true, then the error will be suppressed and
an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This is the entry point for #invoke:String|match
function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} )
local s = new_args['s'] or ''
local start = tonumber( new_args['start'] ) or 1
local plain_flag = str._getBoolean( new_args['plain'] or false )
local pattern = new_args['pattern'] or ''
local match_index = math.floor( tonumber(new_args['match']) or 1 )
local nomatch = new_args['nomatch']
return str._match( s, pattern, start, match_index, plain_flag, nomatch )
end
--[[
pos
This function returns a single character from the target string at position pos.
Usage:
{{#invoke:String|pos|target_string|index_value}}
OR
{{#invoke:String|pos|target=target_string|pos=index_value}}
Parameters
target: The string to search
pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards
from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error.
]]
function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} )
local target_str = new_args['target'] or ''
local pos = tonumber( new_args['pos'] ) or 0
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
return str._error( 'String index out of range' )
end
return mw.ustring.sub( target_str, pos, pos )
end
--[[
str_find
This function duplicates the behavior of {{str_find}}, including all of its quirks.
This is provided in order to support existing templates, but is NOT RECOMMENDED for
new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based,
and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a
value of "1", which is generally unexpected behavior, and must be accounted for
separatetly.
]]
function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} )
local source_str = new_args['source'] or ''
local target_str = new_args['target'] or ''
if target_str == '' then
return 1
end
local start = mw.ustring.find( source_str, target_str, 1, true )
if start == nil then
start = -1
end
return start
end
--[[
find
This function allows one to search for a target string or pattern within another
string.
Usage:
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
OR
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
Parameters
source: The string to search
target: The string or pattern to find within source
start: The index within the source string to start the search, defaults to 1
plain: Boolean flag indicating that target should be understood as plain
text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the parameter. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found
within "source". Indices are 1-based. If "target" is not found, then this
function returns 0. If either "source" or "target" are missing / empty, this
function also returns 0.
This function should be safe for UTF-8 strings.
]]
function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['target'] or ''
local start_pos = tonumber(new_args['start']) or 1
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return 0
end
plain = str._getBoolean( plain )
local start = mw.ustring.find( source_str, pattern, start_pos, plain )
if start == nil then
start = 0
end
return start
end
--[[
replace
This function allows one to replace a target string or pattern within another
string.
Usage:
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
OR
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
count=replacement_count|plain=plain_flag}}
Parameters
source: The string to search
pattern: The string or pattern to find within source
replace: The replacement text
count: The number of occurences to replace, defaults to all.
plain: Boolean flag indicating that pattern should be understood as plain
text and not as a Lua style regular expression, defaults to true
]]
function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['pattern'] or ''
local replace = new_args['replace'] or ''
local count = tonumber( new_args['count'] )
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return source_str
end
plain = str._getBoolean( plain )
if plain then
pattern = str._escapePattern( pattern )
replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences.
end
local result
if count ~= nil then
result = mw.ustring.gsub( source_str, pattern, replace, count )
else
result = mw.ustring.gsub( source_str, pattern, replace )
end
return result
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] )
if not repetitions then
return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
return string.rep( frame.args[1] or '', repetitions )
end
--[[
escapePattern
This function escapes special characters from a Lua string pattern. See [1]
for details on how patterns work.
[1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
Usage:
{{#invoke:String|escapePattern|pattern_string}}
Parameters
pattern_string: The pattern string to escape.
]]
function str.escapePattern( frame )
local pattern_str = frame.args[1]
if not pattern_str then
return str._error( 'No pattern string specified' )
end
local result = str._escapePattern( pattern_str )
return result
end
--[[
count
This function counts the number of occurrences of one string in another.
]]
function str.count(frame)
local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'})
local source = args.source or ''
local pattern = args.pattern or ''
local plain = str._getBoolean(args.plain or true)
if plain then
pattern = str._escapePattern(pattern)
end
local _, count = mw.ustring.gsub(source, pattern, '')
return count
end
--[[
endswith
This function determines whether a string ends with another string.
]]
function str.endswith(frame)
local args = str._getParameters(frame.args, {'source', 'pattern'})
local source = args.source or ''
local pattern = args.pattern or ''
if pattern == '' then
-- All strings end with the empty string.
return "yes"
end
if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then
return "yes"
else
return ""
end
end
--[[
join
Join all non empty arguments together; the first argument is the separator.
Usage:
{{#invoke:String|join|sep|one|two|three}}
]]
function str.join(frame)
local args = {}
local sep
for _, v in ipairs( frame.args ) do
if sep then
if v ~= '' then
table.insert(args, v)
end
else
sep = v
end
end
return table.concat( args, sep or '' )
end
--[[
Helper function that populates the argument list given that user may need to use a mix of
named and unnamed parameters. This is relevant because named parameters are not
identical to unnamed parameters due to string trimming, and when dealing with strings
we sometimes want to either preserve or remove that whitespace depending on the application.
]]
function str._getParameters( frame_args, arg_list )
local new_args = {}
local index = 1
local value
for _, arg in ipairs( arg_list ) do
value = frame_args[arg]
if value == nil then
value = frame_args[index]
index = index + 1
end
new_args[arg] = value
end
return new_args
end
--[[
Helper function to handle error messages.
]]
function str._error( error_str )
local frame = mw.getCurrentFrame()
local error_category = frame.args.error_category or 'Errors reported by Module String'
local ignore_errors = frame.args.ignore_errors or false
local no_category = frame.args.no_category or false
if str._getBoolean(ignore_errors) then
return ''
end
local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>'
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str
end
return error_str
end
--[[
Helper Function to interpret boolean strings
]]
function str._getBoolean( boolean_str )
local boolean_value
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower()
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
or boolean_str == '' then
boolean_value = false
else
boolean_value = true
end
elseif type( boolean_str ) == 'boolean' then
boolean_value = boolean_str
else
error( 'No boolean value found' )
end
return boolean_value
end
--[[
Helper function that escapes all pattern characters so that they will be treated
as plain text.
]]
function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" )
end
return str
6df794dd52434e0f6a372c9918f5a9dedd15f579
Template:SDcat
10
239
585
2020-08-07T18:02:31Z
wikipedia>MusikBot II
0
Protected "[[Template:SDcat]]": [[Wikipedia:High-risk templates|High-risk template or module]] ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
<includeonly>{{#invoke:SDcat |setCat}}</includeonly><noinclude>
{{documentation}}
</noinclude>
8c6e8783ddb0dc699d6fb60370db97b73725b9a6
Module:SDcat
828
240
587
2020-08-16T17:20:37Z
wikipedia>RexxS
0
if no connection to Wikidata, then do nothing
Scribunto
text/plain
--[[
SDcat
Module to check whether local short description matches that on Wikidata
--]]
local p = {}
-------------------------------------------------------------------------------
--[[
setCat has the qid of a Wikidata entity passed as |qid=
(it defaults to the associated qid of the current article if omitted)
and the local short description passed as |sd=
It returns a category if there is an associated Wikidata entity.
It returns one of the following tracking categories, as appropriate:
* Category:Short description matches Wikidata (case-insensitive)
* Category:Short description is different from Wikidata
* Category:Short description with empty Wikidata description
For testing purposes, a link prefix |lp= may be set to ":" to make the categories visible.
--]]
-- function exported for use in other modules
-- (local short description, Wikidata entity-ID, link prefix)
p._setCat = function(sdesc, itemID, lp)
if not mw.wikibase then return nil end
if itemID == "" then itemID = nil end
-- Wikidata description field
local wdesc = (mw.wikibase.getDescription(itemID) or ""):lower()
if wdesc == "" then
return "[[" .. lp .. "Category:Short description with empty Wikidata description]]"
elseif wdesc == sdesc then
return "[[" .. lp .. "Category:Short description matches Wikidata]]"
else
return "[[" .. lp .. "Category:Short description is different from Wikidata]]"
end
end
-- function exported for call from #invoke
p.setCat = function(frame)
local args
if frame.args.sd then
args = frame.args
else
args = frame:getParent().args
end
-- local short description
local sdesc = mw.text.trim(args.sd or ""):lower()
-- Wikidata entity-ID
local itemID = mw.text.trim(args.qid or "")
-- link prefix, strip quotes
local lp = mw.text.trim(args.lp or ""):gsub('"', '')
return p._setCat(sdesc, itemID, lp)
end
return p
6c19ac0f72c79a618eb105808f74701376bb2b38
Template:Template other
10
34
80
2020-08-21T20:48:37Z
meta>Dmehus
0
10 revisions imported: Importing [[mh:test:Template:Soft redirect|Template:Soft redirect]], [[mh:test:Template:Soft redirect 2|Template:Soft redirect 2]], [[mh:test:Template:Interwiki redirect|Template:Interwiki redirect]], and [[mh:test:Template:Interwiki redirect/doc|Template:Interwiki redirect/doc]] from TestWiki.
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Template:Yesno
10
46
147
2020-08-28T03:15:17Z
wikipedia>Xaosflux
0
add additional paramerters, "t", "f" - requested on talk - worked in sandbox /testcases
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }}
|no
|n
|f
|false
|off
|0 = {{{no|<!-- null -->}}}
| = {{{blank|{{{no|<!-- null -->}}}}}}
|¬ = {{{¬|}}}
|yes
|y
|t
|true
|on
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
629c2937bc5cf7cfe13cd2a598582af832782399
Module:TNT
828
22
524
2020-08-30T07:28:25Z
wikipedia>Johnuniq
0
Changed protection level for "[[Module:TNT]]": [[WP:High-risk templates|High-risk Lua module]]: per request at [[WP:RFPP]] to match [[Module:Excerpt]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
9d0d10e54abd232c806dcabccaf03e52858634a1
Template:Subpage other
10
221
544
2020-09-10T16:00:23Z
wikipedia>Favonian
0
Changed protection level for "[[Template:Subpage other]]": [[WP:High-risk templates|Highly visible template]]: requested at [[WP:RFPP]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
{{#ifeq:{{SUBPAGENAME}}|{{ROOTPAGENAME}}|{{{2|}}}|{{{1|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
ebcb508ec39c25594f4151c4e32c01eeb5732f3d
Module:Anchor
828
179
458
2020-09-24T22:32:51Z
wikipedia>Pppery
0
Add class per edit request
Scribunto
text/plain
-- This module implements {{anchor}}.
local getArgs = require('Module:Arguments').getArgs
local tableTools = require('Module:TableTools')
local p = {}
function p.main(frame)
-- Get the positional arguments from #invoke, remove any nil values,
-- and pass them to p._main.
local args = getArgs(frame)
local argArray = tableTools.compressSparseArray(args)
return p._main(unpack(argArray))
end
function p._main(...)
-- Generate the list of anchors.
local anchors = {...}
local ret = {}
for _, anchor in ipairs(anchors) do
ret[#ret + 1] = '<span class="anchor" id="' .. anchor .. '"></span>'
end
return table.concat(ret)
end
return p
e41d3f5d2f2840528aebb9bac719873540fcb3b8
Template:Infobox settlement/densdisp
10
187
474
2020-09-28T06:58:54Z
wikipedia>Jonesey95
0
Undid revision 980749675 by [[Special:Contributions/Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]). broken
wikitext
text/x-wiki
<includeonly>{{#if:
{{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#switch:auto
|{{{/km2}}}|{{{/sqmi}}}={{#iferror:{{#expr:-{{formatnum:{{{pop}}}|R}}}}
||{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{acre|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{dunam|}}}|R}}}}}}
+0
>0
|1}}
}}
}}
|1
}}
|1
}}
|{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}}}
|metv={{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}+0>0
|{{round|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}+0>0
|{{round|{{#expr:100*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:100*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{dunam|}}}|R}}}}}}+0>0
|{{round|{{#expr:1000*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:1000*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}+0>0
|{{round|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}/2.589988110336}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}/2.589988110336}}}}}}}}
|{{round|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}/0.004046856422}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}/0.004046856422}}}}}}}}
}}}}}}}}
|{{round
|{{#expr:{{formatnum:{{{/sqmi}}}|R}}/2.589988110336}}
|{{max
|{{precision|{{formatnum:{{{/sqmi}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{/sqmi}}}|R}}/2.589988110336}}}}
}}
}}
}}
|{{{/km2}}}
}}
|metu=km<sup>2</sup>
|impv={{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}+0>0
|{{round|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{acre|}}}|R}}}}}}+0>0
|{{round|{{#expr:640*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:640*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}+0>0
|{{round|{{#expr:2.589988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:2.589988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}+0>0
|{{round|{{#expr:258.9988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:258.9988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}}}}}}}
|{{round|{{#expr:2589.988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:2589.988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}}}}}}}
}}}}}}}}
|{{round
|{{#expr:{{formatnum:{{{/km2}}}|R}}*2.589988110336}}
|{{max
|{{#expr:{{precision|{{formatnum:{{{/km2}}}|R}}}}-1}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{/km2}}}|R}}*2.589988110336}}}}
}}
}}
}}
|{{{/sqmi}}}
}}
|impu=sq mi
|s=/
}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
8d2587f8008e5720272fd3abbbdd54f8c8dc306a
Template:Infobox settlement/impus
10
188
476
2020-09-28T07:06:34Z
wikipedia>Jonesey95
0
rm braces
wikitext
text/x-wiki
<includeonly>{{formatnum:{{replace|{{{impv}}}|,|}}}}{{{s| }}}{{{impu|ft}}}{{#ifeq:{{{impv|0}}}|1||{{#ifeq:{{{s}}}|/||{{#ifeq:{{{impu}}}|acre|s}}}}}} ({{formatnum:{{replace|{{{metv}}}|,|}}}}{{{s| }}}{{{metu|m}}})</includeonly><noinclude>
{{documentation}}
</noinclude>
0244ccac23dfbd7d52720d359cd5d045d70a53bc
Module:Effective protection level
828
57
185
2020-09-29T03:38:47Z
wikipedia>Jackmcbarn
0
bring in changes from sandbox
Scribunto
text/plain
local p = {}
-- Returns the permission required to perform a given action on a given title.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local level = mw.ext.FlaggedRevs.getStabilitySettings(title)
level = level and level.autoreview
if level == 'review' then
return 'reviewer'
elseif level ~= '' then
return level
else
return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review
end
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then
error( 'First parameter must be one of edit, move, create, upload, undelete, autoreview', 2 )
end
if title.namespace == 8 then -- MediaWiki namespace
if title.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page
return 'interfaceadmin'
else -- any non-JS/CSS MediaWiki page
return 'sysop'
end
elseif title.namespace == 2 and title.isSubpage then
if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page
return 'interfaceadmin'
elseif title.contentModel == 'json' then -- user JSON page
return 'sysop'
end
end
if action == 'undelete' then
return 'sysop'
end
local level = title.protectionLevels[action] and title.protectionLevels[action][1]
if level == 'sysop' or level == 'editprotected' then
return 'sysop'
elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
return 'sysop'
elseif level == 'templateeditor' then
return 'templateeditor'
elseif action == 'move' then
local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move.
if blacklistentry and not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif title.namespace == 6 then
return 'filemover'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
end
local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
if blacklistentry then
if not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason
return 'autoconfirmed'
elseif level then
return level
elseif action == 'upload' then
return 'autoconfirmed'
elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts
return 'user'
else
return '*'
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
70256a489edf6be9808031b14a7e3ef3e025da97
Template:Uses TemplateStyles
10
32
73
2020-10-17T15:10:07Z
meta>K6ka
0
Created page with "<div style="width:250px;float:right;clear:right;margin:0 0 1em 1em;border:1px solid black;-moz-border-radius:10px;-webkit-border-radius:10px;padding:10px 10px 10px 10px; backg..."
wikitext
text/x-wiki
<div style="width:250px;float:right;clear:right;margin:0 0 1em 1em;border:1px solid black;-moz-border-radius:10px;-webkit-border-radius:10px;padding:10px 10px 10px 10px; background:#FFFFFF;">
<p style="margin:0 3% 0 3%;text-align:center;font-size:94%">
[[File:Farm-Fresh css add.svg|left|30px]] '''This template uses [[Help:TemplateStyles|TemplateStyles]]''' <br />
{{{1|}}}
</p></div><includeonly>{{#ifeq:{{SUBPAGENAME}}|doc||[[Category:Templates that use TemplateStyles|{{PAGENAME}}]]}}</includeonly><noinclude>
{{clr}}
{{Documentation}}</noinclude>
fed44ca463856190bcf6280438ed7ea020ad82c3
Template:UBT
10
126
349
2020-10-19T17:34:24Z
wikipedia>Jerm
0
Jerm moved page [[Template:UBT]] to [[Template:Userbox templates]]: Consensus for move request resulted in "Page moved".
wikitext
text/x-wiki
#REDIRECT [[Template:Userbox templates]]
{{Redirect category shell|
{{R from move}}
}}
a3c8d6912211b05645707bddac0cb744e45a0136
Template:Cross
10
101
297
2020-11-14T04:41:20Z
wikipedia>Arbitrarily0
0
Arbitrarily0 moved page [[Template:Cross]] to [[Template:Xmark]]: [[Wikipedia:Requested moves|requested move]]; consensus at [[Template talk:Xmark]]
wikitext
text/x-wiki
#REDIRECT [[Template:Xmark]]
{{Redirect category shell|
{{R from move}}
}}
e97e23c5fb1a53fbf972794777b17b669b615ad4
Module:Documentation/styles.css
828
24
229
2020-11-19T20:21:58Z
wikipedia>Izno
0
Changed protection level for "[[Module:Documentation/styles.css]]": actually match module ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
sanitized-css
text/css
/* {{pp|small=yes}} */
.documentation,
.documentation-metadata {
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
clear: both;
}
.documentation {
margin: 1em 0 0 0;
padding: 1em;
}
.documentation-metadata {
margin: 0.2em 0; /* same margin left-right as .documentation */
font-style: italic;
padding: 0.4em 1em; /* same padding left-right as .documentation */
}
.documentation-startbox {
padding-bottom: 3px;
border-bottom: 1px solid #aaa;
margin-bottom: 1ex;
}
.documentation-heading {
font-weight: bold;
font-size: 125%;
}
.documentation-clear { /* Don't want things to stick out where they shouldn't. */
clear: both;
}
.documentation-toolbar {
font-style: normal;
font-size: 85%;
}
ce0e629c92e3d825ab9fd927fe6cc37d9117b6cb
Template:Tlx
10
40
167
2020-11-20T18:53:35Z
wikipedia>Primefac
0
Primefac moved page [[Template:Tlx]] to [[Template:Template link expanded]] over redirect: expand name, make it more obvious
wikitext
text/x-wiki
#REDIRECT [[Template:Template link expanded]]
{{Redirect category shell|
{{R from move}}
}}
1fec988ceb46cb324af228aac45d7cd25fcc9008
Template:Template link expanded
10
39
169
2020-11-21T12:04:41Z
wikipedia>Primefac
0
update
wikitext
text/x-wiki
{{#Invoke:Template link general|main|code=on}}<noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlx}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
6c99696fee02f1da368ed20d2504e19bc15b1c13
Template:Template link with link off
10
74
235
2020-11-21T12:06:17Z
wikipedia>Primefac
0
update
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nowrap=yes|nolink=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlf}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
b099fea5d1f36b0b4b9cb253ad3a9f4e095f6851
Template:Template link code
10
104
303
2020-11-21T12:06:22Z
wikipedia>Primefac
0
update
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nolink=yes|code=yes|nowrap=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlc}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
044f00ca1bfc10cb967c32e893043ccc6f739764
Template:Userbox templates
10
128
353
2020-12-11T07:45:28Z
wikipedia>Sbb1413
0
wikitext
text/x-wiki
{| class="wikitable"
|+
! {{navbar|Template:Userbox templates|mini=y}}
! Userbox metatemplates
|-
! Left
|vertical-align:top;"|
*{{tlx|Userbox}}
*{{tlx|Userbox-w}} — wide variation
----
*{{tlx|Userbox-flag}} — for location-related userboxes
*{{tlx|Userbox-level}} — for skill-related userboxes
|-
! Right
|
*{{tlx|Userbox-r}}
*{{tlx|Userbox-w-r}} — wide variation
----
*{{tlx|userbox-flag-r}} — for location-related userboxes
*{{tlx|Userbox-level-r}} — for skill-related userboxes
|-
! Left and Right
|style="vertical-align:top;"|
*{{tlx|Userbox-2}}
|-
! None
|style="vertical-align:top;"|
*{{tlx|Userbox-m}}
|-
!colspan="4" style="font-weight:normal;"|
'''See also:''' [[Module:Userbox]], [[Wikipedia:Userboxes]], [[Wikipedia:Userboxes/Userboxes]]
|}<noinclude>{{documentation|content=
This template provides easy links and usage of the basic userbox templates.
[[Category:Documentation shared content templates|Userboxes]]
}}</noinclude>
7a85ee55ea563fd7267355e3618f1a3493840b5d
Module:Location map/styles.css
828
204
508
2021-01-02T20:03:01Z
wikipedia>Izno
0
Protected "[[Module:Location map/styles.css]]": [[WP:High-risk templates|Highly visible template]]: match parent ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
sanitized-css
text/css
/* {{pp|small=yes}} */
.locmap .od {
position: absolute;
}
.locmap .id {
position: absolute;
line-height: 0;
}
.locmap .l0 {
font-size: 0;
position: absolute;
}
.locmap .pv {
line-height: 110%;
position: absolute;
text-align: center;
}
.locmap .pl {
line-height: 110%;
position: absolute;
top: -0.75em;
text-align: right;
}
.locmap .pr {
line-height: 110%;
position: absolute;
top: -0.75em;
text-align: left;
}
.locmap .pv > div {
display: inline;
padding: 1px;
}
.locmap .pl > div {
display: inline; /* inline does not impact floated elements */
padding: 1px;
float: right;
}
.locmap .pr > div {
display: inline; /* inline does not impact floated elements */
padding: 1px;
float: left;
}
1af8c3b5ae1ff654548b74f76b5208f6b360c5a1
Module:Data
828
262
633
2021-01-16T19:03:09Z
wikipedia>Jackmcbarn
0
Make this work when called with wikitext's fake tables
Scribunto
text/plain
local mt = {}
function mt.__index(t, k)
return function(frame)
local data = mw.loadData(k)
local i = 1
for _,v in ipairs(frame.args) do
local ty = type(data)
if ty ~= 'table' then
local args = {}
for j = 1, i - 1 do
args[j] = frame.args[j]
end
if frame.args.softfail then
return '<span class="error">[[Category:Pages with failed Module:Data lookups]]Error: Tried to read index "' .. mw.text.nowiki(v) .. '" of mw.loadData("' .. mw.text.nowiki(k) .. '").' .. mw.text.nowiki(table.concat(args, '.')) .. ', which is a ' .. ty .. '</span>'
else
error('Tried to read index "' .. v .. '" of mw.loadData("' .. k .. '").' .. table.concat(args, '.') .. ', which is a ' .. ty)
end
end
data = data[v]
i = i + 1
end
return data
end
end
return setmetatable({}, mt)
654c5ba2e0c73e7415457ca7a67fe0dfacfdba3b
Template:Tlc
10
103
301
2021-01-23T16:04:55Z
wikipedia>Elli
0
cats
wikitext
text/x-wiki
#REDIRECT [[Template:Template link code]]
{{Redirect category shell|
{{R from template shortcut}}
{{R from high-use template}}
{{R from move}}
}}
48ef4a029c0e27cccb1148a29fb8b7ccb211a4a2
Template:Anchor
10
177
454
2021-01-31T22:06:17Z
wikipedia>Plastikspork
0
Fix |=FOO bug where {{anchor|=FOO}} transcludes [[Template:FOO]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:anchor|main}}<noinclude>
{{Documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
7d65122552007ac959072bddfa6f723296c81998
Template:Tl
10
36
139
2021-02-12T22:03:00Z
wikipedia>Anthony Appleyard
0
Anthony Appleyard moved page [[Template:Tl]] to [[Template:Template link]]: [[Special:Permalink/1006428669|Requested]] by Buidhe at [[WP:RM/TR]]: RM closed as move
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
{{Redirect category shell|
{{R from move}}
}}
d6593bb3b4a866249f55d0f34b047a71fe1f1529
Template:Div col
10
68
213
2021-02-14T23:20:57Z
wikipedia>Matt Fitzpatrick
0
whitelist parameter class
wikitext
text/x-wiki
<includeonly><templatestyles src="Div col/styles.css"/><!--
--><div class="div-col {{#ifeq:{{{small|}}}|yes|div-col-small}} {{#ifeq:{{{rules|}}}|yes|div-col-rules}} {{{class|}}}" <!--
-->{{#if:{{{colwidth|}}}{{{gap|}}}{{{style|}}}|<!--
-->style="{{#if:{{{colwidth|}}}|column-width: {{{colwidth}}};}}{{#if:{{{gap|}}}|column-gap: {{{gap}}};}}{{#if:{{{style|}}}|{{{style}}}}}"<!--
-->}}><!--
-->{{#if:{{{content|}}}|{{{content}}}</div>}}<!-- Inventory how many pages use small=yes
-->{{#ifeq:{{{small|}}}|yes|[[Category:Pages using div col with small parameter]]}}<!--
--></includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using div col with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Div col]] with unknown parameter "_VALUE_"; use colwidth= to specify column size |ignoreblank=y | class | colwidth | content | gap | rules | small | style }}<noinclude>
{{Documentation}}
</noinclude>
6e84133dd867d6c701e7b161878cf66665bb7eb7
Template:Template shortcut
10
107
309
2021-02-16T17:54:32Z
wikipedia>Nardog
0
TfM closed as convert
wikitext
text/x-wiki
<includeonly>{{#invoke:Shortcut|main|template=yes}}</includeonly><noinclude>{{Documentation}}</noinclude>
bfb2889c4c0ec36294b7b667f5e03350d2df680e
Module:Shortcut/config
828
106
307
2021-02-16T18:43:45Z
wikipedia>Nardog
0
Scribunto
text/plain
-- This module holds configuration data for [[Module:Shortcut]].
return {
-- The heading at the top of the shortcut box. It accepts the following parameter:
-- $1 - the total number of shortcuts. (required)
['shortcut-heading'] = '[[Wikipedia:Shortcut|{{PLURAL:$1|Shortcut|Shortcuts}}]]',
-- The heading when |redirect=yes is given. It accepts the following parameter:
-- $1 - the total number of shortcuts. (required)
['redirect-heading'] = '[[Wikipedia:Redirect|{{PLURAL:$1|Redirect|Redirects}}]]',
-- The error message to display when a shortcut is invalid (is not a string, or
-- is the blank string). It accepts the following parameter:
-- $1 - the number of the shortcut in the argument list. (required)
['invalid-shortcut-error'] = 'shortcut #$1 was invalid (shortcuts must be ' ..
'strings of at least one character in length)',
-- The error message to display when no shortcuts or other displayable content
-- were specified. (required)
['no-content-error'] = 'Error: no shortcuts were specified and the ' ..
mw.text.nowiki('|msg=') ..
' parameter was not set.',
-- A category to add when the no-content-error message is displayed. (optional)
['no-content-error-category'] = 'Shortcut templates with missing parameters',
}
f9d1d94844d5953753eb19e30a3ce389eda3d319
Template:Reflist/styles.css
10
171
442
2021-03-08T23:00:26Z
wikipedia>Izno
0
Changed protection level for "[[Template:Reflist/styles.css]]": match parent ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
sanitized-css
text/css
/* {{pp|small=yes}} */
/* can we remove the font size declarations? .references gets a font-size in
* common.css that is always 90, and there is nothing else in reflist out in
* the wild. May affect column sizes.
*/
.reflist {
font-size: 90%; /* Default font-size */
margin-bottom: 0.5em;
list-style-type: decimal;
}
.reflist .references {
font-size: 100%; /* Reset font-size when nested in div.reflist */
margin-bottom: 0; /* Avoid double margin when nested in div.reflist */
list-style-type: inherit; /* Enable custom list style types */
}
/* columns-2 and columns-3 are legacy for "2 or more" column view from when the
* template was implemented with column-count.
*/
.reflist-columns-2 {
column-width: 30em;
}
.reflist-columns-3 {
column-width: 25em;
}
/* Reset top margin for lists embedded in columns */
.reflist-columns {
margin-top: 0.3em;
}
.reflist-columns ol {
margin-top: 0;
}
/* Avoid elements breaking between columns */
.reflist-columns li {
page-break-inside: avoid; /* Removed from CSS in favor of break-inside c. 2020 */
break-inside: avoid-column;
}
.reflist-upper-alpha {
list-style-type: upper-alpha;
}
.reflist-upper-roman {
list-style-type: upper-roman;
}
.reflist-lower-alpha {
list-style-type: lower-alpha;
}
.reflist-lower-greek {
list-style-type: lower-greek;
}
.reflist-lower-roman {
list-style-type: lower-roman;
}
531a26d48f0e7826c61f764cfb7d5fb200032c34
Module:Math
828
205
510
2021-03-11T22:23:48Z
wikipedia>Primefac
0
typo fix
Scribunto
text/plain
--[[
This module provides a number of basic mathematical operations.
]]
local yesno, getArgs -- lazily initialized
local p = {} -- Holds functions to be returned from #invoke, and functions to make available to other Lua modules.
local wrap = {} -- Holds wrapper functions that process arguments from #invoke. These act as intemediary between functions meant for #invoke and functions meant for Lua.
--[[
Helper functions used to avoid redundant code.
]]
local function err(msg)
-- Generates wikitext error messages.
return mw.ustring.format('<strong class="error">Formatting error: %s</strong>', msg)
end
local function unpackNumberArgs(args)
-- Returns an unpacked list of arguments specified with numerical keys.
local ret = {}
for k, v in pairs(args) do
if type(k) == 'number' then
table.insert(ret, v)
end
end
return unpack(ret)
end
local function makeArgArray(...)
-- Makes an array of arguments from a list of arguments that might include nils.
local args = {...} -- Table of arguments. It might contain nils or non-number values, so we can't use ipairs.
local nums = {} -- Stores the numbers of valid numerical arguments.
local ret = {}
for k, v in pairs(args) do
v = p._cleanNumber(v)
if v then
nums[#nums + 1] = k
args[k] = v
end
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[#ret + 1] = args[num]
end
return ret
end
local function fold(func, ...)
-- Use a function on all supplied arguments, and return the result. The function must accept two numbers as parameters,
-- and must return a number as an output. This number is then supplied as input to the next function call.
local vals = makeArgArray(...)
local count = #vals -- The number of valid arguments
if count == 0 then return
-- Exit if we have no valid args, otherwise removing the first arg would cause an error.
nil, 0
end
local ret = table.remove(vals, 1)
for _, val in ipairs(vals) do
ret = func(ret, val)
end
return ret, count
end
--[[
Fold arguments by selectively choosing values (func should return when to choose the current "dominant" value).
]]
local function binary_fold(func, ...)
local value = fold((function(a, b) if func(a, b) then return a else return b end end), ...)
return value
end
--[[
random
Generate a random number
Usage:
{{#invoke: Math | random }}
{{#invoke: Math | random | maximum value }}
{{#invoke: Math | random | minimum value | maximum value }}
]]
function wrap.random(args)
local first = p._cleanNumber(args[1])
local second = p._cleanNumber(args[2])
return p._random(first, second)
end
function p._random(first, second)
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))
-- math.random will throw an error if given an explicit nil parameter, so we need to use if statements to check the params.
if first and second then
if first <= second then -- math.random doesn't allow the first number to be greater than the second.
return math.random(first, second)
end
elseif first then
return math.random(first)
else
return math.random()
end
end
--[[
order
Determine order of magnitude of a number
Usage:
{{#invoke: Math | order | value }}
]]
function wrap.order(args)
local input_string = (args[1] or args.x or '0');
local input_number = p._cleanNumber(input_string);
if input_number == nil then
return err('order of magnitude input appears non-numeric')
else
return p._order(input_number)
end
end
function p._order(x)
if x == 0 then return 0 end
return math.floor(math.log10(math.abs(x)))
end
--[[
precision
Detemines the precision of a number using the string representation
Usage:
{{ #invoke: Math | precision | value }}
]]
function wrap.precision(args)
local input_string = (args[1] or args.x or '0');
local trap_fraction = args.check_fraction;
local input_number;
if not yesno then
yesno = require('Module:Yesno')
end
if yesno(trap_fraction, true) then -- Returns true for all input except nil, false, "no", "n", "0" and a few others. See [[Module:Yesno]].
local pos = string.find(input_string, '/', 1, true);
if pos ~= nil then
if string.find(input_string, '/', pos + 1, true) == nil then
local denominator = string.sub(input_string, pos+1, -1);
local denom_value = tonumber(denominator);
if denom_value ~= nil then
return math.log10(denom_value);
end
end
end
end
input_number, input_string = p._cleanNumber(input_string);
if input_string == nil then
return err('precision input appears non-numeric')
else
return p._precision(input_string)
end
end
function p._precision(x)
if type(x) == 'number' then
x = tostring(x)
end
x = string.upper(x)
local decimal = x:find('%.')
local exponent_pos = x:find('E')
local result = 0;
if exponent_pos ~= nil then
local exponent = string.sub(x, exponent_pos + 1)
x = string.sub(x, 1, exponent_pos - 1)
result = result - tonumber(exponent)
end
if decimal ~= nil then
result = result + string.len(x) - decimal
return result
end
local pos = string.len(x);
while x:byte(pos) == string.byte('0') do
pos = pos - 1
result = result - 1
if pos <= 0 then
return 0
end
end
return result
end
--[[
max
Finds the maximum argument
Usage:
{{#invoke:Math| max | value1 | value2 | ... }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.max(args)
return p._max(unpackNumberArgs(args))
end
function p._max(...)
local max_value = binary_fold((function(a, b) return a > b end), ...)
if max_value then
return max_value
end
end
--[[
median
Find the median of set of numbers
Usage:
{{#invoke:Math | median | number1 | number2 | ...}}
OR
{{#invoke:Math | median }}
]]
function wrap.median(args)
return p._median(unpackNumberArgs(args))
end
function p._median(...)
local vals = makeArgArray(...)
local count = #vals
table.sort(vals)
if count == 0 then
return 0
end
if p._mod(count, 2) == 0 then
return (vals[count/2] + vals[count/2+1])/2
else
return vals[math.ceil(count/2)]
end
end
--[[
min
Finds the minimum argument
Usage:
{{#invoke:Math| min | value1 | value2 | ... }}
OR
{{#invoke:Math| min }}
When used with no arguments, it takes its input from the parent
frame. Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.min(args)
return p._min(unpackNumberArgs(args))
end
function p._min(...)
local min_value = binary_fold((function(a, b) return a < b end), ...)
if min_value then
return min_value
end
end
--[[
sum
Finds the sum
Usage:
{{#invoke:Math| sum | value1 | value2 | ... }}
OR
{{#invoke:Math| sum }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.sum(args)
return p._sum(unpackNumberArgs(args))
end
function p._sum(...)
local sums, count = fold((function(a, b) return a + b end), ...)
if not sums then
return 0
else
return sums
end
end
--[[
average
Finds the average
Usage:
{{#invoke:Math| average | value1 | value2 | ... }}
OR
{{#invoke:Math| average }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.average(args)
return p._average(unpackNumberArgs(args))
end
function p._average(...)
local sum, count = fold((function(a, b) return a + b end), ...)
if not sum then
return 0
else
return sum / count
end
end
--[[
round
Rounds a number to specified precision
Usage:
{{#invoke:Math | round | value | precision }}
--]]
function wrap.round(args)
local value = p._cleanNumber(args[1] or args.value or 0)
local precision = p._cleanNumber(args[2] or args.precision or 0)
if value == nil or precision == nil then
return err('round input appears non-numeric')
else
return p._round(value, precision)
end
end
function p._round(value, precision)
local rescale = math.pow(10, precision or 0);
return math.floor(value * rescale + 0.5) / rescale;
end
--[[
log10
returns the log (base 10) of a number
Usage:
{{#invoke:Math | log10 | x }}
]]
function wrap.log10(args)
return math.log10(args[1])
end
--[[
mod
Implements the modulo operator
Usage:
{{#invoke:Math | mod | x | y }}
--]]
function wrap.mod(args)
local x = p._cleanNumber(args[1])
local y = p._cleanNumber(args[2])
if not x then
return err('first argument to mod appears non-numeric')
elseif not y then
return err('second argument to mod appears non-numeric')
else
return p._mod(x, y)
end
end
function p._mod(x, y)
local ret = x % y
if not (0 <= ret and ret < y) then
ret = 0
end
return ret
end
--[[
gcd
Calculates the greatest common divisor of multiple numbers
Usage:
{{#invoke:Math | gcd | value 1 | value 2 | value 3 | ... }}
--]]
function wrap.gcd(args)
return p._gcd(unpackNumberArgs(args))
end
function p._gcd(...)
local function findGcd(a, b)
local r = b
local oldr = a
while r ~= 0 do
local quotient = math.floor(oldr / r)
oldr, r = r, oldr - quotient * r
end
if oldr < 0 then
oldr = oldr * -1
end
return oldr
end
local result, count = fold(findGcd, ...)
return result
end
--[[
precision_format
Rounds a number to the specified precision and formats according to rules
originally used for {{template:Rnd}}. Output is a string.
Usage:
{{#invoke: Math | precision_format | number | precision }}
]]
function wrap.precision_format(args)
local value_string = args[1] or 0
local precision = args[2] or 0
return p._precision_format(value_string, precision)
end
function p._precision_format(value_string, precision)
-- For access to Mediawiki built-in formatter.
local lang = mw.getContentLanguage();
local value
value, value_string = p._cleanNumber(value_string)
precision = p._cleanNumber(precision)
-- Check for non-numeric input
if value == nil or precision == nil then
return err('invalid input when rounding')
end
local current_precision = p._precision(value)
local order = p._order(value)
-- Due to round-off effects it is neccesary to limit the returned precision under
-- some circumstances because the terminal digits will be inaccurately reported.
if order + precision >= 14 then
if order + p._precision(value_string) >= 14 then
precision = 13 - order;
end
end
-- If rounding off, truncate extra digits
if precision < current_precision then
value = p._round(value, precision)
current_precision = p._precision(value)
end
local formatted_num = lang:formatNum(math.abs(value))
local sign
-- Use proper unary minus sign rather than ASCII default
if value < 0 then
sign = '−'
else
sign = ''
end
-- Handle cases requiring scientific notation
if string.find(formatted_num, 'E', 1, true) ~= nil or math.abs(order) >= 9 then
value = value * math.pow(10, -order)
current_precision = current_precision + order
precision = precision + order
formatted_num = lang:formatNum(math.abs(value))
else
order = 0;
end
formatted_num = sign .. formatted_num
-- Pad with zeros, if needed
if current_precision < precision then
local padding
if current_precision <= 0 then
if precision > 0 then
local zero_sep = lang:formatNum(1.1)
formatted_num = formatted_num .. zero_sep:sub(2,2)
padding = precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
else
padding = precision - current_precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
end
-- Add exponential notation, if necessary.
if order ~= 0 then
-- Use proper unary minus sign rather than ASCII default
if order < 0 then
order = '−' .. lang:formatNum(math.abs(order))
else
order = lang:formatNum(order)
end
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">×</span>10<sup>' .. order .. '</sup>'
end
return formatted_num
end
--[[
divide
Implements the division operator
Usage:
{{#invoke:Math | divide | x | y | round= | precision= }}
--]]
function wrap.divide(args)
local x = args[1]
local y = args[2]
local round = args.round
local precision = args.precision
if not yesno then
yesno = require('Module:Yesno')
end
return p._divide(x, y, yesno(round), precision)
end
function p._divide(x, y, round, precision)
if y == nil or y == "" then
return err("Empty divisor")
elseif not tonumber(y) then
if type(y) == 'string' and string.sub(y, 1, 1) == '<' then
return y
else
return err("Not a number: " .. y)
end
elseif x == nil or x == "" then
return err("Empty dividend")
elseif not tonumber(x) then
if type(x) == 'string' and string.sub(x, 1, 1) == '<' then
return x
else
return err("Not a number: " .. x)
end
else
local z = x / y
if round then
return p._round(z, 0)
elseif precision then
return p._round(z, precision)
else
return z
end
end
end
--[[
Helper function that interprets the input numerically. If the
input does not appear to be a number, attempts evaluating it as
a parser functions expression.
]]
function p._cleanNumber(number_string)
if type(number_string) == 'number' then
-- We were passed a number, so we don't need to do any processing.
return number_string, tostring(number_string)
elseif type(number_string) ~= 'string' or not number_string:find('%S') then
-- We were passed a non-string or a blank string, so exit.
return nil, nil;
end
-- Attempt basic conversion
local number = tonumber(number_string)
-- If failed, attempt to evaluate input as an expression
if number == nil then
local success, result = pcall(mw.ext.ParserFunctions.expr, number_string)
if success then
number = tonumber(result)
number_string = tostring(number)
else
number = nil
number_string = nil
end
else
number_string = number_string:match("^%s*(.-)%s*$") -- String is valid but may contain padding, clean it.
number_string = number_string:match("^%+(.*)$") or number_string -- Trim any leading + signs.
if number_string:find('^%-?0[xX]') then
-- Number is using 0xnnn notation to indicate base 16; use the number that Lua detected instead.
number_string = tostring(number)
end
end
return number, number_string
end
--[[
Wrapper function that does basic argument processing. This ensures that all functions from #invoke can use either the current
frame or the parent frame, and it also trims whitespace for all arguments and removes blank arguments.
]]
local mt = { __index = function(t, k)
return function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return wrap[k](getArgs(frame)) -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.
end
end }
return setmetatable(p, mt)
2bbe734d898299f65412963a3c1782e9fcc4d9ca
Template:Template link
10
35
141
2021-03-25T19:03:22Z
wikipedia>Izno
0
[[Wikipedia:Templates for discussion/Log/2021 March 18#Template:Tlu]] closed as keep ([[WP:XFDC#4.0.11|XFDcloser]])
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eabbec62efe3044a98ebb3ce9e7d4d43c222351d
Template:Template link universal
10
123
343
2021-04-19T02:44:56Z
wikipedia>JJMC89
0
JJMC89 moved page [[Template:Tlu]] to [[Template:Template link universal]]: [[Wikipedia:Requested moves|requested move]]; consensus at [[Template talk:Template link universal]]
wikitext
text/x-wiki
<nowiki>{{</nowiki>{{#if:{{{subst|}}}|
[[WP:SUBST|subst]]:|}}[[{{{1}}}]]<!--
-->{{#if:{{{2|}}}|
|{{{2}}}
}}<!--
-->{{#if:{{{3|}}}|
|{{{3}}}
}}<!--
-->{{#if:{{{4|}}}|
|{{{4}}}
}}<!--
-->{{#if:{{{5|}}}|
|{{{5}}}
}}<!--
-->{{#if:{{{6|}}}|
|{{{6}}}
}}<!--
-->{{#if:{{{7|}}}|
|{{{7}}}
}}<!--
-->{{#if:{{{8|}}}|
|{{{8}}}
}}<!--
-->{{#if:{{{9|}}}|
|{{{9}}}
}}<!--
-->{{#if:{{{10|}}}|
|{{{10}}}
}}<!--
-->{{#if:{{{11|}}}|
|{{{11}}}
}}<!--
-->{{#if:{{{12|}}}|
|''...''
}}<nowiki>}}</nowiki><noinclude>
<!-- Add categories and interwikis to the /doc page, not here, thanks -->
{{documentation}}
</noinclude>
19d8c858c879767a664244fb4a452011a27bc735
Module:Check for clobbered parameters
828
199
498
2021-05-07T15:16:54Z
wikipedia>Izno
0
use if preview
Scribunto
text/plain
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
local checknested = isnotempty(args['nested'])
local delimiter = isnotempty(args['delimiter']) and args['delimiter'] or ';'
local argpairs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
local plist = mw.text.split(v, delimiter)
local pfound = {}
local count = 0
for ii, vv in ipairs(plist) do
vv = trim(vv)
if checknested and pargs[vv] or isnotempty(pargs[vv]) then
count = count + 1
table.insert(pfound, vv)
end
end
if count > 1 then
table.insert(argpairs, pfound)
end
end
end
local warnmsg = {}
local res = ''
local cat = ''
if args['cat'] and mw.ustring.match(args['cat'],'^[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]:') then
cat = args['cat']
end
local template = args['template'] and ' in ' .. args['template'] or ''
if #argpairs > 0 then
for i, v in ipairs( argpairs ) do
table.insert(
warnmsg,
mw.ustring.format(
'Using more than one of the following parameters%s: <code>%s</code>.',
template,
table.concat(v, '</code>, <code>')
)
)
if cat ~= '' then
res = res .. '[[' .. cat .. '|' .. (v[1] == '' and ' ' or '') .. v[1] .. ']]'
end
end
end
if #warnmsg > 0 then
res = require('Module:If preview')._warning({
table.concat(warnmsg, '<br>')
}) .. res
end
return res
end
return p
2d18fb6802fa261d88a0e135ab147ab9f062acde
Template:Category link with count
10
83
257
2021-06-11T18:13:44Z
wikipedia>GKFX
0
Support wider range of (valid) input format
wikitext
text/x-wiki
[[:Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|<!--
-->{{#if:{{{name|}}}|{{{name}}}|Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}}}<!--
-->]] ({{PAGESINCATEGORY:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|{{{2|all}}}}})<noinclude>
{{Documentation}}
</noinclude>
f93f1540b8c157703bd6d24ae35c35bef745981d
Template:Infobox settlement/columns
10
185
470
2021-06-14T22:57:30Z
wikipedia>Izno
0
templatestyles
wikitext
text/x-wiki
<templatestyles src="Infobox settlement/columns/styles.css"/>
<div class="ib-settlement-cols">
<div class="ib-settlement-cols-row">{{#if:{{{0|}}}
|<!-- if 0
-->{{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}
|<!-- if 0 and (1 or 2 or 3 or 4 or 5)
--><div class="ib-settlement-cols-cellt">
{{#if:{{{1|}}}|<div>{{{1}}}</div>}}
{{#if:{{{2|}}}|<div>{{{2}}}</div>}}
{{#if:{{{3|}}}|<div>{{{3}}}</div>}}
{{#if:{{{4|}}}|<div>{{{4}}}</div>}}
{{#if:{{{5|}}}|<div>{{{5}}}</div>}}
</div>
}}<div class="ib-settlement-cols-cellt">{{{0}}}</div>
|<!-- if not 0
-->{{#ifexpr:({{#if:{{{1|}}}|1|0}}+{{#if:{{{2|}}}|1|0}}+{{#if:{{{3|}}}|1|0}}+{{#if:{{{4|}}}|1|0}}) > 2
|<!-- if more than two images
-->{{#if:{{{1|}}}
|<div class="ib-settlement-cols-cell">{{{1}}}</div>{{#if:{{{2|}}}||</div></div><div class="ib-settlement-cols"><!-- TODO: The "3" element case currently produces two div-tables, which is non-optimal, but someone else should figure out how to fix it; 4 and 2 cases output as one "table". --><div class="ib-settlement-cols-row">}}
}}{{#if:{{{2|}}}
|<div class="ib-settlement-cols-cell">{{{2}}}</div>{{#if:{{{1|}}}||</div></div><div class="ib-settlement-cols"><div class="ib-settlement-cols-row">}}
}}</div><div class="ib-settlement-cols-row">{{#if:{{{3|}}}
|{{#if:{{{4|}}}||</div></div><div class="ib-settlement-cols"><div class="ib-settlement-cols-row">}}<div class="ib-settlement-cols-cell">{{{3}}}</div>
}}{{#if:{{{4|}}}
|{{#if:{{{3|}}}||</div></div><div class="ib-settlement-cols"><div class="ib-settlement-cols-row">}}<div class="ib-settlement-cols-cell">{{{4}}}</div>
}}
|<!-- if two or fewer images
-->{{#if:{{{1|}}}|<div class="ib-settlement-cols-cell">{{{1}}}</div>}}<!--
-->{{#if:{{{2|}}}|<div class="ib-settlement-cols-cell">{{{2}}}</div>}}<!--
-->{{#if:{{{3|}}}|<div class="ib-settlement-cols-cell">{{{3}}}</div>}}<!--
-->{{#if:{{{4|}}}|<div class="ib-settlement-cols-cell">{{{4}}}</div>}}
}}
}}</div></div><noinclude>
{{documentation}}
</noinclude>
bdd926fcf77e5f0f9f899ac6b2e23cd7efc8584e
Template:Infobox settlement/columns/styles.css
10
186
472
2021-06-14T22:58:40Z
wikipedia>Izno
0
Protected "[[Template:Infobox settlement/columns/styles.css]]": [[WP:High-risk templates|Highly visible template]]: match parent ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
sanitized-css
text/css
/* {{pp|small=y}} */
.ib-settlement-cols {
text-align: center;
display: table;
width: 100%;
}
.ib-settlement-cols-row {
display: table-row;
}
.ib-settlement-cols-cell {
display: table-cell;
vertical-align: middle;
}
.ib-settlement-cols-cellt {
display: table-cell;
vertical-align: top;
}
7dbb426d519700a7c47317b5c131244df8fc62f0
Template:Navbox
10
91
277
2021-06-26T18:05:09Z
wikipedia>Trialpears
0
Remove TfD notice as it wouldn't involve any changes to this template.
wikitext
text/x-wiki
<includeonly>{{#invoke:Navbox|navbox}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
fe9b964401f895918ee4fe078678f1722a3c41ec
Module:Hatnote/styles.css
828
61
193
2021-07-12T19:22:27Z
wikipedia>Izno
0
per my talk page
sanitized-css
text/css
/* {{pp|small=y}} */
.hatnote {
font-style: italic;
}
/* Limit structure CSS to divs because of [[Module:Hatnote inline]] */
div.hatnote {
/* @noflip */
padding-left: 1.6em;
margin-bottom: 0.5em;
}
.hatnote i {
font-style: normal;
}
/* The templatestyles element inserts a link element before hatnotes.
* TODO: Remove link if/when WMF resolves T200206 */
.hatnote + link + .hatnote {
margin-top: -0.5em;
}
44680ffd6e888866df2cdfa0341af9c7b97da94c
Template:Infobox military unit
10
257
623
2021-07-21T21:20:00Z
wikipedia>Jonesey95
0
add auto short description (displays only when short description is not provided by the article)
wikitext
text/x-wiki
<includeonly>{{Infobox
| bodystyle = {{WPMILHIST Infobox style|main_box_raw}}
| abovestyle = {{WPMILHIST Infobox style|header_raw}}
| subheaderstyle = {{WPMILHIST Infobox style|sub_header_raw}}
| above = {{{unit_name|{{PAGENAMEBASE}}}}}
| subheader = {{{native_name|}}}
| imagestyle = {{WPMILHIST Infobox style|image_box_raw}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|}}}|sizedefault=frameless|upright=1|alt={{{alt|}}}}}
| caption = {{{caption|}}}
| headerstyle = {{WPMILHIST Infobox style|header_raw}}
| labelstyle = padding-right: 1em;
| label1 = {{#if:{{{start_date|}}}|{{#if:{{{end_date|}}}|Active|Founded}}|Active}}
| data1 = {{#if:{{{start_date|}}}|{{#if:{{{end_date|}}}|{{{start_date}}}–{{{end_date}}}|{{{start_date}}}}}|{{{dates|}}}}}
| label2 = Disbanded
| data2 = {{{disbanded|}}}
| label3 = {{#if:{{{country|}}}|Country|Countries}}
| data3 = {{#if:{{{country|}}}|{{{country}}}|{{{countries|}}}}}
| label4 = Allegiance
| data4 = {{{allegiance|}}}
| label5 = Branch
| data5 = {{{branch|}}}
| label6 = Type
| data6 = {{{type|}}}
| label7 = Role
| data7 = {{{role|}}}{{{specialization|}}}
| label8 = Size
| data8 = {{{size|}}}
| label9 = Part of
| data9 = {{{command_structure|}}}
| label10 = {{#if:{{{garrison_label|}}}|{{{garrison_label|}}}|Garrison/HQ}}
| data10 = {{{garrison|}}}
| label11 = Nickname(s)
| data11 = {{{nickname|}}}
| label12 = Patron
| data12 = {{{patron|}}}
| label13 = Motto(s)
| data13 = {{{motto|}}}
| label14 = {{if empty|{{{colors_label|}}}|{{{colours_label|}}}|{{#if:{{{colours|}}}|Colours|Colors}}}}
| data14 = {{#if:{{{colours|}}}|{{{colours|}}}|{{{colors|}}}}}
| label15 = March
| data15 = {{{march|}}}
| label16 = Mascot(s)
| data16 = {{{mascot|}}}
| label17 = Anniversaries
| data17 = {{{anniversaries|}}}
| label18 = {{#if:{{{equipment_label|}}}|{{{equipment_label|}}}|Equipment}}
| data18 = {{{equipment|}}}
| label19 = {{#if:{{{battles_label|}}}|{{{battles_label|}}}|Engagements}}
| data19 = {{{battles|}}}
| label20 = Decorations
| data20 = {{{decorations|}}}
| label21 = {{#if:{{{battle_honours_label|}}}|{{{battle_honours_label|}}}|[[Battle honour|Battle honour]]s}}
| data21 = {{{battle_honours|}}}
| label22 = Flying hours
| data22 = {{{flying_hours|}}}
| label23 = Website
| data23 = {{{website|}}}
| header24 = {{#if:{{{commander1|}}}{{{commander2|}}}{{{commander3|}}}{{{current_commander|}}}{{{ceremonial_chief|}}}{{{colonel_of_the_regiment|}}}{{{notable_commanders|}}} | Commanders }}
| label25 = {{#if:{{{commander1_label|}}}|{{{commander1_label|}}}|{{#if:{{{current_commander_label|}}}|{{{current_commander_label|}}}|Current<br>commander}}}}
| data25 = {{#if:{{{commander1|}}}|{{{commander1|}}}|{{{current_commander|}}}}}
| label26 = {{#if:{{{commander2_label|}}}|{{{commander2_label|}}}|{{#if:{{{ceremonial_chief_label|}}}|{{{ceremonial_chief_label|}}}|Ceremonial chief}}}}
| data26 = {{#if:{{{commander2|}}}|{{{commander2|}}}|{{{ceremonial_chief|}}}}}
| label27 = {{#if:{{{commander3_label|}}}|{{{commander3_label|}}}|{{#if:{{{colonel_of_the_regiment_label|}}}|{{{colonel_of_the_regiment_label|}}}|Colonel of<br>the Regiment}}}}
| data27 = {{#if:{{{commander3|}}}|{{{commander3|}}}|{{{colonel_of_the_regiment|}}}}}
| label28 = {{#if:{{{commander4_label|}}}|{{{commander4_label|}}}|{{#if:{{{command_sergeant_major_label|}}}|{{{command_sergeant_major_label|}}}|Command Sergeant Major}}}}
| data28 = {{#if:{{{commander4|}}}|{{{commander4|}}}|{{{command_sergeant_major|}}}}}
| label29 = {{{commander5_label|Commander}}}
| data29 = {{{commander5|}}}
| label30 = {{{commander6_label|Commander}}}
| data30 = {{{commander6|}}}
| label31 = {{{commander7_label|Commander}}}
| data31 = {{{commander7|}}}
| label32 = {{{commander8_label|Commander}}}
| data32 = {{{commander8|}}}
| label33 = {{{commander9_label|Commander}}}
| data33 = {{{commander9|}}}
| label34 = Notable<br>commanders
| data34 = {{{notable_commanders|}}}
| header35 = {{#if:{{{identification_symbol|}}}{{{identification_symbol_2|}}} | Insignia }}
| header36 = {{#ifeq: {{{identification_symbol_label|}}} | none | {{{identification_symbol|}}} | }}
| label36 = {{#if:{{{identification_symbol_label|}}}|{{{identification_symbol_label|}}}|Identification<br>symbol}}
| data36 = {{#ifeq: {{{identification_symbol_label|}}} | none | | {{{identification_symbol|}}} }}
| label37 = {{#if:{{{identification_symbol_2_label|}}}|{{{identification_symbol_2_label|}}}|Identification<br>symbol}}
| data37 = {{{identification_symbol_2|}}}
| label38 = {{#if:{{{identification_symbol_3_label|}}}|{{{identification_symbol_3_label|}}}|Identification<br>symbol}}
| data38 = {{{identification_symbol_3|}}}
| label39 = {{#if:{{{identification_symbol_4_label|}}}|{{{identification_symbol_4_label|}}}|Identification<br>symbol}}
| data39 = {{{identification_symbol_4|}}}
| label40 = {{#if:{{{identification_symbol_5_label|}}}|{{{identification_symbol_5_label|}}}|Identification<br>symbol}}
| data40 = {{{identification_symbol_5|}}}
| label41 = {{#if:{{{identification_symbol_6_label|}}}|{{{identification_symbol_6_label|}}}|Identification<br>symbol}}
| data41 = {{{identification_symbol_6|}}}
| header42 = {{#if:{{{aircraft_attack|}}}{{{aircraft_bomber|}}}{{{aircraft_electronic|}}}{{{aircraft_fighter|}}}{{{aircraft_interceptor|}}}{{{aircraft_patrol|}}}{{{aircraft_recon|}}}{{{aircraft_trainer|}}}{{{aircraft_transport|}}}{{{aircraft_tanker|}}}{{{aircraft_helicopter|}}}{{{aircraft_helicopter_attack|}}}{{{aircraft_helicopter_cargo|}}}{{{aircraft_helicopter_multirole|}}}{{{aircraft_helicopter_observation|}}}{{{aircraft_helicopter_trainer|}}}{{{aircraft_helicopter_utility|}}}{{{aircraft_general|}}} | Aircraft flown }}
| label43 = [[Attack aircraft|Attack]]
| data43 = {{{aircraft_attack|}}}
| label44 = [[Bomber]]
| data44 = {{{aircraft_bomber|}}}
| label45 = [[Electronic warfare|Electronic<br>warfare]]
| data45 = {{{aircraft_electronic|}}}
| label46 = [[Fighter aircraft|Fighter]]
| data46 = {{{aircraft_fighter|}}}
| label47 = [[Helicopter]]
| data47 = {{{aircraft_helicopter|}}}
| label48 = [[Attack helicopter]]
| data48 = {{{aircraft_helicopter_attack|}}}
| label49 = [[Cargo helicopter]]
| data49 = {{{aircraft_helicopter_cargo|}}}
| label50 = [[Multirole helicopter]]
| data50 = {{{aircraft_helicopter_multirole|}}}
| label51 = [[Observation helicopter]]
| data51 = {{{aircraft_helicopter_observation|}}}
| label52 = [[Trainer helicopter]]
| data52 = {{{aircraft_helicopter_trainer|}}}
| label53 = [[Utility helicopter]]
| data53 = {{{aircraft_helicopter_utility|}}}
| label54 = [[Interceptor aircraft|Interceptor]]
| data54 = {{{aircraft_interceptor|}}}
| label55 = [[Patrol aircraft|Patrol]]
| data55 = {{{aircraft_patrol|}}}
| label56 = [[Surveillance aircraft|Reconnaissance]]
| data56 = {{{aircraft_recon|}}}
| label57 = [[Trainer (aircraft)|Trainer]]
| data57 = {{{aircraft_trainer|}}}
| label58 = [[Cargo aircraft|Transport]]
| data58 = {{{aircraft_transport|}}}
| label59 = [[Aerial refueling|Tanker]]
| data59 = {{{aircraft_tanker|}}}
| data60 = {{{aircraft_general|}}}
| data61 = {{{misc|{{{module|}}}}}}
}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox military unit with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox military unit]] with unknown parameter "_VALUE_"|ignoreblank=y| aircraft_attack | aircraft_bomber | aircraft_electronic | aircraft_fighter | aircraft_general | aircraft_helicopter | aircraft_helicopter_attack | aircraft_helicopter_cargo | aircraft_helicopter_multirole | aircraft_helicopter_observation | aircraft_helicopter_trainer | aircraft_helicopter_utility | aircraft_interceptor | aircraft_patrol | aircraft_recon | aircraft_tanker | aircraft_trainer | aircraft_transport | allegiance | alt | anniversaries | battle_honours | battle_honours_label | battles | battles_label | branch | caption | ceremonial_chief | ceremonial_chief_label | colonel_of_the_regiment | colonel_of_the_regiment_label | colors | colors_label | colours | colours_label | command_sergeant_major | command_sergeant_major_label | command_structure | commander1 | commander1_label | commander2 | commander2_label | commander3 | commander3_label | commander4 | commander4_label | commander5 | commander5_label | commander6 | commander6_label | commander7 | commander7_label | commander8 | commander8_label | commander9 | commander9_label | countries | country | current_commander | current_commander_label | dates | decorations | disbanded | end_date | equipment | equipment_label | flying_hours | garrison | garrison_label | identification_symbol | identification_symbol_2 | identification_symbol_2_label | identification_symbol_3 | identification_symbol_3_label | identification_symbol_4 | identification_symbol_4_label | identification_symbol_5 | identification_symbol_5_label | identification_symbol_6 | identification_symbol_6_label | identification_symbol_label | image | image_size | march | mascot | misc | module | motto | native_name | nickname | notable_commanders | patron | role | size | specialization | start_date | type | unit_name | website }}<includeonly>{{short description|Military unit|2=noreplace}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
01758240c8ad335ee4eb92e9c72c53739871bb39
Template:UF-hcard-org
10
269
647
2021-08-02T18:52:40Z
wikipedia>Sdkb
0
adding option to replace "start date and age" with just "start date"
wikitext
text/x-wiki
{{Microformat message
| format = hCard
| data = an organization's details
| subtemplates =
* Use {{#ifeq:{{yesno-yes|{{{age|}}}}}|yes|{{tl|Start date and age}}|{{tl|Start date}}}} for the date on which an organisation was "established", "founded", "opened" or otherwise started, [[Wikipedia:WikiProject Microformats/dates|unless that date is before 1583 CE]].
* Use {{tl|URL}} for an organisation's URL.
|adr |agent |category |country-name |extended-address |fn |geo |label |latitude |locality |longitude |nickname |note |org |region |street-address |url |vcard
| nocollapse = on
}}<includeonly>{{sandbox other||
[[Category:Templates generating hCards]]
}}</includeonly><noinclude>
{{Documentation |content={{Microformat message templates}}}}
[[Category:Microformat (uF) message templates]]
[[Category:Templates generating hCards| ]]
</noinclude>
631bc99cd046167681b6eb518559d92fc65a4920
Template:Trim brackets
10
142
383
2021-08-16T15:46:03Z
wikipedia>El C
0
Changed protection settings for "[[Template:Trim brackets]]": [[WP:High-risk templates|Highly visible template]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
{{safesubst<noinclude/>:#invoke:String|replace|source={{{1|}}}|pattern=^(%s*)(%[*)(.-)(%]*)(%s*)$|replace=%3|plain=false}}<noinclude>
{{documentation}}
</noinclude>
e8eca21321bdba7db6eece11b7155600db7623c1
Template:TemplateData header
10
77
241
2021-08-29T21:32:29Z
wikipedia>SUM1
0
Added "based" parameter to other transclusion
wikitext
text/x-wiki
<div class="templatedata-header">{{#if:{{{noheader|}}}|<!--
noheader:
-->{{Template parameter usage|based=y}}|<!--
+header:
-->This is the {{#if:{{{nolink|}}}|<!--
+header, nolink TD
-->TemplateData|<!--
+header, +link [[TD]]; DEFAULT:
-->[[Wikipedia:TemplateData|TemplateData]]}}<!--
e.o. #if:nolink; DEFAULT:
--> for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools. {{Template parameter usage|based=y}}<!--
e.o. #if:noheader
-->}}
'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
</div><includeonly><!--
check parameters
-->{{#invoke:Check for unknown parameters|check
|unknown={{template other|1=[[Category:Pages using TemplateData header with unknown parameters|_VALUE_]]}}
|template=Template:TemplateData header
|1 |nolink |noheader
|preview=<div class="error" style="font-weight:normal">Unknown parameter '_VALUE_' in [[Template:TemplateData header]].</div>
}}<!--
-->{{template other|{{sandbox other||
[[Category:Templates using TemplateData]]
}}}}</includeonly><!--
--><noinclude>{{Documentation}}</noinclude>
ddfbb4ae793846b96d4c06330417fa6ed4da2adc
Template:Infobox settlement/styles.css
10
192
484
2021-09-08T20:43:54Z
wikipedia>Izno
0
fix .maptable line
sanitized-css
text/css
/* {{pp|small=y}} */
.ib-settlement {
width: 23em;
border-collapse: collapse;
line-height: 1.2em;
}
/* TODO split definitions to appropriate class names when live from HTML element */
.ib-settlement td,
.ib-settlement th {
border-top: 1px solid #a2a9b1;
padding: 0.4em 0.6em 0.4em 0.6em;
}
.ib-settlement .mergedtoprow .infobox-full-data,
.ib-settlement .mergedtoprow .infobox-header,
.ib-settlement .mergedtoprow .infobox-data,
.ib-settlement .mergedtoprow .infobox-label,
.ib-settlement .mergedtoprow .infobox-below {
border-top: 1px solid #a2a9b1;
padding: 0.4em 0.6em 0.2em 0.6em;
}
.ib-settlement .mergedrow .infobox-full-data,
.ib-settlement .mergedrow .infobox-data,
.ib-settlement .mergedrow .infobox-label {
border: 0;
padding: 0 0.6em 0.2em 0.6em;
}
.ib-settlement .mergedbottomrow .infobox-full-data,
.ib-settlement .mergedbottomrow .infobox-data,
.ib-settlement .mergedbottomrow .infobox-label {
border-top: 0;
border-bottom: 1px solid #a2a9b1;
padding: 0 0.6em 0.4em 0.6em;
}
.ib-settlement .maptable {
border: 0;
padding: 0;
}
.ib-settlement .infobox-header,
.ib-settlement .infobox-below {
text-align: left;
}
.ib-settlement .infobox-above {
font-size: 125%;
line-height: 1.3em;
}
.ib-settlement .infobox-subheader {
background-color: #cddeff;
font-weight: bold;
}
.ib-settlement-native {
font-weight: normal;
padding-top: 0.2em;
}
.ib-settlement-other-name {
font-size: 78%;
}
.ib-settlement-official {
font-weight: bold;
}
.ib-settlement-caption {
padding: 0.3em 0 0 0;
}
.ib-settlement-caption-link {
padding: 0.2em 0;
}
.ib-settlement-nickname {
display: inline;
}
.ib-settlement-fn {
font-weight: normal;
display: inline;
}
bcad428737f5a62eb7bced25a38fccbd46dde186
Module:Redirect
828
89
273
2021-09-10T07:46:37Z
wikipedia>Johnuniq
0
restore p.getTargetFromText which is used by [[Module:RfD]] which is causing "Lua error in Module:RfD at line 87: attempt to call upvalue 'getTargetFromText' (a nil value)"
Scribunto
text/plain
-- This module provides functions for getting the target of a redirect page.
local p = {}
-- Gets a mw.title object, using pcall to avoid generating script errors if we
-- are over the expensive function count limit (among other possible causes).
local function getTitle(...)
local success, titleObj = pcall(mw.title.new, ...)
if success then
return titleObj
else
return nil
end
end
-- Gets the name of a page that a redirect leads to, or nil if it isn't a
-- redirect.
function p.getTargetFromText(text)
local target = string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]"
) or string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]"
)
return target and mw.uri.decode(target, 'PATH')
end
-- Gets the target of a redirect. If the page specified is not a redirect,
-- returns nil.
function p.getTarget(page, fulltext)
-- Get the title object. Both page names and title objects are allowed
-- as input.
local titleObj
if type(page) == 'string' or type(page) == 'number' then
titleObj = getTitle(page)
elseif type(page) == 'table' and type(page.getContent) == 'function' then
titleObj = page
else
error(string.format(
"bad argument #1 to 'getTarget'"
.. " (string, number, or title object expected, got %s)",
type(page)
), 2)
end
if not titleObj then
return nil
end
local targetTitle = titleObj.redirectTarget
if targetTitle then
if fulltext then
return targetTitle.fullText
else
return targetTitle.prefixedText
end
else
return nil
end
end
--[[
-- Given a single page name determines what page it redirects to and returns the
-- target page name, or the passed page name when not a redirect. The passed
-- page name can be given as plain text or as a page link.
--
-- Returns page name as plain text, or when the bracket parameter is given, as a
-- page link. Returns an error message when page does not exist or the redirect
-- target cannot be determined for some reason.
--]]
function p.luaMain(rname, bracket, fulltext)
if type(rname) ~= "string" or not rname:find("%S") then
return nil
end
bracket = bracket and "[[%s]]" or "%s"
rname = rname:match("%[%[(.+)%]%]") or rname
local target = p.getTarget(rname, fulltext)
local ret = target or rname
ret = getTitle(ret)
if ret then
if fulltext then
ret = ret.fullText
else
ret = ret.prefixedText
end
return bracket:format(ret)
else
return nil
end
end
-- Provides access to the luaMain function from wikitext.
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
return p.luaMain(args[1], args.bracket, args.fulltext) or ''
end
-- Returns true if the specified page is a redirect, and false otherwise.
function p.luaIsRedirect(page)
local titleObj = getTitle(page)
if not titleObj then
return false
end
if titleObj.isRedirect then
return true
else
return false
end
end
-- Provides access to the luaIsRedirect function from wikitext, returning 'yes'
-- if the specified page is a redirect, and the blank string otherwise.
function p.isRedirect(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
if p.luaIsRedirect(args[1]) then
return 'yes'
else
return ''
end
end
return p
a224c45940343d66f49a78b0a39b2045e2c45d20
Module:Sidebar/styles.css
828
67
211
2021-09-20T01:15:45Z
wikipedia>Goszei
0
self-rv, it's a little tight
sanitized-css
text/css
/* {{pp-template}} */
/* TODO: Invert width design to be "mobile first" */
.sidebar {
/* TODO: Ask if we should have max-width 22em instead */
width: 22em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
/* @noflip */
margin: 0.5em 0 1em 1em;
background: #f8f9fa;
border: 1px solid #aaa;
padding: 0.2em;
text-align: center;
line-height: 1.4em;
font-size: 88%;
border-collapse: collapse;
/* Timeless has display: none on .nomobile at mobile resolutions, so we
* unhide it with display: table and let precedence and proximity win.
*/
display: table;
}
/* Unfortunately, so does Minerva desktop, except Minerva drops an
* !important on the declaration. So we have to be mean for Minerva users.
* Mobile removes the element entirely with `wgMFRemovableClasses` in
* https://github.com/wikimedia/operations-mediawiki-config/blob/master/
wmf-config/InitialiseSettings.php#L16992
* which is why displaying it categorically with display: table works.
* We don't really want to expose the generic user in the wild on mobile to have
* to deal with sidebars. (Maybe the ones with collapsible lists, so that
* might be an improvement. That is blocked on [[:phab:T111565]].)
*/
body.skin-minerva .sidebar {
display: table !important;
/* also, minerva is way too aggressive about other stylings on tables.
* TODO remove when this template gets moved to a div. plans on talk page.
* We always float right on Minerva because that's a lot of extra CSS
* otherwise. */
float: right !important;
margin: 0.5em 0 1em 1em !important;
}
.sidebar-subgroup {
width: 100%;
margin: 0;
border-spacing: 0;
}
.sidebar-left {
/* @noflip */
float: left;
/* @noflip */
clear: left;
/* @noflip */
margin: 0.5em 1em 1em 0;
}
.sidebar-none {
float: none;
clear: both;
/* @noflip */
margin: 0.5em 1em 1em 0;
}
.sidebar-outer-title {
padding: 0 0.4em 0.2em;
font-size: 125%;
line-height: 1.2em;
font-weight: bold;
}
.sidebar-top-image {
padding: 0.4em;
}
.sidebar-top-caption,
.sidebar-pretitle-with-top-image,
.sidebar-caption {
padding: 0.2em 0.4em 0;
line-height: 1.2em;
}
.sidebar-pretitle {
padding: 0.4em 0.4em 0;
line-height: 1.2em;
}
.sidebar-title,
.sidebar-title-with-pretitle {
padding: 0.2em 0.8em;
font-size: 145%;
line-height: 1.2em;
}
.sidebar-title-with-pretitle {
padding: 0.1em 0.4em;
}
.sidebar-image {
padding: 0.2em 0.4em 0.4em;
}
.sidebar-heading {
padding: 0.1em 0.4em;
}
.sidebar-content {
padding: 0 0.5em 0.4em;
}
.sidebar-content-with-subgroup {
padding: 0.1em 0.4em 0.2em;
}
.sidebar-above,
.sidebar-below {
padding: 0.3em 0.8em;
font-weight: bold;
}
.sidebar-collapse .sidebar-above,
.sidebar-collapse .sidebar-below {
border-top: 1px solid #aaa;
border-bottom: 1px solid #aaa;
}
.sidebar-navbar {
text-align: right;
font-size: 115%;
padding: 0 0.4em 0.4em;
}
.sidebar-list-title {
padding: 0 0.4em;
text-align: left;
font-weight: bold;
line-height: 1.6em;
font-size: 105%;
}
/* centered text with mw-collapsible headers is finicky */
.sidebar-list-title-c {
padding: 0 0.4em;
text-align: center;
margin: 0 3.3em;
}
@media (max-width: 720px) {
/* users have wide latitude to set arbitrary width and margin :(
"Super-specific" selector to prevent overriding this appearance by
lower level sidebars too */
body.mediawiki .sidebar {
width: 100% !important;
clear: both;
float: none !important; /* Remove when we div based; Minerva is dumb */
margin-left: 0 !important;
margin-right: 0 !important;
}
/* TODO: We might consider making all links wrap at small resolutions and then
* only introduce nowrap at higher resolutions. Do when we invert the media
* query.
*/
}
7d621b35a37807a103b59075851fe36201204ceb
Template:GNIS 4
10
224
550
2021-09-21T11:00:25Z
wikipedia>Hike395
0
use if empty
wikitext
text/x-wiki
[{{GNIS URL|{{if empty|{{{1|}}}|{{{id|}}}}}|type={{{type|}}}}} {{if empty|{{{1|}}}{{{id|}}}}}]<noinclude>
{{Documentation}}
</noinclude>
4d099b7c9e3a904e189294a92d36ba0acec287e9
Template:Tlu
10
124
345
2021-10-14T06:25:48Z
wikipedia>Paine Ellsworth
0
add [[WP:RCAT|rcat template]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link universal]]
{{Redirect category shell|
{{R from move}}
{{R from template shortcut}}
}}
cd6da651fe58a4e8bce3c186eeedcc0056f11937
Template:Module other
10
226
554
2021-10-20T19:50:22Z
wikipedia>MusikBot II
0
Changed protection settings for "[[Template:Module other]]": [[Wikipedia:High-risk templates|High-risk template or module]]: 3570 transclusions ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Module}}
| module
| other
}}
}}
| module = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
503694836c1b07142e63fd35d8be69ec8bb9ffe7
Template:Military navigation
10
260
629
2021-10-23T13:20:32Z
wikipedia>Andrybak
0
use [[Template:Sandbox other]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Military navigation|main}}</includeonly><noinclude>
{{Documentation|Wikipedia:WikiProject Military history/Military navigation}}
{{Sandbox other||
[[Category:Navigational box wrapper templates]]
[[Category:Military navigational boxes| ]]
}}</noinclude>
10eb2cd55540aab60dd8603c113e21995e9bb545
Module:Suppress categories
828
85
261
2021-10-26T17:25:37Z
wikipedia>MusikBot II
0
Changed protection settings for "[[Module:Suppress categories]]": [[Wikipedia:High-risk templates|High-risk template or module]]: 2510 transclusions ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))
Scribunto
text/plain
-- This is a simple module to strip categories from wikitext. It does
-- not support nested links or magic words like __TOC__, etc. Even so,
-- it should still handle most categories.
local p = {}
-- Detects if a category link is valid or not. If it is valid,
-- the function returns the blank string. If not, the input
-- is returned with no changes.
local function processCategory( all, submatch )
local beforePipe = mw.ustring.match( submatch, '^(.-)[%s_]*|[%s_]*.-$' )
beforePipe = beforePipe or submatch
if mw.ustring.match( beforePipe, '[%[%]<>{}%c\n]' ) then
return all
else
return ''
end
end
-- Preprocess the content if we aren't being called from #invoke,
-- and pass it to gsub to remove valid category links.
local function suppress( content, isPreprocessed )
if not isPreprocessed then
content = mw.getCurrentFrame():preprocess( content )
end
content = mw.ustring.gsub(
content,
'(%[%[[%s_]*[cC][aA][tT][eE][gG][oO][rR][yY][%s_]*:[%s_]*(.-)[%s_]*%]%])',
processCategory
)
return content
end
-- Get the content to suppress categories from, and find
-- whether the content has already been preprocessed. (If the
-- module is called from #invoke, it has been preprocessed already.)
function p.main( frame )
local content, isPreprocessed
if frame == mw.getCurrentFrame() then
content = frame:getParent().args[1]
if frame.args[1] then
content = frame.args[1]
end
isPreprocessed = true
else
content = frame
isPreprocessed = false
end
return suppress( content, isPreprocessed )
end
return p
0ec3903841c489357a879434c5dc23c11d182c78
Template:Infobox/doc
10
11
71
2021-10-28T12:43:53Z
meta>Startus
0
Add
wikitext
text/x-wiki
{{Documentation subpage}}
{{Lua|Module:Infobox}}
{{Uses TemplateStyles|[[Module:Infobox/styles.css]]}}
==Usage==
c98286012fccf1f2eab447f27d4e51c9fb5aac2c
Template:Main other
10
47
149
2021-12-10T16:08:06Z
wikipedia>Xaosflux
0
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
</noinclude>
86ad907ffeea3cc545159e00cd1f2d6433946450
Module:Navbox/styles.css
828
96
287
2021-12-21T22:10:10Z
wikipedia>Izno
0
remove qualifications on th - this will remove styling from "hand-crafted" navboxes, but there's no other elegant way to deal with it. see talk page
sanitized-css
text/css
/* {{pp|small=y}} */
.navbox {
box-sizing: border-box;
border: 1px solid #a2a9b1;
width: 100%;
clear: both;
font-size: 88%;
text-align: center;
padding: 1px;
margin: 1em auto 0; /* Prevent preceding content from clinging to navboxes */
}
.navbox .navbox {
margin-top: 0; /* No top margin for nested navboxes */
}
.navbox + .navbox, /* TODO: remove first line after transclusions have updated */
.navbox + .navbox-styles + .navbox {
margin-top: -1px; /* Single pixel border between adjacent navboxes */
}
.navbox-inner,
.navbox-subgroup {
width: 100%;
}
.navbox-group,
.navbox-title,
.navbox-abovebelow {
padding: 0.25em 1em;
line-height: 1.5em;
text-align: center;
}
.navbox-group {
white-space: nowrap;
/* @noflip */
text-align: right;
}
.navbox,
.navbox-subgroup {
background-color: #fdfdfd;
}
.navbox-list {
line-height: 1.5em;
border-color: #fdfdfd; /* Must match background color */
}
.navbox-list-with-group {
text-align: left;
border-left-width: 2px;
border-left-style: solid;
}
/* cell spacing for navbox cells */
/* Borders above 2nd, 3rd, etc. rows */
/* TODO: figure out how to replace tr as structure;
* with div structure it should be just a matter of first-child */
tr + tr > .navbox-abovebelow,
tr + tr > .navbox-group,
tr + tr > .navbox-image,
tr + tr > .navbox-list {
border-top: 2px solid #fdfdfd; /* Must match background color */
}
.navbox-title {
background-color: #ccf; /* Level 1 color */
}
.navbox-abovebelow,
.navbox-group,
.navbox-subgroup .navbox-title {
background-color: #ddf; /* Level 2 color */
}
.navbox-subgroup .navbox-group,
.navbox-subgroup .navbox-abovebelow {
background-color: #e6e6ff; /* Level 3 color */
}
.navbox-even {
background-color: #f7f7f7;
}
.navbox-odd {
background-color: transparent;
}
/* TODO: figure out how to remove reliance on td as structure */
.navbox .hlist td dl,
.navbox .hlist td ol,
.navbox .hlist td ul,
.navbox td.hlist dl,
.navbox td.hlist ol,
.navbox td.hlist ul {
padding: 0.125em 0;
}
.navbox .navbar {
display: block;
font-size: 100%;
}
.navbox-title .navbar {
/* @noflip */
float: left;
/* @noflip */
text-align: left;
/* @noflip */
margin-right: 0.5em;
}
e80b0d7a5770e6e105dab832deb6c37a5245ebc6
Module:Hatnote list
828
62
195
2021-12-26T20:05:24Z
wikipedia>Nihiltres
0
Undid revision 1062166786 by [[Special:Contributions/Matthiaspaul|Matthiaspaul]] ([[User talk:Matthiaspaul|talk]]); should be fixed now, and if not, please ping me with examples as I couldn't reproduce the original error
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote list --
-- --
-- This module produces and formats lists for use in hatnotes. In particular, --
-- it implements the for-see list, i.e. lists of "For X, see Y" statements, --
-- as used in {{about}}, {{redirect}}, and their variants. Also introduced --
-- are andList & orList helpers for formatting lists with those conjunctions. --
--------------------------------------------------------------------------------
local mArguments --initialize lazily
local mFormatLink = require('Module:Format link')
local mHatnote = require('Module:Hatnote')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
--------------------------------------------------------------------------------
-- List stringification helper functions
--
-- These functions are used for stringifying lists, usually page lists inside
-- the "Y" portion of "For X, see Y" for-see items.
--------------------------------------------------------------------------------
--default options table used across the list stringification functions
local stringifyListDefaultOptions = {
conjunction = "and",
separator = ",",
altSeparator = ";",
space = " ",
formatted = false
}
--Searches display text only
local function searchDisp(haystack, needle)
return string.find(
string.sub(haystack, (string.find(haystack, '|') or 0) + 1), needle
)
end
-- Stringifies a list generically; probably shouldn't be used directly
local function stringifyList(list, options)
-- Type-checks, defaults, and a shortcut
checkType("stringifyList", 1, list, "table")
if #list == 0 then return nil end
checkType("stringifyList", 2, options, "table", true)
options = options or {}
for k, v in pairs(stringifyListDefaultOptions) do
if options[k] == nil then options[k] = v end
end
local s = options.space
-- Format the list if requested
if options.formatted then
list = mFormatLink.formatPages(
{categorizeMissing = mHatnote.missingTargetCat}, list
)
end
-- Set the separator; if any item contains it, use the alternate separator
local separator = options.separator
for k, v in pairs(list) do
if searchDisp(v, separator) then
separator = options.altSeparator
break
end
end
-- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
local conjunction = s .. options.conjunction .. s
if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
conjunction = separator .. conjunction
end
-- Return the formatted string
return mw.text.listToText(list, separator .. s, conjunction)
end
--DRY function
function p.conjList (conj, list, fmt)
return stringifyList(list, {conjunction = conj, formatted = fmt})
end
-- Stringifies lists with "and" or "or"
function p.andList (...) return p.conjList("and", ...) end
function p.orList (...) return p.conjList("or", ...) end
--------------------------------------------------------------------------------
-- For see
--
-- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
-- {{about}} and {{redirect}} templates and their variants.
--------------------------------------------------------------------------------
--default options table used across the forSee family of functions
local forSeeDefaultOptions = {
andKeyword = 'and',
title = mw.title.getCurrentTitle().text,
otherText = 'other uses',
forSeeForm = 'For %s, see %s.',
}
--Collapses duplicate punctuation
local function punctuationCollapse (text)
local replacements = {
["%.%.$"] = ".",
["%?%.$"] = "?",
["%!%.$"] = "!",
["%.%]%]%.$"] = ".]]",
["%?%]%]%.$"] = "?]]",
["%!%]%]%.$"] = "!]]"
}
for k, v in pairs(replacements) do text = string.gsub(text, k, v) end
return text
end
-- Structures arguments into a table for stringification, & options
function p.forSeeArgsToTable (args, from, options)
-- Type-checks and defaults
checkType("forSeeArgsToTable", 1, args, 'table')
checkType("forSeeArgsToTable", 2, from, 'number', true)
from = from or 1
checkType("forSeeArgsToTable", 3, options, 'table', true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- maxArg's gotten manually because getArgs() and table.maxn aren't friends
local maxArg = 0
for k, v in pairs(args) do
if type(k) == 'number' and k > maxArg then maxArg = k end
end
-- Structure the data out from the parameter list:
-- * forTable is the wrapper table, with forRow rows
-- * Rows are tables of a "use" string & a "pages" table of pagename strings
-- * Blanks are left empty for defaulting elsewhere, but can terminate list
local forTable = {}
local i = from
local terminated = false
-- If there is extra text, and no arguments are given, give nil value
-- to not produce default of "For other uses, see foo (disambiguation)"
if options.extratext and i > maxArg then return nil end
-- Loop to generate rows
repeat
-- New empty row
local forRow = {}
-- On blank use, assume list's ended & break at end of this loop
forRow.use = args[i]
if not args[i] then terminated = true end
-- New empty list of pages
forRow.pages = {}
-- Insert first pages item if present
table.insert(forRow.pages, args[i + 1])
-- If the param after next is "and", do inner loop to collect params
-- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
while args[i + 2] == options.andKeyword do
if args[i + 3] then
table.insert(forRow.pages, args[i + 3])
end
-- Increment to next "and"
i = i + 2
end
-- Increment to next use
i = i + 2
-- Append the row
table.insert(forTable, forRow)
until terminated or i > maxArg
return forTable
end
-- Stringifies a table as formatted by forSeeArgsToTable
function p.forSeeTableToString (forSeeTable, options)
-- Type-checks and defaults
checkType("forSeeTableToString", 1, forSeeTable, "table", true)
checkType("forSeeTableToString", 2, options, "table", true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- Stringify each for-see item into a list
local strList = {}
if forSeeTable then
for k, v in pairs(forSeeTable) do
local useStr = v.use or options.otherText
local pagesStr =
p.andList(v.pages, true) or
mFormatLink._formatLink{
categorizeMissing = mHatnote.missingTargetCat,
link = mHatnote.disambiguate(options.title)
}
local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
forSeeStr = punctuationCollapse(forSeeStr)
table.insert(strList, forSeeStr)
end
end
if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
-- Return the concatenated list
return table.concat(strList, ' ')
end
-- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
-- but not blank/whitespace values. Ignores named args and args < "from".
function p._forSee (args, from, options)
local forSeeTable = p.forSeeArgsToTable(args, from, options)
return p.forSeeTableToString(forSeeTable, options)
end
-- As _forSee, but uses the frame.
function p.forSee (frame, from, options)
mArguments = require('Module:Arguments')
return p._forSee(mArguments.getArgs(frame), from, options)
end
return p
d0828422b1aa0d0d0092d699d059c9e882260398
Template:No redirect
10
100
295
2022-01-02T09:07:18Z
wikipedia>Dinoguy1000
0
fix "|=foo" bug
wikitext
text/x-wiki
{{safesubst:<noinclude/>#if: {{safesubst:<noinclude/>#invoke:Redirect|isRedirect|{{{1}}}}}
| <span class="plainlinks">[{{safesubst:<noinclude/>fullurl:{{{1}}}|redirect=no}} {{{2|{{{1}}}}}}]</span>
| {{safesubst:<noinclude/>#if:{{{2|}}}|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}|{{{2}}}]]|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}]]}}
}}<noinclude>
{{documentation}}
</noinclude>
1760035b1bed54ee08b810208ed3551b812dfe13
Template:Order of magnitude
10
214
530
2022-01-02T09:08:29Z
wikipedia>Dinoguy1000
0
fix "|=foo" bug
wikitext
text/x-wiki
<includeonly>{{safesubst:<noinclude/>#ifexpr:{{{1|0}}}=0
|{{safesubst:<noinclude/>#ifexpr:abs{{{1|0}}}1=1
|0
|{{safesubst:<noinclude/>#expr:floor((ln(abs{{{1}}}1)/ln10)+1)}}
}}
|{{safesubst:<noinclude/>#expr:floor((ln(abs({{{1|0}}}) )/ln 10)+1E((abs{{{1|0}}}>1E100 or abs{{{1|0}}}<1E-100)-14))}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
cede5694e8ebb404ecdd17ae1f8e1c5d19562728
Module:Navbar/styles.css
828
7
201
2022-01-03T23:12:15Z
wikipedia>Izno
0
navbar styles that were moved to parent templates
sanitized-css
text/css
/* {{pp|small=yes}} */
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar-collapse {
float: left;
text-align: left;
}
.navbar-boxtext {
word-spacing: 0;
}
.navbar ul {
display: inline-block;
white-space: nowrap;
line-height: inherit;
}
.navbar-brackets::before {
margin-right: -0.125em;
content: '[ ';
}
.navbar-brackets::after {
margin-left: -0.125em;
content: ' ]';
}
.navbar li {
word-spacing: -0.125em;
}
.navbar a > span,
.navbar a > abbr {
text-decoration: inherit;
}
.navbar-mini abbr {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
.navbar-ct-full {
font-size: 114%;
margin: 0 7em;
}
.navbar-ct-mini {
font-size: 114%;
margin: 0 4em;
}
9d4056f949b4f0b159e3d40dfb1a5f01e72f9571
Template:Pluralize from text
10
195
490
2022-01-09T17:59:39Z
wikipedia>MusikBot II
0
Protected "[[Template:Pluralize from text]]": [[Wikipedia:High-risk templates|High-risk template or module]]: 18336 transclusions ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
{{#invoke:Detect singular|pluralize}}<noinclude>{{documentation}}</noinclude>
305f4b531ea5639895c83cecd0fd809f7f5cf845
Module:Infobox/styles.css
828
21
161
2022-01-18T15:18:00Z
wikipedia>Jdlrobson
0
Fix [[phab:T281642]], a pet peeve of mine. This copies across styles from [[MediaWiki:Minerva.css]]
sanitized-css
text/css
/* {{pp|small=y}} */
/*
* This TemplateStyles sheet deliberately does NOT include the full set of
* infobox styles. We are still working to migrate all of the manual
* infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
* DO NOT ADD THEM HERE
*/
/*
* not strictly certain these styles are necessary since the modules now
* exclusively output infobox-subbox or infobox, not both
* just replicating the module faithfully
*/
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
.infobox .navbar {
font-size: 100%;
}
/* T281642 */
body.skin-minerva .infobox-header,
body.skin-minerva .infobox-subheader,
body.skin-minerva .infobox-above,
body.skin-minerva .infobox-title,
body.skin-minerva .infobox-image,
body.skin-minerva .infobox-full-data,
body.skin-minerva .infobox-below {
text-align: center;
}
e8de6d96f4fde53afc4a6b0fed534405ab59b0a7
Module:Citation/CS1/Utilities
828
161
422
2022-01-22T14:11:16Z
wikipedia>Trappist the monk
0
update per [[Wikipedia:Village_pump_(proposals)#rfc:_shall_we_update_cs1/2?|RfC]];
Scribunto
text/plain
local z = {
error_cats_t = {}; -- for categorizing citations that contain errors
error_ids_t = {}; -- list of error identifiers; used to prevent duplication of certain errors; local to this module
error_msgs_t = {}; -- sequence table of error messages
maint_cats_t = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
prop_cats_t = {}; -- for categorizing citations based on certain properties, language of source for instance
prop_keys_t = {}; -- for adding classes to the citation's <cite> tag
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set (var)
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array (needle, haystack)
if needle == nil then
return false;
end
for n, v in ipairs (haystack) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
]]
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
local count;
if true == allow_empty then
str, count = str:gsub ('^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = str:gsub ('^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table. <args> may be a single string or a
sequence table of multiple strings.
]]
local function substitute (msg, args)
return args and mw.message.newRawMessage (msg, args):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with CSS markup according to the state of hidden. <content> may be a single string or a
sequence table of multiple strings.
]]
local function error_comment (content, hidden)
return substitute (hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content);
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate
like items; unlike items are returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and
digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and
digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash (str)
if not is_set (str) then
return str;
end
local accept; -- boolean
str = str:gsub ("(%(%(.-%)%))", function(m) return m:gsub(",", ","):gsub(";", ";") end) -- replace commas and semicolons in accept-as-written markup with similar unicode characters so they'll be ignored during the split
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace HTML numeric entity with hyphen character
str = str:gsub (' ', ' '); -- replace entity with generic keyboard space character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
item, accept = has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item
if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit
item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace
end
end
table.insert (out, item); -- add the (possibly modified) item to the output table
end
local temp_str = ''; -- concatenate the output table into a comma separated string
temp_str, accept = has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept then
temp_str = has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value
return temp_str:gsub(",", ","):gsub(";", ";");
else
return temp_str:gsub(",", ","):gsub(";", ";"); -- else, return assembled temp_str
end
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided (or link and display are the same), returns a wikilink in the form [[L]]; if neither are
provided or link is omitted, returns an empty string.
]=]
local function make_wikilink (link, display)
if not is_set (link) then return '' end
if is_set (display) and link ~= display then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
end
--[[--------------------------< S E T _ M E S S A G E >----------------------------------------------------------
Sets an error message using the ~/Configuration error_conditions{} table along with arguments supplied in the function
call, inserts the resulting message in z.error_msgs_t{} sequence table, and returns the error message.
<error_id> – key value for appropriate error handler in ~/Configuration error_conditions{} table
<arguments> – may be a single string or a sequence table of multiple strings to be subsititued into error_conditions[error_id].message
<raw> – boolean
true – causes this function to return the error message not wrapped in visible-error, hidden-error span tag;
returns error_conditions[error_id].hidden as a second return value
does not add message to z.error_msgs_t sequence table
false, nil – adds message wrapped in visible-error, hidden-error span tag to z.error_msgs_t
returns the error message wrapped in visible-error, hidden-error span tag; there is no second return value
<prefix> – string to be prepended to <message> -- TODO: remove support for these unused(?) arguments?
<suffix> – string to be appended to <message>
TODO: change z.error_cats_t and z.maint_cats_t to have the form cat_name = true? this to avoid dups without having to have an extra table
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maint_cats_t; TODO: figure out how to delete this table
local function set_message (error_id, arguments, raw, prefix, suffix)
local error_state = cfg.error_conditions[error_id];
prefix = prefix or '';
suffix = suffix or '';
if error_state == nil then
error (cfg.messages['undefined_error'] .. ': ' .. error_id); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set (error_state.category) then
if error_state.message then -- when error_state.message defined, this is an error message
table.insert (z.error_cats_t, error_state.category);
else
if not added_maint_cats[error_id] then
added_maint_cats[error_id] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (error_state.category, arguments)); -- make cat name then add to table
end
return; -- because no message, nothing more to do
end
end
local message = substitute (error_state.message, arguments);
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids_t[error_id] = true;
if z.error_ids_t['err_citation_missing_title'] and -- if missing-title error already noted
in_array (error_id, {'err_bare_url_missing_title', 'err_trans_missing_title'}) then -- and this error is one of these
return '', false; -- don't bother because one flavor of missing title is sufficient
end
message = table.concat ({prefix, message, suffix});
if true == raw then
return message, error_state.hidden; -- return message not wrapped in visible-error, hidden-error span tag
end
message = error_comment (message, error_state.hidden); -- wrap message in visible-error, hidden-error span tag
table.insert (z.error_msgs_t, message); -- add it to the messages sequence table
return message; -- and done; return value generally not used but is used as a flag in various functions of ~/Identifiers
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used to choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set (args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs (error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert (error_list, alias); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maint_cats_t using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maint_cats_t.
]]
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.prop_cats_t using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local added_prop_cats = {}; -- list of property categories that have been added to z.prop_cats_t
local function add_prop_cat (key, arguments, key_modifier)
local key_modified = key .. ((key_modifier and key_modifier) or ''); -- modify <key> with <key_modifier> if present and not nil
if not added_prop_cats [key_modified] then
added_prop_cats [key_modified] = true; -- note that we've added this category
table.insert (z.prop_cats_t, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
table.insert (z.prop_keys_t, 'cs1-prop-' .. key); -- convert key to class for use in the citation's <cite> tag
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics (str)
if not is_set (str) then return str end
if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end
if str:sub (-1, -1) == "'" then str = str .. "<span></span>"; end
return str:gsub ('\n', ' '); -- Remove newlines as they break italics.
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set (str) then
return "";
elseif in_array (key, {'italic-title', 'trans-italic-title'}) then
str = safe_for_italics (str);
end
return substitute (cfg.presentation[key], {str});
end
--[[--------------------------< M A K E _ S E P _ L I S T >------------------------------------------------------------
make a separated list of items using provided separators.
<sep_list> - typically '<comma><space>'
<sep_list_pair> - typically '<space>and<space>'
<sep_list_end> - typically '<comma><space>and<space>' or '<comma><space>&<space>'
defaults to cfg.presentation['sep_list'], cfg.presentation['sep_list_pair'], and cfg.presentation['sep_list_end']
if <sep_list_end> is specified, <sep_list> and <sep_list_pair> must also be supplied
]]
local function make_sep_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 2 >= count then
list = table.concat (list_seq, sep_list_pair); -- insert separator between two items; returns list_seq[1] then only one item
elseif 2 < count then
list = table.concat (list_seq, sep_list, 1, count - 1); -- concatenate all but last item with plain list separator
list = table.concat ({list, list_seq[count]}, sep_list_end); -- concatenate last item onto end of <list> with final separator
end
return list;
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one (args, aliases_list, error_condition, index)
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs (aliases_list) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
for i, v in ipairs (error_list) do
error_list[i] = wrap_style ('parameter', v);
end
table.insert (error_list, wrap_style ('parameter', selected));
set_message (error_condition, {make_sep_list (#error_list, error_list)});
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims whitespace from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub ("%[%[([^%[%]]*)%]%]", function(l)
return l:gsub ("^[^|]*|(.*)$", "%1" ):gsub ("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing whitespace and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wikilink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ("'''''", 1, true) then -- bold italic (5)
argument, flag = argument:gsub ("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ("''''", 1, true) then -- italic start and end without content (4)
argument, flag=argument:gsub ("%'%'%'%'", "");
elseif argument:find ("'''", 1, true) then -- bold (3)
argument, flag=argument:gsub ("%'%'%'", "");
elseif argument:find ("''", 1, true) then -- italic (2)
argument, flag = argument:gsub ("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
add_maint_cat = add_maint_cat, -- exported functions
add_prop_cat = add_prop_cat,
error_comment = error_comment,
has_accept_as_written = has_accept_as_written,
hyphen_to_dash = hyphen_to_dash,
in_array = in_array,
is_set = is_set,
is_wikilink = is_wikilink,
make_sep_list = make_sep_list,
make_wikilink = make_wikilink,
remove_wiki_link = remove_wiki_link,
safe_for_italics = safe_for_italics,
select_one = select_one,
set_message = set_message,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
substitute = substitute,
wrap_style = wrap_style,
z = z, -- exported table
}
b006801b48981b2987f20fc09cbe0dfda525e044
Module:Documentation/config
828
15
227
2022-01-25T23:46:11Z
wikipedia>Ianblair23
0
link
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Help:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
71b68ed73088f1a59d61acf06bbee9fde6677f03
Module:TableTools
828
6
165
2022-01-31T13:08:18Z
wikipedia>MSGJ
0
updates/fixes requested by [[User:Uzume]]
Scribunto
text/plain
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should not --
-- be called directly from #invoke. --
------------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
function p.isPositiveInteger(v)
return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false if
-- not. Although it doesn't operate on tables, it is included here as it is useful
-- for determining whether a value can be a valid table key. Lua will generate an
-- error if a NaN is used as a table key.
------------------------------------------------------------------------------------
function p.isNan(v)
return type(v) == 'number' and v ~= v
end
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
function p.shallowClone(t)
checkType('shallowClone', 1, t, 'table')
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
function p.removeDuplicates(arr)
checkType('removeDuplicates', 1, arr, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for _, v in ipairs(arr) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will return
-- {1, 3, 6}.
------------------------------------------------------------------------------------
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like {"foo1", "bar1", "foo2", "baz2"}, returns a table
-- of subtables in the format
-- {[1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'}}.
-- Keys that don't end with an integer are stored in a subtable named "other". The
-- compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for _ in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
elseif type1 == 'table' or type1 == 'boolean' or type1 == 'function' then
return tostring(item1) < tostring(item2)
else
return item1 < item2
end
end
------------------------------------------------------------------------------------
-- keysToList
--
-- Returns an array of the keys in a table, sorted using either a default
-- comparison function or a custom keySort function.
------------------------------------------------------------------------------------
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, {'function', 'boolean', 'nil'})
end
local arr = {}
local index = 1
for k in pairs(t) do
arr[index] = k
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(arr, keySort)
end
return arr
end
------------------------------------------------------------------------------------
-- sortedPairs
--
-- Iterates through a table, with the keys sorted using the keysToList function.
-- If there are only numerical keys, sparseIpairs is probably more efficient.
------------------------------------------------------------------------------------
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local arr = p.keysToList(t, keySort, true)
local i = 0
return function ()
i = i + 1
local key = arr[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- isArray
--
-- Returns true if the given value is a table and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArray(v)
if type(v) ~= 'table' then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- isArrayLike
--
-- Returns true if the given value is iterable and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArrayLike(v)
if not pcall(pairs, v) then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- invert
--
-- Transposes the keys and values in an array. For example, {"a", "b", "c"} ->
-- {a = 1, b = 2, c = 3}. Duplicates are not supported (result values refer to
-- the index of the last duplicate) and NaN values are ignored.
------------------------------------------------------------------------------------
function p.invert(arr)
checkType("invert", 1, arr, "table")
local isNan = p.isNan
local map = {}
for i, v in ipairs(arr) do
if not isNan(v) then
map[v] = i
end
end
return map
end
------------------------------------------------------------------------------------
-- listToSet
--
-- Creates a set from the array part of the table. Indexing the set by any of the
-- values of the array returns true. For example, {"a", "b", "c"} ->
-- {a = true, b = true, c = true}. NaN values are ignored as Lua considers them
-- never equal to any value (including other NaNs or even themselves).
------------------------------------------------------------------------------------
function p.listToSet(arr)
checkType("listToSet", 1, arr, "table")
local isNan = p.isNan
local set = {}
for _, v in ipairs(arr) do
if not isNan(v) then
set[v] = true
end
end
return set
end
------------------------------------------------------------------------------------
-- deepCopy
--
-- Recursive deep copy function. Preserves identities of subtables.
------------------------------------------------------------------------------------
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[_deepCopy(orig_key, includeMetatable, already_seen)] = _deepCopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = _deepCopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
------------------------------------------------------------------------------------
-- sparseConcat
--
-- Concatenates all values in the table that are indexed by a number, in order.
-- sparseConcat{a, nil, c, d} => "acd"
-- sparseConcat{nil, b, c, d} => "bcd"
------------------------------------------------------------------------------------
function p.sparseConcat(t, sep, i, j)
local arr = {}
local arr_i = 0
for _, v in p.sparseIpairs(t) do
arr_i = arr_i + 1
arr[arr_i] = v
end
return table.concat(arr, sep, i, j)
end
------------------------------------------------------------------------------------
-- length
--
-- Finds the length of an array, or of a quasi-array with keys such as "data1",
-- "data2", etc., using an exponential search algorithm. It is similar to the
-- operator #, but may return a different value when there are gaps in the array
-- portion of the table. Intended to be used on data loaded with mw.loadData. For
-- other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of the number
-- of unnamed template parameters, so use this function for frame.args.
------------------------------------------------------------------------------------
function p.length(t, prefix)
-- requiring module inline so that [[Module:Exponential search]] which is
-- only needed by this one function doesn't get millions of transclusions
local expSearch = require("Module:Exponential search")
checkType('length', 1, t, 'table')
checkType('length', 2, prefix, 'string', true)
return expSearch(function (i)
local key
if prefix then
key = prefix .. tostring(i)
else
key = i
end
return t[key] ~= nil
end) or 0
end
------------------------------------------------------------------------------------
-- inArray
--
-- Returns true if valueToFind is a member of the array, and false otherwise.
------------------------------------------------------------------------------------
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
085e7094ac84eb0132ee65822cf3f69cd8ba3d81
MediaWiki:Common.js
8
43
123
2022-02-06T00:49:59Z
dev>MirahezeGDPR a51581232c7cc84ec1a32c40d8489548
0
not necessarily a good idea
javascript
text/javascript
/* Any JavaScript here will be loaded for all users on every page load. */
7850587e5c59a0259c9c96f81797dcf059b3cac9
Template:Short description/lowercasecheck
10
245
597
2022-02-12T16:35:05Z
wikipedia>ToBeFree
0
Changed protection settings for "[[Template:Short description/lowercasecheck]]": 4 million transclusions, through [[Template:Short description]] ([[WP:HRT]]) ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
{{#ifeq:<!--test first character for lower-case letter-->{{#invoke:string|find|1={{{1|}}}|2=^%l|plain=false}}|1
|<!-- first character is a lower case letter; test against whitelist
-->{{#switch: {{First word|{{{1|}}}}}<!--begin whitelist-->
|c. <!--for circa-->
|gTLD
|iMac
|iOS
|iOS,
|iPad
|iPhone
|iTunes
|macOS
|none
|pH
|pH-dependent=<!-- end whitelist; short description starts with an allowed lower-case string; whitelist matched; do nothing -->
|#default=<!-- apply category to track lower-case short descriptions -->{{main other|[[Category:Pages with lower-case short description|{{trim|{{{1|}}}}}]]}}{{Testcases other|{{red|CATEGORY APPLIED}}}}<!-- end whitelist test -->}}
|<!-- short description does not start with lower-case letter; do nothing; end lower-case test -->
}}<noinclude>
{{documentation}}
</noinclude>
9a6d4db14b74614625fd234b4f8ee3c8e1a235c0
Module:Settlement short description
828
235
574
2022-02-12T16:43:02Z
wikipedia>Jonesey95
0
Undid revision 1071438822 by [[Special:Contributions/Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]). false positive?
Scribunto
text/plain
--generates auto short description for use in infobox settlement
local p = {}
p.categories = ""
local plain = require('Module:Plain text')._main
local getArgs = require('Module:Arguments').getArgs
local tableTools = require ('Module:TableTools')
function p.reverseTable (init)
init[1], init[3] = init[3], init[1]
return init
end
function p.assign (args, argname, num)
local val
local var = {}
for i = 0,num do
--handle initial "subdivision_foo" without number
if i == 0 then
val = ""
else
val = tostring(i)
end
var[i+1] = p.validate(plain(args[argname..val]))
end
return var
end
--Display short description using {{short description}}
function p.shortdesc(text, frame)
return frame:expandTemplate{title = 'Short description', args = {text, 'noreplace'}}
end
function p.category (cattype)
local category = string.format('[[Category:Pages using infobox settlement with bad %s]]', cattype)
if category then p.categories = p.categories..category end --categorize
end
--sanity and other checks
function p.validate (parameter, cat)
if not parameter then return nil end
parameter = parameter:gsub('%b()', '') --remove things in brackets as extraneous information
:gsub('%s+', ' ') --fix possible extra spaces from previous cleanup
:gsub('^%s+', '') --trim spaces from beginning
:gsub('%s+$', '') --trim spaces from end
if parameter:match("[,;]") or not parameter:match("%a") then --must have some letters, ignore if multiple types/subdivisions
if cat then p.category (cat) end
return nil
end
if (parameter == "") then return nil end
return parameter
end
--removes redundancy like "England, United Kingdom" and fixes issues like "Foo in United States" (to "Foo in the United States")
--also used in Module:Type in location
function p.cleanupLoc (location)
if location == "" then return nil end
local replacements = {
["England, United Kingdom"] = "England",
["Scotland, United Kingdom"] = "Scotland",
["Wales, United Kingdom"] = "Wales",
["New York City, New York, United States"] = "New York City",
["^United States$"] = "the United States",
["London, United Kingdom"] = "London, England"
}
for i, v in pairs(replacements) do
location = location:gsub(i, v) --series of replacements
end
return location
end
function p.main(frame)
local categories = ""
local subdivision_types = {}
local subdivision_names = {}
local args = getArgs (frame, {parentOnly = true})
local settlement_type = p.validate(plain(args.settlement_type or args.type), "settlement type") or "Place"
local short_description = plain(args.short_description)
subdivision_types = p.assign(args, "subdivision_type", 2)
subdivision_names = p.assign(args, "subdivision_name", 2)
if short_description then
if (short_description == 'no') then
return
else
local language = mw.language.getContentLanguage()
return p.shortdesc(language:ucfirst(short_description), frame)
end
end
if not(subdivision_names[3] and
(string.find(settlement_type, '[nN]eighbo[u]?rhood') or string.find(settlement_type, '[sS]uburb'))) then
subdivision_names[3] = nil --display the third subdivision_type only if suburb or neighborhood
end
--if say "Voivodeship" is found within the subdivision_type, then specially handle
--by adding Voivodeship to the end if not already present
for x, y in ipairs (subdivision_types) do
local special_types = {
"Voivodeship"
}
for i, j in ipairs(special_types) do
if subdivision_names[x] and string.find(y, j, 1, true)
and not string.find(subdivision_names[x], j, 1, true) then
subdivision_names[x] = subdivision_names[x].." "..j
end
end
end
for x, y in ipairs (subdivision_names) do
if y then
if string.find(settlement_type, y, 1, true) then --if the subdivision is found within the settlement type
subdivision_names[x] = nil --don't display redundancy
p.category ("settlement type")
end
if y == mw.title.getCurrentTitle().text then --if the title is the same as one of the subdivision_names
subdivision_names[x] = nil --don't display redundancy
end
end
end
local location = table.concat(tableTools.compressSparseArray(p.reverseTable(subdivision_names)), ', ')
location = p.cleanupLoc (location)
if location then location = " in " .. location else location = "" end
local language = mw.language.getContentLanguage()
return p.shortdesc(language:ucfirst(settlement_type..location), frame)..p.categories
end
return p
f2f1adada5fd2b30e158e56b9f05102571b2a17f
Module:Check for unknown parameters
828
50
155
2022-02-21T05:24:13Z
wikipedia>BusterD
0
Changed protection settings for "[[Module:Check for unknown parameters]]": [[WP:High-risk templates|Highly visible template]]; requested at [[WP:RfPP]] ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
Scribunto
text/plain
-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
local function clean(text)
-- Return text cleaned for display and truncated if too long.
-- Strip markers are replaced with dummy text representing the original wikitext.
local pos, truncated
local function truncate(text)
if truncated then
return ''
end
if mw.ustring.len(text) > 25 then
truncated = true
text = mw.ustring.sub(text, 1, 25) .. '...'
end
return mw.text.nowiki(text)
end
local parts = {}
for before, tag, remainder in text:gmatch('([^\127]*)\127[^\127]*%-(%l+)%-[^\127]*\127()') do
pos = remainder
table.insert(parts, truncate(before) .. '<' .. tag .. '>...</' .. tag .. '>')
end
table.insert(parts, truncate(text:sub(pos or 1)))
return table.concat(parts)
end
function p._check(args, pargs)
if type(args) ~= "table" or type(pargs) ~= "table" then
-- TODO: error handling
return
end
-- create the list of known args, regular expressions, and the return string
local knownargs = {}
local regexps = {}
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
-- loop over the parent args, and make sure they are on the list
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local values = {}
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
table.insert(values, clean(k))
end
elseif type(k) == 'number' and knownargs[tostring(k)] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(tostring(k), regexp) then
knownflag = true
break
end
end
if not knownflag and ( showblankpos or isnotempty(v) ) then
table.insert(values, k .. ' = ' .. clean(v))
end
end
end
-- add results to the output tables
local res = {}
if #values > 0 then
local unknown_text = args['unknown'] or 'Found _VALUE_, '
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
local preview_text = args['preview']
if isnotempty(preview_text) then
preview_text = require('Module:If preview')._warning({preview_text})
elseif preview == nil then
preview_text = unknown_text
end
unknown_text = preview_text
end
for _, v in pairs(values) do
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
if v == '' then v = ' ' end
-- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
end
end
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
return p
93db6d115d4328d2a5148bb42959105e367b663e
Template:Replace
10
196
492
2022-02-23T02:25:08Z
wikipedia>Xaosflux
0
Changed protection settings for "[[Template:Replace]]": 1MM+ uses ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:String|replace|source={{{1}}}|{{{2}}}|{{{3}}}|plain={{{plain|true}}}|count={{{count|}}}}}<noinclude>
{{documentation}}
</noinclude>
4192ba916713e0f44fdfd0f8e0d9d105c0c85472
Module:Effective protection expiry
828
56
183
2022-02-23T10:59:29Z
wikipedia>Xaosflux
0
Changed protection settings for "[[Module:Effective protection expiry]]": used in the mediawiki interface / match [[Module:Effective protection level]] ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
Scribunto
text/plain
local p = {}
-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)
return stabilitySettings and stabilitySettings.expiry or 'unknown'
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
end
local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
if rawExpiry == 'infinity' then
return 'infinity'
elseif rawExpiry == '' then
return 'unknown'
else
local year, month, day, hour, minute, second = rawExpiry:match(
'^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$'
)
if year then
return string.format(
'%s-%s-%sT%s:%s:%s',
year, month, day, hour, minute, second
)
else
error('internal error in Module:Effective protection expiry; malformed expiry timestamp')
end
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
9a8c58dc2667232ed08a9b206a5d89ca8150312b
Module:Template link general
828
52
171
2022-03-08T08:30:51Z
wikipedia>Primefac
0
update from sandbox - fixes to _show_result and adding _expand
Scribunto
text/plain
-- This implements Template:Tlg
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Is a string non-empty?
local function _ne(s)
return s ~= nil and s ~= ""
end
local nw = mw.text.nowiki
local function addTemplate(s)
local i, _ = s:find(':', 1, true)
if i == nil then
return 'Template:' .. s
end
local ns = s:sub(1, i - 1)
if ns == '' or mw.site.namespaces[ns] then
return s
else
return 'Template:' .. s
end
end
local function trimTemplate(s)
local needle = 'template:'
if s:sub(1, needle:len()):lower() == needle then
return s:sub(needle:len() + 1)
else
return s
end
end
local function linkTitle(args)
if _ne(args.nolink) then
return args['1']
end
local titleObj
local titlePart = '[['
if args['1'] then
-- This handles :Page and other NS
titleObj = mw.title.new(args['1'], 'Template')
else
titleObj = mw.title.getCurrentTitle()
end
titlePart = titlePart .. (titleObj ~= nil and titleObj.fullText or
addTemplate(args['1']))
local textPart = args.alttext
if not _ne(textPart) then
if titleObj ~= nil then
textPart = titleObj:inNamespace("Template") and args['1'] or titleObj.fullText
else
-- redlink
textPart = args['1']
end
end
if _ne(args.subst) then
-- HACK: the ns thing above is probably broken
textPart = 'subst:' .. textPart
end
if _ne(args.brace) then
textPart = nw('{{') .. textPart .. nw('}}')
elseif _ne(args.braceinside) then
textPart = nw('{') .. textPart .. nw('}')
end
titlePart = titlePart .. '|' .. textPart .. ']]'
if _ne(args.braceinside) then
titlePart = nw('{') .. titlePart .. nw('}')
end
return titlePart
end
function p.main(frame)
local args = getArgs(frame, {
trim = true,
removeBlanks = false
})
return p._main(args)
end
function p._main(args)
local bold = _ne(args.bold) or _ne(args.boldlink) or _ne(args.boldname)
local italic = _ne(args.italic) or _ne(args.italics)
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
local code = _ne(args.code) or _ne(args.tt)
local show_result = _ne(args._show_result)
local expand = _ne(args._expand)
-- Build the link part
local titlePart = linkTitle(args)
if bold then titlePart = "'''" .. titlePart .. "'''" end
if _ne(args.nowrapname) then titlePart = '<span class="nowrap">' .. titlePart .. '</span>' end
-- Build the arguments
local textPart = ""
local textPartBuffer = "|"
local codeArguments = {}
local codeArgumentsString = ""
local i = 2
local j = 1
while args[i] do
local val = args[i]
if val ~= "" then
if _ne(args.nowiki) then
-- Unstrip nowiki tags first because calling nw on something that already contains nowiki tags will
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
val = nw(mw.text.unstripNoWiki(val))
end
local k, v = string.match(val, "(.*)=(.*)")
if not k then
codeArguments[j] = val
j = j + 1
else
codeArguments[k] = v
end
codeArgumentsString = codeArgumentsString .. textPartBuffer .. val
if italic then
val = '<span style="font-style:italic;">' .. val .. '</span>'
end
textPart = textPart .. textPartBuffer .. val
end
i = i + 1
end
-- final wrap
local ret = titlePart .. textPart
if not dontBrace then ret = nw('{{') .. ret .. nw('}}') end
if _ne(args.a) then ret = nw('*') .. ' ' .. ret end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
if code then
ret = '<code>' .. ret .. '</code>'
elseif _ne(args.plaincode) then
ret = '<code style="border:none;background:transparent;">' .. ret .. '</code>'
end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
--[[ Wrap as html??
local span = mw.html.create('span')
span:wikitext(ret)
--]]
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
if show_result then
local result = mw.getCurrentFrame():expandTemplate{title = addTemplate(args[1]), args = codeArguments}
ret = ret .. " → " .. result
end
if expand then
local query = mw.text.encode('{{' .. addTemplate(args[1]) .. string.gsub(codeArgumentsString, textPartBuffer, "|") .. '}}')
local url = mw.uri.fullUrl('special:ExpandTemplates', 'wpInput=' .. query)
mw.log()
ret = ret .. " [" .. tostring(url) .. "]"
end
return ret
end
return p
c7307fa3959d308a2dd7fd2f5009c1ce6db3d122
Template:Clear
10
37
103
2022-03-08T14:12:32Z
dev>DarkMatterMan4500
0
Created page with "<div style="clear:{{{1|both}}};"></div><noinclude> {{documentation}} </noinclude>"
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
175
103
2022-06-13T15:31:11Z
wikipedia>Xaosflux
0
Changed protection settings for "[[Template:Clear]]": [[WP:High-risk templates|Highly visible template]]: 3MM+ uses ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
Module:InfoboxImage
828
131
361
2022-03-13T19:18:18Z
wikipedia>WOSlinker
0
add class param from sandbox as per edit request
Scribunto
text/plain
-- Inputs:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
-- page - page to display for multipage images (DjVu)
-- size - size to display the image
-- maxsize - maximum size for image
-- sizedefault - default size to display the image if size param is blank
-- alt - alt text for image
-- title - title text for image
-- border - set to yes if border
-- center - set to yes, if the image has to be centered
-- upright - upright image param
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
-- link - page to visit when clicking on image
-- class - HTML classes to add to the image
-- Outputs:
-- Formatted image.
-- More details available at the "Module:InfoboxImage/doc" page
local i = {};
local placeholder_image = {
"Blue - Replace this image female.svg",
"Blue - Replace this image male.svg",
"Female no free image yet.png",
"Flag of None (square).svg",
"Flag of None.svg",
"Flag of.svg",
"Green - Replace this image female.svg",
"Green - Replace this image male.svg",
"Image is needed female.svg",
"Image is needed male.svg",
"Location map of None.svg",
"Male no free image yet.png",
"Missing flag.png",
"No flag.svg",
"No free portrait.svg",
"No portrait (female).svg",
"No portrait (male).svg",
"Red - Replace this image female.svg",
"Red - Replace this image male.svg",
"Replace this image female (blue).svg",
"Replace this image female.svg",
"Replace this image male (blue).svg",
"Replace this image male.svg",
"Silver - Replace this image female.svg",
"Silver - Replace this image male.svg",
"Replace this image.svg",
"Cricket no pic.png",
"CarersLogo.gif",
"Diagram Needed.svg",
"Example.jpg",
"Image placeholder.png",
"No male portrait.svg",
"Nocover-upload.png",
"NoDVDcover copy.png",
"Noribbon.svg",
"No portrait-BFD-test.svg",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Sin bandera.svg",
"Sin escudo.svg",
"Replace this image - temple.png",
"Replace this image butterfly.png",
"Replace this image.svg",
"Replace this image1.svg",
"Resolution angle.png",
"Image-No portrait-text-BFD-test.svg",
"Insert image here.svg",
"No image available.png",
"NO IMAGE YET square.png",
"NO IMAGE YET.png",
"No Photo Available.svg",
"No Screenshot.svg",
"No-image-available.jpg",
"Null.png",
"PictureNeeded.gif",
"Place holder.jpg",
"Unbenannt.JPG",
"UploadACopyrightFreeImage.svg",
"UploadAnImage.gif",
"UploadAnImage.svg",
"UploadAnImageShort.svg",
"CarersLogo.gif",
"Diagram Needed.svg",
"No male portrait.svg",
"NoDVDcover copy.png",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Noimage.gif",
}
function i.IsPlaceholder(image)
-- change underscores to spaces
image = mw.ustring.gsub(image, "_", " ");
assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')
-- if image starts with [[ then remove that and anything after |
if mw.ustring.sub(image,1,2) == "[[" then
image = mw.ustring.sub(image,3);
image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");
assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
-- capitalise first letter
image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
for i,j in pairs(placeholder_image) do
if image == j then
return true
end
end
return false
end
function i.InfoboxImage(frame)
local image = frame.args["image"];
if image == "" or image == nil then
return "";
end
if image == " " then
return image;
end
if frame.args["suppressplaceholder"] ~= "no" then
if i.IsPlaceholder(image) == true then
return "";
end
end
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then
return "";
end
if mw.ustring.sub(image,1,2) == "[[" then
-- search for thumbnail images and add to tracking cat if found
local cat = "";
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
cat = "[[Category:Pages using infoboxes with thumbnail images]]";
end
return image .. cat;
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then
return image;
elseif mw.ustring.sub(image,1,1) == "<" then
return image;
elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then
-- Found strip marker at begining, so pass don't process at all
return image;
elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then
-- Found strip marker at begining, so pass don't process at all
return image;
else
local result = "";
local page = frame.args["page"];
local size = frame.args["size"];
local maxsize = frame.args["maxsize"];
local sizedefault = frame.args["sizedefault"];
local alt = frame.args["alt"];
local link = frame.args["link"];
local title = frame.args["title"];
local border = frame.args["border"];
local upright = frame.args["upright"] or "";
local thumbtime = frame.args["thumbtime"] or "";
local center = frame.args["center"];
local class = frame.args["class"];
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
if maxsize ~= "" and maxsize ~= nil then
-- if no sizedefault then set to maxsize
if sizedefault == "" or sizedefault == nil then
sizedefault = maxsize
end
-- check to see if size bigger than maxsize
if size ~= "" and size ~= nil then
local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;
local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;
if sizenumber>maxsizenumber and maxsizenumber>0 then
size = maxsize;
end
end
end
-- add px to size if just a number
if (tonumber(size) or 0) > 0 then
size = size .. "px";
end
-- add px to sizedefault if just a number
if (tonumber(sizedefault) or 0) > 0 then
sizedefault = sizedefault .. "px";
end
result = "[[File:" .. image;
if page ~= "" and page ~= nil then
result = result .. "|page=" .. page;
end
if size ~= "" and size ~= nil then
result = result .. "|" .. size;
elseif sizedefault ~= "" and sizedefault ~= nil then
result = result .. "|" .. sizedefault;
else
result = result .. "|frameless";
end
if center == "yes" then
result = result .. "|center"
end
if alt ~= "" and alt ~= nil then
result = result .. "|alt=" .. alt;
end
if link ~= "" and link ~= nil then
result = result .. "|link=" .. link;
end
if border == "yes" then
result = result .. "|border";
end
if upright == "yes" then
result = result .. "|upright";
elseif upright ~= "" then
result = result .. "|upright=" .. upright;
end
if thumbtime ~= "" then
result = result .. "|thumbtime=" .. thumbtime;
end
if class ~= nil and class ~= "" then
result = result .. "|class=" .. class;
end
-- if alt value is a keyword then do not use as a description
if alt == "thumbnail" or alt == "thumb" or alt == "frameless" or alt == "left" or alt == "center" or alt == "right" or alt == "upright" or alt == "border" or mw.ustring.match(alt or "", '^[0-9]*px$', 1) ~= nil then
alt = nil;
end
if title ~= "" and title ~= nil then
-- does title param contain any templatestyles? If yes then set to blank.
if mw.ustring.match(frame:preprocess(title), 'UNIQ%-%-templatestyles', 1) ~= nil then
title = nil;
end
end
if title ~= "" and title ~= nil then
result = result .. "|" .. title;
end
result = result .. "]]";
return result;
end
end
return i;
0ee5fe75ba239fc5c9cedc81ca11bdc0be068542
Template:Documentation
10
12
223
2022-03-29T02:14:34Z
wikipedia>Bsherr
0
consistent with new substitution template format
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Add categories to the /doc subpage -->
</noinclude>
9e62b964e96c4e3d478edecbfcb3c0338ae8a276
Template:If empty
10
172
444
2022-04-03T20:56:41Z
wikipedia>Wugapodes
0
Changed protection settings for "[[Template:If empty]]": [[WP:High-risk templates|Highly visible template]]: used on 2 million pages and permanently cascade protected; matches module protection ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>{{Documentation}}</noinclude>
745940b7bdde8a1585c887ee4ee5ce81d98461a4
Template:FIPS
10
223
548
2022-04-14T00:55:29Z
wikipedia>Zzyzx11
0
updating link
wikitext
text/x-wiki
{{#ifeq: {{#invoke:String|len|s={{{cs|}}}}} | 10
| [https://data.census.gov/cedsci/profile?g=0600000US{{{cs}}} {{{cs}}}]
| {{#ifeq: {{#invoke:String|len|s={{{p|}}}}} | 10
| [https://data.census.gov/cedsci/profile?g=1600000US{{#invoke:String|sub|{{{p}}}|1|2}}{{#invoke:String|sub|{{{p}}}|6|10}} {{{p}}}]
| [{{#if:{{{county|}}}{{{3|}}}
|https://data.census.gov/cedsci/profile?g=0600000US{{{state|{{{1}}}}}}{{{county|{{{3}}}}}}{{{place|{{{2}}}}}}
|https://data.census.gov/cedsci/profile?g=1600000US{{{state|{{{1}}}}}}{{{place|{{{2}}}}}}
}} {{{state|{{{1}}}}}}-{{{place|{{{2}}}}}}]
}}
}}<noinclude>
{{Documentation}}
</noinclude>
6e59843d2ffa6d2c85f0b7e9a7394c23fa8a4956
Template:Infobox service record
10
266
641
2022-05-10T22:28:10Z
wikipedia>Galobtter
0
Added {{being deleted}} per [[Wikipedia:Templates for discussion/Log/2022 April 30#Template:Infobox ship begin]] ([[WP:XFDC#4.0.13|XFDcloser]])
wikitext
text/x-wiki
<noinclude>{{Being deleted|2022 April 30|Template:Infobox ship begin|merge= Template:Infobox ship}}</noinclude><includeonly>{{#switch:{{#ifeq:{{{is_ship|}}}|yes|1|0}}{{#ifeq:{{{is_multi|}}}|yes|1|0}}|
|00 = <table {{WPMILHIST Infobox style|main_box}}><!-- standalone -->
|#default = }}<!-- not standalone (in a primary infobox)
-->{{#ifeq:{{{is_ship|}}}|yes|<tr><!-- here for ship -->
<th colspan="2" {{WPMILHIST Infobox style|header_bar}}>{{#if:{{{label|}}}|{{{label|}}}|Service record}}</th>
</tr>
{{#if:{{{partof|}}}|<tr><td>Part of:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{partof}}}}}</td></tr>
}}{{#if:{{{codes|}}}|<tr><td>Identification codes:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{codes}}}}}</td></tr>
}}{{#if:{{{commanders|}}}|<tr><td>Commanders:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{commanders}}}}}</td></tr>
}}{{#if:{{{operations|}}}|<tr><td>Operations:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{operations}}}}}</td></tr>
}}{{#if:{{{victories|}}}|<tr><td>Victories:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{victories}}}}}</td></tr>
}}{{#if:{{{awards|}}}|<tr><td>Awards:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{awards}}}}}</td></tr>
}}|<tr><!-- here for non-ship -->
<th colspan="2" {{WPMILHIST Infobox style|header_bar}}>{{#if:{{{label|}}}|{{{label|}}}|Service record}}</th>
</tr>
{{#if:{{{partof|}}}|<tr><th style="padding-right: 1em;">Part of</th><td>
{{{partof}}}</td></tr>
}}{{#if:{{{codes|}}}|<tr><th style="padding-right: 1em;">Identification codes</th><td>
{{{codes}}}</td></tr>
}}{{#if:{{{commanders|}}}|<tr><th style="padding-right: 1em;">Commanders</th><td>
{{{commanders}}}</td></tr>
}}{{#if:{{{operations|}}}|<tr><th style="padding-right: 1em;">Operations</th><td>
{{{operations}}}</td></tr>
}}{{#if:{{{victories|}}}|<tr><th style="padding-right: 1em;">Victories</th><td>
{{{victories}}}</td></tr>
}}{{#if:{{{awards|}}}|<tr><th style="padding-right: 1em;">Awards</th><td>
{{{awards}}}</td></tr>
}}}}{{#switch:{{#ifeq:{{{is_ship|}}}|yes|1|0}}{{#ifeq:{{{is_multi|}}}|yes|1|0}}|
|00 = </table>
|#default = }}</includeonly><noinclude>
{{convert to use Infobox}}
{{documentation}}
</noinclude>
f7f64fe650c609522ae5737c494edc577cf855e4
Template:Lang-mia
10
225
552
2022-05-26T10:10:06Z
wikipedia>AquitaneHungerForce
0
Added [[:Category:Algonquian multilingual support templates]].
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=mia
}}</includeonly><noinclude>
{{Documentation|Template:Lang-x/doc}}
[[Category:Algonquian multilingual support templates]]
</noinclude>
30122b9ca33b90f7d8ca4c25656d1f1f3704745d
Template:T
10
283
680
2022-06-05T04:09:28Z
wikipedia>Dinoguy1000
0
not that it matters much, but fix comment closing
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
{{Rcat shell|
{{R from template shortcut}}
}}
<!-- Used as Template:tl throughout English Wikipedia; demo template referenced only on meta -->
bb10dbc83695404528dbc095ea267429142c7f05
Module:Uses Wikidata
828
217
536
2022-06-08T17:12:17Z
wikipedia>Legoktm
0
fix capitalization of Wikidata and Wikipedia in query output
Scribunto
text/plain
local p = {}
function p.usesProperty(frame)
local args = frame.getParent(frame).args or nil
if mw.text.trim(args[1] or '') == '' then
args = frame.args
end
local result = '<ul>'
local ii = 1
while true do
local p_num = mw.text.trim(args[ii] or '')
if p_num ~= '' then
local label = mw.wikibase.getLabel(p_num) or "NO LABEL"
result = result .. "<li>[[File:Disc Plain blue dark.svg|middle|4px|link=|alt=]] <b><i>[[d:Property talk:" .. p_num .. "|" .. label .. " (" .. string.upper(p_num) .. ")]]</i></b> (see <span class='plainlinks'>[https://query.wikidata.org/embed.html#SELECT%20%3FWikidata_item_%20%3FWikidata_item_Label%20%3Fvalue%20%3FvalueLabel%20%3FEnglish_Wikipedia_article%20%23Show%20data%20in%20this%20order%0A%7B%0A%09%3FWikidata_item_%20wdt%3A" .. p_num .. "%20%3Fvalue%20.%20%23Collecting%20all%20items%20which%20have%20" .. p_num .. "%20data%2C%20from%20whole%20Wikidata%20item%20pages%0A%09OPTIONAL%20%7B%3FEnglish_Wikipedia_article%20schema%3Aabout%20%3FWikidata_item_%3B%20schema%3AisPartOf%20%3Chttps%3A%2F%2Fen.wikipedia.org%2F%3E%20.%7D%20%23If%20collected%20item%20has%20link%20to%20English%20Wikipedia%2C%20show%20that%0A%09SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%20%7D%20%23Show%20label%20in%20this%20language.%20%22en%22%20is%20English.%20%20%20%0A%7D%0ALIMIT%201000 uses]</span>)</li>"
ii = ii + 1
else break
end
end
result = result.."</ul>"
return result
end
function p.tuProperty(frame)
local parent = frame.getParent(frame)
local result = '<ul>'
local ii = 1
while true do
local p_num = mw.text.trim(parent.args[ii] or '')
if p_num ~= '' then
local label = mw.wikibase.getLabel(p_num) or "NO LABEL"
result = result .. "<li><span style='font-size:90%;line-height:1;'>●</span> <b>[[d:Property:" .. p_num .. "|" .. label .. "]]</b> <span style='font-size:90%;'>([[d:Property talk:" .. string.upper(p_num) .. "|" .. p_num .. "]])</span></li>"
ii = ii + 1
else break
end
end
result = result.."</ul>"
return result
end
return p
8b704fdbc00fb94538c56f18c5c01f1e72963ea9
Module:Labelled list hatnote
828
279
672
2022-06-08T23:33:35Z
wikipedia>Nihiltres
0
Fixed iteration-and-removal bug
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Labelled list --
-- --
-- This module does the core work of creating a hatnote composed of a list --
-- prefixed by a colon-terminated label, i.e. "LABEL: [andList of pages]", --
-- for {{see also}} and similar templates. --
--------------------------------------------------------------------------------
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local yesno --initialize lazily
local p = {}
-- Defaults global to this module
local defaults = {
label = 'See also', --Final fallback for label argument
labelForm = '%s: %s',
prefixes = {'label', 'label ', 'l'},
template = 'Module:Labelled list hatnote'
}
-- Localizable message strings
local msg = {
errorSuffix = '#Errors',
noInputWarning = 'no page names specified',
noOutputWarning =
"'''[[%s]] — no output: none of the target pages exist.'''"
}
-- Helper function that pre-combines display parameters into page arguments.
-- Also compresses sparse arrays, as a desirable side-effect.
function p.preprocessDisplays (args, prefixes)
-- Prefixes specify which parameters, in order, to check for display options
-- They each have numbers auto-appended, e.g. 'label1', 'label 1', & 'l1'
prefixes = prefixes or defaults.prefixes
local indices = {}
local sparsePages = {}
for k, v in pairs(args) do
if type(k) == 'number' then
indices[#indices + 1] = k
local display
for i = 1, #prefixes do
display = args[prefixes[i] .. k]
if display then break end
end
sparsePages[k] = display and
string.format('%s|%s', string.gsub(v, '|.*$', ''), display) or v
end
end
table.sort(indices)
local pages = {}
for k, v in ipairs(indices) do pages[#pages + 1] = sparsePages[v] end
return pages
end
--Helper function to get a page target from a processed page string
--e.g. "Page|Label" → "Page" or "Target" → "Target"
local function getTarget(pagename)
local pipe = string.find(pagename, '|')
return string.sub(pagename, 0, pipe and pipe - 1 or nil)
end
-- Produces a labelled pages-list hatnote.
-- The main frame (template definition) takes 1 or 2 arguments, for a singular
-- and (optionally) plural label respectively:
-- * {{#invoke:Labelled list hatnote|labelledList|Singular label|Plural label}}
-- The resulting template takes pagename & label parameters normally.
function p.labelledList (frame)
mArguments = require('Module:Arguments')
yesno = require('Module:Yesno')
local labels = {frame.args[1] or defaults.label}
labels[2] = frame.args[2] or labels[1]
labels[3] = frame.args[3] --no defaulting
labels[4] = frame.args[4] --no defaulting
local template = frame:getParent():getTitle()
local args = mArguments.getArgs(frame, {parentOnly = true})
local pages = p.preprocessDisplays(args)
local options = {
category = yesno(args.category),
extraclasses = frame.args.extraclasses,
ifexists = yesno(frame.args.ifexists),
namespace = frame.args.namespace or args.namespace,
selfref = yesno(frame.args.selfref or args.selfref),
template = template
}
return p._labelledList(pages, labels, options)
end
function p._labelledList (pages, labels, options)
if options.ifexists then
for k = #pages, 1, -1 do --iterate backwards to allow smooth removals
local v = pages[k]
local title = mw.title.new(getTarget(v), namespace)
if (v == '') or title == nil or not title.exists then
table.remove(pages, k)
end
end
end
labels = labels or {}
label = (#pages == 1 and labels[1] or labels[2]) or defaults.label
for k, v in pairs(pages) do
if mHatnote.findNamespaceId(v) ~= 0 then
label =
(
#pages == 1 and
(labels[3] or labels[1] or defaults.label) or
(labels[4] or labels[2] or defaults.label)
) or defaults.label
end
end
if #pages == 0 then
if options.ifexists then
mw.addWarning(
string.format(
msg.noOutputWarning, options.template or defaults.template
)
)
return ''
else
return mHatnote.makeWikitextError(
msg.noInputWarning,
(options.template or defaults.template) .. msg.errorSuffix,
options.category
)
end
end
local text = string.format(
options.labelForm or defaults.labelForm,
label,
mHatlist.andList(pages, true)
)
local hnOptions = {
extraclasses = options.extraclasses,
selfref = options.selfref
}
return mHatnote._hatnote(text, hnOptions)
end
return p
b7a8ba27cf6195e6427701b94e8d2acad3c40a21
Template:Reflist
10
170
440
2022-06-11T17:42:16Z
wikipedia>Izno
0
correct my error per [[Template talk:Reflist#liststyle and group]]
wikitext
text/x-wiki
<templatestyles src="Reflist/styles.css" /><div class="reflist <!--
-->{{#if:{{{1|}}}{{{colwidth|}}}|reflist-columns references-column-width}} <!--
-->{{#switch:{{{liststyle|{{{group|}}}}}}|upper-alpha|upper-roman|lower-alpha|lower-greek|lower-roman=reflist-{{{liststyle|{{{group}}}}}}}} <!--
-->{{#if:{{{1|}}}|{{#iferror:{{#ifexpr: {{{1|1}}} > 1 }}||{{#switch:{{{1|}}}|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" <!-- end class
-->{{#if: {{{1|}}}<!-- start style -->
| {{#iferror: {{#ifexpr: {{{1|1}}} > 1 }} |style="column-width: {{{1}}};"}}
| {{#if: {{{colwidth|}}}|style="column-width: {{{colwidth}}};"}}
}}>
{{#tag:references|{{{refs|}}}|group={{{group|}}}|responsive={{#if:{{{1|}}}{{{colwidth|}}}|0|1}}}}</div>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using reflist with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Reflist]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | colwidth | group | liststyle | refs }}<noinclude>
{{Documentation}}
</noinclude>
8c65cc88272db6c0f5cf2b49f84d3e460e60ee5f
Module:Uses TemplateStyles/config
828
228
560
2022-06-16T15:10:06Z
wikipedia>Pppery
0
Matching reality rather than 2018 me's wishful thinking
Scribunto
text/plain
local cfg = {} -- Don’t touch this line.
-- Subpage blacklist: these subpages will not be categorized (except for the
-- error category, which is always added if there is an error).
-- For example “Template:Foo/doc” matches the `doc = true` rule, so it will have
-- no categories. “Template:Foo” and “Template:Foo/documentation” match no rules,
-- so they *will* have categories. All rules should be in the
-- ['<subpage name>'] = true,
-- format.
cfg['subpage_blacklist'] = {
['doc'] = true,
['sandbox'] = true,
['sandbox2'] = true,
['testcases'] = true,
}
-- Sandbox title: if the stylesheet’s title is <template>/<stylesheet>.css, the
-- stylesheet’s sandbox is expected to be at <template>/<sandbox_title>/<stylesheet>.css
-- Set to nil to disable sandbox links.
cfg['sandbox_title'] = 'sandbox'
-- Error category: this category is added if the module call contains errors
-- (e.g. no stylesheet listed). A category name without namespace, or nil
-- to disable categorization (not recommended).
cfg['error_category'] = 'Uses TemplateStyles templates with errors'
-- Default category: this category is added if no custom category is specified
-- in module/template call. A category name without namespace, or nil
-- to disable categorization.
cfg['default_category'] = 'Templates using TemplateStyles'
-- Protection conflict category: this category is added if the protection level
-- of any stylesheet is lower than the protection level of the template. A category name
-- without namespace, or nil to disable categorization (not recommended).
cfg['protection_conflict_category'] = 'Templates using TemplateStyles with a different protection level'
-- Hierarchy of protection levels, used to determine whether one protection level is lower
-- than another and thus should populate protection_conflict_category. No protection is treated as zero
cfg['protection_hierarchy'] = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
-- Padlock pattern: Lua pattern to search on protected stylesheets for, or nil
-- to disable padlock check.
cfg['padlock_pattern'] = '{{pp-'
-- Missing padlock category: this category is added if a protected stylesheet
-- doesn’t contain any padlock template (specified by the above Lua pattern).
-- A category name without namespace (no nil allowed) if the pattern is not nil,
-- unused (and thus may be nil) otherwise.
cfg['missing_padlock_category'] = 'Templates using TemplateStyles without padlocks'
return cfg -- Don’t touch this line.
58e7a37c44f6ea3f6b8af54a559d696cc7256493
Module:Uses TemplateStyles
828
227
558
2022-06-16T15:13:38Z
wikipedia>Pppery
0
Matching reality rather than 2018 me's wishful thinking
Scribunto
text/plain
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local TNT = require('Module:TNT')
local p = {}
local function format(msg, ...)
return TNT.format('I18n/Uses TemplateStyles', msg, ...)
end
local function getConfig()
return mw.loadData('Module:Uses TemplateStyles/config')
end
local function renderBox(tStyles)
local boxArgs = {
type = 'notice',
small = true,
image = string.format('[[File:Farm-Fresh css add.svg|32px|alt=%s]]', format('logo-alt'))
}
if #tStyles < 1 then
boxArgs.text = string.format('<strong class="error">%s</strong>', format('error-emptylist'))
else
local cfg = getConfig()
local tStylesLinks = {}
for i, ts in ipairs(tStyles) do
local link = string.format('[[:%s]]', ts)
local sandboxLink = nil
local tsTitle = mw.title.new(ts)
if tsTitle and cfg['sandbox_title'] then
local tsSandboxTitle = mw.title.new(string.format(
'%s:%s/%s/%s', tsTitle.nsText, tsTitle.baseText, cfg['sandbox_title'], tsTitle.subpageText))
if tsSandboxTitle and tsSandboxTitle.exists then
sandboxLink = format('sandboxlink', link, ':' .. tsSandboxTitle.prefixedText)
end
end
tStylesLinks[i] = sandboxLink or link
end
local tStylesList = mList.makeList('bulleted', tStylesLinks)
boxArgs.text = format(
mw.title.getCurrentTitle():inNamespaces(828,829) and 'header-module' or 'header-template') ..
'\n' .. tStylesList
end
return mMessageBox.main('mbox', boxArgs)
end
local function renderTrackingCategories(args, tStyles, titleObj)
if yesno(args.nocat) then
return ''
end
local cfg = getConfig()
local cats = {}
-- Error category
if #tStyles < 1 and cfg['error_category'] then
cats[#cats + 1] = cfg['error_category']
end
-- TemplateStyles category
titleObj = titleObj or mw.title.getCurrentTitle()
if (titleObj.namespace == 10 or titleObj.namespace == 828)
and not cfg['subpage_blacklist'][titleObj.subpageText]
then
local category = args.category or cfg['default_category']
if category then
cats[#cats + 1] = category
end
if not yesno(args.noprotcat) and (cfg['protection_conflict_category'] or cfg['padlock_pattern']) then
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
local addedLevelCat = false
local addedPadlockCat = false
for i, ts in ipairs(tStyles) do
local tsTitleObj = mw.title.new(ts)
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
if cfg['padlock_pattern'] and tsProt and not addedPadlockCat then
local content = tsTitleObj:getContent()
if not content:find(cfg['padlock_pattern']) then
cats[#cats + 1] = cfg['missing_padlock_category']
addedPadlockCat = true
end
end
if cfg['protection_conflict_category'] and currentProt and tsProt ~= currentProt and not addedLevelCat then
currentProt = cfg['protection_hierarchy'][currentProt] or 0
tsProt = cfg['protection_hierarchy'][tsProt] or 0
if tsProt < currentProt then
addedLevelCat = true
cats[#cats + 1] = cfg['protection_conflict_category']
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
function p._main(args, cfg)
local tStyles = mTableTools.compressSparseArray(args)
local box = renderBox(tStyles)
local trackingCategories = renderTrackingCategories(args, tStyles)
return box .. trackingCategories
end
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
return p
71ca57c37849f38e3c5ee30061bdae730963e48e
Template:Auto short description
10
231
566
2022-07-04T08:57:44Z
wikipedia>Sammi Brie
0
grammar fix
wikitext
text/x-wiki
{{Ombox
| type = notice
| text = This template {{#if:{{{sometimes|}}}|sometimes{{sp}}}}adds an automatically generated '''[[Wikipedia:Short description|short description]]'''{{#if:{{{category|}}}|{{sp}}({{{category}}})|}}{{#if:{{{conditions|}}}|{{space}}{{{conditions}}}}}. If the automatic short description is not optimal, replace it by adding {{tl|Short description}} at the top of the article.
}}<includeonly>{{Subpage other|<!-- do not categorise -->|[[Category:Templates that generate short descriptions{{#if:{{{category|}}}|{{sp}}for {{{category}}}|}}]]}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
4ef114404749d204ef6574916944eb2d8478640e
Template:Round
10
197
494
2022-07-09T01:53:46Z
wikipedia>Neveselbert
0
safesubst
wikitext
text/x-wiki
<includeonly>{{safesubst<noinclude/>:#iferror:{{#expr:{{{2|0}}}}} |
{{main other|[[Category:Pages with bad rounding precision]]}}{{hid|Bad rounding here}}<!--
-->{{safesubst<noinclude/>:#invoke:Math|precision_format| {{{1}}} | 1-{{order of magnitude|{{{1}}}}} }}|
{{safesubst<noinclude/>:#invoke:Math|precision_format| {{{1}}} | {{{2|0}}}}}}}</includeonly><noinclude>
{{documentation}}
</noinclude>
9c2874586b74824fe1beb6830b56eabe7ad936ce
Template:Generic template demo
10
287
688
2022-07-10T21:03:19Z
wikipedia>Aidan9382
0
+{{R semiprotected}}
wikitext
text/x-wiki
#REDIRECT [[Template:Parameter names example]]
{{R semiprotected}}
[[Category:Wikipedia utility templates]]
[[Category:Template namespace templates]]
[[Category:Documentation assistance templates]]
22f645541f749cfd0eeffdee734b51b284103400
Module:Message box/ombox.css
828
28
269
2022-07-11T18:40:17Z
wikipedia>Izno
0
and move mbox-small to 720px here as well
sanitized-css
text/css
/* {{pp|small=y}} */
.ombox {
margin: 4px 0;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
/* For the "small=yes" option. */
.ombox.mbox-small {
font-size: 88%;
line-height: 1.25em;
}
.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ombox-delete {
border: 2px solid #b32424; /* Red */
}
.ombox-content {
border: 1px solid #f28500; /* Orange */
}
.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
.ombox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.9em;
width: 100%;
}
.ombox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.ombox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ombox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ombox .mbox-invalid-type {
text-align: center;
}
@media (min-width: 720px) {
.ombox {
margin: 4px 10%;
}
.ombox.mbox-small {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
width: 238px;
}
}
8fe3df4bb607e699eab2dbd23bd4a1a446391002
Module:Text
828
206
512
2022-07-21T16:43:48Z
wikipedia>Hike395
0
update date
Scribunto
text/plain
local yesNo = require("Module:Yesno")
local Text = { serial = "2022-07-21",
suite = "Text" }
--[=[
Text utilities
]=]
-- local globals
local PatternCJK = false
local PatternCombined = false
local PatternLatin = false
local PatternTerminated = false
local QuoteLang = false
local QuoteType = false
local RangesLatin = false
local SeekQuote = false
local function initLatinData()
if not RangesLatin then
RangesLatin = { { 7, 687 },
{ 7531, 7578 },
{ 7680, 7935 },
{ 8194, 8250 } }
end
if not PatternLatin then
local range
PatternLatin = "^["
for i = 1, #RangesLatin do
range = RangesLatin[ i ]
PatternLatin = PatternLatin ..
mw.ustring.char( range[ 1 ], 45, range[ 2 ] )
end -- for i
PatternLatin = PatternLatin .. "]*$"
end
end
local function initQuoteData()
-- Create quote definitions
if not QuoteLang then
QuoteLang =
{ af = "bd",
ar = "la",
be = "labd",
bg = "bd",
ca = "la",
cs = "bd",
da = "bd",
de = "bd",
dsb = "bd",
et = "bd",
el = "lald",
en = "ld",
es = "la",
eu = "la",
-- fa = "la",
fi = "rd",
fr = "laSPC",
ga = "ld",
he = "ldla",
hr = "bd",
hsb = "bd",
hu = "bd",
hy = "labd",
id = "rd",
is = "bd",
it = "ld",
ja = "x300C",
ka = "bd",
ko = "ld",
lt = "bd",
lv = "bd",
nl = "ld",
nn = "la",
no = "la",
pl = "bdla",
pt = "lald",
ro = "bdla",
ru = "labd",
sk = "bd",
sl = "bd",
sq = "la",
sr = "bx",
sv = "rd",
th = "ld",
tr = "ld",
uk = "la",
zh = "ld",
["de-ch"] = "la",
["en-gb"] = "lsld",
["en-us"] = "ld",
["fr-ch"] = "la",
["it-ch"] = "la",
["pt-br"] = "ldla",
["zh-tw"] = "x300C",
["zh-cn"] = "ld" }
end
if not QuoteType then
QuoteType =
{ bd = { { 8222, 8220 }, { 8218, 8217 } },
bdla = { { 8222, 8220 }, { 171, 187 } },
bx = { { 8222, 8221 }, { 8218, 8217 } },
la = { { 171, 187 }, { 8249, 8250 } },
laSPC = { { 171, 187 }, { 8249, 8250 }, true },
labd = { { 171, 187 }, { 8222, 8220 } },
lald = { { 171, 187 }, { 8220, 8221 } },
ld = { { 8220, 8221 }, { 8216, 8217 } },
ldla = { { 8220, 8221 }, { 171, 187 } },
lsld = { { 8216, 8217 }, { 8220, 8221 } },
rd = { { 8221, 8221 }, { 8217, 8217 } },
x300C = { { 0x300C, 0x300D },
{ 0x300E, 0x300F } } }
end
end -- initQuoteData()
local function fiatQuote( apply, alien, advance )
-- Quote text
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code
-- advance -- number, with level 1 or 2
local r = apply and tostring(apply) or ""
alien = alien or "en"
advance = tonumber(advance) or 0
local suite
initQuoteData()
local slang = alien:match( "^(%l+)-" )
suite = QuoteLang[alien] or slang and QuoteLang[slang] or QuoteLang["en"]
if suite then
local quotes = QuoteType[ suite ]
if quotes then
local space
if quotes[ 3 ] then
space = " "
else
space = ""
end
quotes = quotes[ advance ]
if quotes then
r = mw.ustring.format( "%s%s%s%s%s",
mw.ustring.char( quotes[ 1 ] ),
space,
apply,
space,
mw.ustring.char( quotes[ 2 ] ) )
end
else
mw.log( "fiatQuote() " .. suite )
end
end
return r
end -- fiatQuote()
Text.char = function ( apply, again, accept )
-- Create string from codepoints
-- Parameter:
-- apply -- table (sequence) with numerical codepoints, or nil
-- again -- number of repetitions, or nil
-- accept -- true, if no error messages to be appended
-- Returns: string
local r = ""
apply = type(apply) == "table" and apply or {}
again = math.floor(tonumber(again) or 1)
if again < 1 then
return ""
end
local bad = { }
local codes = { }
for _, v in ipairs( apply ) do
local n = tonumber(v)
if not n or (n < 32 and n ~= 9 and n ~= 10) then
table.insert(bad, tostring(v))
else
table.insert(codes, math.floor(n))
end
end
if #bad > 0 then
if not accept then
r = tostring( mw.html.create( "span" )
:addClass( "error" )
:wikitext( "bad codepoints: " .. table.concat( bad, " " )) )
end
return r
end
if #codes > 0 then
r = mw.ustring.char( unpack( codes ) )
if again > 1 then
r = r:rep(again)
end
end
return r
end -- Text.char()
local function trimAndFormat(args, fmt)
local result = {}
if type(args) ~= 'table' then
args = {args}
end
for _, v in ipairs(args) do
v = mw.text.trim(tostring(v))
if v ~= "" then
table.insert(result,fmt and mw.ustring.format(fmt, v) or v)
end
end
return result
end
Text.concatParams = function ( args, apply, adapt )
-- Concat list items into one string
-- Parameter:
-- args -- table (sequence) with numKey=string
-- apply -- string (optional); separator (default: "|")
-- adapt -- string (optional); format including "%s"
-- Returns: string
local collect = { }
return table.concat(trimAndFormat(args,adapt), apply or "|")
end -- Text.concatParams()
Text.containsCJK = function ( s )
-- Is any CJK code within?
-- Parameter:
-- s -- string
-- Returns: true, if CJK detected
s = s and tostring(s) or ""
if not patternCJK then
patternCJK = mw.ustring.char( 91,
4352, 45, 4607,
11904, 45, 42191,
43072, 45, 43135,
44032, 45, 55215,
63744, 45, 64255,
65072, 45, 65103,
65381, 45, 65500,
131072, 45, 196607,
93 )
end
return mw.ustring.find( s, patternCJK ) ~= nil
end -- Text.containsCJK()
Text.removeDelimited = function (s, prefix, suffix)
-- Remove all text in s delimited by prefix and suffix (inclusive)
-- Arguments:
-- s = string to process
-- prefix = initial delimiter
-- suffix = ending delimiter
-- Returns: stripped string
s = s and tostring(s) or ""
prefix = prefix and tostring(prefix) or ""
suffix = suffix and tostring(suffix) or ""
local prefixLen = mw.ustring.len(prefix)
local suffixLen = mw.ustring.len(suffix)
if prefixLen == 0 or suffixLen == 0 then
return s
end
local i = s:find(prefix, 1, true)
local r = s
local j
while i do
j = r:find(suffix, i + prefixLen)
if j then
r = r:sub(1, i - 1)..r:sub(j+suffixLen)
else
r = r:sub(1, i - 1)
end
i = r:find(prefix, 1, true)
end
return r
end
Text.getPlain = function ( adjust )
-- Remove wikisyntax from string, except templates
-- Parameter:
-- adjust -- string
-- Returns: string
local r = Text.removeDelimited(adjust,"<!--","-->")
r = r:gsub( "(</?%l[^>]*>)", "" )
:gsub( "'''", "" )
:gsub( "''", "" )
:gsub( " ", " " )
return r
end -- Text.getPlain()
Text.isLatinRange = function (s)
-- Are characters expected to be latin or symbols within latin texts?
-- Arguments:
-- s = string to analyze
-- Returns: true, if valid for latin only
s = s and tostring(s) or "" --- ensure input is always string
initLatinData()
return mw.ustring.match(s, PatternLatin) ~= nil
end -- Text.isLatinRange()
Text.isQuote = function ( s )
-- Is this character any quotation mark?
-- Parameter:
-- s = single character to analyze
-- Returns: true, if s is quotation mark
s = s and tostring(s) or ""
if s == "" then
return false
end
if not SeekQuote then
SeekQuote = mw.ustring.char( 34, -- "
39, -- '
171, -- laquo
187, -- raquo
8216, -- lsquo
8217, -- rsquo
8218, -- sbquo
8220, -- ldquo
8221, -- rdquo
8222, -- bdquo
8249, -- lsaquo
8250, -- rsaquo
0x300C, -- CJK
0x300D, -- CJK
0x300E, -- CJK
0x300F ) -- CJK
end
return mw.ustring.find( SeekQuote, s, 1, true ) ~= nil
end -- Text.isQuote()
Text.listToText = function ( args, adapt )
-- Format list items similar to mw.text.listToText()
-- Parameter:
-- args -- table (sequence) with numKey=string
-- adapt -- string (optional); format including "%s"
-- Returns: string
return mw.text.listToText(trimAndFormat(args, adapt))
end -- Text.listToText()
Text.quote = function ( apply, alien, advance )
-- Quote text
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code, or nil
-- advance -- number, with level 1 or 2, or nil
-- Returns: quoted string
apply = apply and tostring(apply) or ""
local mode, slang
if type( alien ) == "string" then
slang = mw.text.trim( alien ):lower()
else
slang = mw.title.getCurrentTitle().pageLanguage
if not slang then
-- TODO FIXME: Introduction expected 2017-04
slang = mw.language.getContentLanguage():getCode()
end
end
if advance == 2 then
mode = 2
else
mode = 1
end
return fiatQuote( mw.text.trim( apply ), slang, mode )
end -- Text.quote()
Text.quoteUnquoted = function ( apply, alien, advance )
-- Quote text, if not yet quoted and not empty
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code, or nil
-- advance -- number, with level 1 or 2, or nil
-- Returns: string; possibly quoted
local r = mw.text.trim( apply and tostring(apply) or "" )
local s = mw.ustring.sub( r, 1, 1 )
if s ~= "" and not Text.isQuote( s, advance ) then
s = mw.ustring.sub( r, -1, 1 )
if not Text.isQuote( s ) then
r = Text.quote( r, alien, advance )
end
end
return r
end -- Text.quoteUnquoted()
Text.removeDiacritics = function ( adjust )
-- Remove all diacritics
-- Parameter:
-- adjust -- string
-- Returns: string; all latin letters should be ASCII
-- or basic greek or cyrillic or symbols etc.
local cleanup, decomposed
if not PatternCombined then
PatternCombined = mw.ustring.char( 91,
0x0300, 45, 0x036F,
0x1AB0, 45, 0x1AFF,
0x1DC0, 45, 0x1DFF,
0xFE20, 45, 0xFE2F,
93 )
end
decomposed = mw.ustring.toNFD( adjust and tostring(adjust) or "" )
cleanup = mw.ustring.gsub( decomposed, PatternCombined, "" )
return mw.ustring.toNFC( cleanup )
end -- Text.removeDiacritics()
Text.sentenceTerminated = function ( analyse )
-- Is string terminated by dot, question or exclamation mark?
-- Quotation, link termination and so on granted
-- Parameter:
-- analyse -- string
-- Returns: true, if sentence terminated
local r
if not PatternTerminated then
PatternTerminated = mw.ustring.char( 91,
12290,
65281,
65294,
65311 )
.. "!%.%?…][\"'%]‹›«»‘’“”]*$"
end
if mw.ustring.find( analyse, PatternTerminated ) then
r = true
else
r = false
end
return r
end -- Text.sentenceTerminated()
Text.ucfirstAll = function ( adjust)
-- Capitalize all words
-- Arguments:
-- adjust = string to adjust
-- Returns: string with all first letters in upper case
adjust = adjust and tostring(adjust) or ""
local r = mw.text.decode(adjust,true)
local i = 1
local c, j, m
m = (r ~= adjust)
r = " "..r
while i do
i = mw.ustring.find( r, "%W%l", i )
if i then
j = i + 1
c = mw.ustring.upper( mw.ustring.sub( r, j, j ) )
r = string.format( "%s%s%s",
mw.ustring.sub( r, 1, i ),
c,
mw.ustring.sub( r, i + 2 ) )
i = j
end
end -- while i
r = r:sub( 2 )
if m then
r = mw.text.encode(r)
end
return r
end -- Text.ucfirstAll()
Text.uprightNonlatin = function ( adjust )
-- Ensure non-italics for non-latin text parts
-- One single greek letter might be granted
-- Precondition:
-- adjust -- string
-- Returns: string with non-latin parts enclosed in <span>
local r
initLatinData()
if mw.ustring.match( adjust, PatternLatin ) then
-- latin only, horizontal dashes, quotes
r = adjust
else
local c
local j = false
local k = 1
local m = false
local n = mw.ustring.len( adjust )
local span = "%s%s<span dir='auto' style='font-style:normal'>%s</span>"
local flat = function ( a )
-- isLatin
local range
for i = 1, #RangesLatin do
range = RangesLatin[ i ]
if a >= range[ 1 ] and a <= range[ 2 ] then
return true
end
end -- for i
end -- flat()
local focus = function ( a )
-- char is not ambivalent
local r = ( a > 64 )
if r then
r = ( a < 8192 or a > 8212 )
else
r = ( a == 38 or a == 60 ) -- '&' '<'
end
return r
end -- focus()
local form = function ( a )
return string.format( span,
r,
mw.ustring.sub( adjust, k, j - 1 ),
mw.ustring.sub( adjust, j, a ) )
end -- form()
r = ""
for i = 1, n do
c = mw.ustring.codepoint( adjust, i, i )
if focus( c ) then
if flat( c ) then
if j then
if m then
if i == m then
-- single greek letter.
j = false
end
m = false
end
if j then
local nx = i - 1
local s = ""
for ix = nx, 1, -1 do
c = mw.ustring.sub( adjust, ix, ix )
if c == " " or c == "(" then
nx = nx - 1
s = c .. s
else
break -- for ix
end
end -- for ix
r = form( nx ) .. s
j = false
k = i
end
end
elseif not j then
j = i
if c >= 880 and c <= 1023 then
-- single greek letter?
m = i + 1
else
m = false
end
end
elseif m then
m = m + 1
end
end -- for i
if j and ( not m or m < n ) then
r = form( n )
else
r = r .. mw.ustring.sub( adjust, k )
end
end
return r
end -- Text.uprightNonlatin()
Text.test = function ( about )
local r
if about == "quote" then
initQuoteData()
r = { }
r.QuoteLang = QuoteLang
r.QuoteType = QuoteType
end
return r
end -- Text.test()
-- Export
local p = { }
for _, func in ipairs({'containsCJK','isLatinRange','isQuote','sentenceTerminated'}) do
p[func] = function (frame)
return Text[func]( frame.args[ 1 ] or "" ) and "1" or ""
end
end
for _, func in ipairs({'getPlain','removeDiacritics','ucfirstAll','uprightNonlatin'}) do
p[func] = function (frame)
return Text[func]( frame.args[ 1 ] or "" )
end
end
function p.char( frame )
local params = frame:getParent().args
local story = params[ 1 ]
local codes, lenient, multiple
if not story then
params = frame.args
story = params[ 1 ]
end
if story then
local items = mw.text.split( mw.text.trim(story), "%s+" )
if #items > 0 then
local j
lenient = (yesNo(params.errors) == false)
codes = { }
multiple = tonumber( params[ "*" ] )
for _, v in ipairs( items ) do
j = tonumber((v:sub( 1, 1 ) == "x" and "0" or "") .. v)
table.insert( codes, j or v )
end
end
end
return Text.char( codes, multiple, lenient )
end
function p.concatParams( frame )
local args
local template = frame.args.template
if type( template ) == "string" then
template = mw.text.trim( template )
template = ( template == "1" )
end
if template then
args = frame:getParent().args
else
args = frame.args
end
return Text.concatParams( args,
frame.args.separator,
frame.args.format )
end
function p.listToFormat(frame)
local lists = {}
local pformat = frame.args["format"]
local sep = frame.args["sep"] or ";"
-- Parameter parsen: Listen
for k, v in pairs(frame.args) do
local knum = tonumber(k)
if knum then lists[knum] = v end
end
-- Listen splitten
local maxListLen = 0
for i = 1, #lists do
lists[i] = mw.text.split(lists[i], sep)
if #lists[i] > maxListLen then maxListLen = #lists[i] end
end
-- Ergebnisstring generieren
local result = ""
local result_line = ""
for i = 1, maxListLen do
result_line = pformat
for j = 1, #lists do
result_line = mw.ustring.gsub(result_line, "%%s", lists[j][i], 1)
end
result = result .. result_line
end
return result
end
function p.listToText( frame )
local args
local template = frame.args.template
if type( template ) == "string" then
template = mw.text.trim( template )
template = ( template == "1" )
end
if template then
args = frame:getParent().args
else
args = frame.args
end
return Text.listToText( args, frame.args.format )
end
function p.quote( frame )
local slang = frame.args[2]
if type( slang ) == "string" then
slang = mw.text.trim( slang )
if slang == "" then
slang = false
end
end
return Text.quote( frame.args[ 1 ] or "",
slang,
tonumber( frame.args[3] ) )
end
function p.quoteUnquoted( frame )
local slang = frame.args[2]
if type( slang ) == "string" then
slang = mw.text.trim( slang )
if slang == "" then
slang = false
end
end
return Text.quoteUnquoted( frame.args[ 1 ] or "",
slang,
tonumber( frame.args[3] ) )
end
function p.zip(frame)
local lists = {}
local seps = {}
local defaultsep = frame.args["sep"] or ""
local innersep = frame.args["isep"] or ""
local outersep = frame.args["osep"] or ""
-- Parameter parsen
for k, v in pairs(frame.args) do
local knum = tonumber(k)
if knum then lists[knum] = v else
if string.sub(k, 1, 3) == "sep" then
local sepnum = tonumber(string.sub(k, 4))
if sepnum then seps[sepnum] = v end
end
end
end
-- sofern keine expliziten Separatoren angegeben sind, den Standardseparator verwenden
for i = 1, math.max(#seps, #lists) do
if not seps[i] then seps[i] = defaultsep end
end
-- Listen splitten
local maxListLen = 0
for i = 1, #lists do
lists[i] = mw.text.split(lists[i], seps[i])
if #lists[i] > maxListLen then maxListLen = #lists[i] end
end
local result = ""
for i = 1, maxListLen do
if i ~= 1 then result = result .. outersep end
for j = 1, #lists do
if j ~= 1 then result = result .. innersep end
result = result .. (lists[j][i] or "")
end
end
return result
end
function p.failsafe()
return Text.serial
end
p.Text = function ()
return Text
end -- p.Text
return p
07f1fc4d39342fd92bdae1c5463bbfede7eeda1a
Template:Para
10
72
221
2022-07-22T08:06:17Z
wikipedia>TheDJ
0
breakup super long words, so we do not overflow the viewport.
wikitext
text/x-wiki
<code class="tpl-para" style="word-break:break-word;{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
06006deea2ed5d552aab61b4332321ab749ae7e8
Module:ISO 3166/data/National
828
211
522
2022-07-28T05:06:29Z
wikipedia>Paine Ellsworth
0
per edit request on talk page - include "U.S." initialism
Scribunto
text/plain
return {
["AD"] = {alpha3="AND",numeric="020",name="Andorra"},
["AE"] = {alpha3="ARE",numeric="784",name="United Arab Emirates",altnames={"UAE"}},
["AF"] = {alpha3="AFG",numeric="004",name="Afghanistan"},
["AG"] = {alpha3="ATG",numeric="028",name="Antigua and Barbuda"},
["AI"] = {alpha3="AIA",numeric="660",name="Anguilla"},
["AL"] = {alpha3="ALB",numeric="008",name="Albania"},
["AM"] = {alpha3="ARM",numeric="051",name="Armenia"},
["AO"] = {alpha3="AGO",numeric="024",name="Angola"},
["AQ"] = {alpha3="ATA",numeric="010",name="Antarctica"},
["AR"] = {alpha3="ARG",numeric="032",name="Argentina"},
["AS"] = {alpha3="ASM",numeric="016",name="American Samoa"},
["AT"] = {alpha3="AUT",numeric="040",name="Austria"},
["AU"] = {alpha3="AUS",numeric="036",name="Australia"},
["AW"] = {alpha3="ABW",numeric="533",name="Aruba"},
["AX"] = {alpha3="ALA",numeric="248",name="Åland Islands",altnames={"Aland Islands","Åland","Aland"}},
["AZ"] = {alpha3="AZE",numeric="031",name="Azerbaijan"},
["BA"] = {alpha3="BIH",numeric="070",name="Bosnia and Herzegovina",altnames={"Bosnia"}},
["BB"] = {alpha3="BRB",numeric="052",name="Barbados"},
["BD"] = {alpha3="BGD",numeric="050",name="Bangladesh"},
["BE"] = {alpha3="BEL",numeric="056",name="Belgium"},
["BF"] = {alpha3="BFA",numeric="854",name="Burkina Faso"},
["BG"] = {alpha3="BGR",numeric="100",name="Bulgaria"},
["BH"] = {alpha3="BHR",numeric="048",name="Bahrain"},
["BI"] = {alpha3="BDI",numeric="108",name="Burundi"},
["BJ"] = {alpha3="BEN",numeric="204",name="Benin"},
["BL"] = {alpha3="BLM",numeric="652",name="Saint Barthélemy",altnames={"St Barthelemy"}},
["BM"] = {alpha3="BMU",numeric="060",name="Bermuda"},
["BN"] = {alpha3="BRN",numeric="096",name="Brunei",isoname="Brunei Darussalam"},
["BO"] = {alpha3="BOL",numeric="068",name="Bolivia",isoname="Bolivia (Plurinational State of)"},
["BQ"] = {alpha3="BES",numeric="535",name="Caribbean Netherlands",isoname="Bonaire, Sint Eustatius and Saba"},
["BR"] = {alpha3="BRA",numeric="076",name="Brazil"},
["BS"] = {alpha3="BHS",numeric="044",name="Bahamas"},
["BT"] = {alpha3="BTN",numeric="064",name="Bhutan"},
["BV"] = {alpha3="BVT",numeric="074",name="Bouvet Island"},
["BW"] = {alpha3="BWA",numeric="072",name="Botswana"},
["BY"] = {alpha3="BLR",numeric="112",name="Belarus"},
["BZ"] = {alpha3="BLZ",numeric="084",name="Belize"},
["CA"] = {alpha3="CAN",numeric="124",name="Canada"},
["CC"] = {alpha3="CCK",numeric="166",name="Cocos (Keeling) Islands",altnames={"Cocos Islands","Keeling Islands"}},
["CD"] = {alpha3="COD",numeric="180",name="Democratic Republic of the Congo",isoname="Congo, Democratic Republic of the",altnames={"Congo-Kinshasa","DRC","DR Congo"}},
["CF"] = {alpha3="CAF",numeric="140",name="Central African Republic",altnames={"CAR"}},
["CG"] = {alpha3="COG",numeric="178",name="Republic of the Congo",isoname="Congo",altnames={"Congo-Brazzaville"}},
["CH"] = {alpha3="CHE",numeric="756",name="Switzerland"},
["CI"] = {alpha3="CIV",numeric="384",name="Côte d'Ivoire",altnames={"Ivory Coast"}},
["CK"] = {alpha3="COK",numeric="184",name="Cook Islands"},
["CL"] = {alpha3="CHL",numeric="152",name="Chile"},
["CM"] = {alpha3="CMR",numeric="120",name="Cameroon"},
["CN"] = {alpha3="CHN",numeric="156",name="China",altnames={"People's Republic of China","PRC"}},
["CO"] = {alpha3="COL",numeric="170",name="Colombia"},
["CR"] = {alpha3="CRI",numeric="188",name="Costa Rica"},
["CU"] = {alpha3="CUB",numeric="192",name="Cuba"},
["CV"] = {alpha3="CPV",numeric="132",name="Cabo Verde",altnames={"Cape Verde"}},
["CW"] = {alpha3="CUW",numeric="531",name="Curaçao",altnames={"Curacao"}},
["CX"] = {alpha3="CXR",numeric="162",name="Christmas Island"},
["CY"] = {alpha3="CYP",numeric="196",name="Cyprus"},
["CZ"] = {alpha3="CZE",numeric="203",name="Czech Republic",isoname="Czechia"},
["DE"] = {alpha3="DEU",numeric="276",name="Germany"},
["DJ"] = {alpha3="DJI",numeric="262",name="Djibouti"},
["DK"] = {alpha3="DNK",numeric="208",name="Denmark"},
["DM"] = {alpha3="DMA",numeric="212",name="Dominica"},
["DO"] = {alpha3="DOM",numeric="214",name="Dominican Republic"},
["DZ"] = {alpha3="DZA",numeric="012",name="Algeria"},
["EC"] = {alpha3="ECU",numeric="218",name="Ecuador"},
["EE"] = {alpha3="EST",numeric="233",name="Estonia"},
["EG"] = {alpha3="EGY",numeric="818",name="Egypt"},
["EH"] = {alpha3="ESH",numeric="732",name="Western Sahara"},
["ER"] = {alpha3="ERI",numeric="232",name="Eritrea"},
["ES"] = {alpha3="ESP",numeric="724",name="Spain"},
["ET"] = {alpha3="ETH",numeric="231",name="Ethiopia"},
["FI"] = {alpha3="FIN",numeric="246",name="Finland"},
["FJ"] = {alpha3="FJI",numeric="242",name="Fiji"},
["FK"] = {alpha3="FLK",numeric="238",name="Falkland Islands",isoname="Falkland Islands (Malvinas)",altnames={"Falklands","Islas Malvinas","Malvinas","Malvinas Islands"}},
["FM"] = {alpha3="FSM",numeric="583",name="Federated States of Micronesia",isoname="Micronesia (Federated States of)",altnames={"Micronesia"}},
["FO"] = {alpha3="FRO",numeric="234",name="Faroe Islands",altnames={"Faroer","Faeroer"}},
["FR"] = {alpha3="FRA",numeric="250",name="France"},
["GA"] = {alpha3="GAB",numeric="266",name="Gabon"},
["GB"] = {alpha3="GBR",numeric="826",name="United Kingdom",isoname="United Kingdom of Great Britain and Northern Ireland",altnames={"UK","Great Britain"}},
["GB-ENG"] = {alpha3="ENG",numeric="000",name="England"}, --Considered to be a country
["GB-NIR"] = {alpha3="NIR",numeric="000",name="Northern Ireland"}, --Considered to be a country
["GB-SCT"] = {alpha3="SCT",numeric="000",name="Scotland"}, --Considered to be a country
["GB-WLS"] = {alpha3="WLS",numeric="000",name="Wales"}, --Considered to be a country
["GB-EAW"] = {alpha3="EAW",numeric="000",name="England and Wales"}, --Considered to be a country
["GD"] = {alpha3="GRD",numeric="308",name="Grenada"},
["GE"] = {alpha3="GEO",numeric="268",name="Georgia"},
["GF"] = {alpha3="GUF",numeric="254",name="French Guiana"},
["GG"] = {alpha3="GGY",numeric="831",name="Guernsey"},
["GH"] = {alpha3="GHA",numeric="288",name="Ghana"},
["GI"] = {alpha3="GIB",numeric="292",name="Gibraltar"},
["GL"] = {alpha3="GRL",numeric="304",name="Greenland"},
["GM"] = {alpha3="GMB",numeric="270",name="Gambia"},
["GN"] = {alpha3="GIN",numeric="324",name="Guinea"},
["GP"] = {alpha3="GLP",numeric="312",name="Guadeloupe"},
["GQ"] = {alpha3="GNQ",numeric="226",name="Equatorial Guinea"},
["GR"] = {alpha3="GRC",numeric="300",name="Greece"},
["GS"] = {alpha3="SGS",numeric="239",name="South Georgia and the South Sandwich Islands"},
["GT"] = {alpha3="GTM",numeric="320",name="Guatemala"},
["GU"] = {alpha3="GUM",numeric="316",name="Guam"},
["GW"] = {alpha3="GNB",numeric="624",name="Guinea-Bissau"},
["GY"] = {alpha3="GUY",numeric="328",name="Guyana"},
["HK"] = {alpha3="HKG",numeric="344",name="Hong Kong",altnames={"Hong Kong SAR","HKSAR"}},
["HM"] = {alpha3="HMD",numeric="334",name="Heard Island and McDonald Islands",altnames={"Heard and McDonald Islands"}},
["HN"] = {alpha3="HND",numeric="340",name="Honduras"},
["HR"] = {alpha3="HRV",numeric="191",name="Croatia"},
["HT"] = {alpha3="HTI",numeric="332",name="Haiti"},
["HU"] = {alpha3="HUN",numeric="348",name="Hungary"},
["ID"] = {alpha3="IDN",numeric="360",name="Indonesia"},
["IE"] = {alpha3="IRL",numeric="372",name="Ireland",altnames={"Republic of Ireland"}},
["IL"] = {alpha3="ISR",numeric="376",name="Israel"},
["IM"] = {alpha3="IMN",numeric="833",name="Isle of Man"},
["IN"] = {alpha3="IND",numeric="356",name="India"},
["IO"] = {alpha3="IOT",numeric="086",name="British Indian Ocean Territory"},
["IQ"] = {alpha3="IRQ",numeric="368",name="Iraq"},
["IR"] = {alpha3="IRN",numeric="364",name="Iran",isoname="Iran (Islamic Republic of)"},
["IS"] = {alpha3="ISL",numeric="352",name="Iceland"},
["IT"] = {alpha3="ITA",numeric="380",name="Italy"},
["JE"] = {alpha3="JEY",numeric="832",name="Jersey"},
["JM"] = {alpha3="JAM",numeric="388",name="Jamaica"},
["JO"] = {alpha3="JOR",numeric="400",name="Jordan"},
["JP"] = {alpha3="JPN",numeric="392",name="Japan"},
["KE"] = {alpha3="KEN",numeric="404",name="Kenya"},
["KG"] = {alpha3="KGZ",numeric="417",name="Kyrgyzstan"},
["KH"] = {alpha3="KHM",numeric="116",name="Cambodia"},
["KI"] = {alpha3="KIR",numeric="296",name="Kiribati"},
["KM"] = {alpha3="COM",numeric="174",name="Comoros"},
["KN"] = {alpha3="KNA",numeric="659",name="Saint Kitts and Nevis",altnames={"St Kitts and Nevis"}},
["KP"] = {alpha3="PRK",numeric="408",name="North Korea",isoname="Korea (Democratic People's Republic of)",altnames={"Democratic People's Republic of Korea"}},
["KR"] = {alpha3="KOR",numeric="410",name="South Korea",isoname="Korea, Republic of",altnames={"Republic of Korea"}},
["KW"] = {alpha3="KWT",numeric="414",name="Kuwait"},
["KY"] = {alpha3="CYM",numeric="136",name="Cayman Islands"},
["KZ"] = {alpha3="KAZ",numeric="398",name="Kazakhstan"},
["LA"] = {alpha3="LAO",numeric="418",name="Laos",isoname="Lao People's Democratic Republic"},
["LB"] = {alpha3="LBN",numeric="422",name="Lebanon"},
["LC"] = {alpha3="LCA",numeric="662",name="Saint Lucia",altnames={"St Lucia"}},
["LI"] = {alpha3="LIE",numeric="438",name="Liechtenstein"},
["LK"] = {alpha3="LKA",numeric="144",name="Sri Lanka"},
["LR"] = {alpha3="LBR",numeric="430",name="Liberia"},
["LS"] = {alpha3="LSO",numeric="426",name="Lesotho"},
["LT"] = {alpha3="LTU",numeric="440",name="Lithuania"},
["LU"] = {alpha3="LUX",numeric="442",name="Luxembourg"},
["LV"] = {alpha3="LVA",numeric="428",name="Latvia"},
["LY"] = {alpha3="LBY",numeric="434",name="Libya"},
["MA"] = {alpha3="MAR",numeric="504",name="Morocco"},
["MC"] = {alpha3="MCO",numeric="492",name="Monaco"},
["MD"] = {alpha3="MDA",numeric="498",name="Moldova",isoname="Moldova, Republic of"},
["ME"] = {alpha3="MNE",numeric="499",name="Montenegro"},
["MF"] = {alpha3="MAF",numeric="663",name="Saint-Martin",isoname="Saint Martin (French part)",altnames={"St Martin","St Martin (French part)","Collectivity of Saint Martin","Collectivity of St Martin"}},
["MG"] = {alpha3="MDG",numeric="450",name="Madagascar"},
["MH"] = {alpha3="MHL",numeric="584",name="Marshall Islands"},
["MK"] = {alpha3="MKD",numeric="807",name="North Macedonia",altnames={"Republic of North Macedonia","Macedonia","Republic of Macedonia","Macedonia, the former Yugoslav Republic of"}},
["ML"] = {alpha3="MLI",numeric="466",name="Mali"},
["MM"] = {alpha3="MMR",numeric="104",name="Myanmar",altnames={"Burma"}},
["MN"] = {alpha3="MNG",numeric="496",name="Mongolia"},
["MO"] = {alpha3="MAC",numeric="446",name="Macau",isoname="Macao",altnames={"Macau SAR","Macao SAR"}},
["MP"] = {alpha3="MNP",numeric="580",name="Northern Mariana Islands"},
["MQ"] = {alpha3="MTQ",numeric="474",name="Martinique"},
["MR"] = {alpha3="MRT",numeric="478",name="Mauritania"},
["MS"] = {alpha3="MSR",numeric="500",name="Montserrat"},
["MT"] = {alpha3="MLT",numeric="470",name="Malta"},
["MU"] = {alpha3="MUS",numeric="480",name="Mauritius"},
["MV"] = {alpha3="MDV",numeric="462",name="Maldives"},
["MW"] = {alpha3="MWI",numeric="454",name="Malawi"},
["MX"] = {alpha3="MEX",numeric="484",name="Mexico"},
["MY"] = {alpha3="MYS",numeric="458",name="Malaysia"},
["MZ"] = {alpha3="MOZ",numeric="508",name="Mozambique"},
["NA"] = {alpha3="NAM",numeric="516",name="Namibia"},
["NC"] = {alpha3="NCL",numeric="540",name="New Caledonia"},
["NE"] = {alpha3="NER",numeric="562",name="Niger"},
["NF"] = {alpha3="NFK",numeric="574",name="Norfolk Island"},
["NG"] = {alpha3="NGA",numeric="566",name="Nigeria"},
["NI"] = {alpha3="NIC",numeric="558",name="Nicaragua"},
["NL"] = {alpha3="NLD",numeric="528",name="Netherlands"},
["NO"] = {alpha3="NOR",numeric="578",name="Norway"},
["NP"] = {alpha3="NPL",numeric="524",name="Nepal"},
["NR"] = {alpha3="NRU",numeric="520",name="Nauru"},
["NU"] = {alpha3="NIU",numeric="570",name="Niue"},
["NZ"] = {alpha3="NZL",numeric="554",name="New Zealand",altnames={"Aotearoa"}},
["OM"] = {alpha3="OMN",numeric="512",name="Oman"},
["PA"] = {alpha3="PAN",numeric="591",name="Panama"},
["PE"] = {alpha3="PER",numeric="604",name="Peru"},
["PF"] = {alpha3="PYF",numeric="258",name="French Polynesia"},
["PG"] = {alpha3="PNG",numeric="598",name="Papua New Guinea"},
["PH"] = {alpha3="PHL",numeric="608",name="Philippines"},
["PK"] = {alpha3="PAK",numeric="586",name="Pakistan"},
["PL"] = {alpha3="POL",numeric="616",name="Poland"},
["PM"] = {alpha3="SPM",numeric="666",name="Saint Pierre and Miquelon",altnames={"St Pierre and Miquelon"}},
["PN"] = {alpha3="PCN",numeric="612",name="Pitcairn"},
["PR"] = {alpha3="PRI",numeric="630",name="Puerto Rico"},
["PS"] = {alpha3="PSE",numeric="275",name="Palestine",isoname="Palestine, State of",altnames={"State of Palestine"}},
["PT"] = {alpha3="PRT",numeric="620",name="Portugal"},
["PW"] = {alpha3="PLW",numeric="585",name="Palau"},
["PY"] = {alpha3="PRY",numeric="600",name="Paraguay"},
["QA"] = {alpha3="QAT",numeric="634",name="Qatar"},
["RE"] = {alpha3="REU",numeric="638",name="Réunion"},
["RO"] = {alpha3="ROU",numeric="642",name="Romania"},
["RS"] = {alpha3="SRB",numeric="688",name="Serbia"},
["RU"] = {alpha3="RUS",numeric="643",name="Russia",isoname="Russian Federation"},
["RW"] = {alpha3="RWA",numeric="646",name="Rwanda"},
["SA"] = {alpha3="SAU",numeric="682",name="Saudi Arabia"},
["SB"] = {alpha3="SLB",numeric="090",name="Solomon Islands"},
["SC"] = {alpha3="SYC",numeric="690",name="Seychelles"},
["SD"] = {alpha3="SDN",numeric="729",name="Sudan"},
["SE"] = {alpha3="SWE",numeric="752",name="Sweden"},
["SG"] = {alpha3="SGP",numeric="702",name="Singapore"},
["SH"] = {alpha3="SHN",numeric="654",name="Saint Helena, Ascension and Tristan da Cunha"},
["SI"] = {alpha3="SVN",numeric="705",name="Slovenia"},
["SJ"] = {alpha3="SJM",numeric="744",name="Svalbard and Jan Mayen"},
["SK"] = {alpha3="SVK",numeric="703",name="Slovakia"},
["SL"] = {alpha3="SLE",numeric="694",name="Sierra Leone"},
["SM"] = {alpha3="SMR",numeric="674",name="San Marino"},
["SN"] = {alpha3="SEN",numeric="686",name="Senegal"},
["SO"] = {alpha3="SOM",numeric="706",name="Somalia"},
["SR"] = {alpha3="SUR",numeric="740",name="Suriname"},
["SS"] = {alpha3="SSD",numeric="728",name="South Sudan"},
["ST"] = {alpha3="STP",numeric="678",name="São Tomé and Príncipe",isoname="Sao Tome and Principe",altnames={"Democratic Republic of Sao Tome and Principe"}},
["SV"] = {alpha3="SLV",numeric="222",name="El Salvador"},
["SX"] = {alpha3="SXM",numeric="534",name="Sint Maarten",isoname="Sint Maarten (Dutch part)",altnames={"St Maarten","Saint Martin (Dutch part)","St Martin (Dutch part)"}},
["SY"] = {alpha3="SYR",numeric="760",name="Syria",isoname="Syrian Arab Republic"},
["SZ"] = {alpha3="SWZ",numeric="748",name="Eswatini",altnames={"Swaziland"}},
["TC"] = {alpha3="TCA",numeric="796",name="Turks and Caicos Islands"},
["TD"] = {alpha3="TCD",numeric="148",name="Chad"},
["TF"] = {alpha3="ATF",numeric="260",name="French Southern and Antarctic Lands",isoname="French Southern Territories"},
["TG"] = {alpha3="TGO",numeric="768",name="Togo"},
["TH"] = {alpha3="THA",numeric="764",name="Thailand"},
["TJ"] = {alpha3="TJK",numeric="762",name="Tajikistan"},
["TK"] = {alpha3="TKL",numeric="772",name="Tokelau"},
["TL"] = {alpha3="TLS",numeric="626",name="Timor-Leste",altnames={"East Timor"}},
["TM"] = {alpha3="TKM",numeric="795",name="Turkmenistan"},
["TN"] = {alpha3="TUN",numeric="788",name="Tunisia"},
["TO"] = {alpha3="TON",numeric="776",name="Tonga"},
["TR"] = {alpha3="TUR",numeric="792",name="Turkey",isoname="Türkiye"},
["TT"] = {alpha3="TTO",numeric="780",name="Trinidad and Tobago"},
["TV"] = {alpha3="TUV",numeric="798",name="Tuvalu"},
["TW"] = {alpha3="TWN",numeric="158",name="Taiwan",isoname="Taiwan, Province of China",altnames={"Republic of China"}},
["TZ"] = {alpha3="TZA",numeric="834",name="Tanzania",isoname="Tanzania, United Republic of"},
["UA"] = {alpha3="UKR",numeric="804",name="Ukraine"},
["UG"] = {alpha3="UGA",numeric="800",name="Uganda"},
["UM"] = {alpha3="UMI",numeric="581",name="United States Minor Outlying Islands"},
["US"] = {alpha3="USA",numeric="840",name="United States",isoname="United States of America",altnames={"US","USA","U.S."}},
["UY"] = {alpha3="URY",numeric="858",name="Uruguay"},
["UZ"] = {alpha3="UZB",numeric="860",name="Uzbekistan"},
["VA"] = {alpha3="VAT",numeric="336",name="Vatican City",isoname="Holy See",altnames={"Holy See (Vatican City State)","Vatican City State"}},
["VC"] = {alpha3="VCT",numeric="670",name="Saint Vincent and the Grenadines",altnames={"St Vincent and the Grenadines"}},
["VE"] = {alpha3="VEN",numeric="862",name="Venezuela",isoname="Venezuela (Bolivarian Republic of)"},
["VG"] = {alpha3="VGB",numeric="092",name="British Virgin Islands",isoname="Virgin Islands (British)",altnames={"UK Virgin Islands","BVI"}},
["VI"] = {alpha3="VIR",numeric="850",name="United States Virgin Islands",isoname="Virgin Islands (U.S.)",altnames={"US Virgin Islands","USVI"}},
["VN"] = {alpha3="VNM",numeric="704",name="Vietnam",isoname="Viet Nam"},
["VU"] = {alpha3="VUT",numeric="548",name="Vanuatu"},
["WF"] = {alpha3="WLF",numeric="876",name="Wallis and Futuna"},
["WS"] = {alpha3="WSM",numeric="882",name="Samoa"},
["YE"] = {alpha3="YEM",numeric="887",name="Yemen"},
["YT"] = {alpha3="MYT",numeric="175",name="Mayotte"},
["ZA"] = {alpha3="ZAF",numeric="710",name="South Africa"},
["ZM"] = {alpha3="ZMB",numeric="894",name="Zambia"},
["ZW"] = {alpha3="ZWE",numeric="716",name="Zimbabwe"}
}
1ae753fe1fa53ce062b0a008dbc9778d589666f0
Template:Collapse bottom
10
139
377
2022-08-21T18:03:39Z
wikipedia>MSGJ
0
Undid revision 1105766128 by [[Special:Contributions/MSGJ|MSGJ]] ([[User talk:MSGJ|talk]]) - did not work
wikitext
text/x-wiki
<includeonly>|}</div></includeonly><noinclude>
{{Documentation|Template:Collapse top/doc}}
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
64b210e8ab0882b262da50e9fbccf2132bc34fab
Template:Cite gnis
10
220
542
2022-08-23T17:13:23Z
wikipedia>Buaidh
0
United States Geological Survey
wikitext
text/x-wiki
<includeonly>{{#if: {{{1|{{{id|}}}}}}
| {{#if: {{{2|{{{title|{{{name|}}}}}}}}}
| {{#invoke:Template wrapper|wrap|_template=cite encyclopedia
|_exclude=type,id,links
|_alias-map=2:entry,3:access-date,4:date,title:entry,name:entry,entrydate:date,entry-date:date
|entry-url={{GNIS URL|{{{1|{{{id|}}}}}}|type={{{type|}}}}}
|encyclopedia={{#ifeq:{{{links|}}}|off
| Geographic Names Information System
| [[Geographic Names Information System]]}}
|publisher={{#ifeq:{{{links|}}}|off
| United States Geological Survey
| [[United States Geological Survey]], [[United States Department of the Interior]]}}
}}
| {{Citation error|no {{para|name}} specified|cite gnis|nocat={{main other||true}}}}
}}
| {{Citation error|no {{para|id}} specified|cite gnis|nocat={{main other||true}}}}
}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
</noinclude>
aeda754dbc81d9f8afc8137e281196e096705d9d
Module:Hatnote
828
60
191
2022-09-05T18:18:32Z
wikipedia>Nihiltres
0
Reordered helper functions (first by export status, then alphabetically) and migrated p.quote upstream from [[Module:Redirect hatnote]] (includes contributions by Tamzin and Nihiltres)
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote --
-- --
-- This module produces hatnote links and links to related articles. It --
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local formatLink -- lazily initialise [[Module:Format link]] ._formatLink
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
function p.defaultClasses(inline)
-- Provides the default hatnote classes as a space-separated string; useful
-- for hatnote-manipulation modules like [[Module:Hatnote group]].
return
(inline == 1 and 'hatnote-inline' or 'hatnote') .. ' ' ..
'navigation-not-searchable'
end
function p.disambiguate(page, disambiguator)
-- Formats a page title with a disambiguation parenthetical,
-- i.e. "Example" → "Example (disambiguation)".
checkType('disambiguate', 1, page, 'string')
checkType('disambiguate', 2, disambiguator, 'string', true)
disambiguator = disambiguator or 'disambiguation'
return mw.ustring.format('%s (%s)', page, disambiguator)
end
function p.findNamespaceId(link, removeColon)
-- Finds the namespace id (namespace number) of a link or a pagename. This
-- function will not work if the link is enclosed in double brackets. Colons
-- are trimmed from the start of the link by default. To skip colon
-- trimming, set the removeColon parameter to false.
checkType('findNamespaceId', 1, link, 'string')
checkType('findNamespaceId', 2, removeColon, 'boolean', true)
if removeColon ~= false then
link = removeInitialColon(link)
end
local namespace = link:match('^(.-):')
if namespace then
local nsTable = mw.site.namespaces[namespace]
if nsTable then
return nsTable.id
end
end
return 0
end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
-- Formats an error message to be returned to wikitext. If
-- addTrackingCategory is not false after being returned from
-- [[Module:Yesno]], and if we are not on a talk page, a tracking category
-- is added.
checkType('makeWikitextError', 1, msg, 'string')
checkType('makeWikitextError', 2, helpLink, 'string', true)
yesno = require('Module:Yesno')
title = title or mw.title.getCurrentTitle()
-- Make the help link text.
local helpText
if helpLink then
helpText = ' ([[' .. helpLink .. '|help]])'
else
helpText = ''
end
-- Make the category text.
local category
if not title.isTalkPage -- Don't categorise talk pages
and title.namespace ~= 2 -- Don't categorise userspace
and yesno(addTrackingCategory) ~= false -- Allow opting out
then
category = 'Hatnote templates with errors'
category = mw.ustring.format(
'[[%s:%s]]',
mw.site.namespaces[14].name,
category
)
else
category = ''
end
return mw.ustring.format(
'<strong class="error">Error: %s%s.</strong>%s',
msg,
helpText,
category
)
end
local curNs = mw.title.getCurrentTitle().namespace
p.missingTargetCat =
--Default missing target category, exported for use in related modules
((curNs == 0) or (curNs == 14)) and
'Articles with hatnote templates targeting a nonexistent page' or nil
function p.quote(title)
--Wraps titles in quotation marks. If the title starts/ends with a quotation
--mark, kerns that side as with {{-'}}
local quotationMarks = {
["'"]=true, ['"']=true, ['“']=true, ["‘"]=true, ['”']=true, ["’"]=true
}
local quoteLeft, quoteRight = -- Test if start/end are quotation marks
quotationMarks[string.sub(title, 1, 1)],
quotationMarks[string.sub(title, -1, -1)]
if quoteLeft or quoteRight then
title = mw.html.create("span"):wikitext(title)
end
if quoteLeft then title:css("padding-left", "0.15em") end
if quoteRight then title:css("padding-right", "0.15em") end
return '"' .. tostring(title) .. '"'
end
--------------------------------------------------------------------------------
-- Hatnote
--
-- Produces standard hatnote text. Implements the {{hatnote}} template.
--------------------------------------------------------------------------------
function p.hatnote(frame)
local args = getArgs(frame)
local s = args[1]
if not s then
return p.makeWikitextError(
'no text specified',
'Template:Hatnote#Errors',
args.category
)
end
return p._hatnote(s, {
extraclasses = args.extraclasses,
selfref = args.selfref
})
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
checkType('_hatnote', 2, options, 'table', true)
options = options or {}
local inline = options.inline
local hatnote = mw.html.create(inline == 1 and 'span' or 'div')
local extraclasses
if type(options.extraclasses) == 'string' then
extraclasses = options.extraclasses
end
hatnote
:attr('role', 'note')
:addClass(p.defaultClasses(inline))
:addClass(extraclasses)
:addClass(options.selfref and 'selfref' or nil)
:wikitext(s)
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
} .. tostring(hatnote)
end
return p
3ae1ed7094c5005ca0896395ec9a587287a0bef1
Module:URL
828
207
514
2022-09-11T18:55:11Z
wikipedia>Paine Ellsworth
0
per edit request on talk page - update
Scribunto
text/plain
--
-- This module implements {{URL}}
--
-- See unit tests at [[Module:URL/testcases]]
local p = {}
local function safeUri(s)
local success, uri = pcall(function()
return mw.uri.new(s)
end)
if success then
return uri
end
end
local function extractUrl(args)
for name, val in pairs(args) do
if name ~= 2 and name ~= "msg" then
local url = name .. "=" .. val;
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
local uri = safeUri(url);
if uri and uri.host then
return url
end
end
end
end
function p._url(url, text, msg)
url = mw.text.trim(url or '')
text = mw.text.trim(text or '')
local nomsg = (msg or ''):sub(1,1):lower() == "n" or msg == 'false' -- boolean: true if msg is "false" or starts with n or N
if url == '' then
if text == '' then
if nomsg then
return nil
else
return mw.getCurrentFrame():expandTemplate{ title = 'tlx', args = { 'URL', "''example.com''", "''optional display text''" } }
end
else
return text
end
end
-- If the URL contains any unencoded spaces, encode them, because MediaWiki will otherwise interpret a space as the end of the URL.
url = mw.ustring.gsub(url, '%s', function(s) return mw.uri.encode(s, 'PATH') end)
-- If there is an empty query string or fragment id, remove it as it will cause mw.uri.new to throw an error
url = mw.ustring.gsub(url, '#$', '')
url = mw.ustring.gsub(url, '%?$', '')
-- If it's an HTTP[S] URL without the double slash, fix it.
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
local uri = safeUri(url)
-- Handle URL's without a protocol and URL's that are protocol-relative,
-- e.g. www.example.com/foo or www.example.com:8080/foo, and //www.example.com/foo
if uri and (not uri.protocol or (uri.protocol and not uri.host)) and url:sub(1, 2) ~= '//' then
url = 'http://' .. url
uri = safeUri(url)
end
if text == '' then
if uri then
if uri.path == '/' then uri.path = '' end
local port = ''
if uri.port then port = ':' .. uri.port end
text = mw.ustring.lower(uri.host or '') .. port .. (uri.relativePath or '')
-- Add <wbr> before _/.-# sequences
text = mw.ustring.gsub(text,"(/+)","<wbr/>%1") -- This entry MUST be the first. "<wbr/>" has a "/" in it, you know.
text = mw.ustring.gsub(text,"(%.+)","<wbr/>%1")
-- text = mw.ustring.gsub(text,"(%-+)","<wbr/>%1") -- DISABLED for now
text = mw.ustring.gsub(text,"(%#+)","<wbr/>%1")
text = mw.ustring.gsub(text,"(_+)","<wbr/>%1")
else -- URL is badly-formed, so just display whatever was passed in
text = url
end
end
return mw.ustring.format('<span class="url">[%s %s]</span>', url, text)
end
--[[
The main entry point for calling from Template:URL.
--]]
function p.url(frame)
local templateArgs = frame.args
local parentArgs = frame:getParent().args
local url = templateArgs[1] or parentArgs[1]
local text = templateArgs[2] or parentArgs[2] or ''
local msg = templateArgs.msg or parentArgs.msg or ''
url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or ''
return p._url(url, text, msg)
end
--[[
The entry point for calling from the forked Template:URL2.
This function returns no message by default.
It strips out wiki-link markup, html tags, and everything after a space.
--]]
function p.url2(frame)
local templateArgs = frame.args
local parentArgs = frame:getParent().args
local url = templateArgs[1] or parentArgs[1]
local text = templateArgs[2] or parentArgs[2] or ''
-- default to no message
local msg = templateArgs.msg or parentArgs.msg or 'no'
url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or ''
-- if the url came from a Wikidata call, it might have a pen icon appended
-- we want to keep that and add it back at the end.
local u1, penicon = mw.ustring.match( url, "(.*)( <span class='penicon.*)" )
if penicon then url = u1 end
-- strip out html tags and [ ] from url
url = (url or ''):gsub("<[^>]*>", ""):gsub("[%[%]]", "")
-- truncate anything after a space
url = url:gsub("%%20", " "):gsub(" .*", "")
return (p._url(url, text, msg) or "") .. (penicon or "")
end
return p
8d7a4c6fe04a01815e940475cf64b28e1ef48cfb
Template:Tl
10
36
101
2022-09-30T01:09:19Z
dev>Pppery
0
Redirected page to [[Template:Template link]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
fb9a6b420e13178e581af6e7d64274cd30a79017
Template:Template link
10
35
99
2022-09-30T01:10:00Z
dev>Pppery
0
46 revisions imported from [[:wikipedia:Template:Template_link]]
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eabbec62efe3044a98ebb3ce9e7d4d43c222351d
Template:Documentation
10
12
87
2022-09-30T01:43:37Z
dev>MacFan4000
0
4 revisions imported from [[:meta:Template:Documentation]]: this is useful and was on templateiwki
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>[[Category:Templates]]</noinclude>
9885bb4fa99bf3d5b960e73606bbb8eed3026877
Template:Tlx
10
40
115
2022-09-30T02:04:32Z
dev>Pppery
0
Redirected page to [[Template:Template link expanded]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link expanded]]
155e901040104f96908f1f4627c4eb3501301bf9
MediaWiki:Common.css
8
42
121
2022-09-30T02:30:44Z
dev>MirahezeGDPR a51581232c7cc84ec1a32c40d8489548
0
Removed protection from "[[MediaWiki:Common.css]]": Unnecessary with already existing interface administrator group only given to trusted users (plus, this is a CSS page not a JavaScript page)
css
text/css
/* Default style for navigation boxes */
.navbox { /* Navbox container style */
box-sizing: border-box;
border: 1px solid #a2a9b1;
width: 100%;
clear: both;
font-size: 88%;
text-align: center;
padding: 1px;
margin: 1em auto 0; /* Prevent preceding content from clinging to navboxes */
}
.navbox .navbox {
margin-top: 0; /* No top margin for nested navboxes */
}
.navbox + .navbox {
margin-top: -1px; /* Single pixel border between adjacent navboxes */
}
.navbox-inner,
.navbox-subgroup {
width: 100%;
}
.navbox-group,
.navbox-title,
.navbox-abovebelow {
padding: 0.25em 1em; /* Title, group and above/below styles */
line-height: 1.5em;
text-align: center;
}
th.navbox-group { /* Group style */
white-space: nowrap;
/* @noflip */
text-align: right;
}
.navbox,
.navbox-subgroup {
background-color: #fdfdfd; /* Background color */
}
.navbox-list {
line-height: 1.5em;
border-color: #fdfdfd; /* Must match background color */
}
/* cell spacing for navbox cells */
tr + tr > .navbox-abovebelow,
tr + tr > .navbox-group,
tr + tr > .navbox-image,
tr + tr > .navbox-list { /* Borders above 2nd, 3rd, etc. rows */
border-top: 2px solid #fdfdfd; /* Must match background color */
}
.navbox th,
.navbox-title {
background-color: #ccccff; /* Level 1 color */
}
.navbox-abovebelow,
th.navbox-group,
.navbox-subgroup .navbox-title {
background-color: #ddddff; /* Level 2 color */
}
.navbox-subgroup .navbox-group,
.navbox-subgroup .navbox-abovebelow {
background-color: #e6e6ff; /* Level 3 color */
}
.navbox-even {
background-color: #f7f7f7; /* Even row striping */
}
.navbox-odd {
background-color: transparent; /* Odd row striping */
}
.navbox .hlist td dl,
.navbox .hlist td ol,
.navbox .hlist td ul,
.navbox td.hlist dl,
.navbox td.hlist ol,
.navbox td.hlist ul {
padding: 0.125em 0; /* Adjust hlist padding in navboxes */
}
/* Default styling for Navbar template */
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar ul {
display: inline;
white-space: nowrap;
}
.mw-body-content .navbar ul {
line-height: inherit;
}
.navbar li {
word-spacing: -0.125em;
}
.navbar.mini li abbr[title] {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
/* Navbar styling when nested in infobox and navbox */
.infobox .navbar {
font-size: 100%;
}
.navbox .navbar {
display: block;
font-size: 100%;
}
.navbox-title .navbar {
/* @noflip */
float: left;
/* @noflip */
text-align: left;
/* @noflip */
margin-right: 0.5em;
}
.infobox {
border: 1px solid #a2a9b1;
border-spacing: 3px;
background-color: #f8f9fa;
color: black;
/* @noflip */
margin: 0.5em 0 0.5em 1em;
padding: 0.2em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
font-size: 88%;
line-height: 1.5em;
}
.infobox caption {
font-size: 125%;
font-weight: bold;
padding: 0.2em;
text-align: center;
}
.infobox td,
.infobox th {
vertical-align: top;
/* @noflip */
text-align: left;
}
.infobox.bordered {
border-collapse: collapse;
}
.infobox.bordered td,
.infobox.bordered th {
border: 1px solid #a2a9b1;
}
.infobox.bordered .borderless td,
.infobox.bordered .borderless th {
border: 0;
}
.infobox.sisterproject {
width: 20em;
font-size: 90%;
}
.infobox.standard-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
}
.infobox.standard-talk.bordered td,
.infobox.standard-talk.bordered th {
border: 1px solid #c0c090;
}
/* styles for bordered infobox with merged rows */
.infobox.bordered .mergedtoprow td,
.infobox.bordered .mergedtoprow th {
border: 0;
border-top: 1px solid #a2a9b1;
/* @noflip */
border-right: 1px solid #a2a9b1;
}
.infobox.bordered .mergedrow td,
.infobox.bordered .mergedrow th {
border: 0;
/* @noflip */
border-right: 1px solid #a2a9b1;
}
/* Styles for geography infoboxes, eg countries,
country subdivisions, cities, etc. */
.infobox.geography {
border-collapse: collapse;
line-height: 1.2em;
font-size: 90%;
}
.infobox.geography td,
.infobox.geography th {
border-top: 1px solid #a2a9b1;
padding: 0.4em 0.6em 0.4em 0.6em;
}
.infobox.geography .mergedtoprow td,
.infobox.geography .mergedtoprow th {
border-top: 1px solid #a2a9b1;
padding: 0.4em 0.6em 0.2em 0.6em;
}
.infobox.geography .mergedrow td,
.infobox.geography .mergedrow th {
border: 0;
padding: 0 0.6em 0.2em 0.6em;
}
.infobox.geography .mergedbottomrow td,
.infobox.geography .mergedbottomrow th {
border-top: 0;
border-bottom: 1px solid #a2a9b1;
padding: 0 0.6em 0.4em 0.6em;
}
.infobox.geography .maptable td,
.infobox.geography .maptable th {
border: 0;
padding: 0;
}
div.listenlist {
background: url("//upload.wikimedia.org/wikipedia/commons/4/47/Sound-icon.svg") no-repeat scroll 0 0 transparent;
background-size: 30px;
padding-left: 40px;
}
/* Fix for hieroglyphs specificity issue in infoboxes ([[phab:T43869]]) */
table.mw-hiero-table td {
vertical-align: middle;
}
/* Style rules for media list templates */
/* TemplateStyles */
div.medialist {
min-height: 50px;
margin: 1em;
/* @noflip */
background-position: top left;
background-repeat: no-repeat;
}
div.medialist ul {
list-style-type: none;
list-style-image: none;
margin: 0;
}
div.medialist ul li {
padding-bottom: 0.5em;
}
div.medialist ul li li {
font-size: 91%;
padding-bottom: 0;
}
/* Messagebox templates */
.messagebox {
border: 1px solid #a2a9b1;
background-color: #f8f9fa;
width: 80%;
margin: 0 auto 1em auto;
padding: .2em;
}
.messagebox.merge {
border: 1px solid #c0b8cc;
background-color: #f0e5ff;
text-align: center;
}
.messagebox.cleanup {
border: 1px solid #9f9fff;
background-color: #efefff;
text-align: center;
}
.messagebox.standard-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
margin: 4px auto;
}
/* For old WikiProject banners inside banner shells. */
.mbox-inside .standard-talk,
.messagebox.nested-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
width: 100%;
margin: 2px 0;
padding: 2px;
}
.messagebox.small {
width: 238px;
font-size: 85%;
/* @noflip */
float: right;
clear: both;
/* @noflip */
margin: 0 0 1em 1em;
line-height: 1.25em;
}
.messagebox.small-talk {
width: 238px;
font-size: 85%;
/* @noflip */
float: right;
clear: both;
/* @noflip */
margin: 0 0 1em 1em;
line-height: 1.25em;
background-color: #F8EABA;
}
/* Cell sizes for ambox/tmbox/imbox/cmbox/ombox/fmbox/dmbox message boxes */
th.mbox-text, td.mbox-text { /* The message body cell(s) */
border: none;
/* @noflip */
padding: 0.25em 0.9em; /* 0.9em left/right */
width: 100%; /* Make all mboxes the same width regardless of text length */
}
td.mbox-image { /* The left image cell */
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em; /* 0.9em left, 0px right */
text-align: center;
}
td.mbox-imageright { /* The right image cell */
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0; /* 0px left, 0.9em right */
text-align: center;
}
td.mbox-empty-cell { /* An empty narrow cell */
border: none;
padding: 0;
width: 1px;
}
/* Article message box styles */
table.ambox {
margin: 0 10%; /* 10% = Will not overlap with other elements */
border: 1px solid #a2a9b1;
/* @noflip */
border-left: 10px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
table.ambox + table.ambox { /* Single border between stacked boxes. */
margin-top: -1px;
}
.ambox th.mbox-text,
.ambox td.mbox-text { /* The message body cell(s) */
padding: 0.25em 0.5em; /* 0.5em left/right */
}
.ambox td.mbox-image { /* The left image cell */
/* @noflip */
padding: 2px 0 2px 0.5em; /* 0.5em left, 0px right */
}
.ambox td.mbox-imageright { /* The right image cell */
/* @noflip */
padding: 2px 0.5em 2px 0; /* 0px left, 0.5em right */
}
table.ambox-notice {
/* @noflip */
border-left: 10px solid #36c; /* Blue */
}
table.ambox-speedy {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.ambox-delete {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
}
table.ambox-content {
/* @noflip */
border-left: 10px solid #f28500; /* Orange */
}
table.ambox-style {
/* @noflip */
border-left: 10px solid #fc3; /* Yellow */
}
table.ambox-move {
/* @noflip */
border-left: 10px solid #9932cc; /* Purple */
}
table.ambox-protection {
/* @noflip */
border-left: 10px solid #a2a9b1; /* Gray-gold */
}
/* Image message box styles */
table.imbox {
margin: 4px 10%;
border-collapse: collapse;
border: 3px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
.imbox .mbox-text .imbox { /* For imboxes inside imbox-text cells. */
margin: 0 -0.5em; /* 0.9 - 0.5 = 0.4em left/right. */
display: block; /* Fix for webkit to force 100% width. */
}
.mbox-inside .imbox { /* For imboxes inside other templates. */
margin: 4px;
}
table.imbox-notice {
border: 3px solid #36c; /* Blue */
}
table.imbox-speedy {
border: 3px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.imbox-delete {
border: 3px solid #b32424; /* Red */
}
table.imbox-content {
border: 3px solid #f28500; /* Orange */
}
table.imbox-style {
border: 3px solid #fc3; /* Yellow */
}
table.imbox-move {
border: 3px solid #9932cc; /* Purple */
}
table.imbox-protection {
border: 3px solid #a2a9b1; /* Gray-gold */
}
table.imbox-license {
border: 3px solid #88a; /* Dark gray */
background-color: #f7f8ff; /* Light gray */
}
table.imbox-featured {
border: 3px solid #cba135; /* Brown-gold */
}
/* Category message box styles */
table.cmbox {
margin: 3px 10%;
border-collapse: collapse;
border: 1px solid #a2a9b1;
background-color: #DFE8FF; /* Default "notice" blue */
box-sizing: border-box;
}
table.cmbox-notice {
background-color: #D8E8FF; /* Blue */
}
table.cmbox-speedy {
margin-top: 4px;
margin-bottom: 4px;
border: 4px solid #b32424; /* Red */
background-color: #FFDBDB; /* Pink */
}
table.cmbox-delete {
background-color: #FFDBDB; /* Red */
}
table.cmbox-content {
background-color: #FFE7CE; /* Orange */
}
table.cmbox-style {
background-color: #FFF9DB; /* Yellow */
}
table.cmbox-move {
background-color: #E4D8FF; /* Purple */
}
table.cmbox-protection {
background-color: #EFEFE1; /* Gray-gold */
}
/* Other pages message box styles */
table.ombox {
margin: 4px 10%;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
table.ombox-notice {
border: 1px solid #a2a9b1; /* Gray */
}
table.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.ombox-delete {
border: 2px solid #b32424; /* Red */
}
table.ombox-content {
border: 1px solid #f28500; /* Orange */
}
table.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
table.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
table.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
/* Talk page message box styles */
table.tmbox {
margin: 4px 10%;
border-collapse: collapse;
border: 1px solid #c0c090; /* Default "notice" gray-brown */
background-color: #f8eaba;
min-width: 80%;
box-sizing: border-box;
}
.tmbox.mbox-small {
min-width: 0; /* reset the min-width of tmbox above */
}
.mediawiki .mbox-inside .tmbox { /* For tmboxes inside other templates. The "mediawiki" class ensures that */
margin: 2px 0; /* this declaration overrides other styles (including mbox-small above) */
width: 100%; /* For Safari and Opera */
}
.mbox-inside .tmbox.mbox-small { /* "small" tmboxes should not be small when */
line-height: 1.5em; /* also "nested", so reset styles that are */
font-size: 100%; /* set in "mbox-small" above. */
}
table.tmbox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.tmbox-delete {
border: 2px solid #b32424; /* Red */
}
table.tmbox-content {
border: 2px solid #f28500; /* Orange */
}
table.tmbox-style {
border: 2px solid #fc3; /* Yellow */
}
table.tmbox-move {
border: 2px solid #9932cc; /* Purple */
}
table.tmbox-protection,
table.tmbox-notice {
border: 1px solid #c0c090; /* Gray-brown */
}
/* Disambig and set index box styles */
table.dmbox {
clear: both;
margin: 0.9em 1em;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
background-color: transparent;
}
/* Footer and header message box styles */
table.fmbox {
clear: both;
margin: 0.2em 0;
width: 100%;
border: 1px solid #a2a9b1;
background-color: #f8f9fa; /* Default "system" gray */
box-sizing: border-box;
}
table.fmbox-system {
background-color: #f8f9fa;
}
table.fmbox-warning {
border: 1px solid #bb7070; /* Dark pink */
background-color: #ffdbdb; /* Pink */
}
table.fmbox-editnotice {
background-color: transparent;
}
/* Div based "warning" style fmbox messages. */
div.mw-warning-with-logexcerpt,
div.mw-lag-warn-high,
div.mw-cascadeprotectedwarning,
div#mw-protect-cascadeon,
div.titleblacklist-warning,
div.locked-warning {
clear: both;
margin: 0.2em 0;
border: 1px solid #bb7070;
background-color: #ffdbdb;
padding: 0.25em 0.9em;
box-sizing: border-box;
}
/* These mbox-small classes must be placed after all other
ambox/tmbox/ombox etc classes. "html body.mediawiki" is so
they override "table.ambox + table.ambox" above. */
html body.mediawiki .mbox-small { /* For the "small=yes" option. */
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
box-sizing: border-box;
width: 238px;
font-size: 88%;
line-height: 1.25em;
}
html body.mediawiki .mbox-small-left { /* For the "small=left" option. */
/* @noflip */
margin: 4px 1em 4px 0;
box-sizing: border-box;
overflow: hidden;
width: 238px;
border-collapse: collapse;
font-size: 88%;
line-height: 1.25em;
}
/* Style for compact ambox */
/* Hide the images */
.compact-ambox table .mbox-image,
.compact-ambox table .mbox-imageright,
.compact-ambox table .mbox-empty-cell {
display: none;
}
/* Remove borders, backgrounds, padding, etc. */
.compact-ambox table.ambox {
border: none;
border-collapse: collapse;
background-color: transparent;
margin: 0 0 0 1.6em !important;
padding: 0 !important;
width: auto;
display: block;
}
body.mediawiki .compact-ambox table.mbox-small-left {
font-size: 100%;
width: auto;
margin: 0;
}
/* Style the text cell as a list item and remove its padding */
.compact-ambox table .mbox-text {
padding: 0 !important;
margin: 0 !important;
}
.compact-ambox table .mbox-text-span {
display: list-item;
line-height: 1.5em;
list-style-type: square;
list-style-image: url(/w/skins/MonoBook/resources/images/bullet.gif);
}
.skin-vector .compact-ambox table .mbox-text-span {
list-style-type: disc;
list-style-image: url(/w/skins/Vector/images/bullet-icon.svg);
list-style-image: url(/w/skins/Vector/images/bullet-icon.png)\9;
}
/* Allow for hiding text in compact form */
.compact-ambox .hide-when-compact {
display: none;
}
/* For template documentation */
/* TemplateStyles */
.template-documentation {
clear: both;
margin: 1em 0 0 0;
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
padding: 1em;
}
d9e4c7221dafae29c01080b36effd079723d287b
Module:Arguments
828
14
91
2022-09-30T02:32:01Z
dev>Pppery
0
24 revisions imported from [[:wikipedia:Module:Arguments]]
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
25
2022-10-28T05:41:15Z
meta>Agent Isai
0
1 revision imported from [[:metawikimedia:Module:Arguments]]: Required for local usage
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Documentation
828
13
93
2022-09-30T02:36:08Z
dev>Pppery
0
Pppery moved page [[Module:Documentation/2]] to [[Module:Documentation]] without leaving a redirect
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return mw.ustring.format('[[%s|%s]]', page, display)
else
return mw.ustring.format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return mw.ustring.format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return '<span class="' .. message('toolbar-class') .. '">('
.. table.concat(ret, ' | ') .. ')</span>'
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:attr('role', 'complementary')
:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)
:attr('aria-label', args.heading == '' and 'Documentation' or nil)
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.fullUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
local data = {}
data.title = title
data.docTitle = docTitle
-- View, display, edit, and purge links if /doc exists.
data.viewLinkDisplay = message('view-link-display')
data.editLinkDisplay = message('edit-link-display')
data.historyLinkDisplay = message('history-link-display')
data.purgeLinkDisplay = message('purge-link-display')
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
data.preload = preload
data.createLinkDisplay = message('create-link-display')
return data
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local function escapeBrackets(s)
-- Escapes square brackets with HTML entities.
s = s:gsub('%[', '[') -- Replace square brackets with HTML entities.
s = s:gsub('%]', ']')
return s
end
local ret
local docTitle = data.docTitle
local title = data.title
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
ret = '[%s] [%s] [%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
else
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
ret = '[%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, createLink, purgeLink)
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:attr('id', 'documentation-heading')
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editUrl = docTitle:fullUrl{action = 'edit'}
local editDisplay = message('edit-link-display')
local editLink = makeUrlLink(editUrl, editDisplay)
local historyUrl = docTitle:fullUrl{action = 'history'}
local historyDisplay = message('history-link-display')
local historyLink = makeUrlLink(historyUrl, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
78cc3a78f2b5dbb267fa16027c0800a22dbd3c42
47
2022-11-09T19:51:21Z
meta>Agent Isai
0
1 revision imported from [[:wikipedia:Module:Documentation]]: Importing from [[w:|English Wikipedia]] to sync templates
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
local messageBox = require('Module:Message box')
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local i18n = mw.loadData('Module:Documentation/i18n')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error(require('Module:TNT').format('I18n/Documentation', 'cfg-error-msg-type', cfgKey, expectType, type(msg)), 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error(require('Module:TNT').format('I18n/Documentation', 'cfg-error-msg-empty', '$' .. match, cfgKey), 4)
end
local ret = ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
return ret
end
p.message = message
local function makeWikilink(page, display)
if display then
return mw.ustring.format('[[%s|%s]]', page, display)
else
return mw.ustring.format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return mw.ustring.format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
return '<small>(' .. table.concat(ret, ' | ') .. ')</small>'
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Load TemplateStyles
----------------------------------------------------------------------------
p.main = function(frame)
local parent = frame.getParent(frame)
local output = p._main(parent.args)
return frame:extensionTag{ name='templatestyles', args = { src= message('templatestyles-scr') } } .. output
end
----------------------------------------------------------------------------
-- Main function
----------------------------------------------------------------------------
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--
-- Messages:
-- 'main-div-id' --> 'template-documentation'
-- 'main-div-classes' --> 'template-documentation iezoomfix'
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
-- This div tag is from {{documentation/start box}}, but moving it here
-- so that we don't have to worry about unclosed tags.
:tag('div')
:attr('id', message('main-div-id'))
:addClass(message('main-div-class'))
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:done()
:wikitext(p._endBox(args, env))
:wikitext(p.addTrackingCategories(env))
return tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title objects and other namespace- or
-- path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
-- env.printTitle - the print version of the template, located at the /Print subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.printTitle()
--[[
-- Title object for the /Print subpage.
-- Messages:
-- 'print-subpage' --> 'Print'
--]]
return env.templateTitle:subPageTitle(message('print-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the same as the
-- subject namespace. However, pages in the Article, File, MediaWiki or Category
-- namespaces must have their /doc, /sandbox and /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.fullUrl(
'Special:ComparePages',
{page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[w:Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[w:Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local frame = mw.getCurrentFrame()
local isPreviewing = frame:preprocess('{{REVISIONID}}') == '' -- True if the page is being previewed.
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if isPreviewing or not compareUrl then
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
else
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
text = text .. makeCategoryLink(message('sandbox-category'))
omargs.text = text
omargs.class = message('sandbox-class')
return messageBox.main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local title = env.title
local protectionLevels
local protectionTemplate = message('protection-template')
local namespace = title.namespace
if not (protectionTemplate and (namespace == 10 or namespace == 828)) then
-- Don't display the protection template if we are not in the template or module namespaces.
return nil
end
protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editLevels = protectionLevels.edit
local moveLevels = protectionLevels.move
if moveLevels and moveLevels[1] == 'sysop' or editLevels and editLevels[1] then
-- The page is full-move protected, or full, template, or semi-protected.
local frame = mw.getCurrentFrame()
return frame:expandTemplate{title = protectionTemplate, args = message('protection-template-args', nil, 'table')}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
local data = {}
data.title = title
data.docTitle = docTitle
-- View, display, edit, and purge links if /doc exists.
data.viewLinkDisplay = i18n['view-link-display']
data.editLinkDisplay = i18n['edit-link-display']
data.historyLinkDisplay = i18n['history-link-display']
data.purgeLinkDisplay = i18n['purge-link-display']
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 6 then -- File namespace
preload = message('file-docpage-preload')
elseif subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
data.preload = preload
data.createLinkDisplay = i18n['create-link-display']
return data
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local function escapeBrackets(s)
-- Escapes square brackets with HTML entities.
return s
:gsub('%[', '[') -- Replace square brackets with HTML entities.
:gsub('%]', ']')
end
local ret
local docTitle = data.docTitle
local title = data.title
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
ret = '[%s] [%s] [%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
else
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
ret = '[%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, createLink)
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=Documentation icon]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'start-box-linkclasses' --> 'mw-editsection-like plainlinks'
-- 'start-box-link-id' --> 'doc_editlinks'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = i18n['template-namespace-heading']
elseif subjectSpace == 828 then -- Module namespace
data.heading = i18n['module-namespace-heading']
elseif subjectSpace == 6 then -- File namespace
data.heading = i18n['file-namespace-heading']
else
data.heading = i18n['other-namespaces-heading']
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
data.linksClass = message('start-box-linkclasses')
data.linksId = message('start-box-link-id')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
:addClass(message('header-div-class'))
:tag('div')
:addClass(message('heading-div-class'))
:wikitext(data.heading)
local links = data.links
if links then
sbox
:tag('div')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
local cbox = mw.html.create('div')
cbox
:addClass(message('content-div-class'))
:wikitext('\n' .. (content or '') .. '\n')
return tostring(cbox)
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the footer text field.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '')
text = text .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.
if printBlurb then
text = text .. '<br />' .. printBlurb
end
end
end
local ebox = mw.html.create('div')
ebox
:addClass(message('footer-div-class'))
:wikitext(text)
return tostring(ebox)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[w:Wikipedia:Template documentation|documentation]]
-- is [[w:Wikipedia:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[w:Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle or args.content then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editUrl = docTitle:fullUrl{action = 'edit'}
local editDisplay = i18n['edit-link-display']
local editLink = makeUrlLink(editUrl, editDisplay)
local historyUrl = docTitle:fullUrl{action = 'history'}
local historyDisplay = i18n['history-link-display']
local historyLink = makeUrlLink(historyUrl, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = i18n['create-link-display']
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
function p.makePrintBlurb(args, env)
--[=[
-- Generates the blurb displayed when there is a print version of the template available.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'print-link-display' --> '/Print'
-- 'print-blurb' --> 'A [[Help:Books/for experts#Improving the book layout|print version]]'
-- .. ' of this template exists at $1.'
-- .. ' If you make a change to this template, please update the print version as well.'
-- 'display-print-category' --> true
-- 'print-category' --> 'Templates with print versions'
--]=]
local printTitle = env.printTitle
if not printTitle then
return nil
end
local ret
if printTitle.exists then
local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display'))
ret = message('print-blurb', {printLink})
local displayPrintCategory = message('display-print-category', nil, 'boolean')
if displayPrintCategory then
ret = ret .. makeCategoryLink(message('print-category'))
end
end
return ret
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
a029650bff998bd1a25784b49e99f984f068d85d
Template:Infobox
10
9
85
2022-09-30T14:45:57Z
dev>Pppery
0
Copy from Wikipedia
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<noinclude>
{{documentation}}
</noinclude>
627ee6fcf4d4f108fe054b5c476201cad0ed7717
Module:Infobox
828
3
105
2022-09-30T14:52:23Z
dev>Pppery
0
Scribunto
text/plain
--
-- This module implements {{Infobox}}
--
local p = {}
local args = {}
local origArgs = {}
local root
local function notempty( s ) return s and s:match( '%S' ) end
local function fixChildBoxes(sval, tt)
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' .. subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' .. subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- https://en.wikipedia.org/w/index.php?title=Template_talk:Infobox_musical_artist&oldid=849054481
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
local function union(t1, t2)
-- Returns the union of the values of two tables, as a sequence.
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
local function getArgNums(prefix)
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
local function addRow(rowArgs)
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:attr('id', rowArgs.rowid)
:tag('th')
:attr('colspan', 2)
:attr('id', rowArgs.headerid)
:addClass(rowArgs.class)
:addClass(args.headerclass)
:css('text-align', 'center')
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
elseif rowArgs.data then
if not rowArgs.data:gsub('%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]', ''):match('^%S') then
rowArgs.rowstyle = 'display:none'
end
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
row:attr('id', rowArgs.rowid)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:attr('id', rowArgs.labelid)
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
if not rowArgs.label then
dataCell
:attr('colspan', 2)
:css('text-align', 'center')
end
dataCell
:attr('id', rowArgs.dataid)
:addClass(rowArgs.class)
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
end
end
local function renderTitle()
if not args.title then return end
root
:tag('caption')
:addClass(args.titleclass)
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
root
:tag('tr')
:tag('th')
:attr('colspan', 2)
:addClass(args.aboveclass)
:css('text-align', 'center')
:css('font-size', '125%')
:css('font-weight', 'bold')
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass(args.belowclass)
:css('text-align', 'center')
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addRow({
data = args['subheader' .. tostring(num)],
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:cssText(args.captionstyle)
:wikitext(caption)
end
addRow({
data = tostring(data),
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
local function preprocessRows()
-- Gets the union of the header and data argument numbers,
-- and renders them all in order using addRow.
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local lastheader
for k, num in ipairs(rownums) do
if args['header' .. tostring(num)] then
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
lastheader = num
elseif args['data' .. tostring(num)] and args['data' .. tostring(num)]:gsub('%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]', ''):match('^%S') then
local data = args['data' .. tostring(num)]
if data:gsub('%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]', ''):match('%S') then
lastheader = nil
end
end
end
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
end
local function renderRows()
-- Gets the union of the header and data argument numbers,
-- and renders them all in order using addRow.
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)],
dataid = args['dataid' .. tostring(num)],
labelid = args['labelid' .. tostring(num)],
headerid = args['headerid' .. tostring(num)],
rowid = args['rowid' .. tostring(num)]
})
end
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
local function _infobox()
-- Specify the overall layout of the infobox, with special settings
-- if the infobox is used as a 'child' inside another infobox.
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass((args.subbox ~= 'yes') and 'infobox' or nil)
:addClass(args.bodyclass)
if args.subbox == 'yes' then
root
:css('padding', '0')
:css('border', 'none')
:css('margin', '-3px')
:css('width', 'auto')
:css('min-width', '100%')
:css('font-size', '100%')
:css('clear', 'none')
:css('float', 'none')
:css('background-color', 'transparent')
else
root
:css('width', '22em')
end
root
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
renderSubheaders()
renderImages()
if args.autoheaders then
preprocessRows()
end
renderRows()
renderBelowRow()
renderItalicTitle()
return tostring(root)
end
local function preprocessSingleArg(argName)
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
local function preprocessArgs(prefixTable, step)
-- Assign the parameters with the given prefixes to the args table, in order, in batches
-- of the step size specified. This is to prevent references etc. from appearing in the
-- wrong order. The prefixTable should be an array containing tables, each of which has
-- two possible fields, a "prefix" string and a "depend" table. The function always parses
-- parameters containing the "prefix" string, but only parses parameters in the "depend"
-- table if the prefix parameter is present and non-blank.
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or (v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
moreArgumentsExist = true -- Do another loop if any arguments are found, even blank ones.
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present and not blank, or
-- we are processing "prefix1" and "prefix" is present and not blank, and
-- if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
local function parseDataParameters()
-- Parse the data parameters in the same order that the old {{infobox}} did, so that
-- references etc. will display in the expected places. Parameters that depend on
-- another parameter are only processed if that parameter is present, to avoid
-- phantom references appearing in article reference lists.
preprocessSingleArg('autoheaders')
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'},
{prefix = 'dataid'},
{prefix = 'labelid'},
{prefix = 'headerid'},
{prefix = 'rowid'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent
preprocessSingleArg('decat')
end
function p.infobox(frame)
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
function p.infoboxTemplate(frame)
-- For calling via #invoke within a template
origArgs = {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
return p
c6ac51f9e2faf9c2f3aba1fb8c05af98db47f4d4
37
2022-11-09T19:51:01Z
meta>Agent Isai
0
1 revision imported from [[:wikipedia:Module:Infobox]]: Importing from [[w:|English Wikipedia]] to sync templates
Scribunto
text/plain
--
-- This module implements {{Infobox}}
--
local p = {}
local navbar = require('Module:Navbar')._navbar
local args = {}
local origArgs
local root
local function notempty( s ) return s and s:match( '%S' ) end
local function fixChildBoxes(sval, tt)
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' .. subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' .. subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
return s
else
return sval
end
end
local function union(t1, t2)
-- Returns the union of the values of two tables, as a sequence.
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
local function getArgNums(prefix)
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
local function addRow(rowArgs)
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
if rowArgs.header then
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:attr('id', rowArgs.rowid)
:tag('th')
:attr('colspan', 2)
:attr('id', rowArgs.headerid)
:addClass(rowArgs.class)
:addClass(args.headerclass)
:css('text-align', 'center')
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
elseif rowArgs.data then
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
row:attr('id', rowArgs.rowid)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:attr('id', rowArgs.labelid)
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
if not rowArgs.label then
dataCell
:attr('colspan', 2)
:css('text-align', 'center')
end
dataCell
:attr('id', rowArgs.dataid)
:addClass(rowArgs.class)
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:newline()
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
end
end
local function renderTitle()
if not args.title then return end
root
:tag('caption')
:addClass(args.titleclass)
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
root
:tag('tr')
:tag('th')
:attr('colspan', 2)
:addClass(args.aboveclass)
:css('text-align', 'center')
:css('font-size', '125%')
:css('font-weight', 'bold')
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass(args.belowclass)
:css('text-align', 'center')
:cssText(args.belowstyle)
:newline()
:wikitext(fixChildBoxes(args.below,'td'))
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addRow({
data = args['subheader' .. tostring(num)],
datastyle = args.subheaderstyle or args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:cssText(args.captionstyle)
:wikitext(caption)
end
addRow({
data = tostring(data),
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
local function renderRows()
-- Gets the union of the header and data argument numbers,
-- and renders them all in order using addRow.
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)],
dataid = args['dataid' .. tostring(num)],
labelid = args['labelid' .. tostring(num)],
headerid = args['headerid' .. tostring(num)],
rowid = args['rowid' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:css('text-align', 'right')
:wikitext(navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
local function renderTrackingCategories()
if args.decat ~= 'yes' then
if #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
end
if args.child == 'yes' and args.title then
root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]')
end
end
end
local function _infobox()
-- Specify the overall layout of the infobox, with special settings
-- if the infobox is used as a 'child' inside another infobox.
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass('infobox')
:addClass(args.bodyclass)
if args.subbox == 'yes' then
root
:css('padding', '0')
:css('border', 'none')
:css('margin', '-3px')
:css('width', 'auto')
:css('min-width', '100%')
:css('font-size', '100%')
:css('clear', 'none')
:css('float', 'none')
:css('background-color', 'transparent')
else
root
:css('width', '22em')
end
root
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
renderSubheaders()
renderImages()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderTrackingCategories()
return tostring(root)
end
local function preprocessSingleArg(argName)
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
local function preprocessArgs(prefixTable, step)
-- Assign the parameters with the given prefixes to the args table, in order, in batches
-- of the step size specified. This is to prevent references etc. from appearing in the
-- wrong order. The prefixTable should be an array containing tables, each of which has
-- two possible fields, a "prefix" string and a "depend" table. The function always parses
-- parameters containing the "prefix" string, but only parses parameters in the "depend"
-- table if the prefix parameter is present and non-blank.
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or (v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
moreArgumentsExist = true -- Do another loop if any arguments are found, even blank ones.
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present and not blank, or
-- we are processing "prefix1" and "prefix" is present and not blank, and
-- if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
function p.infobox(frame)
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so that
-- references etc. will display in the expected places. Parameters that depend on
-- another parameter are only processed if that parameter is present, to avoid
-- phantom references appearing in article reference lists.
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'},
{prefix = 'dataid'},
{prefix = 'labelid'},
{prefix = 'headerid'},
{prefix = 'rowid'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent
preprocessSingleArg('decat')
return frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
} .. _infobox()
end
return p
eccecf7ea52ce105242adb57836ea74e04395312
Template:Template link expanded
10
39
113
2022-09-30T18:48:13Z
dev>Pppery
0
wikitext
text/x-wiki
<code><nowiki>{{</nowiki>{{#if:{{{subst|}}} |[[Help:Substitution|subst]]:}}<!--
-->[[{{{sister|{{{SISTER|}}}}}}{{ns:Template}}:{{{1|}}}|{{{1|}}}]]<!--
-->{{#if:{{{2|}}} ||{{{2}}}}}<!--
-->{{#if:{{{3|}}} ||{{{3}}}}}<!--
-->{{#if:{{{4|}}} ||{{{4}}}}}<!--
-->{{#if:{{{5|}}} ||{{{5}}}}}<!--
-->{{#if:{{{6|}}} ||{{{6}}}}}<!--
-->{{#if:{{{7|}}} ||{{{7}}}}}<!--
-->{{#if:{{{8|}}} ||{{{8}}}}}<!--
-->{{#if:{{{9|}}} ||{{{9}}}}}<!--
-->{{#if:{{{10|}}} ||{{{10}}}}}<!--
-->{{#if:{{{11|}}} ||{{{11}}}}}<!--
-->{{#if:{{{12|}}} ||{{{12}}}}}<!--
-->{{#if:{{{13|}}} ||{{{13}}}}}<!--
-->{{#if:{{{14|}}} ||{{{14}}}}}<!--
-->{{#if:{{{15|}}} ||{{{15}}}}}<!--
-->{{#if:{{{16|}}} ||{{{16}}}}}<!--
-->{{#if:{{{17|}}} ||{{{17}}}}}<!--
-->{{#if:{{{18|}}} ||{{{18}}}}}<!--
-->{{#if:{{{19|}}} ||{{{19}}}}}<!--
-->{{#if:{{{20|}}} ||{{{20}}}}}<!--
-->{{#if:{{{21|}}} ||''...''}}<!--
--><nowiki>}}</nowiki></code><noinclude>
{{Documentation}}
</noinclude>
9f670205d4b358df089b1a820f78f02a88afca3a
Template:Infobox/doc
10
11
107
71
2022-09-30T19:09:06Z
dev>Pppery
0
wikitext
text/x-wiki
{{Documentation subpage}}
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[w:Help:Infobox]] contains an introduction about the recommended content and design of infoboxes.
== Usage ==
Usage is similar to {{tl|navbox}}, but with an additional distinction. Each row on the table can contain either a header, or a label/data pair, or just a data cell. These are mutually exclusive states so if you define a row with both a header and a label/data pair, the label/data pair is ignored.
To insert an image somewhere other than at the top of the infobox, or to insert freeform data, use a row with only a data field.
== Optional control parameters ==
; name : If this parameter is present, "view/talk/edit" links will be added to the bottom of the infobox, pointing to the named page. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however this is rarely what you want, because it will send users clicking these links in an infobox in an article to the template code rather than the data in the infobox that they probably want to change.
; child : See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
; subbox : See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
== Content parameters ==
=== Title ===
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts as a caption it on top of the table. You can use both of them together if you like, or just one or the other, or even neither (though this is not recommended):
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For accessibility reasons, this is the most recommended alternative.
; above : Text to put within the uppermost cell of the table.
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
Examples:
{{Infobox
| name = Infobox/doc
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
{{Infobox
| name = Infobox/doc
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
=== Illustration images ===
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default.
; caption(n) : Text to put underneath the images.
=== Main data ===
; header(n) : Text to use as a header in row n.
; label(n) : Text to use as a label in row n.
; data(n) : Text to display as data in row n.
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a header''(n)'' parameter will cause the corresponding data''(n)'' (and rowclass''(n)'' label''(n)'', see below) parameters to be ignored; the absence of a data''(n)'' parameters will cause the corresponding label''(n)'' parameters to be ignored. Valid combinations for any single row are:
* |class''(n)''= |header''(n)''=
* |rowclass''(n)'= |class''(n)''= |data''(n)''=
* |rowclass''(n)''= |label''(n)''= |class''(n)''= data''(n)''=
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
==== Number ranges ====
To allow flexibility when the layout of an infobox is changed, it may be helpful when developing an infobox to use non-contiguous numbers for header and label/data rows. Parameters for new rows can then be inserted in future without having to renumber existing parameters. For example:
<pre style="overflow:auto">
| header3 = Section 1
| label5 = Label A
| data5 = Data A
| label7 = Label C
| data7 = Data C
| header10 = Section 2
| label12 = Label D
| data12 = Data D
</pre>{{clear}}
==== Making data fields optional ====
A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:
<pre style="overflow:auto">
| label5 = Population
| data5 = {{{population|}}}
</pre>{{clear}}
This way if an article doesn't define the population parameter in its infobox the row won't be displayed.
For more complex fields with pre-formatted contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter ''mass'' has been supplied |then display it, followed by 'kg'":
<pre style="overflow:auto">
| label6 = Mass
| data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}
</pre>{{clear}}
For more on #if, see [[mw:Help:Extension:ParserFunctions##if|here]].
==== Hiding headers when all data fields are hidden ====
You can also make headers optional in a similar way. Consider this example:
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
If you want the first header to appear only if one or more of the data fields that fall under it are filled, one could use the following pattern as an example of how to do it:
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no empty row appears before the next static content. The trick to this is that the "#if" returns false only if there is nothing whatsoever in the conditional section, so only if all three of item1, item2 and item3 are undefined will the if statement fail.
Note that such trick may be sometimes very complex to test if there are many data items whose value depends on complex tests (or when a data row is generated by a recursive invocation of this template as a [[#Subboxes|subbox]]). Ideally, the Lua module supporting this template should now support a new way to make each header row autohideable by detecting if there is at least one non-empty data row after that header row (a parameter like "autohide header1 = yes", for example, would remove the need to perform the "#if" test so that we can just to define "header1 = Optional header"),
=== Footer ===
; below : Text to put in the bottom cell. The bottom cell is intended for footnotes, see-also, and other such information.
== Presentation parameters ==
=== Italic titles ===
Titles of articles with infoboxes may be made italic by passing the <code>italic title</code> parameter.
* Turn on italic titles by passing |italic title=<nowiki>{{{italic title|}}}</nowiki> from the infobox.
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing |italic title=<nowiki>{{{italic title|no}}}</nowiki>
* Do not make any titles italic by not passing the parameter at all.
=== CSS styling ===
; bodystyle : Applies to the infobox table as a whole
; titlestyle : Applies only to the title caption. Adding a background color is usually inadvisable since the text is rendered "outside" the infobox.
; abovestyle : Applies only to the "above" cell at the top. The default style has font-size:125%; since this cell is usually used for a title, if you want to use the above cell for regular-sized text include "font-size:100%;" in the abovestyle.
; imagestyle : Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
; captionstyle : Applies to the text of the image caption.
; rowstyle(n) : This parameter is inserted into the <code>style</code> attribute for the specified row.
; headerstyle : Applies to all header cells
; labelstyle : Applies to all label cells
; datastyle : Applies to all data cells
; belowstyle : Applies only to the below cell
=== HTML classes and microformats ===
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
<!-- currently not implemented in Lua module
; aboverowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''above''' cell is on.
-->
; aboveclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''above''' cell.
; subheaderrowclass(n) : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''subheader''' is on.
; subheaderclass(n) : This parameter is inserted into the <code>class</code> attribute for the infobox's '''subheader'''.
; imagerowclass(n) : These parameters are inserted into the <code>class</code> attribute for the complete table row their respective '''image''' is on.
; imageclass : This parameter is inserted into the <code>class</code> attribute for the '''image'''.
; rowclass(n) : This parameter is inserted into the <code>class</code> attribute for the specified row including the '''label''' and '''data''' cells.
; class(n) : This parameter is inserted into the <code>class</code> attribute for the '''data''' cell of the specified row. If there's no '''data''' cell it has no effect.
<!-- currently not implemented in Lua module
; belowrowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''below''' cell is on.
-->
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others beig used for microformats.
To flag an infobox as containing [[w:hCard|hCard]] information, for example, add the following parameter:
<pre style="overflow:auto">
| bodyclass = vcard
</pre>{{clear}}
And for each row containing a data cell that's part of the vcard, add a corresponding class parameter:
<pre style="overflow:auto">
| class1 = fn
| class2 = org
| class3 = tel
</pre>{{clear}}
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
See [[w:microformat]] for more information on microformats in general.
== Examples ==
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
{{Infobox
|name = Infobox/doc
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
<pre style="overflow:auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
| image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
</pre>{{clear}}
For this example, the '''bodystyle''' and '''labelstyle''' parameters are used to adjust the infobox width and define a default width for the column of labels:
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
<pre style="overflow: auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
</pre>{{clear}}
== Embedding ==
One infobox template can be embedded into another using the |child= parameter or the |embed= parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note, in the examples above, the child infobox is placed in a <code>data</code> field, not a <code>header</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a '''header''' field (but not in a '''label''' field because it would not be displayed!), either using
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
or,
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note that omitting the |title= parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation.
== Subboxes ==
An alternative method for embedding is to use |subbox=yes, which removes the outer border from the infobox, but preserves the interior structure. One feature of this approach is that the parent and child boxes need not have the same structure, and the label and data fields are not aligned between the parent and child boxes because they are not in the same parent table.
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
<source lang="sass" style="overflow:auto">
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
</source>{{clear}}
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
== Full blank syntax ==
(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| child = {{{child|}}}
| subbox = {{{subbox|}}}
| italic title = {{{italic title|no}}}
| bodystyle =
| titlestyle =
| abovestyle =
| subheaderstyle =
| title =
| above =
| subheader =
| imagestyle =
| captionstyle =
| image =
| caption =
| image2 =
| caption2 =
| headerstyle =
| labelstyle =
| datastyle =
| header1 =
| label1 =
| data1 =
| header2 =
| label2 =
| data2 =
| header3 =
| label3 =
| data3 =
| header4 =
| label4 =
| data4 =
| header5 =
| label5 =
| data5 =
| header6 =
| label6 =
| data6 =
| header7 =
| label7 =
| data7 =
| header8 =
| label8 =
| data8 =
| header9 =
| label9 =
| data9 =
| header10 =
| label10 =
| data10 =
| header11 =
| label11 =
| data11 =
| header12 =
| label12 =
| data12 =
| header13 =
| label13 =
| data13 =
| header14 =
| label14 =
| data14 =
| header15 =
| label15 =
| data15 =
| header16 =
| label16 =
| data16 =
| header17 =
| label17 =
| data17 =
| header18 =
| label18 =
| data18 =
| header19 =
| label19 =
| data19 =
| header20 =
| label20 =
| data20 =
| belowstyle =
| below =
}}
</pre>{{clear}}
==See also==
* [[Module:Infobox]], the [[mw:Lua/Overview|Lua]] module on which this template is based
* [[w:Wikipedia:List of infoboxes|List of infoboxes]]
38686ab37d436b2158042649ea6e552897fbcfa5
Module:Yesno
828
16
129
2022-10-01T17:25:37Z
dev>Pppery
0
Pppery moved page [[Module:Yesno/2]] to [[Module:Yesno]] without leaving a redirect
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
23
2022-10-28T05:41:15Z
meta>Agent Isai
0
1 revision imported from [[:metawikimedia:Module:Yesno]]: Required for local usage
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Module:Documentation/config
828
15
95
2022-10-01T17:37:53Z
dev>Pppery
0
Pppery moved page [[Module:Documentation/config/2]] to [[Module:Documentation/config]] without leaving a redirect
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[w:Wikipedia:Template documentation|documentation]] is [[mw:Help:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[mw:Extension:Scribunto/Lua reference manual|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
d70e8b1402a2bbe08a1fef4b75d743e661af0c95
49
2022-11-09T19:51:21Z
meta>Agent Isai
0
1 revision imported from [[:wikipedia:Module:Documentation/config]]: Importing from [[w:|English Wikipedia]] to sync templates
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local _format = require('Module:TNT').format
local function format(id)
return _format('I18n/Documentation', id)
end
local cfg = {} -- Do not edit this line.
cfg['templatestyles-scr'] = 'Module:Documentation/styles.css'
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-template']
-- The name of the template that displays the protection icon (a padlock on enwiki).
cfg['protection-template'] = 'PP-template'
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
-- cfg['protection-template-args']
-- Any arguments to send to the protection template. This should be a Lua table.
-- For example, if the protection template is "pp-template", and the wikitext template invocation
-- looks like "{{pp-template|docusage=yes}}", then this table should look like "{docusage = 'yes'}".
--]]
cfg['protection-template-args'] = {docusage = 'yes'}
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[Image:Edit In Sandbox Icon - Color.svg|40px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = format('sandbox-notice-pagetype-template')
cfg['sandbox-notice-pagetype-module'] = format('sandbox-notice-pagetype-module')
cfg['sandbox-notice-pagetype-other'] = format('sandbox-notice-pagetype-other')
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = format('sandbox-notice-blurb')
cfg['sandbox-notice-diff-blurb'] = format('sandbox-notice-diff-blurb')
cfg['sandbox-notice-compare-link-display'] = format('sandbox-notice-compare-link-display')
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = format('sandbox-notice-testcases-blurb')
cfg['sandbox-notice-testcases-link-display'] = format('sandbox-notice-testcases-link-display')
cfg['sandbox-notice-testcases-run-blurb'] = format('sandbox-notice-testcases-run-blurb')
cfg['sandbox-notice-testcases-run-link-display'] = format('sandbox-notice-testcases-run-link-display')
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=Documentation icon]]'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = format('transcluded-from-blurb')
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = format('create-module-doc-blurb')
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = format('experiment-blurb-template')
cfg['experiment-blurb-module'] = format('experiment-blurb-module')
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = format('sandbox-link-display')
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = format('sandbox-edit-link-display')
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = format('sandbox-create-link-display')
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = format('compare-link-display')
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = format('mirror-link-display')
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = format('testcases-link-display')
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = format('testcases-edit-link-display')
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = format('testcases-create-link-display')
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = format('add-categories-blurb')
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = format('subpages-blurb')
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = format('subpages-link-display')
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = format('template-pagetype')
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = format('module-pagetype')
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = format('default-pagetype')
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['file-docpage-preload']
-- Preload file for documentation page in the file namespace.
cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- Print version configuration
----------------------------------------------------------------------------------------------------
-- cfg['print-subpage']
-- The name of the template subpage used for print versions.
cfg['print-subpage'] = 'Print'
-- cfg['print-link-display']
-- The text to display when linking to the /Print subpage.
cfg['print-link-display'] = '/Print'
-- cfg['print-blurb']
-- Text to display if a /Print subpage exists. $1 is a link to the subpage with a display value of cfg['print-link-display'].
cfg['print-blurb'] = format('print-blurb')
-- cfg['display-print-category']
-- Set to true to enable output of cfg['print-category'] if a /Print subpage exists.
-- This should be a boolean value (either true or false).
cfg['display-print-category'] = true
-- cfg['print-category']
-- Category to output if cfg['display-print-category'] is set to true, and a /Print subpage exists.
cfg['print-category'] = 'Templates with print versions'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['main-div-id']
-- The "id" attribute of the main HTML "div" tag.
cfg['main-div-id'] = 'template-documentation'
-- cfg['main-div-classes']
-- The CSS classes added to the main HTML "div" tag.
cfg['main-div-class'] = 'ts-doc-doc'
cfg['header-div-class'] = 'ts-doc-header'
cfg['heading-div-class'] = 'ts-doc-heading'
cfg['content-div-class'] = 'ts-doc-content'
cfg['footer-div-class'] = 'ts-doc-footer plainlinks'
cfg['sandbox-class'] = 'ts-doc-sandbox'
-- cfg['start-box-linkclasses']
-- The CSS classes used for the [view][edit][history] or [create] links in the start box.
cfg['start-box-linkclasses'] = 'ts-tlinks-tlinks mw-editsection-like plainlinks'
-- cfg['start-box-link-id']
-- The HTML "id" attribute for the links in the start box.
cfg['start-box-link-id'] = 'doc_editlinks'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
79bc957b39b5b752fa4c2e2e80a35faa01901425
Template:Documentation subpage
10
25
89
2022-10-01T17:51:17Z
dev>Pppery
0
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
| <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
</includeonly><!--
-->{{#ifeq:{{{doc-notice|show}}} |show
| {{Mbox
| type = notice
| style = margin-bottom:1.0em;
| image = [[File:Edit-copy green.svg|40px|alt=|link=]]
| text =
'''This is a documentation subpage''' for '''{{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}'''.<br/> It contains usage information, [[mw:Help:Categories|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} | page}}}}.
}}
}}<!--
-->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
-->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
| <includeonly><!--
-->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
| [[Category:Documentation subpages without corresponding pages]]
}}<!--
--></includeonly>
}}<!--
(completing initial #ifeq: at start of template:)
--><includeonly>
| <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
}}<!--
--></includeonly><noinclude>{{Documentation}}</noinclude>
471e685c1c643a5c6272e20e49824fffebad0448
Module:Format link
828
59
189
2022-10-04T13:37:11Z
wikipedia>Pppery
0
Avoid Lua erroring when we run out of expensive parser function calls
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Format link
--
-- Makes a wikilink from the given link and display values. Links are escaped
-- with colons if necessary, and links to sections are detected and displayed
-- with " § " as a separator rather than the standard MediaWiki "#". Used in
-- the {{format link}} template.
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local mError -- lazily initialise [[Module:Error]]
local yesno -- lazily initialise [[Module:Yesno]]
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
local function maybeItalicize(s, shouldItalicize)
-- Italicize s if s is a string and the shouldItalicize parameter is true.
if s and shouldItalicize then
return '<i>' .. s .. '</i>'
else
return s
end
end
local function parseLink(link)
-- Parse a link and return a table with the link's components.
-- These components are:
-- - link: the link, stripped of any initial colon (always present)
-- - page: the page name (always present)
-- - section: the page name (may be nil)
-- - display: the display text, if manually entered after a pipe (may be nil)
link = removeInitialColon(link)
-- Find whether a faux display value has been added with the {{!}} magic
-- word.
local prePipe, display = link:match('^(.-)|(.*)$')
link = prePipe or link
-- Find the page, if it exists.
-- For links like [[#Bar]], the page will be nil.
local preHash, postHash = link:match('^(.-)#(.*)$')
local page
if not preHash then
-- We have a link like [[Foo]].
page = link
elseif preHash ~= '' then
-- We have a link like [[Foo#Bar]].
page = preHash
end
-- Find the section, if it exists.
local section
if postHash and postHash ~= '' then
section = postHash
end
return {
link = link,
page = page,
section = section,
display = display,
}
end
local function formatDisplay(parsed, options)
-- Formats a display string based on a parsed link table (matching the
-- output of parseLink) and an options table (matching the input options for
-- _formatLink).
local page = maybeItalicize(parsed.page, options.italicizePage)
local section = maybeItalicize(parsed.section, options.italicizeSection)
if (not section) then
return page
elseif (not page) then
return mw.ustring.format('§ %s', section)
else
return mw.ustring.format('%s § %s', page, section)
end
end
local function missingArgError(target)
mError = require('Module:Error')
return mError.error{message =
'Error: no link or target specified! ([[' .. target .. '#Errors|help]])'
}
end
--------------------------------------------------------------------------------
-- Main functions
--------------------------------------------------------------------------------
function p.formatLink(frame)
-- The formatLink export function, for use in templates.
yesno = require('Module:Yesno')
local args = getArgs(frame)
local link = args[1] or args.link
local target = args[3] or args.target
if not (link or target) then
return missingArgError('Template:Format link')
end
return p._formatLink{
link = link,
display = args[2] or args.display,
target = target,
italicizePage = yesno(args.italicizepage),
italicizeSection = yesno(args.italicizesection),
categorizeMissing = args.categorizemissing
}
end
function p._formatLink(options)
-- The formatLink export function, for use in modules.
checkType('_formatLink', 1, options, 'table')
local function check(key, expectedType) --for brevity
checkTypeForNamedArg(
'_formatLink', key, options[key], expectedType or 'string', true
)
end
check('link')
check('display')
check('target')
check('italicizePage', 'boolean')
check('italicizeSection', 'boolean')
check('categorizeMissing')
-- Normalize link and target and check that at least one is present
if options.link == '' then options.link = nil end
if options.target == '' then options.target = nil end
if not (options.link or options.target) then
return missingArgError('Module:Format link')
end
local parsed = parseLink(options.link)
local display = options.display or parsed.display
local catMissing = options.categorizeMissing
local category = ''
-- Find the display text
if not display then display = formatDisplay(parsed, options) end
-- Handle the target option if present
if options.target then
local parsedTarget = parseLink(options.target)
parsed.link = parsedTarget.link
parsed.page = parsedTarget.page
end
-- Test if page exists if a diagnostic category is specified
if catMissing and (mw.ustring.len(catMissing) > 0) then
local title = nil
if parsed.page then title = mw.title.new(parsed.page) end
if title and (not title.isExternal) then
local success, exists = pcall(function() return title.exists end)
if success and not exists then
category = mw.ustring.format('[[Category:%s]]', catMissing)
end
end
end
-- Format the result as a link
if parsed.link == display then
return mw.ustring.format('[[:%s]]%s', parsed.link, category)
else
return mw.ustring.format('[[:%s|%s]]%s', parsed.link, display, category)
end
end
--------------------------------------------------------------------------------
-- Derived convenience functions
--------------------------------------------------------------------------------
function p.formatPages(options, pages)
-- Formats an array of pages using formatLink and the given options table,
-- and returns it as an array. Nil values are not allowed.
local ret = {}
for i, page in ipairs(pages) do
ret[i] = p._formatLink{
link = page,
categorizeMissing = options.categorizeMissing,
italicizePage = options.italicizePage,
italicizeSection = options.italicizeSection
}
end
return ret
end
return p
1253bdd2683ee4badc33856bfd5499b09a7dca1f
Module:Icon
828
92
279
2022-10-21T08:04:06Z
wikipedia>WOSlinker
0
use require("strict") instead of require("Module:No globals")
Scribunto
text/plain
-- This module implements [[Template:Icon]].
require("strict")
local yesNo = require("Module:Yesno")
local getArgs = require("Module:Arguments").getArgs
local getPlain = nil
local p = {}
-- Determine whether we're being called from a sandbox
local sandbox = mw.getCurrentFrame():getTitle():find('sandbox', 1, true) and '/sandbox' or ''
-- Implements [[Template:Icon]]
-- Returns the icon image corresponding to a string (like 'B')
function p._main(args, data)
local data_module = 'Module:Icon/data'..sandbox
data = data or mw.loadData(data_module)
local code = args.class or args[1]
local iconData
if code then
code = code:match('^%s*(.-)%s*$'):lower() -- trim whitespace and put in lower case
iconData = data[code]
end
if not iconData then
iconData = data._DEFAULT
end
return string.format(
'[[File:%s%s%s|%s|class=noviewer|alt=%s]]',
iconData.image,
iconData.tooltip and '|' .. iconData.tooltip or '',
iconData.link == false and '|link=' or '',
args.size or '16x16px',
iconData.alt or ''
)
end
-- Implements [[Template:Icon link]], a superset of [[Template:Icon]]
-- Returns an icon, plus a suitably formatted wikilink
function p._link(args, data)
args.size = args.size or args.iconsize
local icon = p._main(args, data)
-- If no link given in args[2], default back to [[Template:Icon]]
if not args[2] then
return icon
end
-- Strip wiki markup out of link
getPlain = getPlain or require("Module:Text").Text().getPlain
local link = getPlain(args[2])
local display = args[3] or args[2]
-- italicize display string, if requested
if yesNo(args.i) or yesNo(args.italic) or yesNo(args.italics) then
display = '<i>'..display..'</i>'
end
-- if display is link, just use standard wlink
if link == display then
return icon..' [['..link..']]'
end
return icon..' [['..link..'|'..display..']]'
end
function p.main(frame)
local args = getArgs(frame,{parentFirst=true})
return p._main(args)
end
function p.link(frame)
local args = getArgs(frame,{parentFirst=true})
return p._link(args)
end
return p
7688d9a465bd7c4caa51f7e5c02676c162d583f5
Module:Protection banner
828
63
203
2022-10-21T08:07:11Z
wikipedia>WOSlinker
0
use require('strict') instead of require('Module:No globals')
Scribunto
text/plain
-- This module implements {{pp-meta}} and its daughter templates such as
-- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.
-- Initialise necessary modules.
require('strict')
local makeFileLink = require('Module:File link')._main
local effectiveProtectionLevel = require('Module:Effective protection level')._main
local effectiveProtectionExpiry = require('Module:Effective protection expiry')._main
local yesno = require('Module:Yesno')
-- Lazily initialise modules and objects we don't always need.
local getArgs, makeMessageBox, lang
-- Set constants.
local CONFIG_MODULE = 'Module:Protection banner/config'
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function makeCategoryLink(cat, sort)
if cat then
return string.format(
'[[%s:%s|%s]]',
mw.site.namespaces[14].name,
cat,
sort
)
end
end
-- Validation function for the expiry and the protection date
local function validateDate(dateString, dateType)
if not lang then
lang = mw.language.getContentLanguage()
end
local success, result = pcall(lang.formatDate, lang, 'U', dateString)
if success then
result = tonumber(result)
if result then
return result
end
end
error(string.format(
'invalid %s: %s',
dateType,
tostring(dateString)
), 4)
end
local function makeFullUrl(page, query, display)
return string.format(
'[%s %s]',
tostring(mw.uri.fullUrl(page, query)),
display
)
end
-- Given a directed graph formatted as node -> table of direct successors,
-- get a table of all nodes reachable from a given node (though always
-- including the given node).
local function getReachableNodes(graph, start)
local toWalk, retval = {[start] = true}, {}
while true do
-- Can't use pairs() since we're adding and removing things as we're iterating
local k = next(toWalk) -- This always gets the "first" key
if k == nil then
return retval
end
toWalk[k] = nil
retval[k] = true
for _,v in ipairs(graph[k]) do
if not retval[v] then
toWalk[v] = true
end
end
end
end
--------------------------------------------------------------------------------
-- Protection class
--------------------------------------------------------------------------------
local Protection = {}
Protection.__index = Protection
Protection.supportedActions = {
edit = true,
move = true,
autoreview = true,
upload = true
}
Protection.bannerConfigFields = {
'text',
'explanation',
'tooltip',
'alt',
'link',
'image'
}
function Protection.new(args, cfg, title)
local obj = {}
obj._cfg = cfg
obj.title = title or mw.title.getCurrentTitle()
-- Set action
if not args.action then
obj.action = 'edit'
elseif Protection.supportedActions[args.action] then
obj.action = args.action
else
error(string.format(
'invalid action: %s',
tostring(args.action)
), 3)
end
-- Set level
obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title)
if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then
-- Users need to be autoconfirmed to move pages anyway, so treat
-- semi-move-protected pages as unprotected.
obj.level = '*'
end
-- Set expiry
local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title)
if effectiveExpiry == 'infinity' then
obj.expiry = 'indef'
elseif effectiveExpiry ~= 'unknown' then
obj.expiry = validateDate(effectiveExpiry, 'expiry date')
end
-- Set reason
if args[1] then
obj.reason = mw.ustring.lower(args[1])
if obj.reason:find('|') then
error('reasons cannot contain the pipe character ("|")', 3)
end
end
-- Set protection date
if args.date then
obj.protectionDate = validateDate(args.date, 'protection date')
end
-- Set banner config
do
obj.bannerConfig = {}
local configTables = {}
if cfg.banners[obj.action] then
configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason]
end
if cfg.defaultBanners[obj.action] then
configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level]
configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default
end
configTables[#configTables + 1] = cfg.masterBanner
for i, field in ipairs(Protection.bannerConfigFields) do
for j, t in ipairs(configTables) do
if t[field] then
obj.bannerConfig[field] = t[field]
break
end
end
end
end
return setmetatable(obj, Protection)
end
function Protection:isUserScript()
-- Whether the page is a user JavaScript or CSS page.
local title = self.title
return title.namespace == 2 and (
title.contentModel == 'javascript' or title.contentModel == 'css'
)
end
function Protection:isProtected()
return self.level ~= '*'
end
function Protection:shouldShowLock()
-- Whether we should output a banner/padlock
return self:isProtected() and not self:isUserScript()
end
-- Whether this page needs a protection category.
Protection.shouldHaveProtectionCategory = Protection.shouldShowLock
function Protection:isTemporary()
return type(self.expiry) == 'number'
end
function Protection:makeProtectionCategory()
if not self:shouldHaveProtectionCategory() then
return ''
end
local cfg = self._cfg
local title = self.title
-- Get the expiry key fragment.
local expiryFragment
if self.expiry == 'indef' then
expiryFragment = self.expiry
elseif type(self.expiry) == 'number' then
expiryFragment = 'temp'
end
-- Get the namespace key fragment.
local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace]
if not namespaceFragment and title.namespace % 2 == 1 then
namespaceFragment = 'talk'
end
-- Define the order that key fragments are tested in. This is done with an
-- array of tables containing the value to be tested, along with its
-- position in the cfg.protectionCategories table.
local order = {
{val = expiryFragment, keypos = 1},
{val = namespaceFragment, keypos = 2},
{val = self.reason, keypos = 3},
{val = self.level, keypos = 4},
{val = self.action, keypos = 5}
}
--[[
-- The old protection templates used an ad-hoc protection category system,
-- with some templates prioritising namespaces in their categories, and
-- others prioritising the protection reason. To emulate this in this module
-- we use the config table cfg.reasonsWithNamespacePriority to set the
-- reasons for which namespaces have priority over protection reason.
-- If we are dealing with one of those reasons, move the namespace table to
-- the end of the order table, i.e. give it highest priority. If not, the
-- reason should have highest priority, so move that to the end of the table
-- instead.
--]]
table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))
--[[
-- Define the attempt order. Inactive subtables (subtables with nil "value"
-- fields) are moved to the end, where they will later be given the key
-- "all". This is to cut down on the number of table lookups in
-- cfg.protectionCategories, which grows exponentially with the number of
-- non-nil keys. We keep track of the number of active subtables with the
-- noActive parameter.
--]]
local noActive, attemptOrder
do
local active, inactive = {}, {}
for i, t in ipairs(order) do
if t.val then
active[#active + 1] = t
else
inactive[#inactive + 1] = t
end
end
noActive = #active
attemptOrder = active
for i, t in ipairs(inactive) do
attemptOrder[#attemptOrder + 1] = t
end
end
--[[
-- Check increasingly generic key combinations until we find a match. If a
-- specific category exists for the combination of key fragments we are
-- given, that match will be found first. If not, we keep trying different
-- key fragment combinations until we match using the key
-- "all-all-all-all-all".
--
-- To generate the keys, we index the key subtables using a binary matrix
-- with indexes i and j. j is only calculated up to the number of active
-- subtables. For example, if there were three active subtables, the matrix
-- would look like this, with 0 corresponding to the key fragment "all", and
-- 1 corresponding to other key fragments.
--
-- j 1 2 3
-- i
-- 1 1 1 1
-- 2 0 1 1
-- 3 1 0 1
-- 4 0 0 1
-- 5 1 1 0
-- 6 0 1 0
-- 7 1 0 0
-- 8 0 0 0
--
-- Values of j higher than the number of active subtables are set
-- to the string "all".
--
-- A key for cfg.protectionCategories is constructed for each value of i.
-- The position of the value in the key is determined by the keypos field in
-- each subtable.
--]]
local cats = cfg.protectionCategories
for i = 1, 2^noActive do
local key = {}
for j, t in ipairs(attemptOrder) do
if j > noActive then
key[t.keypos] = 'all'
else
local quotient = i / 2 ^ (j - 1)
quotient = math.ceil(quotient)
if quotient % 2 == 1 then
key[t.keypos] = t.val
else
key[t.keypos] = 'all'
end
end
end
key = table.concat(key, '|')
local attempt = cats[key]
if attempt then
return makeCategoryLink(attempt, title.text)
end
end
return ''
end
function Protection:isIncorrect()
local expiry = self.expiry
return not self:shouldHaveProtectionCategory()
or type(expiry) == 'number' and expiry < os.time()
end
function Protection:isTemplateProtectedNonTemplate()
local action, namespace = self.action, self.title.namespace
return self.level == 'templateeditor'
and (
(action ~= 'edit' and action ~= 'move')
or (namespace ~= 10 and namespace ~= 828)
)
end
function Protection:makeCategoryLinks()
local msg = self._cfg.msg
local ret = {self:makeProtectionCategory()}
if self:isIncorrect() then
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-incorrect'],
self.title.text
)
end
if self:isTemplateProtectedNonTemplate() then
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-template'],
self.title.text
)
end
return table.concat(ret)
end
--------------------------------------------------------------------------------
-- Blurb class
--------------------------------------------------------------------------------
local Blurb = {}
Blurb.__index = Blurb
Blurb.bannerTextFields = {
text = true,
explanation = true,
tooltip = true,
alt = true,
link = true
}
function Blurb.new(protectionObj, args, cfg)
return setmetatable({
_cfg = cfg,
_protectionObj = protectionObj,
_args = args
}, Blurb)
end
-- Private methods --
function Blurb:_formatDate(num)
-- Formats a Unix timestamp into dd Month, YYYY format.
lang = lang or mw.language.getContentLanguage()
local success, date = pcall(
lang.formatDate,
lang,
self._cfg.msg['expiry-date-format'] or 'j F Y',
'@' .. tostring(num)
)
if success then
return date
end
end
function Blurb:_getExpandedMessage(msgKey)
return self:_substituteParameters(self._cfg.msg[msgKey])
end
function Blurb:_substituteParameters(msg)
if not self._params then
local parameterFuncs = {}
parameterFuncs.CURRENTVERSION = self._makeCurrentVersionParameter
parameterFuncs.EDITREQUEST = self._makeEditRequestParameter
parameterFuncs.EXPIRY = self._makeExpiryParameter
parameterFuncs.EXPLANATIONBLURB = self._makeExplanationBlurbParameter
parameterFuncs.IMAGELINK = self._makeImageLinkParameter
parameterFuncs.INTROBLURB = self._makeIntroBlurbParameter
parameterFuncs.INTROFRAGMENT = self._makeIntroFragmentParameter
parameterFuncs.PAGETYPE = self._makePagetypeParameter
parameterFuncs.PROTECTIONBLURB = self._makeProtectionBlurbParameter
parameterFuncs.PROTECTIONDATE = self._makeProtectionDateParameter
parameterFuncs.PROTECTIONLEVEL = self._makeProtectionLevelParameter
parameterFuncs.PROTECTIONLOG = self._makeProtectionLogParameter
parameterFuncs.TALKPAGE = self._makeTalkPageParameter
parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter
parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter
parameterFuncs.VANDAL = self._makeVandalTemplateParameter
self._params = setmetatable({}, {
__index = function (t, k)
local param
if parameterFuncs[k] then
param = parameterFuncs[k](self)
end
param = param or ''
t[k] = param
return param
end
})
end
msg = msg:gsub('${(%u+)}', self._params)
return msg
end
function Blurb:_makeCurrentVersionParameter()
-- A link to the page history or the move log, depending on the kind of
-- protection.
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'move' then
-- We need the move log link.
return makeFullUrl(
'Special:Log',
{type = 'move', page = pagename},
self:_getExpandedMessage('current-version-move-display')
)
else
-- We need the history link.
return makeFullUrl(
pagename,
{action = 'history'},
self:_getExpandedMessage('current-version-edit-display')
)
end
end
function Blurb:_makeEditRequestParameter()
local mEditRequest = require('Module:Submit an edit request')
local action = self._protectionObj.action
local level = self._protectionObj.level
-- Get the edit request type.
local requestType
if action == 'edit' then
if level == 'autoconfirmed' then
requestType = 'semi'
elseif level == 'extendedconfirmed' then
requestType = 'extended'
elseif level == 'templateeditor' then
requestType = 'template'
end
end
requestType = requestType or 'full'
-- Get the display value.
local display = self:_getExpandedMessage('edit-request-display')
return mEditRequest._link{type = requestType, display = display}
end
function Blurb:_makeExpiryParameter()
local expiry = self._protectionObj.expiry
if type(expiry) == 'number' then
return self:_formatDate(expiry)
else
return expiry
end
end
function Blurb:_makeExplanationBlurbParameter()
-- Cover special cases first.
if self._protectionObj.title.namespace == 8 then
-- MediaWiki namespace
return self:_getExpandedMessage('explanation-blurb-nounprotect')
end
-- Get explanation blurb table keys
local action = self._protectionObj.action
local level = self._protectionObj.level
local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject'
-- Find the message in the explanation blurb table and substitute any
-- parameters.
local explanations = self._cfg.explanationBlurbs
local msg
if explanations[action][level] and explanations[action][level][talkKey] then
msg = explanations[action][level][talkKey]
elseif explanations[action][level] and explanations[action][level].default then
msg = explanations[action][level].default
elseif explanations[action].default and explanations[action].default[talkKey] then
msg = explanations[action].default[talkKey]
elseif explanations[action].default and explanations[action].default.default then
msg = explanations[action].default.default
else
error(string.format(
'could not find explanation blurb for action "%s", level "%s" and talk key "%s"',
action,
level,
talkKey
), 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeImageLinkParameter()
local imageLinks = self._cfg.imageLinks
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if imageLinks[action][level] then
msg = imageLinks[action][level]
elseif imageLinks[action].default then
msg = imageLinks[action].default
else
msg = imageLinks.edit.default
end
return self:_substituteParameters(msg)
end
function Blurb:_makeIntroBlurbParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('intro-blurb-expiry')
else
return self:_getExpandedMessage('intro-blurb-noexpiry')
end
end
function Blurb:_makeIntroFragmentParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('intro-fragment-expiry')
else
return self:_getExpandedMessage('intro-fragment-noexpiry')
end
end
function Blurb:_makePagetypeParameter()
local pagetypes = self._cfg.pagetypes
return pagetypes[self._protectionObj.title.namespace]
or pagetypes.default
or error('no default pagetype defined', 8)
end
function Blurb:_makeProtectionBlurbParameter()
local protectionBlurbs = self._cfg.protectionBlurbs
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if protectionBlurbs[action][level] then
msg = protectionBlurbs[action][level]
elseif protectionBlurbs[action].default then
msg = protectionBlurbs[action].default
elseif protectionBlurbs.edit.default then
msg = protectionBlurbs.edit.default
else
error('no protection blurb defined for protectionBlurbs.edit.default', 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeProtectionDateParameter()
local protectionDate = self._protectionObj.protectionDate
if type(protectionDate) == 'number' then
return self:_formatDate(protectionDate)
else
return protectionDate
end
end
function Blurb:_makeProtectionLevelParameter()
local protectionLevels = self._cfg.protectionLevels
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if protectionLevels[action][level] then
msg = protectionLevels[action][level]
elseif protectionLevels[action].default then
msg = protectionLevels[action].default
elseif protectionLevels.edit.default then
msg = protectionLevels.edit.default
else
error('no protection level defined for protectionLevels.edit.default', 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeProtectionLogParameter()
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'autoreview' then
-- We need the pending changes log.
return makeFullUrl(
'Special:Log',
{type = 'stable', page = pagename},
self:_getExpandedMessage('pc-log-display')
)
else
-- We need the protection log.
return makeFullUrl(
'Special:Log',
{type = 'protect', page = pagename},
self:_getExpandedMessage('protection-log-display')
)
end
end
function Blurb:_makeTalkPageParameter()
return string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[self._protectionObj.title.namespace].talk.name,
self._protectionObj.title.text,
self._args.section or 'top',
self:_getExpandedMessage('talk-page-link-display')
)
end
function Blurb:_makeTooltipBlurbParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-blurb-expiry')
else
return self:_getExpandedMessage('tooltip-blurb-noexpiry')
end
end
function Blurb:_makeTooltipFragmentParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-fragment-expiry')
else
return self:_getExpandedMessage('tooltip-fragment-noexpiry')
end
end
function Blurb:_makeVandalTemplateParameter()
return mw.getCurrentFrame():expandTemplate{
title="vandal-m",
args={self._args.user or self._protectionObj.title.baseText}
}
end
-- Public methods --
function Blurb:makeBannerText(key)
-- Validate input.
if not key or not Blurb.bannerTextFields[key] then
error(string.format(
'"%s" is not a valid banner config field',
tostring(key)
), 2)
end
-- Generate the text.
local msg = self._protectionObj.bannerConfig[key]
if type(msg) == 'string' then
return self:_substituteParameters(msg)
elseif type(msg) == 'function' then
msg = msg(self._protectionObj, self._args)
if type(msg) ~= 'string' then
error(string.format(
'bad output from banner config function with key "%s"'
.. ' (expected string, got %s)',
tostring(key),
type(msg)
), 4)
end
return self:_substituteParameters(msg)
end
end
--------------------------------------------------------------------------------
-- BannerTemplate class
--------------------------------------------------------------------------------
local BannerTemplate = {}
BannerTemplate.__index = BannerTemplate
function BannerTemplate.new(protectionObj, cfg)
local obj = {}
obj._cfg = cfg
-- Set the image filename.
local imageFilename = protectionObj.bannerConfig.image
if imageFilename then
obj._imageFilename = imageFilename
else
-- If an image filename isn't specified explicitly in the banner config,
-- generate it from the protection status and the namespace.
local action = protectionObj.action
local level = protectionObj.level
local namespace = protectionObj.title.namespace
local reason = protectionObj.reason
-- Deal with special cases first.
if (
namespace == 10
or namespace == 828
or reason and obj._cfg.indefImageReasons[reason]
)
and action == 'edit'
and level == 'sysop'
and not protectionObj:isTemporary()
then
-- Fully protected modules and templates get the special red "indef"
-- padlock.
obj._imageFilename = obj._cfg.msg['image-filename-indef']
else
-- Deal with regular protection types.
local images = obj._cfg.images
if images[action] then
if images[action][level] then
obj._imageFilename = images[action][level]
elseif images[action].default then
obj._imageFilename = images[action].default
end
end
end
end
return setmetatable(obj, BannerTemplate)
end
function BannerTemplate:renderImage()
local filename = self._imageFilename
or self._cfg.msg['image-filename-default']
or 'Transparent.gif'
return makeFileLink{
file = filename,
size = (self.imageWidth or 20) .. 'px',
alt = self._imageAlt,
link = self._imageLink,
caption = self.imageCaption
}
end
--------------------------------------------------------------------------------
-- Banner class
--------------------------------------------------------------------------------
local Banner = setmetatable({}, BannerTemplate)
Banner.__index = Banner
function Banner.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj.imageWidth = 40
obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip.
obj._reasonText = blurbObj:makeBannerText('text')
obj._explanationText = blurbObj:makeBannerText('explanation')
obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing.
return setmetatable(obj, Banner)
end
function Banner:__tostring()
-- Renders the banner.
makeMessageBox = makeMessageBox or require('Module:Message box').main
local reasonText = self._reasonText or error('no reason text set', 2)
local explanationText = self._explanationText
local mbargs = {
page = self._page,
type = 'protection',
image = self:renderImage(),
text = string.format(
"'''%s'''%s",
reasonText,
explanationText and '<br />' .. explanationText or ''
)
}
return makeMessageBox('mbox', mbargs)
end
--------------------------------------------------------------------------------
-- Padlock class
--------------------------------------------------------------------------------
local Padlock = setmetatable({}, BannerTemplate)
Padlock.__index = Padlock
function Padlock.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj.imageWidth = 20
obj.imageCaption = blurbObj:makeBannerText('tooltip')
obj._imageAlt = blurbObj:makeBannerText('alt')
obj._imageLink = blurbObj:makeBannerText('link')
obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action]
or cfg.padlockIndicatorNames.default
or 'pp-default'
return setmetatable(obj, Padlock)
end
function Padlock:__tostring()
local frame = mw.getCurrentFrame()
-- The nowiki tag helps prevent whitespace at the top of articles.
return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{
name = 'indicator',
args = {name = self._indicatorName},
content = self:renderImage()
}
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p = {}
function p._exportClasses()
-- This is used for testing purposes.
return {
Protection = Protection,
Blurb = Blurb,
BannerTemplate = BannerTemplate,
Banner = Banner,
Padlock = Padlock,
}
end
function p._main(args, cfg, title)
args = args or {}
cfg = cfg or require(CONFIG_MODULE)
local protectionObj = Protection.new(args, cfg, title)
local ret = {}
-- If a page's edit protection is equally or more restrictive than its
-- protection from some other action, then don't bother displaying anything
-- for the other action (except categories).
if not yesno(args.catonly) and (protectionObj.action == 'edit' or
args.demolevel or
not getReachableNodes(
cfg.hierarchy,
protectionObj.level
)[effectiveProtectionLevel('edit', protectionObj.title)])
then
-- Initialise the blurb object
local blurbObj = Blurb.new(protectionObj, args, cfg)
-- Render the banner
if protectionObj:shouldShowLock() then
ret[#ret + 1] = tostring(
(yesno(args.small) and Padlock or Banner)
.new(protectionObj, blurbObj, cfg)
)
end
end
-- Render the categories
if yesno(args.category) ~= false then
ret[#ret + 1] = protectionObj:makeCategoryLinks()
end
return table.concat(ret)
end
function p.main(frame, cfg)
cfg = cfg or require(CONFIG_MODULE)
-- Find default args, if any.
local parent = frame.getParent and frame:getParent()
local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', '')]
-- Find user args, and use the parent frame if we are being called from a
-- wrapper template.
getArgs = getArgs or require('Module:Arguments').getArgs
local userArgs = getArgs(frame, {
parentOnly = defaultArgs,
frameOnly = not defaultArgs
})
-- Build the args table. User-specified args overwrite default args.
local args = {}
for k, v in pairs(defaultArgs or {}) do
args[k] = v
end
for k, v in pairs(userArgs) do
args[k] = v
end
return p._main(args, cfg)
end
return p
894f0884d4c2da1ce19d385b96f59af654b0946a
Module:Message box
828
18
125
2022-10-21T19:39:49Z
dev>Pppery
0
These can just go, the first for being very Wikipedia-specific, and the second for being almost impossible to import properly
Scribunto
text/plain
-- This is a meta-module for producing message box templates, including
-- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.
-- Load necessary modules.
require('Module:No globals')
local getArgs
local yesno = require('Module:Yesno')
local templatestyles = 'Module:Message box/styles.css'
-- Get a language object for formatDate and ucfirst.
local lang = mw.language.getContentLanguage()
-- Define constants
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {user = 'tmbox', talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <small class='date-container'>''(<span class='date'>%s</span>)''</small>", date)
end
self.info = args.info
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
if cfg.imageEmptyCellStyle then
self.imageEmptyCellStyle = 'border:none;padding:0px;width:1px'
end
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
or 'Imbox notice.png', imageSize)
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):css('width', '52px')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
:cssText(self.imageEmptyCellStyle or nil)
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) and not self.isSmall then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):css('width', '52px')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:css('text-align', 'center')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
local function templatestyles(frame, src)
return mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = templatestyles} }
.. 'CONFIG_MODULE'
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
be00cd389f9f2afcd361e5d5e33622839555cbd9
Module:Template wrapper
828
182
464
2022-10-21T21:11:46Z
wikipedia>Legoktm
0
Replace [[Module:No globals]] with require( "strict" )
Scribunto
text/plain
require('strict');
local error_msg = '<span style=\"font-size:100%\" class=\"error\"><code style=\"color:inherit; border:inherit; padding:inherit;\">|_template=</code> missing or empty</span>';
--[[--------------------------< I S _ I N _ T A B L E >--------------------------------------------------------
scan through tbl looking for value; return true if found, false else
]]
local function is_in_table (tbl, value)
for k, v in pairs (tbl) do
if v == value then return true end
end
return false;
end
--[[--------------------------< A D D _ P A R A M E T E R >----------------------------------------------------
adds parameter name and its value to args table according to the state of boolean list argument; kv pair for
template execution; k=v string for template listing.
]]
local function add_parameter (k, v, args, list)
if list then
table.insert( args, table.concat ({k, '=', v})); -- write parameter names and values to args table as string
else
args[k] = v; -- copy parameters to args table
end
end
--[[--------------------------< A L I A S _ M A P _ G E T >----------------------------------------------------
returns a table of local template (parent frame) parameter names and the target template names that match where
in [key]=<value> pairs where:
[key] is local template parameter name (an alias)
<value> is target template parameter name (the canonical parameter name used in the working template)
The parameter |_alias-map= has the form:
|_alias-map=<list>
where <list> is a comma-separated list of alias / canonical parameter name pairs in the form
<from> : <to>
where:
<from> is the local template's parameter name (alias)
<to> is the target template's parameter name (canonical)
for enumerated parameters place an octothorp (#) where the enumerator digits are placed in the parameter names:
<from#> : <to#>
]]
local function alias_map_get (_alias_map)
local T = mw.text.split (_alias_map, '%s*,%s*'); -- convert the comma-separated list into a table of alias pairs
local mapped_aliases = {}; -- mapped aliases will go here
local l_name, t_name; -- parameter names
for _, alias_pair in ipairs (T) do -- loop through the table of alias pairs
l_name, t_name = alias_pair:match ('(.-)%s*:%s*(.+)'); -- from each pair, get local and target parameter names
if l_name and t_name then -- if both are set
if tonumber (l_name) then
l_name = tonumber (l_name); -- convert number-as-text to a number
end
mapped_aliases[l_name] = t_name; -- add them to the map table
end
end
return mapped_aliases;
end
--[[--------------------------< F R A M E _ A R G S _ G E T >--------------------------------------------------
Fetch the wrapper template's 'default' and control parameters; adds default parameters to args
returns content of |_template= parameter (name of the working template); nil else
]]
local function frame_args_get (frame_args, args, list)
local template;
for k, v in pairs (frame_args) do -- here we get the wrapper template's 'default' parameters
if 'string' == type (k) and (v and ('' ~= v)) then -- do not pass along positional or empty parameters
if '_template' == k then
template = v; -- save the name of template that we are wrapping
elseif '_exclude' ~= k and '_reuse' ~= k and '_include-positional' ~= k and '_alias-map' ~= k then -- these already handled so ignore here;
add_parameter (k, v, args, list); -- add all other parameters to args in the style dictated by list
end
end
end
return template; -- return contents of |_template= parameter
end
--[=[--------------------------< P F R A M E _ A R G S _ G E T >------------------------------------------------
Fetches the wrapper template's 'live' parameters; adds live parameters that aren't members of the exclude table to
args table; positional parameters may not be excluded
no return value
]=]
local function pframe_args_get (pframe_args, args, exclude, _include_positional, list)
for k, v in pairs (pframe_args) do
if 'string' == type (k) and not is_in_table (exclude, k) then -- do not pass along excluded parameters
if v and ('' ~= v) then -- pass along only those parameters that have assigned values
if 'unset' == v:lower() then -- special keyword to unset 'default' parameters set in the wrapper template
v = ''; -- unset the value in the args table
end
add_parameter (k, v, args, list) -- add all other parameters to args in the style dictated by list; alias map only supported for local-template parameters
end
end
end
if _include_positional then
for i, v in ipairs (pframe_args) do -- pass along positional parameters
if 'unset' == v:lower() then -- special keyword to unset 'default' parameters set in the wrapper template
v = ''; -- unset the value in the args table
end
add_parameter (i, v, args, list);
end
end
end
--[[--------------------------< _ M A I N >--------------------------------------------------------------------
Collect the various default and live parameters into args styled according to boolean list.
returns name of the working or listed template or nil for an error message
]]
local function _main (frame, args, list)
local template;
local exclude = {}; -- table of parameter names for parameters that are not passed to the working template
local reuse_list = {}; -- table of pframe parameter names whose values are modified before they are passed to the working template as the same name
local alias_map = {}; -- table that maps parameter aliases to working template canonical parameter names
local _include_positional;
if frame.args._exclude and ('' ~= frame.args._exclude) then -- if there is |_exclude= and it's not empty
exclude = mw.text.split (frame.args._exclude, "%s*,%s*"); -- make a table from its contents
end
-- TODO: |_reuse= needs a better name (|_reuse=)
if frame.args._reuse and ('' ~= frame.args._reuse) then -- if there is |_reuse= and it's not empty
reuse_list = mw.text.split (frame.args._reuse, "%s*,%s*"); -- make a table from its contents
end
if frame.args['_alias-map'] and ('' ~= frame.args['_alias-map']) then -- if there is |_alias-map= and it's not empty
alias_map = alias_map_get (frame.args['_alias-map']); -- make a table from its contents
end
template = frame_args_get (frame.args, args, list); -- get parameters provided in the {{#invoke:template wrapper|...|...}}
if nil == template or '' == template then -- this is the one parameter that is required by this module
return nil; -- not present, tell calling function to emit an error message
end
_include_positional = 'yes' == frame.args['_include-positional']; -- when true pass all positional parameters along with non-excluded named parameters to ...
-- ... the working template; positional parameters are not excludable
local _pframe_args = frame:getParent().args; -- here we get the wrapper template's 'live' parameters from pframe.args
local pframe_args = {}; -- a local table that we can modify
for k, v in pairs (_pframe_args) do -- make a copy that we can modify
pframe_args[k] = v;
end
-- here we look for pframe parameters that are aliases of canonical parameter names; when found
-- we replace the alias with the canonical. We do this here because the reuse_list works on
-- canonical parameter names so first we convert alias parameter names to canonical names and then
-- we remove those canonical names from the pframe table that are reused (provided to the working
-- template through the frame args table)
for k, v in pairs (alias_map) do -- k is alias name, v is canonical name
if pframe_args[k] then -- if pframe_args has parameter with alias name
pframe_args[v] = _pframe_args[k]; -- create new canonical name with alias' value
pframe_args[k] = nil; -- unset the alias
end
end
for k, v in pairs (pframe_args) do -- do enumerated parameter alias -> canonical translation
if 'string' == type (k) then -- only named parameters can be enumerated
if alias_map[k..'#'] then -- non-enumerated alias matches enumerated parameter pattern? enumerator at end only
pframe_args[alias_map[k..'#']:gsub('#', '')] = v; -- remove '#' and copy parameter to pframe_args table
pframe_args[k] = nil; -- unset the alias
elseif k:match ('%d+') then -- if this parameter name contains digits
local temp = k:gsub ('%d+', '#'); -- make a copy; digits replaced with single '#'
local enum = k:match ('%d+'); -- get the enumerator
if alias_map[temp] then -- if this parameter is a recognized enumerated alias
pframe_args[alias_map[temp]:gsub('#', enum)] = v; -- use canonical name and replace '#' with enumerator and add to pframe_args
pframe_args[k] = nil; -- unset the alias
end
end
end
end
-- pframe parameters that are _reused are 'reused' have the form something like this:
-- |chapter=[[wikisource:{{{chapter}}}|{{{chapter}}}]]
-- where a parameter in the wrapping template is modified and then passed to the working template
-- using the same parameter name (in this example |chapter=)
-- remove parameters that will be reused
for k, v in ipairs (reuse_list) do -- k is numerical index, v is canonical parameter name to ignore
if pframe_args[v] then -- if pframe_args has parameter that should be ignored
pframe_args[v] = nil; -- unset the ignored parameter
end
end
pframe_args_get (pframe_args, args, exclude, _include_positional, list); -- add parameters and values to args that are not listed in the exclude table
return template; -- args now has all default and live parameters, return working template name
end
--[[--------------------------< W R A P >----------------------------------------------------------------------
Template entry point. Call this function to 'execute' the working template
]]
local function wrap (frame)
local args = {}; -- table of default and live parameters and their values to be passed to the wrapped template
local template; -- the name of the working template
template = _main (frame, args, false); -- get default and live parameters and the name of the working template
if not template then -- template name is required
return error_msg; -- emit error message and abandon if template name not present
end
return frame:expandTemplate {title=template, args=args}; -- render the working template
end
--[[--------------------------< L I S T >----------------------------------------------------------------------
Template entry point. Call this function to 'display' the source for the working template. This function added
as a result of a TfD here: Wikipedia:Templates_for_discussion/Log/2018_April_28#Module:PassArguments
This function replaces a similarly named function which was used in {{cite compare}} and {{cite compare2}}
Values in the args table are numerically indexed strings in the form 'name=value'
]]
local function list(frame, do_link)
local args = {}; -- table of default and live parameters and their values to be passed to the listed template
local template; -- the name of the listed template
template = _main (frame, args, true); -- get default and live parameters and the name of the listed template
if not template then -- template name is required
return error_msg; -- emit error message and abandon if template name not present
end
if do_link then
template = ('[[%s|%s]]'):format(frame:expandTemplate{ title='Transclude', args = {template} }, template)
end
table.sort(args)
for i = 1, #args do
local stripped = args[i]:match('^' .. i .. '=([^=]*)$')
if stripped then args[i] = stripped else break end
end
return frame:preprocess(table.concat({
'<code style="color:inherit; background:inherit; border:none;">{{',
template,
('<wbr><nowiki>|%s</nowiki>'):rep(#args):format(unpack(args)), '}}</code>'})); -- render the template
end
local function link (frame)
return list(frame, true)
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
link = link,
list = list,
wrap = wrap,
};
5e3d3ed3f3988725fb0fef6b44479bacc4210f37
Template:Trim
10
281
676
2022-10-26T14:01:15Z
wikipedia>MSGJ
0
x parameter not needed
wikitext
text/x-wiki
<includeonly>{{safesubst:#if:1|{{{1|}}}}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
3d29fbfff9683523147db6e1f55c0e17ed30863b
Template:Lua
10
31
69
2022-10-28T05:41:39Z
meta>Agent Isai
0
1 revision imported from [[:metawikimedia:Template:Lua]]: Required for local usage
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>{{Lua|Module:Lua banner}}{{documentation}}[[Category:Utility templates]]</noinclude>
fd85a870209733ca65a7290fa45f6b4f321bac0b
Module:Lua banner/config
828
30
67
2022-10-28T05:41:41Z
meta>Agent Isai
0
1 revision imported from [[:metawikimedia:Module:Lua_banner/config]]: Required for local usage
Scribunto
text/plain
local cfg = {} -- Don’t touch this line.
-- Subpage blacklist: these subpages will not be categorized (except for the
-- error category, which is always added if there is an error).
-- For example “Template:Foo/doc” matches the `doc = true` rule, so it will have
-- no categories. “Template:Foo” and “Template:Foo/documentation” match no rules,
-- so they *will* have categories. All rules should be in the
-- ['<subpage name>'] = true,
-- format.
cfg['subpage_blacklist'] = {
['doc'] = true,
['sandbox'] = true,
['sandbox2'] = true,
['testcases'] = true,
}
-- Allow wishes: whether wishes for conversion to Lua are allowed.
-- If true, calls with zero parameters are valid, and considered to be wishes:
-- The box’s text is “This template should use Lua”, and cfg['wish_category'] is
-- added. If false, such calls are invalid, an error message appears, and
-- cfg['error_category'] is added.
cfg['allow_wishes'] = false
-- Default category: this category is added if the module call contains errors
-- (e.g. no module listed). A category name without namespace, or nil
-- to disable categorization (not recommended).
cfg['error_category'] = 'Lua templates with errors'
-- Wish category: this category is added if no module is listed, and wishes are
-- allowed. (Not used if wishes are not allowed.) A category name without
-- namespace, or nil to disable categorization.
cfg['wish_category'] = nil
-- Default category: this category is added if none of the below module_categories
-- matches the first module listed. A category name without namespace, or nil
-- to disable categorization.
cfg['default_category'] = 'Lua-based templates'
-- Module categories: one of these categories is added if the first listed module
-- is the listed module (e.g. {{Lua|Module:String}} adds
-- [[Category:Lua String-based templates]].) Format:
-- ['<module name>'] = '<category name>'
-- where neither <module name> nor <category name> contains namespace. An empty
-- table (i.e. no module-based categorization) will suffice on smaller wikis.
cfg['module_categories'] = {
['Citation'] = 'Lua-based citation templates',
['Citation/CS1'] = 'Lua-based citation templates',
}
return cfg -- Don’t touch this line.
96ff2360e00fa7bf1df8fa9bea988789b8a82cab
Module:No globals
828
19
31
2022-10-28T05:42:58Z
meta>Agent Isai
0
1 revision imported from [[:metawikimedia:Module:No_globals]]: Required for local usage
Scribunto
text/plain
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
-- perf optimization here and below: do not load Module:TNT unless there is an error
error(require('Module:TNT').format('I18n/No globals', 'err-read', tostring(k)), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error(require('Module:TNT').format('I18n/No globals', 'err-write', tostring(k)), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)
efcb47c74e7e2bb9a4ad8764d99a0afce8fed410
Module:Template translation
828
17
27
2022-10-28T05:42:59Z
meta>Agent Isai
0
6 revisions imported from [[:metawikimedia:Module:Template_translation]]: Required for local usage
Scribunto
text/plain
local this = {}
function this.checkLanguage(subpage, default)
--[[Check first if there's an any invalid character that would cause the
mw.language.isKnownLanguageTag function() to throw an exception:
- all ASCII controls in [\000-\031\127],
- double quote ("), sharp sign (#), ampersand (&), apostrophe ('),
- slash (/), colon (:), semicolon (;), lower than (<), greater than (>),
- brackets and braces ([, ], {, }), pipe (|), backslash (\\)
All other characters are accepted, including space and all non-ASCII
characters (including \192, which is invalid in UTF-8).
--]]
if mw.language.isValidCode(subpage) and mw.language.isKnownLanguageTag(subpage)
--[[However "SupportedLanguages" are too restrictive, as they discard many
valid BCP47 script variants (only because MediaWiki still does not
define automatic transliterators for them, e.g. "en-dsrt" or
"fr-brai" for French transliteration in Braille), and country variants,
(useful in localized data, even if they are no longer used for
translations, such as zh-cn, also useful for legacy codes).
We want to avoid matching subpagenames containing any uppercase letter,
(even if they are considered valid in BCP 47, in which they are
case-insensitive; they are not "SupportedLanguages" for MediaWiki, so
they are not "KnownLanguageTags" for MediaWiki).
To be more restrictive, we exclude tags
* for specific uses in template subpages and unusable as language tags;
* that is not ASCII and not a lowercase letter, minus-hyphen, or digit,
or does not start by a letter or does not finish by a letter or digit;
* or that has subtags with more than 8 characters between hyphens;
* or that has two hyphens.
--]]
or subpage ~= "doc"
and subpage ~= "layout"
and subpage ~= "button"
and subpage ~= "buttons"
and subpage ~= "sandbox"
and subpage ~= "testcase"
and subpage ~= "testcases"
and string.find(subpage, "^[%l][%-%d%l]*[%d%l]$") ~= nil
and string.find(subpage, "[%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l]") == nil
and string.find(subpage, "%-%-") == nil then
return subpage
end
-- Otherwise there's currently no known language subpage
return default
end
--[[Get the last subpage of an arbitrary page if it is a translation.
To be used from templates.
]]
function this.getLanguageSubpage(frame)
local title = frame and frame.args[1]
if not title or title == '' then
title = mw.title.getCurrentTitle()
end
return this._getLanguageSubpage(title)
end
--[[Get the last subpage of an arbitrary page if it is a translation.
To be used from Lua.
]]
function this._getLanguageSubpage(title)
if type(title) == 'string' then
title = mw.title.new(title)
end
if not title then
-- invalid title
return nil
end
--[[This code does not work in all namespaces where the Translate tool works.
-- It works in the main namespace on Meta because it allows subpages there
-- It would not work in the main namespace of English Wikipedia (but the
-- articles are monolignual on that wiki).
-- On Meta-Wiki the main space uses subpages and its pages are translated.
-- The Translate tool allows translatng pages in all namespaces, even if
-- the namespace officially does not have subpages.
-- On Meta-Wiki the Category namespace still does not have subpages enabled,
-- even if they would be very useful for categorizing templates, that DO have
-- subpages (for documentatio and tstboxes pages). This is a misconfiguration
-- bug of Meta-Wiki. The work-around is to split the full title and then
-- get the last titlepart.
local subpage = title.subpageText
--]]
local titleparts = mw.text.split(title.fullText, '/')
local subpage = titleparts[#titleparts]
return this.checkLanguage(subpage, '')
end
--[[Get the last subpage of the current page if it is a translation.
]]
function this.getCurrentLanguageSubpage()
return this._getLanguageSubpage(mw.title.getCurrentTitle())
end
--[[Get the first part of the language code of the subpage, before the '-'.
--]]
function this.getMainLanguageSubpage()
parts = mw.text.split(this.getCurrentLanguageSubpage(), '-')
return parts[1]
end
--[[Get the last subpage of the current frame if it is a translation.
Not used locally.
--]]
function this.getFrameLanguageSubpage(frame)
return this._getLanguageSubpage(frame:getParent():getTitle())
end
--[[Get the language of the current page. Not used locally.
--]]
function this.getLanguage()
local subpage = mw.title.getCurrentTitle().subpageText
return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode())
end
--[[Get the language of the current frame. Not used locally.
--]]
function this.getFrameLanguage(frame)
local titleparts = mw.text.split(frame:getParent():getTitle(), '/')
local subpage = titleparts[#titleparts]
return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode())
end
function this.title(namespace, basepagename, subpage)
local message, title
local pagename = basepagename
if (subpage or '') ~= '' then
pagename = pagename .. '/' .. subpage
end
local valid, title = xpcall(function()
return mw.title.new(pagename, namespace) -- costly
end, function(msg) -- catch undocumented exception (!?)
-- thrown when namespace does not exist. The doc still
-- says it should return a title, even in that case...
message = msg
end)
if valid and title ~= nil and (title.id or 0) ~= 0 then
return title
end
return { -- "pseudo" mw.title object with id = nil in case of error
prefixedText = pagename, -- the only property we need below
message = message -- only for debugging
}
end
--[[If on a translation subpage (like Foobar/de), this function returns
a given template in the same language, if the translation is available.
Otherwise, the template is returned in its default language, without
modification.
This is aimed at replacing the current implementation of Template:TNTN.
This version does not expand the returned template name: this solves the
problem of self-recursion in TNT when translatable templates need themselves
to transclude other translable templates (such as Tnavbar).
--]]
function this.getTranslatedTemplate(frame, withStatus)
local args = frame.args
local pagename = args['template']
--[[Check whether the pagename is actually in the Template namespace, or
if we're transcluding a main-namespace page.
(added for backward compatibility of Template:TNT)
]]
local namespace, title = args['tntns'] or ''
if namespace ~= '' then -- Checks for tntns parameter for custom ns.
title = this.title(namespace, pagename) -- Costly
else -- Supposes that set page is in ns10.
namespace = 'Template'
title = this.title(namespace, pagename) -- Costly
if title.id == nil then -- not found in the Template namespace, assume the main namespace (for backward compatibility)
namespace = ''
title = this.title(namespace, pagename) -- Costly
end
end
-- Get the last subpage and check if it matches a known language code.
local subpage = args['uselang'] or ''
if subpage == '' then
subpage = this.getCurrentLanguageSubpage()
end
if subpage == '' then
-- Check if a translation of the pagename exists in English
local newtitle = this.title(namespace, pagename, 'en') -- Costly
-- Use the translation when it exists
if newtitle.id ~= nil then
title = newtitle
end
else
-- Check if a translation of the pagename exists in that language
local newtitle = this.title(namespace, pagename, subpage) -- Costly
if newtitle.id == nil then
-- Check if a translation of the pagename exists in English
newtitle = this.title(namespace, pagename, 'en') -- Costly
end
-- Use the translation when it exists
if newtitle.id ~= nil then
title = newtitle
end
end
-- At this point the title should exist
if withStatus then
-- status returned to Lua function below
return title.prefixedText, title.id ~= nil
else
-- returned directly to MediaWiki
return title.prefixedText
end
end
--[[If on a translation subpage (like Foobar/de), this function renders
a given template in the same language, if the translation is available.
Otherwise, the template is rendered in its default language, without
modification.
This is aimed at replacing the current implementation of Template:TNT.
Note that translatable templates cannot transclude themselves other
translatable templates, as it will recurse on TNT. Use TNTN instead
to return only the effective template name to expand externally, with
template parameters also provided externally.
--]]
function this.renderTranslatedTemplate(frame)
local title, found = this.getTranslatedTemplate(frame, true)
-- At this point the title should exist prior to performing the expansion
-- of the template, otherwise render a red link to the missing page
-- (resolved in its assumed namespace). If we don't tet this here, a
-- script error would be thrown. Returning a red link is consistant with
-- MediaWiki behavior when attempting to transclude inexistant templates.
if not found then
return '[[' .. title .. ']]'
end
-- Copy args pseudo-table to a proper table so we can feed it to expandTemplate.
-- Then render the pagename.
local args = frame.args
local pargs = (frame:getParent() or {}).args
local arguments = {}
if (args['noshift'] or '') == '' then
for k, v in pairs(pargs) do
local n = tonumber(k) or 0
if n <= 0 then -- unnumbered args
arguments[k] = v
elseif n >= 2 then -- numbered args >= 2 need to be shifted
arguments[n - 1] = v
end
end
else -- special case where TNT is used as autotranslate
-- (don't shift again what is shifted in the invokation)
for k, v in pairs(pargs) do
arguments[k] = v
end
end
arguments['template'] = title -- override the existing parameter of the base template name supplied with the full name of the actual template expanded
arguments['tntns'] = nil -- discard the specified namespace override
arguments['uselang'] = args['uselang'] -- argument forwarded into parent frame
arguments['noshift'] = args['noshift'] -- argument forwarded into parent frame
return frame:expandTemplate{title = ':' .. title, args = arguments}
end
--[[A helper for mocking TNT in Special:TemplateSandbox. TNT breaks
TemplateSandbox; mocking it with this method means templates won't be
localized but at least TemplateSandbox substitutions will work properly.
Won't work with complex uses.
--]]
function this.mockTNT(frame)
local pargs = (frame:getParent() or {}).args
local arguments = {}
for k, v in pairs(pargs) do
local n = tonumber(k) or 0
if n <= 0 then -- unnumbered args
arguments[k] = v
elseif n >= 2 then -- numbered args >= 2 need to be shifted
arguments[n - 1] = v
end
end
if not pargs[1] then
return ''
end
return frame:expandTemplate{title = 'Template:' .. pargs[1], args = arguments}
end
return this
5d6ccce18a15ce0078fd1918b6afeb5b443f37ee
Module:Documentation/i18n
828
23
53
2022-10-28T05:43:07Z
meta>Agent Isai
0
2 revisions imported from [[:metawikimedia:Module:Documentation/i18n]]: Required for local usage
Scribunto
text/plain
local format = require('Module:TNT').format
local i18n = {}
i18n['cfg-error-msg-type'] = format('I18n/Documentation', 'cfg-error-msg-type')
i18n['cfg-error-msg-empty'] = format('I18n/Documentation', 'cfg-error-msg-empty')
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
i18n['template-namespace-heading'] = format('I18n/Documentation', 'template-namespace-heading')
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
i18n['module-namespace-heading'] = format('I18n/Documentation', 'module-namespace-heading')
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
i18n['file-namespace-heading'] = format('I18n/Documentation', 'file-namespace-heading')
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
i18n['other-namespaces-heading'] = format('I18n/Documentation', 'other-namespaces-heading')
-- cfg['view-link-display']
-- The text to display for "view" links.
i18n['view-link-display'] = format('I18n/Documentation', 'view-link-display')
-- cfg['edit-link-display']
-- The text to display for "edit" links.
i18n['edit-link-display'] = format('I18n/Documentation', 'edit-link-display')
-- cfg['history-link-display']
-- The text to display for "history" links.
i18n['history-link-display'] = format('I18n/Documentation', 'history-link-display')
-- cfg['purge-link-display']
-- The text to display for "purge" links.
i18n['purge-link-display'] = format('I18n/Documentation', 'purge-link-display')
-- cfg['create-link-display']
-- The text to display for "create" links.
i18n['create-link-display'] = format('I18n/Documentation', 'create-link-display')
return i18n
9a9f234b177a424f1fc465eb25c484eff54905c0
Module:Documentation/styles.css
828
24
55
2022-10-28T05:43:10Z
meta>Agent Isai
0
31 revisions imported from [[:metawikimedia:Module:Documentation/styles.css]]: Required for local usage
text
text/plain
/* {{PP-template}} */
.ts-doc-sandbox .mbox-image {
padding:.75em 0 .75em .75em;
}
.ts-doc-doc {
clear: both;
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
margin-top: 1em;
padding: 5px;
}
.ts-doc-header {
padding-bottom: 3px;
border-bottom: 1px solid #a2a9b1;
margin-bottom: 1ex;
}
.ts-doc-header .ts-tlinks-tlinks {
display: inline-block;
line-height: 24px;
margin-left: 1em;
}
.ts-doc-header .ts-tlinks-tlinks a.external {
color: #0645ad;
}
.ts-doc-header .ts-tlinks-tlinks a.external:visited {
color: #0b0080;
}
.ts-doc-header .ts-tlinks-tlinks a.external:active {
color: #faa700;
}
.ts-doc-content:after {
content: '';
clear: both;
display: block;
}
.ts-doc-heading {
display: inline-block;
padding-left: 55px;
background: center left/50px no-repeat;
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png);
background-image: url(https://upload.wikimedia.org/wikipedia/commons/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg);
font-size: 1.5em;
}
.ts-doc-content > *:first-child,
.ts-doc-footer > *:first-child {
margin-top: .5em;
}
.ts-doc-content > *:last-child,
.ts-doc-footer > *:last-child {
margin-bottom: .5em;
}
.ts-doc-footer {
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
padding: .25em 1em;
margin-top: .2em;
font-style: italic;
}
.ts-doc-footer small {
font-style: normal;
}
.ts-doc-sandbox {
clear: both;
}
c37b0ddfd0b1c128c187ca56721d1c4e481b05ff
Template:IsDocSubpage
10
26
59
2022-10-28T05:43:20Z
meta>Agent Isai
0
1 revision imported from [[:metawikimedia:Template:IsDocSubpage]]: Required for local usage
wikitext
text/x-wiki
<onlyinclude><includeonly>{{#ifexpr: (
{{#ifeq:{{lc:{{SUBPAGENAME}}}}|{{lc:{{{override|doc}}}}}|1|0}} or (
{{#ifeq:{{lc:{{#titleparts:{{FULLPAGENAME}}|-1|-2}}}}|{{lc:{{{override|doc}}}}}|1|0}}
and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}}
)
)<!--
-->|{{{true|1}}}<!--
-->|{{{false|}}}<!--
-->}}</includeonly></onlyinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
e60f69b26953d441bf5b76229c9222f16c042ae6
Module:Message box/configuration
828
20
33
2022-11-09T19:50:51Z
meta>Agent Isai
0
1 revision imported from [[:wikipedia:Module:Message_box/configuration]]: Importing from [[w:|English Wikipedia]] to sync templates
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '<small>[[Help:Maintenance template removal|Learn how and when to remove this template message]]</small>',
templatestyles = 'Module:Message box/ambox.css'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true,
templatestyles = 'Module:Message box/cmbox.css'
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false,
templatestyles = 'Module:Message box/fmbox.css'
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox license.png' -- @todo We need an SVG version of this
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg'
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes',
templatestyles = 'Module:Message box/imbox.css'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true,
templatestyles = 'Module:Message box/ombox.css'
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
templateCategory = 'Talk message boxes',
templatestyles = 'Module:Message box/tmbox.css'
}
}
b6f0151037e6867b577c8cca32ff297e48697a10
Module:List
828
27
61
2022-11-09T19:51:04Z
meta>Agent Isai
0
1 revision imported from [[:wikipedia:Module:List]]: Importing from [[w:|English Wikipedia]] to sync templates
Scribunto
text/plain
-- This module outputs different kinds of lists. At the moment, bulleted,
-- unbulleted, horizontal, ordered, and horizontal ordered lists are supported.
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes
data.classes = {}
data.templatestyles = ''
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Template:Flatlist/styles.css' }
}
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Template:Plainlist/styles.css' }
}
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for i, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for i, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for i, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return data.templatestyles .. tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
b60cb90a28f54a237f389f8009157816b631d806
Module:TableTools
828
6
35
2022-11-09T19:51:05Z
meta>Agent Isai
0
1 revision imported from [[:wikipedia:Module:TableTools]]: Importing from [[w:|English Wikipedia]] to sync templates
Scribunto
text/plain
--[[
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should --
-- not be called directly from #invoke. --
------------------------------------------------------------------------------------
--]]
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
--[[
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
--]]
function p.isPositiveInteger(v)
if type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity then
return true
else
return false
end
end
--[[
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a value can be a valid table key. Lua will
-- generate an error if a NaN is used as a table key.
------------------------------------------------------------------------------------
--]]
function p.isNan(v)
if type(v) == 'number' and tostring(v) == '-nan' then
return true
else
return false
end
end
--[[
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
--]]
function p.shallowClone(t)
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
--]]
function p.removeDuplicates(t)
checkType('removeDuplicates', 1, t, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for i, v in ipairs(t) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
--]]
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k, v in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
-- return {1, 3, 6}.
------------------------------------------------------------------------------------
--]]
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
s = s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
return s
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k, v in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
-- of subtables in the format
-- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
-- Keys that don't end with an integer are stored in a subtable named "other".
-- The compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
--]]
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
--[[
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
--]]
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for k in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
else -- This will fail with table, boolean, function.
return item1 < item2
end
end
--[[
Returns a list of the keys in a table, sorted using either a default
comparison function or a custom keySort function.
]]
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, { 'function', 'boolean', 'nil' })
end
local list = {}
local index = 1
for key, value in pairs(t) do
list[index] = key
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(list, keySort)
end
return list
end
--[[
Iterates through a table, with the keys sorted using the keysToList function.
If there are only numerical keys, sparseIpairs is probably more efficient.
]]
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local list = p.keysToList(t, keySort, true)
local i = 0
return function()
i = i + 1
local key = list[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
--[[
Returns true if all keys in the table are consecutive integers starting at 1.
--]]
function p.isArray(t)
checkType("isArray", 1, t, "table")
local i = 0
for k, v in pairs(t) do
i = i + 1
if t[i] == nil then
return false
end
end
return true
end
-- { "a", "b", "c" } -> { a = 1, b = 2, c = 3 }
function p.invert(array)
checkType("invert", 1, array, "table")
local map = {}
for i, v in ipairs(array) do
map[v] = i
end
return map
end
--[[
{ "a", "b", "c" } -> { ["a"] = true, ["b"] = true, ["c"] = true }
--]]
function p.listToSet(t)
checkType("listToSet", 1, t, "table")
local set = {}
for _, item in ipairs(t) do
set[item] = true
end
return set
end
--[[
Recursive deep copy function.
Preserves identities of subtables.
]]
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[deepcopy(orig_key, includeMetatable, already_seen)] = deepcopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = deepcopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
--[[
Concatenates all values in the table that are indexed by a number, in order.
sparseConcat{ a, nil, c, d } => "acd"
sparseConcat{ nil, b, c, d } => "bcd"
]]
function p.sparseConcat(t, sep, i, j)
local list = {}
local list_i = 0
for _, v in p.sparseIpairs(t) do
list_i = list_i + 1
list[list_i] = v
end
return table.concat(list, sep, i, j)
end
--[[
-- This returns the length of a table, or the first integer key n counting from
-- 1 such that t[n + 1] is nil. It is similar to the operator #, but may return
-- a different value when there are gaps in the array portion of the table.
-- Intended to be used on data loaded with mw.loadData. For other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of
-- the number of unnamed template parameters, so use this function for
-- frame.args.
--]]
function p.length(t)
local i = 1
while t[i] ~= nil do
i = i + 1
end
return i - 1
end
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
fe918509f168332267834b3a6f5c219a9de5b2e7
Module:Navbar
828
4
39
2022-11-09T19:51:14Z
meta>Agent Isai
0
1 revision imported from [[:wikipedia:Module:Navbar]]: Importing from [[w:|English Wikipedia]] to sync templates
Scribunto
text/plain
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local function get_title_arg(is_collapsible, template)
local title_arg = 1
if is_collapsible then title_arg = 2 end
if template then title_arg = 'template' end
return title_arg
end
local function choose_links(template, args)
-- The show table indicates the default displayed items.
-- view, talk, edit, hist, move, watch
-- TODO: Move to configuration.
local show = {true, true, true, false, false, false}
if template then
show[2] = false
show[3] = false
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6,
talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
-- TODO: Consider removing TableTools dependency.
for _, v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
local remove_edit_link = args.noedit
if remove_edit_link then show[3] = false end
return show
end
local function add_link(link_description, ul, is_mini, font_style)
local l
if link_description.url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-' .. link_description.full)
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:attr('title', link_description.html_title)
:cssText(font_style)
:wikitext(is_mini and link_description.mini or link_description.full)
:done()
:wikitext(l[3])
:done()
end
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
if not title then
error(cfg.invalid_title .. title_text)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- TODO: Get link_descriptions and show into the configuration module.
-- link_descriptions should be easier...
local link_descriptions = {
{ ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template',
['link'] = title.fullText, ['url'] = false },
{ ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template',
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = title:fullUrl('action=edit'), ['url'] = true },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = title:fullUrl('action=history'), ['url'] = true },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template',
['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
local ul = mw.html.create('ul')
if has_brackets then
ul:addClass(cfg.classes.brackets)
:cssText(font_style)
end
for i, _ in ipairs(displayed_links) do
if displayed_links[i] then add_link(link_descriptions[i], ul, is_mini, font_style) end
end
return ul:done()
end
function p._navbar(args)
-- TODO: We probably don't need both fontstyle and fontcolor...
local font_style = args.fontstyle
local font_color = args.fontcolor
local is_collapsible = args.collapsible
local is_mini = args.mini
local is_plain = args.plain
local collapsible_class = nil
if is_collapsible then
collapsible_class = cfg.classes.collapsible
if not is_plain then is_mini = 1 end
if font_color then
font_style = (font_style or '') .. '; color: ' .. font_color .. ';'
end
end
local navbar_style = args.style
local div = mw.html.create():tag('div')
div
:addClass(cfg.classes.navbar)
:addClass(cfg.classes.plainlinks)
:addClass(cfg.classes.horizontal_list)
:addClass(collapsible_class) -- we made the determination earlier
:cssText(navbar_style)
if is_mini then div:addClass(cfg.classes.mini) end
local box_text = (args.text or cfg.box_text) .. ' '
-- the concatenated space guarantees the box text is separated
if not (is_mini or is_plain) then
div
:tag('span')
:addClass(cfg.classes.box_text)
:cssText(font_style)
:wikitext(box_text)
end
local template = args.template
local displayed_links = choose_links(template, args)
local has_brackets = args.brackets
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local list = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(list)
if is_collapsible then
local title_text_class
if is_mini then
title_text_class = cfg.classes.collapsible_title_mini
else
title_text_class = cfg.classes.collapsible_title_full
end
div:done()
:tag('div')
:addClass(title_text_class)
:cssText(font_style)
:wikitext(args[1])
end
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())
end
function p.navbar(frame)
return p._navbar(require('Module:Arguments').getArgs(frame))
end
return p
a5c8d3a8f8beb18984ea7f145ddbdf88a065d23e
Module:Navbar/configuration
828
5
41
2022-11-09T19:51:15Z
meta>Agent Isai
0
1 revision imported from [[:wikipedia:Module:Navbar/configuration]]: Importing from [[w:|English Wikipedia]] to sync templates
Scribunto
text/plain
return {
['templatestyles'] = 'Module:Navbar/styles.css',
['box_text'] = 'This box: ', -- default text box when not plain or mini
['title_namespace'] = 'Template', -- namespace to default to for title
['invalid_title'] = 'Invalid title ',
['classes'] = { -- set a line to nil if you don't want it
['navbar'] = 'navbar',
['plainlinks'] = 'plainlinks', -- plainlinks
['horizontal_list'] = 'hlist', -- horizontal list class
['mini'] = 'navbar-mini', -- class indicating small links in the navbar
['this_box'] = 'navbar-boxtext',
['brackets'] = 'navbar-brackets',
-- 'collapsible' is the key for a class to indicate the navbar is
-- setting up the collapsible element in addition to the normal
-- navbar.
['collapsible'] = 'navbar-collapse',
['collapsible_title_mini'] = 'navbar-ct-mini',
['collapsible_title_full'] = 'navbar-ct-full'
}
}
bbf3d86b48a5b40835e8e232ae9821e6bca390ec
Module:Navbar/styles.css
828
7
8
2022-11-09T19:51:16Z
meta>Agent Isai
0
1 revision imported from [[:wikipedia:Module:Navbar/styles.css]]: Importing from [[w:|English Wikipedia]] to sync templates
text
text/plain
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar-collapse {
float: left;
text-align: left;
}
.navbar-boxtext {
word-spacing: 0;
}
.navbar ul {
display: inline-block;
white-space: nowrap;
line-height: inherit;
}
.navbar-brackets::before {
margin-right: -0.125em;
content: '[ ';
}
.navbar-brackets::after {
margin-left: -0.125em;
content: ' ]';
}
.navbar li {
word-spacing: -0.125em;
}
.navbar a > span,
.navbar a > abbr {
text-decoration: inherit;
}
.navbar-mini abbr {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
.navbar-ct-full {
font-size: 114%;
margin: 0 7em;
}
.navbar-ct-mini {
font-size: 114%;
margin: 0 4em;
}
ffa40f872281063642a36504ff608aa4c75ecf55
Module:Lua banner
828
29
65
2022-11-09T19:51:28Z
meta>Agent Isai
0
1 revision imported from [[:wikipedia:Module:Lua_banner]]: Importing from [[w:|English Wikipedia]] to sync templates
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local TNT = require('Module:TNT')
local p = {}
local function format(msg)
return TNT.format('I18n/Lua banner', msg)
end
local function getConfig()
return mw.loadData('Module:Lua banner/config')
end
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args, cfg)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules, cfg)
local trackingCategories = p.renderTrackingCategories(args, modules, nil, cfg)
return box .. trackingCategories
end
function p.renderBox(modules, cfg)
local boxArgs = {}
if #modules < 1 then
cfg = cfg or getConfig()
if cfg['allow_wishes'] then
boxArgs.text = format('wishtext')
else
boxArgs.text = string.format('<strong class="error">%s</strong>', format('error_emptylist'))
end
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
end
local moduleList = mList.makeList('bulleted', moduleLinks)
boxArgs.text = format('header') .. '\n' .. moduleList
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = string.format(
'[[File:Lua-logo-nolabel.svg|30px|alt=%s|link=%s]]',
format('logo_alt'),
format('logo_link')
)
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj, cfg)
if yesno(args.nocat) then
return ''
end
cfg = cfg or getConfig()
local cats = {}
-- Error category
if #modules < 1 and not cfg['allow_wishes'] and cfg['error_category'] then
cats[#cats + 1] = cfg['error_category']
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
if titleObj.namespace == 10
and not cfg['subpage_blacklist'][titleObj.subpageText]
then
local category = args.category
if not category then
local pagename = modules[1] and mw.title.new(modules[1])
category = pagename and cfg['module_categories'][pagename.text]
if not category then
if cfg['allow_wishes'] and #modules < 1 then
category = cfg['wish_category']
else
category = cfg['default_category']
end
end
end
if category then
cats[#cats + 1] = category
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
0fa5bd41f4b7ea898a70bc3d83af64846d0b0338
249
65
2023-02-16T14:39:53Z
wikipedia>Uzume
0
[[Module:Citation]] has been blanked since [[Wikipedia:Templates for discussion/Log/2018 May 13#Module:Citation]]; remove special handling
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
return box .. trackingCategories
end
function p.renderBox(modules)
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox.exists then
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText)
end
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" then
title = title.basePageTitle
end
if title.contentModel == "Scribunto" then
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
boxArgs.text = 'This template uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-Logo.svg|30px|alt=|link=]]'
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj)
if yesno(args.nocat) then
return ''
end
local cats = {}
-- Error category
if #modules < 1 then
cats[#cats + 1] = 'Lua templates with errors'
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
local subpageBlacklist = {
doc = true,
sandbox = true,
sandbox2 = true,
testcases = true
}
if not subpageBlacklist[titleObj.subpageText] then
local protCatName
if titleObj.namespace == 10 then
local category = args.category
if not category then
local categories = {
['Module:String'] = 'Templates based on the String Lua module',
['Module:Math'] = 'Templates based on the Math Lua module',
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
['Module:Citation/CS1'] = 'Templates based on the Citation/CS1 Lua module'
}
category = modules[1] and categories[modules[1]]
category = category or 'Lua-based templates'
end
cats[#cats + 1] = category
protCatName = "Templates using under-protected Lua modules"
elseif titleObj.namespace == 828 then
protCatName = "Modules depending on under-protected modules"
end
if not args.noprotcat and protCatName then
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
break
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
03ec1b34a40121efc562c0c64a67ebbf57d56dff
Module:Message box/ombox.css
828
28
63
2022-11-09T19:51:31Z
meta>Agent Isai
0
1 revision imported from [[:wikipedia:Module:Message_box/ombox.css]]: Importing from [[w:|English Wikipedia]] to sync templates
text
text/plain
/* {{pp|small=y}} */
.ombox {
margin: 4px 0;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
/* For the "small=yes" option. */
.ombox.mbox-small {
font-size: 88%;
line-height: 1.25em;
}
.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ombox-delete {
border: 2px solid #b32424; /* Red */
}
.ombox-content {
border: 1px solid #f28500; /* Orange */
}
.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
.ombox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.9em;
width: 100%;
}
.ombox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.ombox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ombox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ombox .mbox-invalid-type {
text-align: center;
}
@media (min-width: 720px) {
.ombox {
margin: 4px 10%;
}
.ombox.mbox-small {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
width: 238px;
}
}
8fe3df4bb607e699eab2dbd23bd4a1a446391002
Module:Message box
828
18
29
2022-11-09T19:55:49Z
meta>Agent Isai
0
Fix
Scribunto
text/plain
require('Module:No globals')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
or 'Imbox notice.png', imageSize)
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
fd6a8b1a0ac5916465cdf2eb099825f1d006cfba
Template:Suppress categories
10
84
259
2022-11-26T18:00:01Z
wikipedia>MusikBot II
0
Changed protection settings for "[[Template:Suppress categories]]": [[Wikipedia:High-risk templates|High-risk template or module]]: 2612 transclusions ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))
wikitext
text/x-wiki
<includeonly>{{{{{|safesubst:}}}#invoke:Suppress categories|main}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
1f9c6065201d31d4c70f982129b5babbb809ae8c
Module:Icon/data
828
93
281
2022-12-02T06:35:43Z
wikipedia>Paine Ellsworth
0
per edit request on talk page - include icons for Mediawiki, Phabricator and Wikitech
Scribunto
text/plain
-- This module stores icon data for [[Module:Icon]].
--------------------------------------------------------------------------------
-- Icon data
--------------------------------------------------------------------------------
local data = {
fa = {
image = "Featured article star.svg",
tooltip = "Featured article",
link = true,
},
far = {
image = "Cscr-star piece.png",
tooltip = "Featured article review",
link = true,
},
farc = {
image = "Cscr-star piece.png",
tooltip = "Featured article removal candidate",
link = true,
},
ffa = {
aliases = {"dfa"},
image = "Featured article star - cross.svg",
tooltip = "Former featured article",
link = true,
},
fac = {
aliases = {"fan"},
image = "Cscr-candidate.svg",
tooltip = "Featured article candidate",
link = true,
},
ffac = {
aliases = {"nofa"},
image = "Featured article star - cross.svg",
tooltip = "Failed featured article candidate",
link = true,
},
fl = {
image = "Featured article star.svg",
tooltip = "Featured list",
link = true,
},
flrc = {
aliases = {"flr"},
image = "Cscr-star piece.png",
tooltip = "Featured list removal candidate",
link = true,
},
ffl = {
aliases = {"dfl"},
image = "Cscr-featured-strike.svg",
tooltip = "Former featured list",
link = true,
},
flc = {
aliases = {"fln"},
image = "Cscr-candidate.svg",
tooltip = "Featured list candidate",
link = true,
},
fflc = {
aliases = {"nofl"},
image = "Cscr-former.svg",
tooltip = "Failed featured list candidate",
link = true,
},
a = {
image = "Symbol a class.svg",
tooltip = "A-Class article",
link = true,
},
dac = {
aliases = {"daa"},
image = "Symbol unsupport A vote.svg",
tooltip = "Demoted A-Class article",
link = true,
},
acc = {
aliases = {"acn", "aac"},
image = "A candidate.svg",
tooltip = "A-Class article candidate",
link = true,
},
noac = {
aliases = {"faac"},
image = "Symbol unsupport A vote.svg",
tooltip = "Failed A-Class article candidate",
link = true,
},
ga = {
image = "Symbol support vote.svg",
tooltip = "Good article",
link = false,
},
gar = {
image = "GA Candidate Neutral vote(ChaosNil).svg",
tooltip = "Good article reassessment",
link = false,
},
dga = {
image = "Symbol unsupport vote.svg",
tooltip = "Delisted good article",
link = false,
},
gan = {
aliases = {"gac"},
image = "GA candidate.svg",
tooltip = "Good article nominee",
link = false,
},
ga2 = {
image = "Symbol neutral vote.svg",
tooltip = "Good article, 2nd opinion",
link = false,
},
gah = {
image = "Symbol wait.svg",
tooltip = "Good article on hold",
link = false,
},
fgan = {
aliases = {"noga", "gaf", "gf"},
image = "Symbol oppose vote.svg",
tooltip = "Failed good article nominee",
link = false,
},
fp = {
image = "Cscr-featured.svg",
tooltip = "Featured picture",
link = true,
},
fpc = {
aliases = {"fpn"},
image = "Cscr-candidate.svg",
tooltip = "Featured picture candidate",
link = true,
},
ffp = {
image = "Cscr-former.svg",
tooltip = "Former featured picture",
link = true,
},
vp = {
image = "ENWP VP Logo.svg",
tooltip = "Valued picture",
link = true,
},
vpc = {
image = "Valued pics 1.svg",
tooltip = "Valued picture candidate",
link = true,
},
fs = {
image = "Cscr-featured.svg",
tooltip = "Featured sound",
link = true,
},
ffs = {
image = "Cscr-former.svg",
tooltip = "Former featured sound",
link = true,
},
fsc = {
image = "Cscr-candidate.svg",
tooltip = "Featured sound candidate",
link = true,
},
fpo = {
image = "Linecons big-star.svg",
tooltip = "Before the featured portal process ceased in 2017, this had been designated as a featured portal.",
link = true,
},
fpor = {
image = "Cscr-star piece.png",
tooltip = "Featured portal review",
link = true,
},
ffpo = {
image = "Featured article star - cross.svg",
tooltip = "Former featured portal",
link = true,
},
fpoc = {
image = "Cscr-candidate.svg",
tooltip = "Featured portal candidate",
link = true,
},
ft = {
image = "Cscr-featuredtopic.svg",
tooltip = "Featured topic",
link = true,
},
ftrc = {
image = "Cscr-star piece.png",
tooltip = "Featured topic removal candidate",
link = true,
},
fft = {
aliases = {"dft"},
image = "DFT candidate_cluster.svg",
tooltip = "Former featured topic",
link = true,
},
ftc = {
aliases = {"ftn"},
image = "FT candidate cluster.svg",
tooltip = "Featured topic candidate",
link = false,
},
gt = {
image = "Support cluster.svg",
tooltip = "Good topic",
link = false,
},
gtrc = {
image = "Symbol unsupport vote.svg",
tooltip = "Good topic removal candidate",
link = false,
},
gtc = {
aliases = {"gtn"},
image = "GA candidate cluster.svg",
tooltip = "Good topic candidate",
link = false,
},
bplus = {
aliases = {"b+"},
image = "Symbol bplus class.svg",
tooltip = "Bplus-Class article",
link = true,
},
b = {
image = "Symbol b class.svg",
tooltip = "B-Class article",
link = true,
},
br = {
aliases = {"bcr"},
image = "Bclass-checklist.svg",
tooltip = "B-Class review",
link = true,
},
c = {
image = "Symbol c class.svg",
tooltip = "C-Class article",
link = true,
},
start = {
image = "Symbol start class.svg",
tooltip = "Start-Class article",
link = true,
},
stub = {
image = "Symbol stub class.svg",
tooltip = "Stub-Class article",
link = true,
},
list = {
aliases = {"comparison"},
image = "Symbol list class.svg",
tooltip = "List-Class article",
link = false,
},
no = {
image = "Crystal button cancel.svg",
tooltip = "Unknown-Class article",
link = true,
},
book = {
image = "Symbol book class2.svg",
tooltip = "Wikipedia book",
link = true,
},
category = {
aliases = {"cat", "categ"},
image = "Symbol category class.svg",
tooltip = "Category",
link = false,
},
disambiguation = {
aliases = {"dab", "disamb", "disambig"},
image = "Symbol dab class.svg",
tooltip = "Disambiguation page",
link = true,
},
image = {
aliases = {"file"},
image = "Symbol file class.svg",
tooltip = "File",
link = true,
},
needed = {
image = "Symbol needed class.svg",
tooltip = "Needed article",
link = false,
},
outline = {
image = "Global thinking.svg",
tooltip = "Outline",
link = false,
},
portal = {
image = "Symbol portal class.svg",
tooltip = "Portal",
link = true,
},
project = {
image = "Symbol project class.svg",
tooltip = "Project page",
link = false,
},
redirect = {
aliases = {"red", "redir"},
image = "Symbol redirect vote2.svg",
tooltip = "Redirect",
link = true,
},
template = {
aliases = {"temp", "templ"},
image = "Symbol template class.svg",
tooltip = "Template",
link = false,
},
essay = {
image = "Essay.svg",
tooltip = "Essay",
link = false,
},
na = {
image = "Symbol na class.svg",
tooltip = "Non-article page",
link = true,
},
aa = {
image = "Yes check.svg",
tooltip = "Audited article of limited subject matter",
link = false,
},
da = {
image = "Symbol oppose vote.svg",
tooltip = "Demoted article",
link = false,
},
dyk = {
image = "Symbol question.svg",
tooltip = "Did You Know?",
link = false,
},
dyk2 = {
image = "DYK questionmark icon.svg",
tooltip = "Did You Know?",
link = false,
},
pr = {
image = "Nuvola apps kedit.png",
tooltip = "Peer review",
link = true,
},
ppr = {
image = "Nuvola apps kedit.png",
tooltip = "Portal peer review",
link = true,
},
q = {
aliases = {"question"},
image = "Symbol question.svg",
tooltip = "Question",
link = false,
},
cleanup = {
image = "Edit-clear.svg",
tooltip = "Cleanup work",
link = false,
},
qi = {
image = "Quality images logo.svg",
tooltip = "Quality image on Wikimedia Commons",
link = false,
},
vi = {
image = "Valued image seal.svg",
tooltip = "Valued image on Wikimedia Commons",
link = false,
},
tfa = {
image = "Wikipedia-logo.svg",
tooltip = "Today's Featured Article",
link = true,
},
tfl = {
image = "Wikipedia-logo.svg",
tooltip = "Today's Featured List",
link = true,
},
itn = {
image = "Globe current.svg",
tooltip = "In The News",
link = true,
},
otd = {
image = "Nuvola apps date.svg",
tooltip = "On This Day",
link = true,
},
wikiproject = {
image = "People icon.svg",
tooltip = "WikiProject",
link = false,
},
goce = {
image = "Writing Magnifying.PNG",
tooltip = "Guild of Copy Editors",
link = true,
},
wikipedia = {
image = "Wikipedia-logo.svg",
tooltip = "Wikipedia page",
link = true,
},
commons = {
image = "Commons-logo.svg",
tooltip = "Commons page",
link = false,
},
wikiquote = {
image = "Wikiquote-logo.svg",
tooltip = "Wikiquote page",
link = false,
},
wikiversity = {
image = "Wikiversity logo 2017.svg",
tooltip = "Wikiversity page",
link = true,
},
wikibooks = {
image = "Wikibooks-logo.svg",
tooltip = "Wikibooks page",
link = true,
},
wikisource = {
image = "Wikisource-logo.svg",
tooltip = "Wikisource page",
link = true,
},
wiktionary = {
image = "Wiktionary-logo.svg",
tooltip = "Wiktionary page",
link = true,
},
wikinews = {
image = "Wikinews-logo.svg",
tooltip = "Wikinews page",
link = true,
},
wikispecies = {
image = "Wikispecies-logo.svg",
tooltip = "Wikispecies page",
link = true,
},
wikidata = {
image = "Wikidata-logo.svg",
tooltip = "Wikidata page",
link = false,
},
wikivoyage = {
image = "Wikivoyage-logo.svg",
tooltip = "Wikivoyage page",
link = true,
},
mediawiki = {
image = "MediaWiki-2020-icon.svg",
tooltip = "MediaWiki",
link = false,
},
phabricator = {
aliases = {"phab"},
image = "Favicon-Phabricator-WM.svg",
tooltip = "Phabricator",
link = false,
},
wikitech = {
image = "Wikitech-2021-blue-icon.svg",
tooltip = "Wikitech",
link = false,
},
meta = {
image = "Wikimedia Community Logo.svg",
tooltip = "Meta-wiki page",
link = false,
},
four = {
aliases = {"4a"},
image = "Four Award.svg",
tooltip = "Four Award",
link = false,
},
million = {
image = "Million award logo.svg",
tooltip = "Million Award",
link = true,
},
module = {
image = "Lua-logo-nolabel.svg",
tooltip = "Module",
link = false,
},
vital = {
image = "Círculos_Concéntricos.svg",
tooltip = "Vital article",
link = false,
},
potd = {
image = "Wikipedia-logo.svg",
tooltip = "Picture of the Day",
link = true,
},
_DEFAULT = {
image = "Symbol question.svg",
link = false,
}
}
--------------------------------------------------------------------------------
-- End icon data
--------------------------------------------------------------------------------
-- Make aliases work the same as normal keys, and remove the "aliases" subtables.
local ret= {}
for code, iconData in pairs(data) do
iconData.canonicalCode = code
if iconData.aliases then
for _, alias in ipairs(iconData.aliases) do
ret[alias] = iconData
end
iconData.aliases = nil
end
ret[code] = iconData
end
return ret
d8e668d4755103abdbc8325fa35964e99198c29d
Template:Fix comma category
10
234
572
2022-12-08T20:50:50Z
wikipedia>Pppery
0
Doc to subpage
wikitext
text/x-wiki
{{#invoke:String|replace|{{{1}}}|%[%[Category:(.-)from (.-) 2,(.-)%]%]|[[Category:%1 from %2 2%3]]|plain=false}}<noinclude>{{documentation}}</noinclude>
beac35ea2acb0b21dc3e27cb7807f3a10bbb7948
Template:Plainlist/styles.css
10
112
319
2022-12-11T06:59:53Z
wikipedia>Izno
0
add this reset from mobile.css
sanitized-css
text/css
/* {{pp-template|small=yes}} */
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none;
margin: 0;
padding: 0; /* Reset Minerva default */
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
51706efa229ff8794c0d94f260a208e7c5e6ec30
Module:Side box
828
176
452
2022-12-13T04:33:19Z
wikipedia>Izno
0
we cookin with plainlist templatestyles now
Scribunto
text/plain
local yesno = require('Module:Yesno')
local p = {}
local function makeData(args)
local data = {}
-- Main table classes
data.classes = {}
if yesno(args.metadata) ~= false then
table.insert(data.classes, 'metadata')
end
if args.position and args.position:lower() == 'left' then
table.insert(data.classes, 'side-box-left')
else
table.insert(data.classes, 'side-box-right')
end
if args.collapsible then
table.insert(data.classes, 'mw-collapsible')
if args.collapsible == "collapsed" then
table.insert(data.classes, 'mw-collapsed')
end
data.collapsible = true
end
table.insert(data.classes, args.class)
-- Image
if args.image and args.image ~= 'none' then
data.image = args.image
end
-- we have to check to see if a downstream use has plainlist like
-- Template:Sister_project. also it's the default. wikitext is :(
if args.textclass == 'plainlist' or not args.textclass then
data.textclass = 'plainlist'
data.plainlist_templatestyles = 'Plainlist/styles.css'
else
data.textclass = args.textclass
end
-- Copy over data that does not need adjusting
local argsToCopy = {
-- aria qualities
'role',
'labelledby',
-- Styles
'style',
'textstyle',
'templatestyles',
-- Above row
'above',
'abovestyle',
-- Body row
'text',
'imageright',
-- Below row
'below',
}
for i, key in ipairs(argsToCopy) do
data[key] = args[key]
end
return data
end
local function renderSidebox(data)
-- Renders the sidebox HTML.
-- Table root
local root = mw.html.create('div')
root:attr('role', data.role)
:attr('aria-labelledby', data.labelledby)
:addClass('side-box')
for i, class in ipairs(data.classes or {}) do
root:addClass(class)
end
if data.style then
root:cssText(data.style)
end
local frame = mw.getCurrentFrame()
if data.plainlist_templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles', args = { src = data.plainlist_templatestyles }
})
end
-- The "above" row
if data.above then
local above = root:newline():tag('div')
above:addClass('side-box-abovebelow')
:newline()
:wikitext(data.above)
if data.textstyle then
above:cssText(data.textstyle)
end
if data.abovestyle then
above:cssText(data.abovestyle)
end
end
-- The body row
local body = root:newline():tag('div')
body:addClass('side-box-flex')
:addClass(data.collapsible and 'mw-collapsible-content')
:newline()
if data.image then
body:tag('div')
:addClass('side-box-image')
:wikitext(data.image)
end
local text = body:newline():tag('div')
text:addClass('side-box-text')
:addClass(data.textclass)
if data.textstyle then
text:cssText(data.textstyle)
end
text:wikitext(data.text)
if data.imageright then
body:newline():tag('div')
:addClass('side-box-imageright')
:wikitext(data.imageright)
end
-- The below row
if data.below then
local below = root:newline():tag('div')
below
:addClass('side-box-abovebelow')
:wikitext(data.below)
if data.textstyle then
below:cssText(data.textstyle)
end
end
root:newline()
local templatestyles = ''
if data.templatestyles then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = data.templatestyles }
}
end
return frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Side box/styles.css' }
} .. templatestyles .. tostring(root)
end
function p._main(args)
local data = makeData(args)
return renderSidebox(data)
end
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
return p
096bef4a3721857fc16eb509a4f8d75973484485
Module:Shortcut
828
105
305
2022-12-13T23:41:34Z
wikipedia>Izno
0
use module:list for plainlist, move templatestyles to module space
Scribunto
text/plain
-- This module implements {{shortcut}}.
-- Set constants
local CONFIG_MODULE = 'Module:Shortcut/config'
-- Load required modules
local checkType = require('libraryUtil').checkType
local yesno = require('Module:Yesno')
local p = {}
local function message(msg, ...)
return mw.message.newRawMessage(msg, ...):plain()
end
local function makeCategoryLink(cat)
return string.format('[[%s:%s]]', mw.site.namespaces[14].name, cat)
end
function p._main(shortcuts, options, frame, cfg)
checkType('_main', 1, shortcuts, 'table')
checkType('_main', 2, options, 'table', true)
options = options or {}
frame = frame or mw.getCurrentFrame()
cfg = cfg or mw.loadData(CONFIG_MODULE)
local templateMode = options.template and yesno(options.template)
local redirectMode = options.redirect and yesno(options.redirect)
local isCategorized = not options.category or yesno(options.category) ~= false
-- Validate shortcuts
for i, shortcut in ipairs(shortcuts) do
if type(shortcut) ~= 'string' or #shortcut < 1 then
error(message(cfg['invalid-shortcut-error'], i), 2)
end
end
-- Make the list items. These are the shortcuts plus any extra lines such
-- as options.msg.
local listItems = {}
for i, shortcut in ipairs(shortcuts) do
local templatePath, prefix
if templateMode then
-- Namespace detection
local titleObj = mw.title.new(shortcut, 10)
if titleObj.namespace == 10 then
templatePath = titleObj.fullText
else
templatePath = shortcut
end
prefix = options['pre' .. i] or options.pre or ''
end
if options.target and yesno(options.target) then
listItems[i] = templateMode
and string.format("{{%s[[%s|%s]]}}", prefix, templatePath, shortcut)
or string.format("[[%s]]", shortcut)
else
listItems[i] = frame:expandTemplate{
title = 'No redirect',
args = templateMode and {templatePath, shortcut} or {shortcut, shortcut}
}
if templateMode then
listItems[i] = string.format("{{%s%s}}", prefix, listItems[i])
end
end
end
table.insert(listItems, options.msg)
-- Return an error if we have nothing to display
if #listItems < 1 then
local msg = cfg['no-content-error']
msg = string.format('<strong class="error">%s</strong>', msg)
if isCategorized and cfg['no-content-error-category'] then
msg = msg .. makeCategoryLink(cfg['no-content-error-category'])
end
return msg
end
local root = mw.html.create()
root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = 'Module:Shortcut/styles.css'} })
-- Anchors
local anchorDiv = root
:tag('div')
:addClass('module-shortcutanchordiv')
for i, shortcut in ipairs(shortcuts) do
local anchor = mw.uri.anchorEncode(shortcut)
anchorDiv:tag('span'):attr('id', anchor)
end
-- Shortcut heading
local shortcutHeading
do
local nShortcuts = #shortcuts
if nShortcuts > 0 then
local headingMsg = options['shortcut-heading'] or
redirectMode and cfg['redirect-heading'] or
cfg['shortcut-heading']
shortcutHeading = message(headingMsg, nShortcuts)
shortcutHeading = frame:preprocess(shortcutHeading)
end
end
-- Shortcut box
local shortcutList = root
:tag('div')
:addClass('module-shortcutboxplain noprint')
:attr('role', 'note')
if options.float and options.float:lower() == 'left' then
shortcutList:addClass('module-shortcutboxleft')
end
if options.clear and options.clear ~= '' then
shortcutList:css('clear', options.clear)
end
if shortcutHeading then
shortcutList
:tag('div')
:addClass('module-shortcutlist')
:wikitext(shortcutHeading)
end
local ubl = require('Module:List').unbulleted(listItems)
shortcutList:wikitext(ubl)
return tostring(root)
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame)
-- Separate shortcuts from options
local shortcuts, options = {}, {}
for k, v in pairs(args) do
if type(k) == 'number' then
shortcuts[k] = v
else
options[k] = v
end
end
-- Compress the shortcut array, which may contain nils.
local function compressArray(t)
local nums, ret = {}, {}
for k in pairs(t) do
nums[#nums + 1] = k
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[i] = t[num]
end
return ret
end
shortcuts = compressArray(shortcuts)
return p._main(shortcuts, options, frame)
end
return p
03fd46a265e549852a9ed3d3a9249b247d84cb4f
Template:Documentation/doc
10
38
111
2022-12-16T04:57:03Z
dev>Pppery
0
/* Usage */
wikitext
text/x-wiki
{{documentation subpage}}
This is the {{tl|Documentation}} template, used on almost every template page to contain that template's documented instructions and information.
For detailed instructions on how and when to use this template, see [[w:Wikipedia:Template documentation]].
This template displays a green documentation box like you are seeing now and automatically loads the content from a /doc subpage. It can also load the content from other places if instructed to.
This template is intended for documenting templates and other pages that are [[w:Wikipedia:Transclusion|transcluded]] onto other pages. It can be used in the [[w:Wikipedia:Template namespace|template namespace]] and most other [[w:Wikipedia:Namespace|namespace]]s.
Use of this template allows templates to be [[w:Wikipedia:Protection policy|protected]] where necessary, while allowing anyone to edit the documentation and categories.
===Usage===
Normally this template is used without any parameters, placed at the bottom of the template or page being documented, within a <noinclude> container:
<syntaxhighlight lang="xml+smarty">
<!--Last line of your template code--><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
</syntaxhighlight>
Then this template automatically loads the content from the /doc subpage of the template it is used on.
This template can also load the content from any other page. Like this:
<syntaxhighlight lang="xml+smarty">
<!--Last line of your template code--><noinclude>
{{Documentation |Template:Other page/doc}}
</noinclude>
</syntaxhighlight>
Note that when loading the documentation from a page other than the local /doc page it becomes tricky to handle the categories.
The content can also be fed directly as text. Like this:
<syntaxhighlight lang="xml+smarty">
<!--Last line of your template code--><noinclude>
{{Documentation
| content =
(some documentation)
}}</noinclude>
</syntaxhighlight>
When the <nowiki>|content=</nowiki> parameter is used, the doc box normally does not show the [edit] [purge] links in the top right corner. Note that if the /doc page exists, a link to it is still shown in the link box below the doc box.
Parameter <nowiki>|1=</nowiki> and the <nowiki>|content=</nowiki> parameter can also be combined, like this:
<syntaxhighlight lang="xml+smarty">
<!--Last line of your template code--><noinclude>
{{Documentation |1=Template:Any page/doc
| content =
{{Template:Any page/doc |parameters}}
}}</noinclude>
</syntaxhighlight>
Then the pagename fed as parameter 1 is used for the [edit] [purge] links and for the /doc link in the link box below the doc box. But the '''content''' parameter is used for the content shown in the doc box. The above code means that the content is transcluded as {{tlx|Any page/doc|parameters}}. In this example a parameter is also fed to the /doc page being loaded.
=== Shortcut ===
To automatically insert the [[w:Wikipedia:Noinclude|noinclude tags]], the template call and the guiding comment, use this [[w:WP:Substitution|substitution]] code:<br>
:<code><nowiki>{{subst:doc-code}}</nowiki></code>
===Best practice===
The code should be added at the bottom of the template code, with no space before <noinclude> (which would cause extra space on pages where the template is used).
Categories that apply to the template itself should be added to the bottom of the /doc subpage, inside <includeonly> tags.
If the documentation page contains <includeonly> or <noinclude> tags as part of the visible documentation text, replace the "<code><</code>" with "<code>&lt;</code>".
===Heading===
When in the Template namespace, this template shows this heading:
:[[File:Test Template Info-Icon - Version (2).svg|32px|link=[[w:Wikipedia:Template documentation]]]] '''Template documentation'''
In most other namespaces, such as "{{SITENAME}}:", it shows this heading:
:'''Documentation'''
But when on File (image) pages it shows this heading:
:'''Summary'''
The '''heading''' parameter can be used to set the heading to something else. Like this:
:<code><nowiki>{{Documentation |heading=Infobox documentation}}</nowiki></code>
If the '''heading''' parameter is empty but defined, no heading is shown and no [edit] [purge] links are shown. Like this:
:<code><nowiki>{{Documentation |heading=}}</nowiki></code>
The '''heading-style''' parameter can be fed optional [[w:Cascading Style Sheets|CSS]] values. Without quotation marks <code>" "</code> but with the ending semicolons <code>;</code>. For example:
:<code>heading-style=font-size:150%;color:red;</code>
===Link box===
Below the big doc box is a small link box that shows some meta-data about the documentation. The link box shows different things depending on what parameters are fed to this template, and in which namespace it is used. In some cases the link box is not shown at all.
To hide the link box, add the parameter
: <nowiki>|link box=off</nowiki>.
You can also insert customised text into the link box, by setting the <nowiki>|link box=</nowiki> parameter. For example:
<pre style="width:auto; overflow:scroll">
|link box=This documentation is automatically generated by [[w:Template:Country showdata]]
</pre>
===Automatic functions===
If the documentation page does not exist, the [create] link includes a [[mw:Manual:Creating pages with preloaded text|preload]] page so that clicking it will pre-fill the edit form with the basic documentation page format. Preload text is also used for the /sandbox and /testcases [create] links.
===Subject namespaces vs. talk namespaces===
Terminology: ''Subject namespaces'' are the opposite of ''talk namespaces''. For instance "Template:" is the subject space of "Template talk:".
This template is usually placed in a subject namespace, within <noinclude> tags. But in some cases this template needs to be on the talk page:
* In the Mediawiki namespace, since <noinclude> often does not work in system messages, and since the Mediawiki namespace needs to be kept clean for performance reasons.
When placed on talk pages, this template usually is placed near the top of the page and without <noinclude> tags.
The /doc, /sandbox and /testcases pages should normally be in the subject namespace, except in the namespaces that do not have the MediaWiki [[w:m:Help:Link#Subpage feature|subpage feature]] enabled: Main, File, Mediawiki and Category. (But currently we only show the /sandbox and /testcases links from User, User talk, Template and Template talk namespaces.) There are also a whole bunch of other technical reasons why the /doc page must be stored under the talk page for those (but only those) namespaces.
This template automatically points its [create] links for the /doc, /sandbox and /testcases to the right namespace.
===Technical details===
The preload page for the /doc [create] link is [[Template:Documentation/preload]]. The preload pages for the /sandbox and /testcases [create] links are [[Template:Documentation/preload-sandbox]] and [[Template:Documentation/preload-testcases]]. The preload page for the /sandbox [mirror] link is [[Template:Documentation/mirror]].
====Full syntax====
<pre>
{{Documentation}}
{{Documentation
| content =
}}
{{Documentation
| [path to documentation page]
| heading-style =
| heading =
| link box =
}}
</pre>
===See also===
* {{tl|Documentation subpage}}, a notice placed at the top of a /doc subpage explaining its role and including a link to the page it documents.
* [[w:Wikipedia:Template documentation]] is a how-to guide to template documentation.
* [[w:Wikipedia:Template sandbox and test cases]] explains the use of /sandbox and /testcases subpages and includes more information about template testing.
92ff94e315af492eb2698f80537068806f486349
Template:Documentation/preload
10
41
119
2022-12-16T17:09:58Z
dev>Pppery
0
wikitext
text/x-wiki
{{Documentation subpage}}
== Usage ==
<include<includeonly></includeonly>only>
<!-- Categories below this line -->
}}</include<includeonly></includeonly>only><noinclude>
{{Documentation|content=
This page contains the default wikitext that appears when an editor clicks "create" to begin creating a new template documentation page.
[[Category:Documentation preloads]]
}}</noinclude>
587413cafd960a3f7f3c9257a4160f3654fdbe0f
Module:Infobox/styles.css
828
21
43
2022-12-20T18:53:25Z
meta>MacFan4000
0
Fix - admins: please do not reimport this page as there are more styles here then on wikipedia
text
text/plain
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
.infobox .navbar {
font-size: 100%;
}
/* T281642 */
body.skin-minerva .infobox-header,
body.skin-minerva .infobox-subheader,
body.skin-minerva .infobox-above,
body.skin-minerva .infobox-title,
body.skin-minerva .infobox-image,
body.skin-minerva .infobox-full-data,
body.skin-minerva .infobox-below {
text-align: center;
}
/* Infobox template style */
.infobox {
border: 1px solid #a2a9b1;
border-spacing: 3px;
background-color: #f8f9fa;
color: black;
/* @noflip */
margin: 0.5em 0 0.5em 1em;
padding: 0.2em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
font-size: 88%;
line-height: 1.5em;
width: 22em;
}
.infobox-header,
.infobox-label,
.infobox-above,
.infobox-full-data,
.infobox-data,
.infobox-below,
.infobox-subheader,
.infobox-image,
.infobox-navbar,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
vertical-align: top;
}
.infobox-label,
.infobox-data,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
/* @noflip */
text-align: left;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-above,
.infobox .infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
font-size: 125%;
font-weight: bold;
text-align: center;
}
.infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
padding: 0.2em;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-header,
.infobox .infobox-subheader,
.infobox .infobox-image,
.infobox .infobox-full-data,
.infobox .infobox-below {
text-align: center;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-navbar {
/* @noflip */
text-align: right;
}
eb850346855e4c081e692209d188b8432a2378d4
Template:Short description
10
237
578
2022-12-23T23:04:16Z
wikipedia>Fayenatic london
0
remove categories for several more namespaces, see [[Wikipedia:Categories for discussion/Log/2022 December 15#Pages with short description]]
wikitext
text/x-wiki
{{#ifeq:{{lc:{{{1|}}}}}|none|<nowiki /><!--Prevents whitespace issues when used with adjacent newlines-->|<div class="shortdescription nomobile noexcerpt noprint searchaux" style="display:none">{{{1|}}}{{SHORTDESC:{{{1|}}}|{{{2|}}}}}</div>}}<includeonly>{{#ifeq:{{{pagetype}}}|Disambiguation pages||{{#ifeq:{{pagetype |defaultns = all |user=exclude}}|exclude||{{#ifeq:{{#switch: {{NAMESPACENUMBER}} | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 100 | 101 | 118 | 119 | 828 | 829 | = exclude|#default=}}|exclude||[[Category:{{{pagetype|{{pagetype |defaultns = extended |plural=y}}}}} with short description]]}}}}}}</includeonly><!-- Start tracking
-->{{#invoke:Check for unknown parameters|check|unknown={{Main other|[[Category:Pages using short description with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Short description]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | pagetype | bot |plural }}<!--
-->{{#ifexpr: {{#invoke:String|len|{{{1|}}}}}>100 | [[Category:{{{pagetype|{{pagetype |defaultns = extended |plural=y}}}}} with long short description]]}}<!--
--><includeonly>{{#if:{{{1|}}}||[[Category:Pages with empty short description]]}}</includeonly><!--
-->{{Short description/lowercasecheck|{{{1|}}}}}<!--
-->{{Main other |{{SDcat |sd={{{1|}}} }} }}<noinclude>
{{Documentation}}
</noinclude>
f175a6d61b40a87adb43e2dd4f73c7979759b34c
Template:Hlist/styles.css
10
88
271
2022-12-26T18:00:17Z
wikipedia>Izno
0
actually remove that block, someone can dig for authorship
sanitized-css
text/css
/* {{pp-protected|reason=match parent|small=yes}} */
/*
* hlist styles are defined in core and Minerva and differ in Minerva. The
* current definitions here (2023-01-01) are sufficient to override Minerva
* without use of the hlist-separated class. The most problematic styles were
* related to margin, padding, and the bullet. Check files listed at
* [[MediaWiki talk:Common.css/to do#hlist-separated]]
*/
/*
* TODO: When the majority of readership supports it (or some beautiful world
* in which grade C support is above the minimum threshold), use :is()
*/
.hlist dl,
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
/*
* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again
* We also want to reset margin-right in Minerva
*/
margin: 0;
display: inline;
}
/* Display requested top-level lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
/* Display nested lists inline */
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li {
display: none;
}
/* TODO: :not() can maybe be used here to remove the later rule. naive test
* seems to work. more testing needed. like so:
*.hlist dt:not(:last-child)::after {
* content: ": ";
*}
*.hlist dd:not(:last-child)::after,
*.hlist li:not(:last-child)::after {
* content: " · ";
* font-weight: bold;
*}
*/
/* Generate interpuncts */
.hlist dt::after {
content: ": ";
}
.hlist dd::after,
.hlist li::after {
content: " · ";
font-weight: bold;
}
.hlist dd:last-child::after,
.hlist dt:last-child::after,
.hlist li:last-child::after {
content: none;
}
/* Add parentheses around nested lists */
.hlist dd dd:first-child::before,
.hlist dd dt:first-child::before,
.hlist dd li:first-child::before,
.hlist dt dd:first-child::before,
.hlist dt dt:first-child::before,
.hlist dt li:first-child::before,
.hlist li dd:first-child::before,
.hlist li dt:first-child::before,
.hlist li li:first-child::before {
content: " (";
font-weight: normal;
}
.hlist dd dd:last-child::after,
.hlist dd dt:last-child::after,
.hlist dd li:last-child::after,
.hlist dt dd:last-child::after,
.hlist dt dt:last-child::after,
.hlist dt li:last-child::after,
.hlist li dd:last-child::after,
.hlist li dt:last-child::after,
.hlist li li:last-child::after {
content: ")";
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.hlist ol {
counter-reset: listitem;
}
.hlist ol > li {
counter-increment: listitem;
}
.hlist ol > li::before {
content: " " counter(listitem) "\a0";
}
.hlist dd ol > li:first-child::before,
.hlist dt ol > li:first-child::before,
.hlist li ol > li:first-child::before {
content: " (" counter(listitem) "\a0";
}
8c9dd9c9c00f30eead17fe10f51d183333e81f33
Module:Infobox
828
3
159
37
2022-12-27T21:29:12Z
wikipedia>Izno
0
merge hlist here
Scribunto
text/plain
local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local lists = {
plainlist_t = {
patterns = {
'^plainlist$',
'%splainlist$',
'^plainlist%s',
'%splainlist%s'
},
found = false,
styles = 'Plainlist/styles.css'
},
hlist_t = {
patterns = {
'^hlist$',
'%shlist$',
'^hlist%s',
'%shlist%s'
},
found = false,
styles = 'Hlist/styles.css'
}
}
local function has_list_class(args_to_check)
for _, list in pairs(lists) do
if not list.found then
for _, arg in pairs(args_to_check) do
for _, pattern in ipairs(list.patterns) do
if mw.ustring.find(arg or '', pattern) then
list.found = true
break
end
end
if list.found then break end
end
end
end
end
local function fixChildBoxes(sval, tt)
local function notempty( s ) return s and s:match( '%S' ) end
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- [[Special:Diff/849054481]]
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
-- Cleans empty tables
local function cleanInfobox()
root = tostring(root)
if has_rows == false then
root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
end
end
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class, args.headerclass })
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:tag('th')
:attr('colspan', '2')
:addClass('infobox-header')
:addClass(rowArgs.class)
:addClass(args.headerclass)
-- @deprecated next; target .infobox-<name> .infobox-header
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
if rowArgs.data then
root:wikitext(
'[[Category:Pages using infobox templates with ignored data cells]]'
)
end
elseif rowArgs.data and rowArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class })
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
-- @deprecated next; target .infobox-<name> .infobox-label
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
dataCell
:attr('colspan', not rowArgs.label and '2' or nil)
:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox(-full)-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
else
table.insert(empty_row_categories, rowArgs.data or '')
end
end
local function renderTitle()
if not args.title then return end
has_rows = true
has_list_class({args.titleclass})
root
:tag('caption')
:addClass('infobox-title')
:addClass(args.titleclass)
-- @deprecated next; target .infobox-<name> .infobox-title
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
has_rows = true
has_list_class({ args.aboveclass })
root
:tag('tr')
:tag('th')
:attr('colspan', '2')
:addClass('infobox-above')
:addClass(args.aboveclass)
-- @deprecated next; target .infobox-<name> .infobox-above
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
has_rows = true
has_list_class({ args.belowclass })
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-below')
:addClass(args.belowclass)
-- @deprecated next; target .infobox-<name> .infobox-below
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function addSubheaderRow(subheaderArgs)
if subheaderArgs.data and
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ subheaderArgs.rowclass, subheaderArgs.class })
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-subheader')
:addClass(subheaderArgs.class)
:cssText(subheaderArgs.datastyle)
:cssText(subheaderArgs.rowcellstyle)
:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
else
table.insert(empty_row_categories, subheaderArgs.data or '')
end
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addSubheaderRow({
data = args['subheader' .. tostring(num)],
-- @deprecated next; target .infobox-<name> .infobox-subheader
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function addImageRow(imageArgs)
if imageArgs.data and
imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ imageArgs.rowclass, imageArgs.class })
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-image')
:addClass(imageArgs.class)
:cssText(imageArgs.datastyle)
:wikitext(fixChildBoxes(imageArgs.data, 'td'))
else
table.insert(empty_row_categories, imageArgs.data or '')
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:addClass('infobox-caption')
-- @deprecated next; target .infobox-<name> .infobox-caption
:cssText(args.captionstyle)
:wikitext(caption)
end
addImageRow({
data = tostring(data),
-- @deprecated next; target .infobox-<name> .infobox-image
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
if not args.autoheaders then return end
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local lastheader
for k, num in ipairs(rownums) do
if args['header' .. tostring(num)] then
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
lastheader = num
elseif args['data' .. tostring(num)] and
args['data' .. tostring(num)]:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
local data = args['data' .. tostring(num)]
if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
lastheader = nil
end
end
end
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
end
-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
-- @deprecated next; target .infobox-<name> rowclass
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-navbar')
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(require('Module:Italic title')._main({}))
end
end
-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
for _, s in ipairs(empty_row_categories) do
root:wikitext(s)
end
end
-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
if args.decat == 'yes' then return end
if args.child == 'yes' then
if args.title then
root:wikitext(
'[[Category:Pages using embedded infobox templates with the title parameter]]'
)
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles using infobox templates with no data rows]]')
end
end
--[=[
Loads the templatestyles for the infobox.
TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
local hlist_templatestyles = ''
if lists.hlist_t.found then
hlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.hlist_t.styles }
}
end
local plainlist_templatestyles = ''
if lists.plainlist_t.found then
plainlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.plainlist_t.styles }
}
end
-- See function description
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
}
local templatestyles = ''
if args['templatestyles'] then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
-- hlist -> plainlist -> base is best-effort to preserve old Common.css ordering.
-- this ordering is not a guarantee because the rows of interest invoking
-- each class may not be on a specific page
hlist_templatestyles,
plainlist_templatestyles,
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()
renderImages()
preprocessRows()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderEmptyRowCategories()
renderTrackingCategories()
cleanInfobox()
end
-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
:addClass(args.bodyclass)
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
has_list_class({ args.bodyclass })
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
structure_infobox_common()
return loadTemplateStyles() .. root
end
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or
(v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present
-- and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
-- Do another loop if any arguments are found, even blank ones.
moreArgumentsExist = true
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present
-- and not blank, or we are processing "prefix1" and "prefix" is
-- present and not blank, and if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()
preprocessSingleArg('autoheaders')
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
-- different behaviour for italics if blank or absent
args['italic title'] = origArgs['italic title']
preprocessSingleArg('decat')
preprocessSingleArg('templatestyles')
preprocessSingleArg('child templatestyles')
preprocessSingleArg('grandchild templatestyles')
end
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
origArgs = {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
return p
0ddb7e5c8426d67cd589b710efb9912ddfb67fea
Template:Flatlist
10
166
432
2022-12-29T17:46:45Z
wikipedia>Izno
0
templatestyles obviates the need for hlist-separated
wikitext
text/x-wiki
<templatestyles src="Hlist/styles.css"/><div class="hlist {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
{{{1}}}
</div>}}<noinclude></div>
{{documentation}}
</noinclude>
cf60aa4aef920d48fa394e786f72fe5f6dcd3169
Module:List
828
27
163
61
2022-12-29T17:57:56Z
wikipedia>Izno
0
add templatestyles for hlist
Scribunto
text/plain
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes and TemplateStyles
data.classes = {}
data.templatestyles = ''
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Plainlist/styles.css' }
}
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for _, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for _, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for _, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return data.templatestyles .. tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
7a4f36a6e9cd56370bdd8207d23694124821dc1a
Module:Navbox/configuration
828
95
285
2022-12-29T18:14:27Z
wikipedia>Izno
0
get these in
Scribunto
text/plain
return {
aria_label = 'Navbox',
nowrap_item = '%s<span class="nowrap">%s</span>',
templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Navbox/styles.css' }
},
hlist_templatestyles = 'Hlist/styles.css',
plainlist_templatestyles = 'Plainlist/styles.css',
-- do not localize marker table
marker = {
oddeven = '\127_ODDEVEN_\127',
restart = '\127_ODDEVEN0_\127',
regex = '\127_ODDEVEN(%d?)_\127'
},
category = {
orphan = '[[Category:Navbox orphans]]',
horizontal_lists = 'Navigational boxes without horizontal lists',
background_colors = 'Navboxes using background colours',
illegible = 'Potentially illegible navboxes',
borders = 'Navboxes using borders',
},
keyword = {
border_subgroup = 'subgroup',
border_child = 'child',
border_none = 'none',
evenodd_swap = 'swap',
navbar_off = 'off',
navbar_plain = 'plain',
nocat_false = 'false',
nowrapitems_yes = 'yes',
orphan_yes = 'yes',
state_collapsed = 'collapsed',
state_off = 'off',
state_plain = 'plain',
subpage_doc = 'doc',
subpage_sandbox = 'sandbox',
subpage_testcases = 'testcases',
tracking_no = 'no'
},
class = {
autocollapse = 'autocollapse',
collapsible = 'mw-collapsible',
collapsed = 'mw-collapsed',
-- Warning
navbox = 'navbox', -- WMF currently hides 'navbox' from mobile,
-- so you probably shouldn't change the navbox class.
navbox_abovebelow = 'navbox-abovebelow',
navbox_group = 'navbox-group',
navbox_image = 'navbox-image',
navbox_inner = 'navbox-inner',
navbox_list = 'navbox-list',
navbox_list_with_group = 'navbox-list-with-group',
navbox_part = 'navbox-', -- do not l10n
navbox_styles = 'navbox-styles',
navbox_subgroup = 'navbox-subgroup',
navbox_title = 'navbox-title', -- l10n only if you change pattern.navbox_title below
navbox_odd_part = 'odd', -- do not l10n
navbox_even_part = 'even', -- do not l10n
nomobile = 'nomobile',
nowraplinks = 'nowraplinks',
noviewer = 'noviewer' -- used to remove images from MediaViewer
},
pattern = {
listnum = '^list(%d+)$',
class = 'class',
sandbox = '/sandbox$',
navbox = 'Template:Navbox',
nowrap = '^<span class="nowrap">',
style = 'style$',
navbox_title = '<th[^>]*"navbox%-title"',
hlist = 'hlist',
plainlist = 'plainlist',
},
arg = {
above = 'above',
aboveclass = 'aboveclass',
abovestyle = 'abovestyle',
basestyle = 'basestyle',
bodyclass = 'bodyclass',
bodystyle = 'bodystyle',
border = 'border',
below = 'below',
belowclass = 'belowclass',
belowstyle = 'belowstyle',
evenodd = 'evenodd',
evenstyle = 'evenstyle',
group1 = 'group1',
group2 = 'group2',
group_and_num = 'group%d',
groupstyle_and_num = 'group%dstyle',
groupclass = 'groupclass',
groupstyle = 'groupstyle',
groupwidth = 'groupwidth',
innerstyle = 'innerstyle',
image = 'image',
imageclass = 'imageclass',
imageleft = 'imageleft',
imageleftstyle = 'imageleftstyle',
imagesetyle = 'imagestyle',
list_and_num = 'list%d',
listclass_and_num = 'list%dclass',
liststyle_and_num = 'list%dstyle',
list1padding = 'list1padding',
listclass = 'listclass',
listpadding = 'listpadding',
liststyle = 'liststyle',
name = 'name',
navbar = 'navbar',
navboxclass = 'navboxclass',
nocat = 'nocat',
nowrapitems = 'nowrapitems',
oddstyle = 'oddstyle',
orphan = 'orphan',
state = 'state',
style = 'style',
templatestyles = 'templatestyles',
child_templatestyles = 'child templatestyles',
title = 'title',
titleclass = 'titleclass',
titlestyle = 'titlestyle',
tracking = 'tracking'
},
-- names of navbar arguments
navbar = {
name = 1,
fontstyle = 'fontstyle',
mini = 'mini'
}
}
4148736fd32a93636c0413e73ed38afaef065ec9
Module:Navbar/configuration
828
5
199
41
2022-12-29T18:18:21Z
wikipedia>Izno
0
add hlist/styles.css
Scribunto
text/plain
return {
['templatestyles'] = 'Module:Navbar/styles.css',
['hlist_templatestyles'] = 'Hlist/styles.css',
['box_text'] = 'This box: ', -- default text box when not plain or mini
['title_namespace'] = 'Template', -- namespace to default to for title
['invalid_title'] = 'Invalid title ',
['classes'] = { -- set a line to nil if you don't want it
['navbar'] = 'navbar',
['plainlinks'] = 'plainlinks', -- plainlinks
['horizontal_list'] = 'hlist', -- horizontal list class
['mini'] = 'navbar-mini', -- class indicating small links in the navbar
['this_box'] = 'navbar-boxtext',
['brackets'] = 'navbar-brackets',
-- 'collapsible' is the key for a class to indicate the navbar is
-- setting up the collapsible element in addition to the normal
-- navbar.
['collapsible'] = 'navbar-collapse',
['collapsible_title_mini'] = 'navbar-ct-mini',
['collapsible_title_full'] = 'navbar-ct-full'
}
}
b007c336b17ec4bcd4d5a9dca9f8cba301662b55
Module:Detect singular
828
202
504
2023-01-02T22:05:13Z
wikipedia>Hike395
0
decode HTML entities
Scribunto
text/plain
local p = {}
local getArgs = require('Module:Arguments').getArgs
local yesNo = require('Module:Yesno')
local getPlain = require('Module:Text').Text().getPlain
-- function to determine whether "sub" occurs in "s"
local function plainFind(s, sub)
return mw.ustring.find(s, sub, 1, true)
end
-- function to count the number of times "pattern" (a regex) occurs in "s"
local function countMatches(s, pattern)
local _, count = mw.ustring.gsub(s, pattern, '')
return count
end
local singular = 1
local likelyPlural = 2
local plural = 3
-- Determine whether a string is singular or plural (i.e., it represents one
-- item or many)
-- Arguments:
-- origArgs[1]: string to process
-- origArgs.no_comma: if false, use commas to detect plural (default false)
-- origArgs.parse_links: if false, treat wikilinks as opaque singular objects (default false)
-- Returns:
-- singular, likelyPlural, or plural (see constants above), or nil for completely unknown
function p._main(origArgs)
origArgs = type(origArgs) == 'table' and origArgs or {}
local args = {}
-- canonicalize boolean arguments
for key, default in pairs({no_comma=false,parse_links=false,any_comma=false,no_and=false}) do
if origArgs[key] == nil then
args[key] = default
else
args[key] = yesNo(origArgs[key],default)
end
end
local checkComma = not args.no_comma
local checkAnd = not args.no_and
local rewriteLinks = not args.parse_links
local anyComma = args.any_comma
local s = origArgs[1] -- the input string
if not s then
return nil -- empty input returns nil
end
s = tostring(s)
s = mw.text.decode(s,true) --- replace HTML entities (to avoid spurious semicolons)
if plainFind(s,'data-plural="0"') then -- magic data string to return true
return singular
end
if plainFind(s,'data-plural="1"') then -- magic data string to return false
return plural
end
-- count number of list items
local numListItems = countMatches(s,'<%s*li')
-- if exactly one, then singular, if more than one, then plural
if numListItems == 1 then
return singular
end
if numListItems > 1 then
return plural
end
-- if "list of" occurs inside of wlink, then it's plural
if mw.ustring.find(s:lower(), '%[%[[^%]]*list of[^%]]+%]%]') then
return plural
end
-- fix for trailing br tags passed through [[template:marriage]]
s = mw.ustring.gsub(s, '<%s*br[^>]*>%s*(</div>)', '%1')
-- replace all wikilinks with fixed string
if rewriteLinks then
s = mw.ustring.gsub(s,'%b[]','WIKILINK')
end
-- Five conditions: any one of them can make the string a likely plural or plural
local hasBreak = mw.ustring.find(s,'<%s*br')
-- For the last 4, evaluate on string stripped of wikimarkup
s = getPlain(s)
local hasBullets = countMatches(s,'%*+') > 1
local multipleQids = mw.ustring.find(s,'Q%d+[%p%s]+Q%d+') -- has multiple QIDs in a row
if hasBullets or multipleQids then
return plural
end
local commaPattern = anyComma and '[,;]' or '%D[,;]%D' -- semi-colon similar to comma
local hasComma = checkComma and mw.ustring.find(s, commaPattern)
local hasAnd = checkAnd and mw.ustring.find(s,'[,%s]and%s')
if hasBreak or hasComma or hasAnd then
return likelyPlural
end
return singular
end
function p._pluralize(args)
args = type(args) == 'table' and args or {}
local singularForm = args[3] or args.singular or ""
local pluralForm = args[4] or args.plural or ""
local likelyForm = args.likely or pluralForm
local link = args[5] or args.link
if link then
link = tostring(link)
singularForm = '[['..link..'|'..singularForm..']]'
pluralForm = '[['..link..'|'..pluralForm..']]'
likelyForm = '[['..link..'|'..likelyForm..']]'
end
if args[2] then
return pluralForm
end
local detect = p._main(args)
if detect == nil then
return "" -- return blank on complete failure
end
if detect == singular then
return singularForm
elseif detect == likelyPlural then
return likelyForm
else
return pluralForm
end
end
function p.main(frame)
local args = getArgs(frame)
-- For template, return 1 if singular, blank if plural or empty
local result = p._main(args)
if result == nil then
return 1
end
return result == singular and 1 or ""
end
function p.pluralize(frame)
local args = getArgs(frame)
return p._pluralize(args)
end
return p
6afb2e8c0bd8ddff094e2861b836521ee4a5a779
Module:Citation/CS1/styles.css
828
165
430
2023-01-14T14:43:34Z
wikipedia>Trappist the monk
0
sync from sandbox;
sanitized-css
text/css
/* Protection icon
the following line controls the page-protection icon in the upper right corner
it must remain within this comment
{{sandbox other||{{pp-template}}}}
*/
/* Overrides
Some wikis do not override user agent default styles for HTML <cite> and <q>,
unlike en.wp. On en.wp, keep these the same as [[MediaWiki:Common.css]].
The word-wrap and :target styles were moved here from Common.css.
On en.wp, keep these the same as [[Template:Citation/styles.css]].
*/
cite.citation {
font-style: inherit; /* Remove italics for <cite> */
/* Break long urls, etc., rather than overflowing box */
word-wrap: break-word;
}
.citation q {
quotes: '"' '"' "'" "'"; /* Straight quote marks for <q> */
}
/* Highlight linked elements (such as clicked references) in blue */
.citation:target {
/* ignore the linter - all browsers of interest implement this */
background-color: rgba(0, 127, 255, 0.133);
}
/* ID and URL access
Both core and Common.css have selector .mw-parser-output a[href$=".pdf"].external
for PDF pages. All TemplateStyles pages are hoisted to .mw-parser-output. We need
to have specificity equal to a[href$=".pdf"].external for locks to override PDF icon.
That's essentially 2 classes and 1 element.
the .id-lock-... selectors are for use by non-citation templates like
{{Catalog lookup link}} which do not have to handle PDF links
*/
.id-lock-free a,
.citation .cs1-lock-free a {
background: url(//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg)
right 0.1em center/9px no-repeat;
}
.id-lock-limited a,
.id-lock-registration a,
.citation .cs1-lock-limited a,
.citation .cs1-lock-registration a {
background: url(//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg)
right 0.1em center/9px no-repeat;
}
.id-lock-subscription a,
.citation .cs1-lock-subscription a {
background: url(//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg)
right 0.1em center/9px no-repeat;
}
/* Wikisource
Wikisource icon when |chapter= or |title= is wikilinked to Wikisource
as in cite wikisource
*/
.cs1-ws-icon a {
background: url(//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg)
right 0.1em center/12px no-repeat;
}
/* Errors and maintenance */
.cs1-code {
/* <code>...</code> style override: mediawiki's css definition is specified here:
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/
69cd73811f7aadd093050dbf20ed70ef0b42a713/skins%2Fcommon%2FcommonElements.css#L199
*/
color: inherit;
background: inherit;
border: none;
padding: inherit;
}
.cs1-hidden-error {
display: none;
color: #d33;
}
.cs1-visible-error {
color: #d33;
}
.cs1-maint {
display: none;
color: #3a3;
margin-left: 0.3em;
}
/* Small text size
Set small text size in one place. 0.95 (here) * 0.9 (from references list) is
~0.85, which is the lower bound for size for accessibility. Old styling for this
was just 0.85. We could write the rule so that when this template is inside
references/reflist, only then does it multiply by 0.95; else multiply by 0.85 */
.cs1-format {
font-size: 95%;
}
/* kerning */
.cs1-kern-left {
padding-left: 0.2em;
}
.cs1-kern-right {
padding-right: 0.2em;
}
/* selflinks – avoid bold font style when cs1|2 template links to the current page */
.citation .mw-selflink {
font-weight: inherit;
}
7c96feb084b1883e7b6522660da6a14bdcc94752
Template:Large
10
265
639
2023-01-16T01:12:34Z
wikipedia>Jonesey95
0
use this template's own documentation
wikitext
text/x-wiki
<span style="font-size:120%">{{{1}}}</span><noinclude>
{{Documentation}}
</noinclude>
8ba6ec8c3178e22dc1f05aa239df8a2b052be668
Module:Documentation/styles.css
828
24
97
55
2023-01-16T23:40:04Z
dev>Pppery
0
sanitized-css
text/css
.documentation,
.documentation-metadata {
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
clear: both;
}
.documentation {
margin: 1em 0 0 0;
padding: 1em;
}
.documentation-metadata {
margin: 0.2em 0; /* same margin left-right as .documentation */
font-style: italic;
padding: 0.4em 1em; /* same padding left-right as .documentation */
}
.documentation-startbox {
padding-bottom: 3px;
border-bottom: 1px solid #aaa;
margin-bottom: 1ex;
}
.documentation-heading {
font-weight: bold;
font-size: 125%;
}
.documentation-clear { /* Don't want things to stick out where they shouldn't. */
clear: both;
}
.documentation-toolbar {
font-style: normal;
font-size: 85%;
}
/* [[Category:Template stylesheets]] */
5fb984fe8632dc068db16853a824c9f3d5175dd9
Module:Message box/doc
828
44
127
2023-01-16T23:41:25Z
dev>Pppery
0
wikitext
text/x-wiki
{{documentation subpage}}
This is a meta-module that implements the message box templates {{tl|mbox}} etc.. It is intended to be used from Lua modules, and should not be used directly from wiki pages. If you want to use this module's functionality from a wiki page, please use the individual message box templates instead.
== Usage ==
To use this module from another Lua module, first you need to load it.
<syntaxhighlight lang="lua">
local messageBox = require('Module:Message box')
</syntaxhighlight>
To create a message box, use the <code>main</code> function. It takes two parameters: the first is the box type (as a string), and the second is a table containing the message box parameters.
<syntaxhighlight lang="lua">
local box = messageBox.main( boxType, {
param1 = param1,
param2 = param2,
-- More parameters...
})
</syntaxhighlight>
There are seven available box types:
{| class="wikitable"
! Box type !! Template !! Purpose
|-
| <code>mbox</code> || For message boxes to be used in multiple namespaces
|-
| <code>ambox</code> || For article message boxes
|-
| <code>cmbox</code> || For category message boxes
|-
| <code>fmbox</code> || For interface message boxes
|-
| <code>imbox</code> || For file namespace message boxes
|-
| <code>tmbox</code> || For talk page message boxes
|-
| <code>ombox</code> || For message boxes in other namespaces
|}
See {{Tl|mbox}] for the available parameters.
== Usage from #invoke ==
As well as the <code>main</code> function, this module has separate functions for each box type. They are accessed using the code <code><nowiki>{{#invoke:Message box|mbox|...}}</nowiki></code>, <code><nowiki>{{#invoke:Message box|ambox|...}}</nowiki></code>, etc. These will work when called from other modules, but they access code used to process arguments passed from #invoke, and so calling them will be less efficient than calling <code>main</code>.
== Technical details ==
The module uses the same basic code for each of the templates listed above; the differences between each of them are configured using the data at [[Module:Message box/configuration]]. Here are the various configuration options and what they mean:
* <code>types</code> – a table containing data used by the type parameter of the message box. The table keys are the values that can be passed to the type parameter, and the table values are tables containing the class and the image used by that type.
* <code>default</code> – the type to use if no value was passed to the type parameter, or if an invalid value was specified.
* <code>showInvalidTypeError</code> – whether to show an error if the value passed to the type parameter was invalid.
* <code>allowBlankParams</code> – usually blank values are stripped from parameters passed to the module. However, whitespace is preserved for the parameters included in the allowBlankParams table.
* <code>allowSmall</code> – whether a small version of the message box can be produced with "small=yes".
* <code>smallParam</code> – a custom name for the small parameter. For example, if set to "left" you can produce a small message box using "small=left".
* <code>smallClass</code> – the class to use for small message boxes.
* <code>substCheck</code> – whether to perform a subst check or not.
* <code>classes</code> – an array of classes to use with the message box.
* <code>imageEmptyCell</code> – whether to use an empty <td> cell if there is no image set. This is used to preserve spacing for message boxes with a width of less than 100% of the screen.
* <code>imageEmptyCellStyle</code> – whether empty image cells should be styled.
* <code>imageCheckBlank</code> – whether "image=blank" results in no image being displayed.
* <code>imageSmallSize</code> – usually, images used in small message boxes are set to 30x30px. This sets a custom size.
* <code>imageCellDiv</code> – whether to enclose the image in a div enforcing a maximum image size.
* <code>useCollapsibleTextFields</code> – whether to use text fields that can be collapsed, i.e. "issue", "fix", "talk", etc. Currently only used in ambox.
* <code>imageRightNone</code> – whether imageright=none results in no image being displayed on the right-hand side of the message box.
* <code>sectionDefault</code> – the default name for the "section" parameter. Depends on <code>useCollapsibleTextFields</code>.
* <code>allowMainspaceCategories</code> – allow categorisation in the main namespace.
* <code>templateCategory</code> – the name of a category to be placed on the template page.
* <code>templateCategoryRequireName</code> – whether the <code>name</code> parameter is required to display the template category.
* <code>templateErrorCategory</code> – the name of the error category to be used on the template page.
* <code>templateErrorParamsToCheck</code> – an array of parameter names to check. If any are absent, the <code>templateErrorCategory</code> is applied to the template page.
38bb5d3c8f58e991b70953e50ee89b56cf05ca4e
Module:Yesno/doc
828
45
131
2023-01-16T23:44:22Z
dev>Pppery
0
wikitext
text/x-wiki
{{documentation subpage}}
This module provides a consistent interface for processing boolean or boolean-style string input. While Lua allows the <code>true</code> and <code>false</code> boolean values, wikicode templates can only express boolean values through strings such as "yes", "no", etc. This module processes these kinds of strings and turns them into boolean input for Lua to process. It also returns <code>nil</code> values as <code>nil</code>, to allow for distinctions between <code>nil</code> and <code>false</code>. The module also accepts other Lua structures as input, i.e. booleans, numbers, tables, and functions. If it is passed input that it does not recognise as boolean or <code>nil</code>, it is possible to specify a default value to return.
== Syntax ==
<syntaxhighlight lang="lua">yesno(value, default)</syntaxhighlight>
<code>value</code> is the value to be tested. Boolean input or boolean-style input (see below) always evaluates to either <code>true</code> or <code>false</code>, and <code>nil</code> always evaluates to <code>nil</code>. Other values evaluate to <code>default</code>.
== Usage ==
First, load the module. Note that it can only be loaded from other Lua modules, not from normal wiki pages. For normal wiki pages you can use {{tl|yesno}} instead.
<syntaxhighlight lang="lua">
local yesno = require('Module:Yesno')
</syntaxhighlight>
Some input values always return <code>true</code>, and some always return <code>false</code>. <code>nil</code> values always return <code>nil</code>.
<syntaxhighlight lang="lua">
-- These always return true:
yesno('yes')
yesno('y')
yesno('true')
yesno('t')
yesno('1')
yesno(1)
yesno(true)
-- These always return false:
yesno('no')
yesno('n')
yesno('false')
yesno('f')
yesno('0')
yesno(0)
yesno(false)
-- A nil value always returns nil:
yesno(nil)
</syntaxhighlight>
String values are converted to lower case before they are matched:
<syntaxhighlight lang="lua">
-- These always return true:
yesno('Yes')
yesno('YES')
yesno('yEs')
yesno('Y')
yesno('tRuE')
-- These always return false:
yesno('No')
yesno('NO')
yesno('nO')
yesno('N')
yesno('fALsE')
</syntaxhighlight>
===Undefined input ('foo')===
You can specify a default value if yesno receives input other than that listed above. If you don't supply a default, the module will return <code>nil</code> for these inputs.
<syntaxhighlight lang="lua">
-- These return nil:
yesno('foo')
yesno({})
yesno(5)
yesno(function() return 'This is a function.' end)
yesno(nil, true)
yesno(nil, 'bar')
-- These return true:
yesno('foo', true)
yesno({}, true)
yesno(5, true)
yesno(function() return 'This is a function.' end, true)
-- These return "bar":
yesno('foo', 'bar')
yesno({}, 'bar')
yesno(5, 'bar')
yesno(function() return 'This is a function.' end, 'bar')
</syntaxhighlight>
Note that the empty string also functions this way:
<syntaxhighlight lang="lua">
yesno('') -- Returns nil.
yesno('', true) -- Returns true.
yesno('', 'bar') -- Returns "bar".
</syntaxhighlight>
Although the empty string usually evaluates to false in wikitext, it evaluates to true in Lua. This module prefers the Lua behaviour over the wikitext behaviour. If treating the empty string as false is important for your module, you will need to convert empty strings to a value that evaluates to false before passing them to this module. In the case of arguments received from wikitext, this can be done by using [[Module:Arguments]].
===Handling nil results===
By definition
:<syntaxhighlight lang="lua">
yesno(nil) -- Returns nil.
yesno('foo') -- Returns nil.
yesno(nil, true) -- Returns nil.
yesno(nil, false) -- Returns nil.
yesno('foo', true) -- Returns true.
</syntaxhighlight>
To get the binary <syntaxhighlight lang="lua" inline>true/false</syntaxhighlight>-only values, use code like:
<syntaxhighlight lang="lua">
myvariable = yesno(value) or false -- When value is nil, result is false.
myvariable = yesno(value) or true -- When value is nil, result is true.
myvariable = yesno('foo') or false -- Unknown string returns nil, result is false.
myvariable = yesno('foo', true) or false -- Default value (here: true) applies, result is true.
</syntaxhighlight>
03067100698692707464a82f865632745988653f
Template:Documentation subpage
10
25
57
2023-01-17T03:06:00Z
meta>BrandonWM
0
and this
wikitext
text/x-wiki
<includeonly>{{#if:{{IsDocSubpage|override={{{override|doc}}}}}
| <!--doc subpage--></includeonly>{{#ifeq:{{{doc-notice|show}}}|show
| {{Ombox|type=notice|image=[[File:Edit-copy green.svg|40px|link=]]
|text='''This is a documentation [[mw:Help:Subpages|subpage]] for {{#if:{{{1|}}}
| {{{1}}}
| [[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]
}}.'''<br/> It contains usage information, categories, and other content that is not part of the original<!--
--> {{#if: {{{text2|}}}
| {{{text2|}}}
| {{#if: {{{text1|}}}
| {{{text1|}}}
| {{#ifeq: {{SUBJECTSPACE}} | {{ns:User}}
| {{lc:{{SUBJECTSPACE}}}} template page
| {{#if: {{SUBJECTSPACE}}
| {{lc:{{SUBJECTSPACE}}}} page
| article
}}
}}
}}
}}.
}}
<!--If not on a doc subpage, do nothing-->}}{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}{{#if: {{{inhibit|}}}
| <!--Skip-->
| <includeonly>{{#ifexist: {{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch: {{SUBJECTSPACE}}
|Template=Template
|Module=Module
|User=User
|#default=Template
}} documentation pages{{#translation:}}]]
| [[Category:Documentation subpages without corresponding pages{{#translation:}}]]
}}</includeonly>
}}<includeonly>
}}</includeonly><noinclude>{{Documentation}}<!--Add categories and interwikis to the /doc subpage, not here!--></noinclude>
2fcb7e4e2d233f798b114d37652fc333213f5ea7
233
57
2023-04-29T17:27:17Z
wikipedia>Paine Ellsworth
0
m
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
| <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
</includeonly><!--
-->{{#ifeq:{{{doc-notice|show}}} |show
| {{Mbox
| type = notice
| style = margin-bottom:1.0em;
| image = [[File:Edit-copy green.svg|40px|alt=|link=]]
| text =
{{strong|This is a [[Wikipedia:Template documentation|documentation]] [[Wikipedia:Subpages|subpage]]}} for {{terminate sentence|{{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}}}<br />It may contain usage information, [[Wikipedia:Categorization|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} |{{#ifeq:{{SUBJECTSPACE}} |{{ns:User}} |{{lc:{{SUBJECTSPACE}}}} template page |{{#if:{{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}.
}}
}}<!--
-->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
-->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
| <includeonly><!--
-->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
| [[Category:Documentation subpages without corresponding pages]]
}}<!--
--></includeonly>
}}<!--
(completing initial #ifeq: at start of template:)
--><includeonly>
| <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
}}<!--
--></includeonly><noinclude>{{Documentation}}</noinclude>
41ca90af0945442788a2dbd08c8c54a61a23c057
Module:Side box/styles.css
828
232
568
2023-01-19T20:36:50Z
wikipedia>TheDJ
0
use display flow-root to force a new Block formatting context
sanitized-css
text/css
/* {{pp|small=y}} */
.side-box {
margin: 4px 0;
box-sizing: border-box;
border: 1px solid #aaa;
font-size: 88%;
line-height: 1.25em;
background-color: #f9f9f9;
display: flow-root;
}
.side-box-abovebelow,
.side-box-text {
padding: 0.25em 0.9em;
}
.side-box-image {
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.side-box-imageright {
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* roughly the skin's sidebar + size of side box */
@media (min-width: 500px) {
.side-box-flex {
display: flex;
align-items: center;
}
.side-box-text {
flex: 1;
}
}
@media (min-width: 720px) {
.side-box {
width: 238px;
}
.side-box-right {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin-left: 1em;
}
/* derives from mbox classes, which do not float left in mbox-small-left
* so far as I can tell, that was a deliberate decision, since only .ambox
* supports mbox-left
*/
.side-box-left {
/* @noflip */
margin-right: 1em;
}
}
5be55dbc33007e62deac23036c134ed064dbe603
Template:Infobox command structure
10
267
643
2023-01-22T22:30:11Z
wikipedia>Zackmann08
0
Adding unknown parameter tracking through [[:Category:Pages using infobox command structure with unknown parameters]] using [[Module:check for unknown parameters]]
wikitext
text/x-wiki
<includeonly>{{military navigation
|raw_name = {{{raw_name|}}}
|title = {{{name|{{PAGENAMEBASE}}}}} {{#if:{{{date|}}}|({{{date}}})}}
|bodyclass= {{{bodyclass|}}}
|group1 = {{#if:{{{parent|}}}|Parent unit}}
|list1 = {{#if:{{{parent|}}}|{{{parent}}}}}
|group2 = {{#if:{{{subordinate|}}}|Components}}
|list2 = {{#if:{{{subordinate|}}}|{{{subordinate}}}}}
}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox command structure with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox command structure]] with unknown parameter "_VALUE_"|ignoreblank=y| bodyclass | date | name | parent | raw_name | subordinate }}<noinclude>
{{documentation}}
</noinclude>
0222856a8bdc4a20c67c6fd07070c8fda0e927a2
Module:Userbox
828
122
341
2023-01-23T19:38:09Z
wikipedia>GKFX
0
Remove check for alt text in colour contrast checker. Categorizes too many userboxes which have no actual issue.
Scribunto
text/plain
-- This module implements {{userbox}}.
local categoryHandler = require('Module:Category handler').main
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function checkNum(val, default)
-- Checks whether a value is a number greater than or equal to zero. If so,
-- returns it as a number. If not, returns a default value.
val = tonumber(val)
if val and val >= 0 then
return val
else
return default
end
end
local function addSuffix(num, suffix)
-- Turns a number into a string and adds a suffix.
if num then
return tostring(num) .. suffix
else
return nil
end
end
local function checkNumAndAddSuffix(num, default, suffix)
-- Checks a value with checkNum and adds a suffix.
num = checkNum(num, default)
return addSuffix(num, suffix)
end
local function makeCat(cat, sort)
-- Makes a category link.
if sort then
return mw.ustring.format('[[Category:%s|%s]]', cat, sort)
else
return mw.ustring.format('[[Category:%s]]', cat)
end
end
--------------------------------------------------------------------------------
-- Argument processing
--------------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local origArgs = require('Module:Arguments').getArgs(frame)
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.main(funcName, args)
end
end
p.userbox = makeInvokeFunc('_userbox')
p['userbox-2'] = makeInvokeFunc('_userbox-2')
p['userbox-r'] = makeInvokeFunc('_userbox-r')
--------------------------------------------------------------------------------
-- Main functions
--------------------------------------------------------------------------------
function p.main(funcName, args)
local userboxData = p[funcName](args)
local userbox = p.render(userboxData)
local cats = p.categories(args)
return userbox .. (cats or '')
end
function p._userbox(args)
-- Does argument processing for {{userbox}}.
local data = {}
-- Get div tag values.
data.float = args.float or 'left'
local borderWidthNum = checkNum(args['border-width'] or args['border-s'], 1) -- Used to calculate width.
data.borderWidth = addSuffix(borderWidthNum, 'px')
data.borderColor = args['border-color'] or args['border-c'] or args[1] or args['id-c'] or '#999'
data.width = addSuffix(240 - 2 * borderWidthNum, 'px') -- Also used in the table tag.
data.bodyClass = args.bodyclass
-- Get table tag values.
data.backgroundColor = args['info-background'] or args[2] or args['info-c'] or '#eee'
-- Get info values.
data.info = args.info or args[4] or "<code>{{{info}}}</code>"
data.infoTextAlign = args['info-a'] or 'left'
data.infoFontSize = checkNumAndAddSuffix(args['info-size'] or args['info-s'], 8, 'pt')
data.infoHeight = checkNumAndAddSuffix(args['logo-height'] or args['id-h'], 45, 'px')
data.infoPadding = args['info-padding'] or args['info-p'] or '0 4px 0 4px'
data.infoLineHeight = args['info-line-height'] or args['info-lh'] or '1.25em'
data.infoColor = args['info-color'] or args['info-fc'] or 'black'
data.infoOtherParams = args['info-other-param'] or args['info-op']
data.infoClass = args['info-class']
-- Get id values.
local id = args.logo or args[3] or args.id
data.id = id
data.showId = id and true or false
data.idWidth = checkNumAndAddSuffix(args['logo-width'] or args['id-w'], 45, 'px')
data.idHeight = checkNumAndAddSuffix(args['logo-height'] or args['id-h'], 45, 'px')
data.idBackgroundColor = args['logo-background'] or args[1] or args['id-c'] or '#ddd'
data.idTextAlign = args['id-a'] or 'center'
data.idFontSize = checkNum(args['logo-size'] or args[5] or args['id-s'], 14)
data.idColor = args['logo-color'] or args['id-fc'] or data.infoColor
data.idPadding = args['logo-padding'] or args['id-p'] or '0 1px 0 0'
data.idLineHeight = args['logo-line-height'] or args['id-lh'] or '1.25em'
data.idOtherParams = args['logo-other-param'] or args['id-op']
data.idClass = args['id-class']
return data
end
p['_userbox-2'] = function (args)
-- Does argument processing for {{userbox-2}}.
local data = {}
-- Get div tag values.
data.float = args.float or 'left'
local borderWidthNum = checkNum(args['border-s'] or args[9], 1) -- Used to calculate width.
data.borderWidth = addSuffix(borderWidthNum, 'px')
data.borderColor = args['border-c'] or args[6] or args['id1-c'] or args[1] or '#999999'
data.width = addSuffix(240 - 2 * borderWidthNum, 'px') -- Also used in the table tag.
data.bodyClass = args.bodyclass
-- Get table tag values.
data.backgroundColor = args['info-c'] or args[2] or '#eeeeee'
-- Get info values.
data.info = args.info or args[4] or "<code>{{{info}}}</code>"
data.infoTextAlign = args['info-a'] or 'left'
data.infoFontSize = checkNumAndAddSuffix(args['info-s'], 8, 'pt')
data.infoColor = args['info-fc'] or args[8] or 'black'
data.infoPadding = args['info-p'] or '0 4px 0 4px'
data.infoLineHeight = args['info-lh'] or '1.25em'
data.infoOtherParams = args['info-op']
-- Get id values.
data.showId = true
data.id = args.logo or args[3] or args.id1 or 'id1'
data.idWidth = checkNumAndAddSuffix(args['id1-w'], 45, 'px')
data.idHeight = checkNumAndAddSuffix(args['id-h'], 45, 'px')
data.idBackgroundColor = args['id1-c'] or args[1] or '#dddddd'
data.idTextAlign = 'center'
data.idFontSize = checkNum(args['id1-s'], 14)
data.idLineHeight = args['id1-lh'] or '1.25em'
data.idColor = args['id1-fc'] or data.infoColor
data.idPadding = args['id1-p'] or '0 1px 0 0'
data.idOtherParams = args['id1-op']
-- Get id2 values.
data.showId2 = true
data.id2 = args.logo or args[5] or args.id2 or 'id2'
data.id2Width = checkNumAndAddSuffix(args['id2-w'], 45, 'px')
data.id2Height = data.idHeight
data.id2BackgroundColor = args['id2-c'] or args[7] or args[1] or '#dddddd'
data.id2TextAlign = 'center'
data.id2FontSize = checkNum(args['id2-s'], 14)
data.id2LineHeight = args['id2-lh'] or '1.25em'
data.id2Color = args['id2-fc'] or data.infoColor
data.id2Padding = args['id2-p'] or '0 0 0 1px'
data.id2OtherParams = args['id2-op']
return data
end
p['_userbox-r'] = function (args)
-- Does argument processing for {{userbox-r}}.
local data = {}
-- Get div tag values.
data.float = args.float or 'left'
local borderWidthNum = checkNum(args['border-width'] or args['border-s'], 1) -- Used to calculate width.
data.borderWidth = addSuffix(borderWidthNum, 'px')
data.borderColor = args['border-color'] or args['border-c'] or args[1] or args['id-c'] or '#999'
data.width = addSuffix(240 - 2 * borderWidthNum, 'px') -- Also used in the table tag.
data.bodyClass = args.bodyclass
-- Get table tag values.
data.backgroundColor = args['info-background'] or args[2] or args['info-c'] or '#eee'
-- Get id values.
data.showId = false -- We only show id2 in userbox-r.
-- Get info values.
data.info = args.info or args[4] or "<code>{{{info}}}</code>"
data.infoTextAlign = args['info-align'] or args['info-a'] or 'left'
data.infoFontSize = checkNumAndAddSuffix(args['info-size'] or args['info-s'], 8, 'pt')
data.infoPadding = args['info-padding'] or args['info-p'] or '0 4px 0 4px'
data.infoLineHeight = args['info-line-height'] or args['info-lh'] or '1.25em'
data.infoColor = args['info-color'] or args['info-fc'] or 'black'
data.infoOtherParams = args['info-other-param'] or args['info-op']
-- Get id2 values.
data.showId2 = true
data.id2 = args.logo or args[3] or args.id or 'id'
data.id2Width = checkNumAndAddSuffix(args['logo-width'] or args['id-w'], 45, 'px')
data.id2Height = checkNumAndAddSuffix(args['logo-height'] or args['id-h'], 45, 'px')
data.id2BackgroundColor = args['logo-background'] or args[1] or args['id-c'] or '#ddd'
data.id2TextAlign = args['id-a'] or 'center'
data.id2FontSize = checkNum(args['logo-size'] or args[5] or args['id-s'], 14)
data.id2Color = args['logo-color'] or args['id-fc'] or data.infoColor
data.id2Padding = args['logo-padding'] or args['id-p'] or '0 0 0 1px'
data.id2LineHeight = args['logo-line-height'] or args['id-lh'] or '1.25em'
data.id2OtherParams = args['logo-other-param'] or args['id-op']
return data
end
function p.render(data)
-- Renders the userbox html using the content of the data table.
-- Render the div tag html.
local root = mw.html.create('div')
root
:css('float', data.float)
:css('border', (data.borderWidth or '') .. ' solid ' .. (data.borderColor or ''))
:css('margin', '1px')
:css('width', data.width)
:addClass('wikipediauserbox')
:addClass(data.bodyClass)
-- Render the table tag html.
local tableroot = root:tag('table')
tableroot
:attr('role', 'presentation')
:css('border-collapse', 'collapse')
:css('width', data.width)
:css('margin-bottom', '0')
:css('margin-top', '0')
:css('background', data.backgroundColor)
-- Render the id html.
local tablerow = tableroot:tag('tr')
if data.showId then
tablerow:tag('td')
:css('border', '0')
:css('width', data.idWidth)
:css('height', data.idHeight)
:css('background', data.idBackgroundColor)
:css('text-align', data.idTextAlign)
:css('font-size', data.idFontSize .. 'pt')
:css('font-weight', 'bold')
:css('color', data.idColor)
:css('padding', data.idPadding)
:css('line-height', data.idLineHeight)
:css('vertical-align', 'middle')
:cssText(data.idOtherParams)
:addClass(data.idClass)
:wikitext(data.id)
end
-- Render the info html.
tablerow:tag('td')
:css('border', '0')
:css('text-align', data.infoTextAlign)
:css('font-size', data.infoFontSize)
:css('padding', data.infoPadding)
:css('height', data.infoHeight)
:css('line-height', data.infoLineHeight)
:css('color', data.infoColor)
:css('vertical-align', 'middle')
:cssText(data.infoOtherParams)
:addClass(data.infoClass)
:wikitext(data.info)
-- Render the second id html.
if data.showId2 then
tablerow:tag('td')
:css('border', '0')
:css('width', data.id2Width)
:css('height', data.id2Height)
:css('background', data.id2BackgroundColor)
:css('text-align', data.id2TextAlign)
:css('font-size', data.id2FontSize .. 'pt')
:css('font-weight', 'bold')
:css('color', data.id2Color)
:css('padding', data.id2Padding)
:css('line-height', data.id2LineHeight)
:css('vertical-align', 'middle')
:cssText(data.id2OtherParams)
:wikitext(data.id2)
end
local title = mw.title.getCurrentTitle()
if (title.namespace == 2) and not title.text:match("/") then
return tostring(root) -- regular user page
elseif title.namespace == 14 then
return tostring(root) -- category
elseif title.isTalkPage then
return tostring(root) -- talk page
end
local legible = true
local contrast = require('Module:Color contrast')._ratio
local function has_text(wikitext)
wikitext = wikitext:gsub("]]", "|]]")
wikitext = wikitext:gsub("%[%[%s*[Mm][Ee][Dd][Ii][Aa]%s*:[^|]-(|.-)]]", "")
wikitext = wikitext:gsub("%[%[%s*[Ii][Mm][Aa][Gg][Ee]%s*:[^|]-(|.-)]]", "")
wikitext = wikitext:gsub("%[%[%s*[Ff][Ii][Ll][Ee]%s*:[^|]-(|.-)]]", "")
return mw.text.trim(wikitext) ~= ""
end
if contrast { data.infoColor, data.backgroundColor, error = 0 } < 4.5 then
legible = false
end
-- For bold text >= 14pt, requirement is only 3.
local idContrastThreshold = 4.5
local id2ContrastThreshold = 4.5
if (data.idFontSize or 0) >= 14 then
idContrastThreshold = 3
end
if (data.id2FontSize or 0) >= 14 then
id2ContrastThreshold = 3
end
if data.showId and contrast { data.idColor, data.idBackgroundColor, error = 0 } < idContrastThreshold then
if has_text(data.id or "") then
legible = false
end
end
if data.showId2 and contrast { data.id2Color, data.id2BackgroundColor, error = 0 } < id2ContrastThreshold then
if has_text(data.id2 or "") then
legible = false
end
end
if not legible then
root:wikitext('[[Category:Userboxes with insufficient color contrast]]')
end
return tostring(root)
end
function p.categories(args, page)
-- Gets categories from [[Module:Category handler]].
-- The page parameter makes the function act as though the module was being called from that page.
-- It is included for testing purposes.
local cats = {}
cats[#cats + 1] = args.usercategory
cats[#cats + 1] = args.usercategory2
cats[#cats + 1] = args.usercategory3
cats[#cats + 1] = args.usercategory4
cats[#cats + 1] = args.usercategory5
-- Get the title object
local title
if page then
title = mw.title.new(page)
else
title = mw.title.getCurrentTitle()
end
-- Build category handler arguments.
local chargs = {}
chargs.page = page
chargs.nocat = args.nocat
chargs.main = '[[Category:Pages with templates in the wrong namespace]]'
if args.notcatsubpages then
chargs.subpage = 'no'
end
-- User namespace.
local user = ''
for i, cat in ipairs(cats) do
user = user .. makeCat(cat)
end
chargs.user = user
-- Template namespace.
local basepage = title.baseText
local template = ''
for i, cat in ipairs(cats) do
template = template .. makeCat(cat, ' ' .. basepage)
end
chargs.template = template
return categoryHandler(chargs)
end
return p
3afddd38f65cb302185911fa9957526a85855673
Module:If empty
828
173
446
2023-01-26T18:33:28Z
wikipedia>MSGJ
0
lastk is not needed
Scribunto
text/plain
local p = {}
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
for k,v in ipairs(args) do
if v ~= '' then
return v
end
end
end
return p
4790391408957dea3ff9f453834c05f6b379a45c
Template:Distinguish
10
53
177
2023-02-04T21:16:13Z
wikipedia>Hog Farm
0
[[Wikipedia:Templates for discussion/Log/2023 February 4#Template:Distinguish]] closed as keep ([[WP:XFDC#4.0.13|XFDcloser]])
wikitext
text/x-wiki
{{#invoke:Distinguish|distinguish}}<noinclude><!-- splitting these lines causes {{Documentation}} template to terminate green shading when Distinguish is used in /doc pages. -->
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis to Wikidata, not here! -->
</noinclude>
f949a4cbfd6eb0ab77b832e69059a40a964b1fd8
Template:GNIS URL
10
219
540
2023-02-12T13:00:30Z
wikipedia>Hike395
0
add URL for retired/archived GNIS types
wikitext
text/x-wiki
{{#switch:{{{type|}}}
|antarid=https://web.archive.org/web/2020/https://geonames.usgs.gov/apex/f?p=gnispq:5:::NO::P5_ANTAR_ID:{{urlencode:{{{1|{{{id|}}}}}}}}
|retired|archived=https://web.archive.org/web/2020/https://geonames.usgs.gov/apex/f?p=gnispq:3:::NO::P3_FID:{{urlencode:{{{1|{{{id|}}}}}}}}
|#default=https://edits.nationalmap.gov/apps/gaz-domestic/public/summary/{{urlencode:{{{1|{{{id|}}}}}}}}}}<noinclude>
{{Documentation}}
</noinclude>
dfd131ef230ab495032d2706ae5a243072ffd3bf
Template:Sister project
10
181
462
2023-02-14T12:14:20Z
wikipedia>Paine Ellsworth
0
"iw" for interwiki link (other-language WPs)
wikitext
text/x-wiki
{{Side box
| metadata=no
| position = {{{position|}}}
| image =
{{#switch: {{{image|}}}
| none = <!-- "image=none", do nothing -->
| = <!-- No image fed, select an image -->
[[File:{{#switch: {{lc: {{{project|}}} }}
| commons|c = Commons-logo.svg
| meta|metawiki|m = Wikimedia Community Logo.svg
| wikibooks|wbk|wb|b = Wikibooks-logo-en-noslogan.svg
| wikidata|data = Wikidata-logo.svg
| wikiquote|quote|wqt|q = Wikiquote-logo.svg
| wikipedia|wp|w|iw = Wikipedia-logo-v2.svg
| wikisource|source|ws|s = Wikisource-logo.svg
| wiktionary|wikt|wkt|wdy|d = Wiktionary-logo-en-v2.svg
| wikinews|news|wnw|n = Wikinews-logo.svg
| wikispecies|species = Wikispecies-logo.svg
| wikiversity|wvy|v = Wikiversity logo 2017.svg
| wikivoyage|voyage|voy = Wikivoyage-Logo-v3-icon.svg
| mediawiki|mw = MediaWiki-2020-icon.svg
| outreachwiki|outreach = Wikimedia Outreach.png
| incubator = Incubator-notext.svg
| #default = Wikimedia-logo.svg
}}|40x40px|class=noviewer|alt=|link=
]]
| #default = {{{image|}}}
}}
| textclass = {{{textclass|plainlist}}}
| textstyle = {{{textstyle|}}}
| text = {{{text}}}
| below = {{{below|}}}
| imageright = {{{imageright|}}}
| class = plainlinks sistersitebox
}}<noinclude>{{Documentation}}<!-- Add categories and interwikis to the /doc subpage, not here! --></noinclude>
0929197ea6267d9d63d80f9f8432fe1cfbe7ace8
Template:Specialist lea type descr
10
140
379
2023-02-24T09:32:01Z
wikipedia>Yeeno
0
fix spelling and remove periods for one-word descriptions
wikitext
text/x-wiki
<noinclude>
==Usage==
1 == specialist agency template code value - mandatory<br>
The specialist agency type descriptions can be edited here.
Do not change the specialist agency type code values here only. All [[:Category:Specialist law enforcement agency codified templates|other related templates]] must be edited too if the specialist agency type code values are changed.
==Encyclopedic content==
{{Tempmore |Specialist law enforcement agency}}
</noinclude><!--
Return specialist agency type description
--><includeonly>{{#switch: {{lc:{{{1|}}}}}
</includeonly><noinclude>{|class="wikitable"
!Code!!Description
|-</noinclude>
| border <includeonly>=</includeonly><noinclude>||</noinclude> National border patrol, security, and integrity.<noinclude>
|-</noinclude>
| coast <includeonly>=</includeonly><noinclude>||</noinclude> Coastal patrol, marine border protection, marine search and rescue.<noinclude>
|-</noinclude>
| corruption <includeonly>=</includeonly><noinclude>||</noinclude> [[Anti-corruption]]<noinclude>
|-</noinclude>
| customs <includeonly>=</includeonly><noinclude>||</noinclude> [[Customs]], [[excise]] and [[gaming law|gambling]].<noinclude>
|-</noinclude>
| diplomatic <includeonly>=</includeonly><noinclude>||</noinclude> Diplomatic personnel and facilities.<noinclude>
|-</noinclude>
| education<noinclude><br></noinclude><includeonly>
| </includeonly>nontertiary<noinclude><br></noinclude><includeonly>
| </includeonly>primary<noinclude><br></noinclude><includeonly>
| </includeonly>secondary<noinclude><br></noinclude><includeonly>
| </includeonly>tertiary <includeonly>=</includeonly><noinclude>||</noinclude> Buildings and lands occupied or explicitly controlled by the educational institution and the institution's personnel, and public entering the buildings and immediate precincts of the institution.<noinclude>
|-</noinclude>
| envher <includeonly>=</includeonly><noinclude>||</noinclude> Environment, parks, and/or heritage property.<noinclude>
|-</noinclude>
| fraud <includeonly>=</includeonly><noinclude>||</noinclude> Serious or complex fraud, commercial crime, fraud covering multiple lower level jurisdictions.<noinclude>
|-</noinclude>
| immigration <includeonly>=</includeonly><noinclude>||</noinclude> [[Immigration]]<noinclude>
|-</noinclude>
| institution <includeonly>=</includeonly><noinclude>||</noinclude> Buildings and lands occupied or explicitly controlled by the institution and the institution's personnel, and public entering the buildings and precincts of the institution.<noinclude>
|-</noinclude>
| paramilitary <includeonly>=</includeonly><noinclude>||</noinclude> Paramilitary law enforcement, counter insurgency, and [[riot control]].<noinclude>
|-</noinclude>
| specops <includeonly>=</includeonly><noinclude>||</noinclude> Counter terrorism, [[police tactical unit|special weapons operations]]. Protection of internationally protected persons, other very important persons, and/or of state property of significance.<noinclude>
|-</noinclude>
| postal <includeonly>=</includeonly><noinclude>||</noinclude> Property, personnel, and/or postal items of a postal service. <noinclude>
|-</noinclude>
| property <includeonly>=</includeonly><noinclude>||</noinclude> Buildings and other fixed assets.<noinclude>
|-</noinclude>
| protection <includeonly>=</includeonly><noinclude>||</noinclude> Protection of international or domestic [[Very Important Person|VIPs]], protection of significant state assets.<noinclude>
|-</noinclude>
| rail <includeonly>=</includeonly><noinclude>||</noinclude> Railways, tramways, and/or rail transit systems.<noinclude>
|-</noinclude>
| road <includeonly>=</includeonly><noinclude>||</noinclude> Highways, roads, and/or traffic.<noinclude>
|-</noinclude>
| tax <includeonly>=</includeonly><noinclude>||</noinclude> Taxation<noinclude>
|-</noinclude>
| transit <includeonly>=</includeonly><noinclude>||</noinclude> Commuter transit systems and immediate environs, rail, tram, ferry, bus, etc.<noinclude>
|-</noinclude>
| vehicle <includeonly>=</includeonly><noinclude>||</noinclude> Vehicle safety and hazardous material transport laws and regulations, licensing, registration, insurance, etc.<noinclude>
|-</noinclude>
| water <includeonly>=</includeonly><noinclude>||</noinclude> Water ways and bodies and/or coastal areas.<noinclude>
|}</noinclude><includeonly>
}}</includeonly><noinclude>
[[Category:Specialist law enforcement agency codified templates|Specialist lea type descr]]
</noinclude>
a8a70873252b5433544a1d0962d0ca83d2d51c9e
Template:Xmark
10
102
299
2023-03-07T22:16:00Z
wikipedia>Jonesey95
0
fix comment to match template name
wikitext
text/x-wiki
[[{{ {{{|safesubst:}}}#switch:{{ {{{|safesubst:}}}lc:{{{color|{{{colour|}}}}}} }}
|red |rd |r =File:X mark.svg
|darkred |dkred |drd |dr =File:Dark Red x.svg
|orange |or |o =File:Orange x.svg
|yellow |yel |y =File:Dark yellow x.svg
|black |blk |k =File:Black x.svg
|grey |gray |gry |gy =File:SemiTransBlack x.svg
<!--default--> |File:X mark.svg
}}|{{ {{{|safesubst:}}}#if:{{{1|}}}|{{{1}}}|20}}px|link=|alt=☒]]<span style="display:none">N</span><!--template:Xmark--><noinclude>
{{documentation}}
</noinclude>
71b3471d91ac8237d642abb3e6f35824f0b554dc
Module:Shortcut/styles.css
828
113
321
2023-03-14T15:53:59Z
wikipedia>Izno
0
Undid revision 1144571295 by [[Special:Contributions/TheDJ|TheDJ]] ([[User talk:TheDJ|talk]]) I'm sorry, that's not what we discussed or agreed to
sanitized-css
text/css
/* {{pp-template}} */
.module-shortcutboxplain {
float: right;
margin: 0 0 0 1em;
border: 1px solid #aaa;
background: #fff;
padding: 0.3em 0.6em 0.2em 0.6em;
text-align: center;
font-size: 85%;
}
.module-shortcutboxleft {
float: left;
margin: 0 1em 0 0;
}
.module-shortcutlist {
display: inline-block;
border-bottom: 1px solid #aaa;
margin-bottom: 0.2em;
}
.module-shortcutboxplain ul {
font-weight: bold;
}
.module-shortcutanchordiv {
position: relative;
top: -3em;
}
li .module-shortcutanchordiv {
float: right; /* IE/Edge in list items */
}
.mbox-imageright .module-shortcutboxplain {
padding: 0.4em 1em 0.4em 1em;
line-height: 1.3;
margin: 0;
}
ccf3877e4b14726147d3b1d8a297fbecacdb2cf8
Module:Sidebar/configuration
828
66
209
2023-03-14T22:32:24Z
wikipedia>Izno
0
add hlist and plainlist_templatestyles keys
Scribunto
text/plain
return {
i18n = {
child_yes = 'yes',
float_none = 'none',
float_left = 'left',
wrap_true = 'true',
navbar_none = 'none',
navbar_off = 'off',
default_list_title = 'List',
title_not_to_add_navbar = 'Template:Sidebar',
collapse_title_not_to_add_navbar = 'Template:Sidebar with collapsible lists',
templatestyles = 'Module:Sidebar/styles.css',
hlist_templatestyles = 'Hlist/styles.css',
plainlist_templatestyles = 'Plainlist/styles.css',
category = {
child = '[[Category:Pages using sidebar with the child parameter]]',
conversion = '[[Category:Sidebars with styles needing conversion]]'
},
pattern = {
collapse_sandbox = '/sandbox$',
sandbox = '/sandbox$',
subgroup = 'sidebar%-subgroup',
style_conversion = 'style$',
uncategorized_conversion_titles = {
'/[Ss]andbox',
'/[Tt]estcases',
'/[Dd]oc$'
}
},
class = {
sidebar = 'sidebar',
subgroup = 'sidebar-subgroup',
collapse = 'sidebar-collapse',
float_none = 'sidebar-none',
float_left = 'sidebar-left',
wraplinks = 'nowraplinks',
outer_title = 'sidebar-outer-title',
top_image = 'sidebar-top-image',
top_caption = 'sidebar-top-caption',
pretitle = 'sidebar-pretitle',
pretitle_with_top_image = 'sidebar-pretitle-with-top-image',
title = 'sidebar-title',
title_with_pretitle = 'sidebar-title-with-pretitle',
image = 'sidebar-image',
caption = 'sidebar-caption',
above = 'sidebar-above',
heading = 'sidebar-heading',
content = 'sidebar-content',
content_with_subgroup = 'sidebar-content-with-subgroup',
below = 'sidebar-below',
navbar = 'sidebar-navbar',
list = 'sidebar-list',
list_title = 'sidebar-list-title',
list_title_centered = 'sidebar-list-title-c',
list_content = 'sidebar-list-content'
}
}
}
dc2a980ac2162a898f7c21e6d6ba7e994dfeb315
Module:Sidebar
828
65
207
2023-03-14T22:35:53Z
wikipedia>Izno
0
move these items to config, discovered during work at meta
Scribunto
text/plain
require('strict')
local cfg = mw.loadData('Module:Sidebar/configuration')
local p = {}
local getArgs = require('Module:Arguments').getArgs
--[[
Categorizes calling templates and modules with a 'style' parameter of any sort
for tracking to convert to TemplateStyles.
TODO after a long cleanup: Catch sidebars in other namespaces than Template and Module.
TODO would probably want to remove /log and /archive as CS1 does
]]
local function categorizeTemplatesWithInlineStyles(args)
local title = mw.title.getCurrentTitle()
if title.namespace ~= 10 and title.namespace ~= 828 then return '' end
for _, pattern in ipairs (cfg.i18n.pattern.uncategorized_conversion_titles) do
if title.text:match(pattern) then return '' end
end
for key, _ in pairs(args) do
if mw.ustring.find(key, cfg.i18n.pattern.style_conversion) or key == 'width' then
return cfg.i18n.category.conversion
end
end
end
--[[
For compatibility with the original {{sidebar with collapsible lists}}
implementation, which passed some parameters through {{#if}} to trim their
whitespace. This also triggered the automatic newline behavior.
]]
-- See ([[meta:Help:Newlines and spaces#Automatic newline]])
local function trimAndAddAutomaticNewline(s)
s = mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1")
if mw.ustring.find(s, '^[#*:;]') or mw.ustring.find(s, '^{|') then
return '\n' .. s
else
return s
end
end
--[[
Finds whether a sidebar has a subgroup sidebar.
]]
local function hasSubgroup(s)
if mw.ustring.find(s, cfg.i18n.pattern.subgroup) then
return true
else
return false
end
end
local function has_navbar(navbar_mode, sidebar_name)
return navbar_mode ~= cfg.i18n.navbar_none and
navbar_mode ~= cfg.i18n.navbar_off and
(
sidebar_name or
mw.getCurrentFrame():getParent():getTitle():gsub(cfg.i18n.pattern.sandbox, '') ~=
cfg.i18n.title_not_to_add_navbar
)
end
local function has_list_class(args, htmlclass)
local patterns = {
'^' .. htmlclass .. '$',
'%s' .. htmlclass .. '$',
'^' .. htmlclass .. '%s',
'%s' .. htmlclass .. '%s'
}
for arg, value in pairs(args) do
if type(arg) == 'string' and mw.ustring.find(arg, 'class') then
for _, pattern in ipairs(patterns) do
if mw.ustring.find(args[arg] or '', pattern) then
return true
end
end
end
end
return false
end
-- there are a lot of list classes in the wild, so we add their TemplateStyles
local function add_list_styles(args)
local frame = mw.getCurrentFrame()
local function add_list_templatestyles(htmlclass, templatestyles)
if has_list_class(args, htmlclass) then
return frame:extensionTag{
name = 'templatestyles', args = { src = templatestyles }
}
else
return ''
end
end
local plainlist_styles = add_list_templatestyles('plainlist', cfg.i18n.plainlist_templatestyles)
local hlist_styles = add_list_templatestyles('hlist', cfg.i18n.hlist_templatestyles)
-- a second workaround for [[phab:T303378]]
-- when that issue is fixed, we can actually use has_navbar not to emit the
-- tag here if we want
if has_navbar(args.navbar, args.name) and hlist_styles == '' then
hlist_styles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.i18n.hlist_templatestyles}
}
end
-- hlist -> plainlist is best-effort to preserve old Common.css ordering. [hlist_note]
return hlist_styles .. plainlist_styles
end
-- work around [[phab:T303378]]
-- for each arg: find all the templatestyles strip markers, insert them into a
-- table. then remove all templatestyles markers from the arg
local function move_hiding_templatestyles(args)
local gfind = string.gfind
local gsub = string.gsub
local templatestyles_markers = {}
local strip_marker_pattern = '(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)'
for k, arg in pairs(args) do
for marker in gfind(arg, strip_marker_pattern) do
table.insert(templatestyles_markers, marker)
end
args[k] = gsub(arg, strip_marker_pattern, '')
end
return templatestyles_markers
end
--[[
Main sidebar function. Takes the frame, args, and an optional collapsibleClass.
The collapsibleClass is and should be used only for sidebars with collapsible
lists, as in p.collapsible.
]]
function p.sidebar(frame, args, collapsibleClass)
if not args then
args = getArgs(frame)
end
local hiding_templatestyles = table.concat(move_hiding_templatestyles(args))
local root = mw.html.create()
local child = args.child and mw.text.trim(args.child) == cfg.i18n.child_yes
root = root:tag('table')
if not child then
root
:addClass(cfg.i18n.class.sidebar)
-- force collapsibleclass to be sidebar-collapse otherwise output nothing
:addClass(collapsibleClass == cfg.i18n.class.collapse and cfg.i18n.class.collapse or nil)
:addClass('nomobile')
:addClass(args.float == cfg.i18n.float_none and cfg.i18n.class.float_none or nil)
:addClass(args.float == cfg.i18n.float_left and cfg.i18n.class.float_left or nil)
:addClass(args.wraplinks ~= cfg.i18n.wrap_true and cfg.i18n.class.wraplinks or nil)
:addClass(args.bodyclass or args.class)
:css('width', args.width or nil)
:cssText(args.bodystyle or args.style)
if args.outertitle then
root
:tag('caption')
:addClass(cfg.i18n.class.outer_title)
:addClass(args.outertitleclass)
:cssText(args.outertitlestyle)
:wikitext(args.outertitle)
end
if args.topimage then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(cfg.i18n.class.top_image)
:addClass(args.topimageclass)
:cssText(args.topimagestyle)
:wikitext(args.topimage)
if args.topcaption then
imageCell
:tag('div')
:addClass(cfg.i18n.class.top_caption)
:cssText(args.topcaptionstyle)
:wikitext(args.topcaption)
end
end
if args.pretitle then
root
:tag('tr')
:tag('td')
:addClass(args.topimage and cfg.i18n.class.pretitle_with_top_image
or cfg.i18n.class.pretitle)
:addClass(args.pretitleclass)
:cssText(args.basestyle)
:cssText(args.pretitlestyle)
:wikitext(args.pretitle)
end
else
root
:addClass(cfg.i18n.class.subgroup)
:addClass(args.bodyclass or args.class)
:cssText(args.bodystyle or args.style)
end
if args.title then
if child then
root
:wikitext(args.title)
else
root
:tag('tr')
:tag('th')
:addClass(args.pretitle and cfg.i18n.class.title_with_pretitle
or cfg.i18n.class.title)
:addClass(args.titleclass)
:cssText(args.basestyle)
:cssText(args.titlestyle)
:wikitext(args.title)
end
end
if args.image then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(cfg.i18n.class.image)
:addClass(args.imageclass)
:cssText(args.imagestyle)
:wikitext(args.image)
if args.caption then
imageCell
:tag('div')
:addClass(cfg.i18n.class.caption)
:cssText(args.captionstyle)
:wikitext(args.caption)
end
end
if args.above then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.above)
:addClass(args.aboveclass)
:cssText(args.abovestyle)
:newline() -- newline required for bullet-points to work
:wikitext(args.above)
end
local rowNums = {}
for k, v in pairs(args) do
k = '' .. k
local num = k:match('^heading(%d+)$') or k:match('^content(%d+)$')
if num then table.insert(rowNums, tonumber(num)) end
end
table.sort(rowNums)
-- remove duplicates from the list (e.g. 3 will be duplicated if both heading3
-- and content3 are specified)
for i = #rowNums, 1, -1 do
if rowNums[i] == rowNums[i - 1] then
table.remove(rowNums, i)
end
end
for i, num in ipairs(rowNums) do
local heading = args['heading' .. num]
if heading then
root
:tag('tr')
:tag('th')
:addClass(cfg.i18n.class.heading)
:addClass(args.headingclass)
:addClass(args['heading' .. num .. 'class'])
:cssText(args.basestyle)
:cssText(args.headingstyle)
:cssText(args['heading' .. num .. 'style'])
:newline()
:wikitext(heading)
end
local content = args['content' .. num]
if content then
root
:tag('tr')
:tag('td')
:addClass(hasSubgroup(content) and cfg.i18n.class.content_with_subgroup
or cfg.i18n.class.content)
:addClass(args.contentclass)
:addClass(args['content' .. num .. 'class'])
:cssText(args.contentstyle)
:cssText(args['content' .. num .. 'style'])
:newline()
:wikitext(content)
:done()
-- Without a linebreak after the </td>, a nested list like
-- "* {{hlist| ...}}" doesn't parse correctly.
:newline()
end
end
if args.below then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.below)
:addClass(args.belowclass)
:cssText(args.belowstyle)
:newline()
:wikitext(args.below)
end
if not child and has_navbar(args.navbar, args.name) then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.navbar)
:cssText(args.navbarstyle)
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
fontstyle = args.navbarfontstyle
})
end
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.i18n.templatestyles }
}
local templatestyles = ''
if args['templatestyles'] and args['templatestyles'] ~= '' then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] and args['child templatestyles'] ~= '' then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] and args['grandchild templatestyles'] ~= '' then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
add_list_styles(args), -- see [hlist_note] above about ordering
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles,
hiding_templatestyles,
tostring(root),
(child and cfg.i18n.category.child or ''),
categorizeTemplatesWithInlineStyles(args)
})
end
local function list_title(args, is_centered_list_titles, num)
local title_text = trimAndAddAutomaticNewline(args['list' .. num .. 'title']
or cfg.i18n.default_list_title)
local title
if is_centered_list_titles then
-- collapsible can be finicky, so provide some CSS/HTML to support
title = mw.html.create('div')
:addClass(cfg.i18n.class.list_title_centered)
:wikitext(title_text)
else
title = mw.html.create()
:wikitext(title_text)
end
local title_container = mw.html.create('div')
:addClass(cfg.i18n.class.list_title)
-- don't /need/ a listnumtitleclass because you can do
-- .templateclass .listnumclass .sidebar-list-title
:addClass(args.listtitleclass)
:cssText(args.basestyle)
:cssText(args.listtitlestyle)
:cssText(args['list' .. num .. 'titlestyle'])
:node(title)
:done()
return title_container
end
--[[
Main entry point for sidebar with collapsible lists.
Does the work of creating the collapsible lists themselves and including them
into the args.
]]
function p.collapsible(frame)
local args = getArgs(frame)
if not args.name and
frame:getParent():getTitle():gsub(cfg.i18n.pattern.collapse_sandbox, '') ==
cfg.i18n.collapse_title_not_to_add_navbar then
args.navbar = cfg.i18n.navbar_none
end
local contentArgs = {}
local is_centered_list_titles = false
if args['centered list titles'] and args['centered list titles'] ~= '' then
is_centered_list_titles = true
end
for k, v in pairs(args) do
local num = string.match(k, '^list(%d+)$')
if num then
local expand = args.expanded and
(args.expanded == 'all' or args.expanded == args['list' .. num .. 'name'])
local row = mw.html.create('div')
row
:addClass(cfg.i18n.class.list)
:addClass('mw-collapsible')
:addClass((not expand) and 'mw-collapsed' or nil)
:addClass(args['list' .. num .. 'class'])
:cssText(args.listframestyle)
:cssText(args['list' .. num .. 'framestyle'])
:node(list_title(args, is_centered_list_titles, num))
:tag('div')
:addClass(cfg.i18n.class.list_content)
:addClass('mw-collapsible-content')
-- don't /need/ a listnumstyleclass because you can do
-- .templatename .listnumclass .sidebar-list
:addClass(args.listclass)
:cssText(args.liststyle)
:cssText(args['list' .. num .. 'style'])
:wikitext(trimAndAddAutomaticNewline(args['list' .. num]))
contentArgs['content' .. num] = tostring(row)
end
end
for k, v in pairs(contentArgs) do
args[k] = v
end
return p.sidebar(frame, args, cfg.i18n.class.collapse)
end
return p
71fe765846593e025ca2f94371315e9dbb5bb4d2
Template:Div col/styles.css
10
69
215
2023-03-29T18:11:31Z
wikipedia>Jonesey95
0
Attempt to copy plainlist class from [[MediaWiki:Common.css]]. I don't know if this actually works.
sanitized-css
text/css
/* {{pp|small=yes}} */
.div-col {
margin-top: 0.3em;
column-width: 30em;
}
.div-col-small {
font-size: 90%;
}
.div-col-rules {
column-rule: 1px solid #aaa;
}
/* Reset top margin for lists in div col */
.div-col dl,
.div-col ol,
.div-col ul {
margin-top: 0;
}
/* Avoid elements breaking between columns
See also Template:No col break */
.div-col li,
.div-col dd {
page-break-inside: avoid; /* Removed from CSS in favor of break-inside c. 2020 */
break-inside: avoid-column;
}
/* Unbulleted lists */
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none;
margin: 0;
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
76c2c0a042b9164cff638cd44af5ab129702c141
Help:Infobox/user style
12
87
267
2023-04-03T14:00:08Z
wikipedia>Maddy from Celeste
0
blatant self-promotion
wikitext
text/x-wiki
{{{heading|
==Infoboxes and user style ==
}}}
Users can have [[WP:User style|user CSS]] that hides<!--, moves, or makes collapsible--> any infoboxes in their own browsers.
To hide all infoboxes, add the following to [[Special:MyPage/common.css]] (for all [[WP:Skin|skins]], or [[Special:MyPage/skin.css]] for just the current skin), on a line by itself:
<syntaxhighlight lang="css">div.mw-parser-output .infobox { display: none; }</syntaxhighlight>
Alternatively, you can add the following code to [[Special:MyPage/common.js|your common.js]] or into a browser user script that is executed by an extension like [[Greasemonkey]]:
<syntaxhighlight lang="js">$('.infobox').hide();</syntaxhighlight>
Be aware that although{{#if:{{{guideline|}}}||, per [[WP:Manual of Style/Infoboxes]],}} all information in an infobox ideally should also be found in the main body of an article, there isn't perfect compliance with this guideline. For example, the full taxonomic hierarchy in {{tlx|Taxobox}}, and the OMIM and other medical database codes of {{tlx|Infobox disease}} are often not found in the main article content. The infobox is also often the location of the most significant, even only, image in an article. There is a userscript which removes infoboxes but moves the images contained to separate thumbnails: [[User:Maddy from Celeste/disinfobox.js]].<!--
Needs Special:Mypage/common.js options for:
* Making infoboxes collapsible
** Making them auto-collapsed
* Moving infoboxes to bottom of page
--><noinclude>
{{Documentation|content=
This documentation snippet is transcluded at [[Help:Infobox]], [[Template:Infobox/doc]], [[WP:Customisation#Hiding specific messages]], [[Help:User style]], [[WP:Manual of Style/Infoboxes]], and other places where this information is relevant.
As a template, this snippet takes a {{para|heading}} parameter to replace the level-2 <code>==Infoboxes and user style==</code> section heading code, as needed. E.g., for a <code>=== ... ===</code> level-3 heading: <code><nowiki>heading={{=}}{{=}}{{=}}Infoboxes and user style{{=}}{{=}}{{=}}</nowiki></code>
}}
</noinclude>
ba4dac68eb2bdc49a32f2a11b9afd52381bf06b5
Template:Collapse top
10
138
375
2023-04-07T02:02:13Z
wikipedia>Izno
0
per tech news
wikitext
text/x-wiki
<div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section -->
{| <!-- Template:Collapse top --> class="mw-collapsible mw-archivedtalk {{<includeonly>safesubst:</includeonly>#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}} {{{class|}}}" style="background: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|Silver}}}; margin: 0.2em auto auto; width:{{<includeonly>safesubst:</includeonly>#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}; padding: 1px;"
|-
! style="background: {{{bg|#{{main other|F0F2F5|CCFFCC}}}}}; font-size:87%; padding:0.2em 0.3em; text-align:{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}|left|{{<includeonly>safesubst:</includeonly>#if:{{{align|}}}|left|center}}}}; {{<includeonly>safesubst:</includeonly>#if:{{{fc|}}}|color: {{{fc}}};|}}" | <div style="font-size:115%;{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}||margin:0 4em}}">{{{1|{{{title|{{{reason|{{{header|{{{heading|{{{result|Extended content}}}}}}}}}}}}}}}}}}</div>
{{<includeonly>safesubst:</includeonly>#if:{{{warning|{{{2|}}}}}}
|{{<includeonly>safesubst:</includeonly>!}}-
{{<includeonly>safesubst:</includeonly>!}} style="text-align:center; font-style:italic;" {{<includeonly>safesubst:</includeonly>!}} {{{2|The following is a closed discussion. {{strongbad|Please do not modify it.}} }}} }}
|-
| style="border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|White}}};" {{<includeonly>safesubst:</includeonly>!}}<noinclude>
{{lorem ipsum|3}}
{{Collapse bottom}}
{{Documentation}}
</noinclude>
247cc43d5198baf8804d0926529cbbdd7be91113
Template:Uses TemplateStyles
10
32
556
73
2023-04-18T22:22:16Z
wikipedia>Grufo
0
Move the preview inside the documentation
wikitext
text/x-wiki
<includeonly>{{#invoke:Uses TemplateStyles|main}}</includeonly><noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
60f2fc73c4d69b292455879f9fcb3c68f6c63c2a
Template:Microformat message
10
268
645
2023-04-24T21:58:07Z
wikipedia>GoldRingChip
0
large
wikitext
text/x-wiki
The [[Help:HTML in wikitext|HTML mark-up]] produced by this template includes {{#if:{{{type|}}} |{{{type}}} |an [[{{{format}}} microformat]]}} that makes {{{data}}} readily [[Parsing|parsable]] by computer programs. This aids tasks such as the cataloguing of articles and maintenance of databases. For more information about the use of microformats on Wikipedia, please visit [[Wikipedia:WikiProject Microformats|the Microformat WikiProject]].<!--
-->{{#if:{{{subtemplates<includeonly>|</includeonly>}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{large|Subtemplates}}
{{{subtemplates}}}
'''''Please do not remove instances of these subtemplates.'''''
</div>}}<!--
-->{{#if:{{{subsection1|}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;"><!--(newline in case subsection begins with heading:)-->
{{{subsection1}}}
</div>}}<!--
-->{{#if:{{{1<includeonly>|</includeonly>}}} <!--(i.e. if at least one unnamed parameter supplied:)-->
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{large|Classes used}}
The [[HTML attribute|HTML class]]es of this microformat include:
: {{hlist
|item_style=font-size:110%;{{{itemstyle|}}}
|{{{1}}} |{{{2<includeonly>|</includeonly>}}} |{{{3|<noinclude>{{nobold|……}}</noinclude>}}}
|{{{4|}}} |{{{5|}}} |{{{6|}}} |{{{7|}}} |{{{8|}}} |{{{9|}}} |{{{10|}}} |{{{11|}}} |{{{12|}}} |{{{13|}}} |{{{14|}}} |{{{15|}}} |{{{16|}}} |{{{17|}}} |{{{18|}}} |{{{19|}}} |{{{20|}}}
}} </div>
{{longitem|style=line-height:1.3em|'''''Please do not rename or remove these classes{{#if:{{{nocollapse<includeonly>|</includeonly>}}} |<br/>nor collapse nested elements which use them}}.'''''}}<!--
-->}}<!--(end #if:[1])--><noinclude>
{{Documentation}}
</noinclude>
25d8c54d56c1c64f1b98e6c8b2a50054e6a9deb5
Template:Coord
10
183
466
2023-04-30T08:14:15Z
wikipedia>Galobtter
0
Changed protection settings for "[[Template:Coord]]": Only purpose is to call fully-protected module ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
<includeonly>{{#invoke:Coordinates|coord}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
05c1e2a95ff86fa91442c704f36a9f125b603492
Module:Protection banner/config
828
64
205
2023-05-08T11:41:01Z
wikipedia>Fayenatic london
0
Update categories from "fully-protected" to "fully protected", removing hyphen, per valid request at [[WP:CFDS]]
Scribunto
text/plain
-- This module provides configuration data for [[Module:Protection banner]].
return {
--------------------------------------------------------------------------------
--
-- BANNER DATA
--
--------------------------------------------------------------------------------
--[[
-- Banner data consists of six fields:
-- * text - the main protection text that appears at the top of protection
-- banners.
-- * explanation - the text that appears below the main protection text, used
-- to explain the details of the protection.
-- * tooltip - the tooltip text you see when you move the mouse over a small
-- padlock icon.
-- * link - the page that the small padlock icon links to.
-- * alt - the alt text for the small padlock icon. This is also used as tooltip
-- text for the large protection banners.
-- * image - the padlock image used in both protection banners and small padlock
-- icons.
--
-- The module checks in three separate tables to find a value for each field.
-- First it checks the banners table, which has values specific to the reason
-- for the page being protected. Then the module checks the defaultBanners
-- table, which has values specific to each protection level. Finally, the
-- module checks the masterBanner table, which holds data for protection
-- templates to use if no data has been found in the previous two tables.
--
-- The values in the banner data can take parameters. These are specified
-- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name
-- enclosed in curly braces).
--
-- Available parameters:
--
-- ${CURRENTVERSION} - a link to the page history or the move log, with the
-- display message "current-version-edit-display" or
-- "current-version-move-display".
--
-- ${EDITREQUEST} - a link to create an edit request for the current page.
--
-- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes
-- on the talk page; you may submit a request to ask an administrator to make
-- an edit if it is minor or supported by consensus."
--
-- ${IMAGELINK} - a link to set the image to, depending on the protection
-- action and protection level.
--
-- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
-- is set. E.g. "Editing of this page by new or unregistered users is currently
-- disabled until dd Month YYYY."
--
-- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation
-- so that it can be used in run-on sentences.
--
-- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
-- Defined in the cfg.pagetypes table.
--
-- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.
-- "Editing of this page by new or unregistered users is currently disabled"
--
-- ${PROTECTIONDATE} - the protection date, if it has been supplied to the
-- template.
--
-- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or
-- "semi-protected".
--
-- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,
-- depending on the protection action.
--
-- ${TALKPAGE} - a link to the talk page. If a section is specified, links
-- straight to that talk page section.
--
-- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to
-- create a blurb like "This template is semi-protected", or "This article is
-- move-protected until DD Month YYYY".
--
-- ${VANDAL} - links for the specified username (or the root page name)
-- using Module:Vandal-m.
--
-- Functions
--
-- For advanced users, it is possible to use Lua functions instead of strings
-- in the banner config tables. Using functions gives flexibility that is not
-- possible just by using parameters. Functions take two arguments, the
-- protection object and the template arguments, and they must output a string.
--
-- For example:
--
-- text = function (protectionObj, args)
-- if protectionObj.level == 'autoconfirmed' then
-- return 'foo'
-- else
-- return 'bar'
-- end
-- end
--
-- Some protection object properties and methods that may be useful:
-- protectionObj.action - the protection action
-- protectionObj.level - the protection level
-- protectionObj.reason - the protection reason
-- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set
-- to indefinite, and the protection time in unix time if temporary.
-- protectionObj.protectionDate - the protection date in unix time, or nil if
-- unspecified.
-- protectionObj.bannerConfig - the banner config found by the module. Beware
-- of editing the config field used by the function, as it could create an
-- infinite loop.
-- protectionObj:isProtected - returns a boolean showing whether the page is
-- protected.
-- protectionObj:isTemporary - returns a boolean showing whether the expiry is
-- temporary.
-- protectionObj:isIncorrect - returns a boolean showing whether the protection
-- template is incorrect.
--]]
-- The master banner data, used if no values have been found in banners or
-- defaultBanners.
masterBanner = {
text = '${INTROBLURB}',
explanation = '${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPBLURB}',
link = '${IMAGELINK}',
alt = 'Page ${PROTECTIONLEVEL}'
},
-- The default banner data. This holds banner data for different protection
-- levels.
-- *required* - this table needs edit, move, autoreview and upload subtables.
defaultBanners = {
edit = {},
move = {},
autoreview = {
default = {
alt = 'Page protected with pending changes',
tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users',
image = 'Pending-protection-shackle.svg'
}
},
upload = {}
},
-- The banner data. This holds banner data for different protection reasons.
-- In fact, the reasons specified in this table control which reasons are
-- valid inputs to the first positional parameter.
--
-- There is also a non-standard "description" field that can be used for items
-- in this table. This is a description of the protection reason for use in the
-- module documentation.
--
-- *required* - this table needs edit, move, autoreview and upload subtables.
banners = {
edit = {
blp = {
description = 'For pages protected to promote compliance with the'
.. ' [[Wikipedia:Biographies of living persons'
.. '|biographies of living persons]] policy',
text = '${INTROFRAGMENT} to promote compliance with'
.. ' [[Wikipedia:Biographies of living persons'
.. "|Wikipedia's policy on the biographies"
.. ' of living people]].',
tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on'
.. ' biographies of living persons',
},
dmca = {
description = 'For pages protected by the Wikimedia Foundation'
.. ' due to [[Digital Millennium Copyright Act]] takedown requests',
explanation = function (protectionObj, args)
local ret = 'Pursuant to a rights owner notice under the Digital'
.. ' Millennium Copyright Act (DMCA) regarding some content'
.. ' in this article, the Wikimedia Foundation acted under'
.. ' applicable law and took down and restricted the content'
.. ' in question.'
if args.notice then
ret = ret .. ' A copy of the received notice can be found here: '
.. args.notice .. '.'
end
ret = ret .. ' For more information, including websites discussing'
.. ' how to file a counter-notice, please see'
.. " [[Wikipedia:Office actions]] and the article's ${TALKPAGE}."
.. "'''Do not remove this template from the article until the"
.. " restrictions are withdrawn'''."
return ret
end,
image = 'Office-protection-shackle.svg',
},
dispute = {
description = 'For pages protected due to editing disputes',
text = function (protectionObj, args)
-- Find the value of "disputes".
local display = 'disputes'
local disputes
if args.section then
disputes = string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[protectionObj.title.namespace].talk.name,
protectionObj.title.text,
args.section,
display
)
else
disputes = display
end
-- Make the blurb, depending on the expiry.
local msg
if type(protectionObj.expiry) == 'number' then
msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
else
msg = '${INTROFRAGMENT} until editing %s have been resolved.'
end
return string.format(msg, disputes)
end,
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPFRAGMENT} due to editing disputes',
},
ecp = {
description = 'For articles in topic areas authorized by'
.. ' [[Wikipedia:Arbitration Committee|ArbCom]] or'
.. ' meets the criteria for community use',
tooltip = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
alt = 'Extended-protected ${PAGETYPE}',
},
mainpage = {
description = 'For pages protected for being displayed on the [[Main Page]]',
text = 'This file is currently'
.. ' [[Wikipedia:This page is protected|protected]] from'
.. ' editing because it is currently or will soon be displayed'
.. ' on the [[Main Page]].',
explanation = 'Images on the Main Page are protected due to their high'
.. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.'
.. '<br /><span style="font-size:90%;">'
.. "'''Administrators:''' Once this image is definitely off the Main Page,"
.. ' please unprotect this file, or reduce to semi-protection,'
.. ' as appropriate.</span>',
},
office = {
description = 'For pages protected by the Wikimedia Foundation',
text = function (protectionObj, args)
local ret = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the'
.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
.. ' and is protected.'
if protectionObj.protectionDate then
ret = ret .. ' It has been protected since ${PROTECTIONDATE}.'
end
return ret
end,
explanation = "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
.. " page unless you are authorized by the Wikimedia Foundation to do"
.. " so.'''",
image = 'Office-protection-shackle.svg',
},
reset = {
description = 'For pages protected by the Wikimedia Foundation and'
.. ' "reset" to a bare-bones version',
text = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the'
.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
.. ' and is protected.',
explanation = function (protectionObj, args)
local ret = ''
if protectionObj.protectionDate then
ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was'
else
ret = ret .. 'This ${PAGETYPE} has been'
end
ret = ret .. ' reduced to a'
.. ' simplified, "bare bones" version so that it may be completely'
.. ' rewritten to ensure it meets the policies of'
.. ' [[WP:NPOV|Neutral Point of View]] and [[WP:V|Verifiability]].'
.. ' Standard Wikipedia policies will apply to its rewriting—which'
.. ' will eventually be open to all editors—and will be strictly'
.. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while'
.. ' it is being rebuilt.\n\n'
.. 'Any insertion of material directly from'
.. ' pre-protection revisions of the ${PAGETYPE} will be removed, as'
.. ' will any material added to the ${PAGETYPE} that is not properly'
.. ' sourced. The associated talk page(s) were also cleared on the'
.. " same date.\n\n"
.. "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not override"
.. " this action, and do not remove protection from this page,"
.. " unless you are authorized by the Wikimedia Foundation"
.. " to do so. No editor may remove this notice.'''"
return ret
end,
image = 'Office-protection-shackle.svg',
},
sock = {
description = 'For pages protected due to'
.. ' [[Wikipedia:Sock puppetry|sock puppetry]]',
text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
.. ' [[Wikipedia:Blocking policy|blocked]] or'
.. ' [[Wikipedia:Banning policy|banned users]]'
.. ' from editing it.',
tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from'
.. ' editing it',
},
template = {
description = 'For [[Wikipedia:High-risk templates|high-risk]]'
.. ' templates and Lua modules',
text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
.. ' as it is [[Wikipedia:High-risk templates|high-risk]].',
explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] or'
.. ' [[Wikipedia:Template editor|template editor]] to make an edit if'
.. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by'
.. ' [[Wikipedia:Consensus|consensus]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'
.. ' to prevent vandalism',
alt = 'Permanently protected ${PAGETYPE}',
},
usertalk = {
description = 'For pages protected against disruptive edits by a'
.. ' particular user',
text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
.. ' such as abusing the'
.. ' {{[[Template:unblock|unblock]]}} template.',
explanation = 'If you cannot edit this user talk page and you need to'
.. ' make a change or leave a message, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for edits to a protected page'
.. '|request an edit]],'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]],'
.. ' [[Special:Userlogin|log in]],'
.. ' or [[Special:UserLogin/signup|create an account]].',
},
vandalism = {
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism|vandalism]]',
text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
explanation = function (protectionObj, args)
local ret = ''
if protectionObj.level == 'sysop' then
ret = ret .. "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. '
end
return ret .. '${EXPLANATIONBLURB}'
end,
tooltip = '${TOOLTIPFRAGMENT} due to vandalism',
}
},
move = {
dispute = {
description = 'For pages protected against page moves due to'
.. ' disputes over the page title',
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
image = 'Move-protection-shackle.svg'
},
vandalism = {
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism#Page-move vandalism'
.. ' |page-move vandalism]]'
}
},
autoreview = {},
upload = {}
},
--------------------------------------------------------------------------------
--
-- GENERAL DATA TABLES
--
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Protection blurbs
--------------------------------------------------------------------------------
-- This table produces the protection blurbs available with the
-- ${PROTECTIONBLURB} parameter. It is sorted by protection action and
-- protection level, and is checked by the module in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
protectionBlurbs = {
edit = {
default = 'This ${PAGETYPE} is currently [[Help:Protection|'
.. 'protected]] from editing',
autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'
.. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'
.. ' users|unregistered]] users is currently [[Help:Protection|disabled]]',
extendedconfirmed = 'This ${PAGETYPE} is currently under extended confirmed protection',
},
move = {
default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
.. ' from [[Help:Moving a page|page moves]]'
},
autoreview = {
default = 'All edits made to this ${PAGETYPE} by'
.. ' [[Wikipedia:User access levels#New users|new]] or'
.. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]'
.. ' users are currently'
.. ' [[Wikipedia:Pending changes|subject to review]]'
},
upload = {
default = 'Uploading new versions of this ${PAGETYPE} is currently disabled'
}
},
--------------------------------------------------------------------------------
-- Explanation blurbs
--------------------------------------------------------------------------------
-- This table produces the explanation blurbs available with the
-- ${EXPLANATIONBLURB} parameter. It is sorted by protection action,
-- protection level, and whether the page is a talk page or not. If the page is
-- a talk page it will have a talk key of "talk"; otherwise it will have a talk
-- key of "subject". The table is checked in the following order:
-- 1. page's protection action, page's protection level, page's talk key
-- 2. page's protection action, page's protection level, default talk key
-- 3. page's protection action, default protection level, page's talk key
-- 4. page's protection action, default protection level, default talk key
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
explanationBlurbs = {
edit = {
autoconfirmed = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
.. ' ${EDITREQUEST}, discuss changes on the ${TALKPAGE},'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].',
},
extendedconfirmed = {
default = 'Extended confirmed protection prevents edits from all unregistered editors'
.. ' and registered users with fewer than 30 days tenure and 500 edits.'
.. ' The [[Wikipedia:Protection policy#extended|policy on community use]]'
.. ' specifies that extended confirmed protection can be applied to combat'
.. ' disruption, if semi-protection has proven to be ineffective.'
.. ' Extended confirmed protection may also be applied to enforce'
.. ' [[Wikipedia:Arbitration Committee|arbitration sanctions]].'
.. ' Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask for uncontroversial changes supported by'
.. ' [[Wikipedia:Consensus|consensus]].'
},
default = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Please discuss any changes on the ${TALKPAGE}; you'
.. ' may ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
.. '|consensus]]. You may also [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|request]] that this page be unprotected.',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' You may [[Wikipedia:Requests for page'
.. ' protection#Current requests for edits to a protected page|request an'
.. ' edit]] to this page, or [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|ask]] for it to be unprotected.'
}
},
move = {
default = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves on the'
.. ' ${TALKPAGE} or at [[Wikipedia:Requested moves]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves at'
.. ' [[Wikipedia:Requested moves]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.'
}
},
autoreview = {
default = {
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Edits to this ${PAGETYPE} by new and unregistered users'
.. ' will not be visible to readers until they are accepted by'
.. ' a reviewer. To avoid the need for your edits to be'
.. ' reviewed, you may'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].'
},
},
upload = {
default = {
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but new versions of the file'
.. ' cannot be uploaded until it is unprotected. You can'
.. ' request that a new version be uploaded by using a'
.. ' [[Wikipedia:Edit requests|protected edit request]], or you'
.. ' can [[Wikipedia:Requests for page protection|request]]'
.. ' that the file be unprotected.'
}
}
},
--------------------------------------------------------------------------------
-- Protection levels
--------------------------------------------------------------------------------
-- This table provides the data for the ${PROTECTIONLEVEL} parameter, which
-- produces a short label for different protection levels. It is sorted by
-- protection action and protection level, and is checked in the following
-- order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
protectionLevels = {
edit = {
default = 'protected',
templateeditor = 'template-protected',
extendedconfirmed = 'extended-protected',
autoconfirmed = 'semi-protected',
},
move = {
default = 'move-protected'
},
autoreview = {
},
upload = {
default = 'upload-protected'
}
},
--------------------------------------------------------------------------------
-- Images
--------------------------------------------------------------------------------
-- This table lists different padlock images for each protection action and
-- protection level. It is used if an image is not specified in any of the
-- banner data tables, and if the page does not satisfy the conditions for using
-- the ['image-filename-indef'] image. It is checked in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
images = {
edit = {
default = 'Full-protection-shackle.svg',
templateeditor = 'Template-protection-shackle.svg',
extendedconfirmed = 'Extended-protection-shackle.svg',
autoconfirmed = 'Semi-protection-shackle.svg'
},
move = {
default = 'Move-protection-shackle.svg',
},
autoreview = {
default = 'Pending-protection-shackle.svg'
},
upload = {
default = 'Upload-protection-shackle.svg'
}
},
-- Pages with a reason specified in this table will show the special "indef"
-- padlock, defined in the 'image-filename-indef' message, if no expiry is set.
indefImageReasons = {
template = true
},
--------------------------------------------------------------------------------
-- Image links
--------------------------------------------------------------------------------
-- This table provides the data for the ${IMAGELINK} parameter, which gets
-- the image link for small padlock icons based on the page's protection action
-- and protection level. It is checked in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
imageLinks = {
edit = {
default = 'Wikipedia:Protection policy#full',
templateeditor = 'Wikipedia:Protection policy#template',
extendedconfirmed = 'Wikipedia:Protection policy#extended',
autoconfirmed = 'Wikipedia:Protection policy#semi'
},
move = {
default = 'Wikipedia:Protection policy#move'
},
autoreview = {
default = 'Wikipedia:Protection policy#pending'
},
upload = {
default = 'Wikipedia:Protection policy#upload'
}
},
--------------------------------------------------------------------------------
-- Padlock indicator names
--------------------------------------------------------------------------------
-- This table provides the "name" attribute for the <indicator> extension tag
-- with which small padlock icons are generated. All indicator tags on a page
-- are displayed in alphabetical order based on this attribute, and with
-- indicator tags with duplicate names, the last tag on the page wins.
-- The attribute is chosen based on the protection action; table keys must be a
-- protection action name or the string "default".
padlockIndicatorNames = {
autoreview = 'pp-autoreview',
default = 'pp-default'
},
--------------------------------------------------------------------------------
-- Protection categories
--------------------------------------------------------------------------------
--[[
-- The protection categories are stored in the protectionCategories table.
-- Keys to this table are made up of the following strings:
--
-- 1. the expiry date
-- 2. the namespace
-- 3. the protection reason (e.g. "dispute" or "vandalism")
-- 4. the protection level (e.g. "sysop" or "autoconfirmed")
-- 5. the action (e.g. "edit" or "move")
--
-- When the module looks up a category in the table, first it will will check to
-- see a key exists that corresponds to all five parameters. For example, a
-- user page semi-protected from vandalism for two weeks would have the key
-- "temp-user-vandalism-autoconfirmed-edit". If no match is found, the module
-- changes the first part of the key to "all" and checks the table again. It
-- keeps checking increasingly generic key combinations until it finds the
-- field, or until it reaches the key "all-all-all-all-all".
--
-- The module uses a binary matrix to determine the order in which to search.
-- This is best demonstrated by a table. In this table, the "0" values
-- represent "all", and the "1" values represent the original data (e.g.
-- "indef" or "file" or "vandalism").
--
-- expiry namespace reason level action
-- order
-- 1 1 1 1 1 1
-- 2 0 1 1 1 1
-- 3 1 0 1 1 1
-- 4 0 0 1 1 1
-- 5 1 1 0 1 1
-- 6 0 1 0 1 1
-- 7 1 0 0 1 1
-- 8 0 0 0 1 1
-- 9 1 1 1 0 1
-- 10 0 1 1 0 1
-- 11 1 0 1 0 1
-- 12 0 0 1 0 1
-- 13 1 1 0 0 1
-- 14 0 1 0 0 1
-- 15 1 0 0 0 1
-- 16 0 0 0 0 1
-- 17 1 1 1 1 0
-- 18 0 1 1 1 0
-- 19 1 0 1 1 0
-- 20 0 0 1 1 0
-- 21 1 1 0 1 0
-- 22 0 1 0 1 0
-- 23 1 0 0 1 0
-- 24 0 0 0 1 0
-- 25 1 1 1 0 0
-- 26 0 1 1 0 0
-- 27 1 0 1 0 0
-- 28 0 0 1 0 0
-- 29 1 1 0 0 0
-- 30 0 1 0 0 0
-- 31 1 0 0 0 0
-- 32 0 0 0 0 0
--
-- In this scheme the action has the highest priority, as it is the last
-- to change, and the expiry has the least priority, as it changes the most.
-- The priorities of the expiry, the protection level and the action are
-- fixed, but the priorities of the reason and the namespace can be swapped
-- through the use of the cfg.bannerDataNamespaceHasPriority table.
--]]
-- If the reason specified to the template is listed in this table,
-- namespace data will take priority over reason data in the protectionCategories
-- table.
reasonsWithNamespacePriority = {
vandalism = true,
},
-- The string to use as a namespace key for the protectionCategories table for each
-- namespace number.
categoryNamespaceKeys = {
[ 2] = 'user',
[ 3] = 'user',
[ 4] = 'project',
[ 6] = 'file',
[ 8] = 'mediawiki',
[ 10] = 'template',
[ 12] = 'project',
[ 14] = 'category',
[100] = 'portal',
[828] = 'module',
},
protectionCategories = {
['all|all|all|all|all'] = 'Wikipedia fully protected pages',
['all|all|office|all|all'] = 'Wikipedia Office-protected pages',
['all|all|reset|all|all'] = 'Wikipedia Office-protected pages',
['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages',
['all|all|mainpage|all|all'] = 'Wikipedia fully protected main page files',
['all|all|all|extendedconfirmed|all'] = 'Wikipedia extended-confirmed-protected pages',
['all|all|ecp|extendedconfirmed|all'] = 'Wikipedia extended-confirmed-protected pages',
['all|template|all|all|edit'] = 'Wikipedia fully protected templates',
['all|all|all|autoconfirmed|edit'] = 'Wikipedia semi-protected pages',
['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages',
['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people',
['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people',
['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute',
['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users',
['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism',
['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories',
['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files',
['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals',
['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages',
['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages',
['all|template|all|autoconfirmed|edit'] = 'Wikipedia semi-protected templates',
['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages',
['all|all|all|templateeditor|edit'] = 'Wikipedia template-protected pages other than templates and modules',
['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates',
['all|template|all|templateeditor|move'] = 'Wikipedia template-protected templates', -- move-protected templates
['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people',
['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people',
['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute',
['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users',
['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism',
['all|category|all|sysop|edit'] = 'Wikipedia fully protected categories',
['all|file|all|sysop|edit'] = 'Wikipedia fully protected files',
['all|project|all|sysop|edit'] = 'Wikipedia fully protected project pages',
['all|talk|all|sysop|edit'] = 'Wikipedia fully protected talk pages',
['all|template|all|extendedconfirmed|edit'] = 'Wikipedia extended-confirmed-protected templates',
['all|template|all|sysop|edit'] = 'Wikipedia fully protected templates',
['all|user|all|sysop|edit'] = 'Wikipedia fully protected user and user talk pages',
['all|module|all|all|edit'] = 'Wikipedia fully protected modules',
['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules',
['all|module|all|extendedconfirmed|edit'] = 'Wikipedia extended-confirmed-protected modules',
['all|module|all|autoconfirmed|edit'] = 'Wikipedia semi-protected modules',
['all|all|all|sysop|move'] = 'Wikipedia move-protected pages',
['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages',
['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute',
['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism',
['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals',
['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages',
['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages',
['all|template|all|sysop|move'] = 'Wikipedia move-protected templates',
['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages',
['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages',
['all|file|all|all|upload'] = 'Wikipedia upload-protected files',
},
--------------------------------------------------------------------------------
-- Expiry category config
--------------------------------------------------------------------------------
-- This table configures the expiry category behaviour for each protection
-- action.
-- * If set to true, setting that action will always categorise the page if
-- an expiry parameter is not set.
-- * If set to false, setting that action will never categorise the page.
-- * If set to nil, the module will categorise the page if:
-- 1) an expiry parameter is not set, and
-- 2) a reason is provided, and
-- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck
-- table.
expiryCheckActions = {
edit = nil,
move = false,
autoreview = true,
upload = false
},
reasonsWithoutExpiryCheck = {
blp = true,
template = true,
},
--------------------------------------------------------------------------------
-- Pagetypes
--------------------------------------------------------------------------------
-- This table produces the page types available with the ${PAGETYPE} parameter.
-- Keys are namespace numbers, or the string "default" for the default value.
pagetypes = {
[0] = 'article',
[6] = 'file',
[10] = 'template',
[14] = 'category',
[828] = 'module',
default = 'page'
},
--------------------------------------------------------------------------------
-- Strings marking indefinite protection
--------------------------------------------------------------------------------
-- This table contains values passed to the expiry parameter that mean the page
-- is protected indefinitely.
indefStrings = {
['indef'] = true,
['indefinite'] = true,
['indefinitely'] = true,
['infinite'] = true,
},
--------------------------------------------------------------------------------
-- Group hierarchy
--------------------------------------------------------------------------------
-- This table maps each group to all groups that have a superset of the original
-- group's page editing permissions.
hierarchy = {
sysop = {},
reviewer = {'sysop'},
filemover = {'sysop'},
templateeditor = {'sysop'},
extendedconfirmed = {'sysop'},
autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'},
user = {'autoconfirmed'},
['*'] = {'user'}
},
--------------------------------------------------------------------------------
-- Wrapper templates and their default arguments
--------------------------------------------------------------------------------
-- This table contains wrapper templates used with the module, and their
-- default arguments. Templates specified in this table should contain the
-- following invocation, and no other template content:
--
-- {{#invoke:Protection banner|main}}
--
-- If other content is desired, it can be added between
-- <noinclude>...</noinclude> tags.
--
-- When a user calls one of these wrapper templates, they will use the
-- default arguments automatically. However, users can override any of the
-- arguments.
wrappers = {
['Template:Pp'] = {},
['Template:Pp-extended'] = {'ecp'},
['Template:Pp-blp'] = {'blp'},
-- we don't need Template:Pp-create
['Template:Pp-dispute'] = {'dispute'},
['Template:Pp-main-page'] = {'mainpage'},
['Template:Pp-move'] = {action = 'move', catonly = 'yes'},
['Template:Pp-move-dispute'] = {'dispute', action = 'move', catonly = 'yes'},
-- we don't need Template:Pp-move-indef
['Template:Pp-move-vandalism'] = {'vandalism', action = 'move', catonly = 'yes'},
['Template:Pp-office'] = {'office'},
['Template:Pp-office-dmca'] = {'dmca'},
['Template:Pp-pc'] = {action = 'autoreview', small = true},
['Template:Pp-pc1'] = {action = 'autoreview', small = true},
['Template:Pp-reset'] = {'reset'},
['Template:Pp-semi-indef'] = {small = true},
['Template:Pp-sock'] = {'sock'},
['Template:Pp-template'] = {'template', small = true},
['Template:Pp-upload'] = {action = 'upload'},
['Template:Pp-usertalk'] = {'usertalk'},
['Template:Pp-vandalism'] = {'vandalism'},
},
--------------------------------------------------------------------------------
--
-- MESSAGES
--
--------------------------------------------------------------------------------
msg = {
--------------------------------------------------------------------------------
-- Intro blurb and intro fragment
--------------------------------------------------------------------------------
-- These messages specify what is produced by the ${INTROBLURB} and
-- ${INTROFRAGMENT} parameters. If the protection is temporary they use the
-- intro-blurb-expiry or intro-fragment-expiry, and if not they use
-- intro-blurb-noexpiry or intro-fragment-noexpiry.
-- It is possible to use banner parameters in these messages.
['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
--------------------------------------------------------------------------------
-- Tooltip blurb
--------------------------------------------------------------------------------
-- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.
-- If the protection is temporary the tooltip-blurb-expiry message is used, and
-- if not the tooltip-blurb-noexpiry message is used.
-- It is possible to use banner parameters in these messages.
['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.',
['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},',
['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
--------------------------------------------------------------------------------
-- Special explanation blurb
--------------------------------------------------------------------------------
-- An explanation blurb for pages that cannot be unprotected, e.g. for pages
-- in the MediaWiki namespace.
-- It is possible to use banner parameters in this message.
['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Please discuss any changes on the ${TALKPAGE}; you'
.. ' may ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
.. '|consensus]].',
--------------------------------------------------------------------------------
-- Protection log display values
--------------------------------------------------------------------------------
-- These messages determine the display values for the protection log link
-- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.
-- It is possible to use banner parameters in these messages.
['protection-log-display'] = 'protection log',
['pc-log-display'] = 'pending changes log',
--------------------------------------------------------------------------------
-- Current version display values
--------------------------------------------------------------------------------
-- These messages determine the display values for the page history link
-- or the move log link produced by the ${CURRENTVERSION} parameter.
-- It is possible to use banner parameters in these messages.
['current-version-move-display'] = 'current title',
['current-version-edit-display'] = 'current version',
--------------------------------------------------------------------------------
-- Talk page
--------------------------------------------------------------------------------
-- This message determines the display value of the talk page link produced
-- with the ${TALKPAGE} parameter.
-- It is possible to use banner parameters in this message.
['talk-page-link-display'] = 'talk page',
--------------------------------------------------------------------------------
-- Edit requests
--------------------------------------------------------------------------------
-- This message determines the display value of the edit request link produced
-- with the ${EDITREQUEST} parameter.
-- It is possible to use banner parameters in this message.
['edit-request-display'] = 'submit an edit request',
--------------------------------------------------------------------------------
-- Expiry date format
--------------------------------------------------------------------------------
-- This is the format for the blurb expiry date. It should be valid input for
-- the first parameter of the #time parser function.
['expiry-date-format'] = 'F j, Y "at" H:i e',
--------------------------------------------------------------------------------
-- Tracking categories
--------------------------------------------------------------------------------
-- These messages determine which tracking categories the module outputs.
['tracking-category-incorrect'] = 'Wikipedia pages with incorrect protection templates',
['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules',
--------------------------------------------------------------------------------
-- Images
--------------------------------------------------------------------------------
-- These are images that are not defined by their protection action and protection level.
['image-filename-indef'] = 'Full-protection-shackle.svg',
['image-filename-default'] = 'Transparent.gif',
--------------------------------------------------------------------------------
-- End messages
--------------------------------------------------------------------------------
}
--------------------------------------------------------------------------------
-- End configuration
--------------------------------------------------------------------------------
}
a20552ae38cb5253a4fa29aa126abc74215a589f
Template:Longitem
10
133
365
2023-05-09T01:38:28Z
wikipedia>Neveselbert
0
Undid revision 1153902556 by [[Special:Contributions/Neveselbert|Neveselbert]] ([[User talk:Neveselbert|talk]]) - backlinked
wikitext
text/x-wiki
<noinclude>{{#tag: code|
</noinclude>{{#ifeq: {{{1|+}}} | {{{1|-}}} | <div style="}}display: inline-block; line-height: 1.2em; padding: .1em 0; {{#ifeq: {{{1|+}}} | {{{1|-}}} | {{{style|}}}">{{{1|}}}</div> | <includeonly>width: 100%;</includeonly> }}<includeonly>{{#if:{{{2|}}}|[[Category:Pages using Template:Longitem with unnamed style parameter]]}}</includeonly><noinclude>
|lang=wikitext}}
{{documentation}}
</noinclude>
2919b818deb36b243e9f9517917cbcfaa2c8d4ec
Template:Sidebar with collapsible lists/doc
10
288
690
2023-05-10T21:13:28Z
wikipedia>WOSlinker
0
syntaxhighlight lang="wikitext"
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]). -->
{{High-use| 64996 }}
{{Template display|nomobile}}
{{Lua|Module:Sidebar}}
{{tl|Sidebar with collapsible lists}} is a version of {{tl|Sidebar}} which offers [[Help:Collapsing|collapsible]] lists in addition to Sidebar's ''content'' parameters.
== Usage ==
{{Generic template demo
|name={{PAGENAME}} |pretitle |title |image |above |heading1 |list1title |list1 |list2title |list2
|heading3={{{heading{{italics correction|''N''}}}}} |list3title={{{list{{italics correction|''N''}}title}}} |list3={{{list{{italics correction|''N''}}}}} |content4={{{content{{italics correction|''N''}}}}}
|below
}}
Parameters with infrequent use omitted.
<syntaxhighlight lang="wikitext">
{{Sidebar with collapsible lists
| name = {{subst:PAGENAME}}
| pretitle =
| title =
| image =
| templatestyles =
| expanded = {{{expanded|}}}
| heading1 =
| list1name =
| list1title =
| list1 =
| heading2 =
| list2name =
| list2title =
| list2 =
<!-- ...... -->
| headingN = <!-- Template:Sidebar's "headingN" and/or "contentN" parameters (where -->
| contentN = <!-- N is a number) may be used to include uncollapsible lists/content -->
<!-- ...... -->
| below =
}}
</syntaxhighlight>
== Parameters ==
{{further|Template:Sidebar#Parameters}}
This template takes all {{tl|sidebar}} parameters. In addition:
; {{para|list<sub>n</sub>title}}
: The displayed title of the collapsible list<sub>n</sub>.
; {{para|list<sub>n</sub>}}
: The contents of the collapsible list<sub>n</sub>.
; {{para|list<sub>n</sub>class}}
: A class can be added to target a specific list either with TemplateStyles or microformats. See [[Template:Sidebar#Classes]].
: In the context of TemplateStyles, specific list contents can be targeted like so: <code>.templateclass .listnclass .sidebar-list-title</code> for a specific list title and <code>.templateclass .listnclass .sidebar-list</code> for a specific list.
; {{para|expanded}} {{nobold|and}} {{para|list<sub>n</sub>name}}
: {{para|expanded}} is used to indicate which (if any) list named {{para|list<sub>n</sub>name}} is shown expanded when the template is first displayed; see {{tl|Collapsible lists option}}.
; {{para|centered list titles}}
: Set to anything (though {{para|centered list titles|y}} or {{para|centered list titles|yes}} are idiomatic) to make the sidebar list titles centered. This works around some not-great behavior in how centered text interacts with the collapsible toggle.
{{Sidebar with collapsible lists |list1={{{list1}}} without {{{list1title}}} |navbar=off}}
A {{para|list<sub>n</sub>}} without a {{para|list<sub>n</sub>title}} displays the default title ("List").
== Handling long links ==
{{further|Template:Sidebar#Handling long links}}
See [[Template:Sidebar#Handling long links]].
== TemplateStyles ==
The classes available for styling, besides those listed in [[Template:Sidebar#TemplateStyles]], are:
; <code>.sidebar-collapse</code>
: The top-level {{tl|sidebar with collapsible lists}} class.
; <code>.sidebar-list</code>
: The class is a container when either {{para|list<sub>n</sub>title}} or {{para|list<sub>n</sub>}} is provided in {{tl|sidebar with collapsible lists}}.
; <code>.sidebar-list-title</code>
: The class associated with a {{para|list<sub>n</sub>title}}. Every list title will have this class. Use the {{para|centered list titles}} to center text instead of adding CSS here.
; <code>.sidebar-list-content</code>
: The class associated with a {{para|list<sub>n</sub>}}. Every list content will have this class.
== Deprecated parameters ==
{{further|Template:Sidebar#Deprecated parameters}}
These parameters are deprecated for the same reason as the style parameters in {{t|Sidebar}} template.
; ''listtitlestyle'' {{nobold|and}} ''liststyle''
: These are the equivalent of, respectively, {{tl|Collapsible list}}'s ''titlestyle'' and ''liststyle'' parameters.
; ''listframestyle''
: Sets the framestyle (see {{tl|Collapsible list}}) for the lists.
; ''listNframestyle''
: Sets the framestyle for ''listN'', overriding ''listframestyle''.
; ''listNtitlestyle''
: Sets the titlestyle for ''listN'', overriding ''listtitlestyle'' above.
; ''listNstyle''
: Sets the liststyle for ''listN'', overriding ''liststyle'' above.
== See also ==
* {{diff|Template:Sidebar with collapsible lists|next|544062416|Last pre-Lua version}}
* {{tl|Collapsible list}}
* {{tl|Collapsible lists option}}
* {{tl|Navbox with collapsible groups}}
* {{tl|Sidebar}}
* [[Wikipedia:UBLIST]], for help in using unbulleted lists in fields.
<includeonly>{{#ifeq:{{PAGENAME}}|Sidebar with collapsible lists|
<!-- Categories go below this line, please; interwikis go to Wikidata, thank you! -->
[[Category:Sidebar meta-templates]]
[[Category:Collapse templates]]
}}</includeonly>
ad3358062eab0432c04637e90478fb08b0f09bd8
Template:Infobox command structure/doc
10
271
651
2023-05-16T22:43:07Z
wikipedia>WOSlinker
0
/* Command structure box */ syntaxhighlight lang="wikitext"
wikitext
text/x-wiki
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
{{#ifeq:{{{noheader|}}}|yes||{{Documentation subpage}}
==Usage==
}}
==== Command structure box ====
{{Infobox command structure
| bodyclass = plainlist
| name = 12th Infantry Division
| date = 1941–1943
| parent = [[XVII Corps (United Kingdom)|XVII Corps]]
| subordinate =
* 17th Mechanized Regiment
* 51st Light Infantry Regiment
* 53rd Infantry Regiment
* 107th Artillery Brigade
}}
A command structure box may be used to summarize information about an individual military unit's parent and subordinate units; it should generally be used in conjunction with {{tlx|Infobox military unit}}. If needed, multiple boxes may be used to show the unit's command structure during different periods.
The box should be added using the {{tlx|Infobox command structure}} template, as shown below:
<div style="width:350px;background:#dddddd;border: 1px solid black;"><syntaxhighlight lang="wikitext" style="overflow:auto; margin:0.5em">
{{Infobox command structure
| name =
| date =
| parent =
| subordinate =
}}
</syntaxhighlight></div>
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
* '''name''' – the name of the unit or formation.
* '''date''' – ''optional'' – the dates during which the given structure was in place.
* '''parent''' – ''optional'' – the unit's parent unit.
* '''subordinate''' – ''optional'' – the unit's subordinate units. <noinclude>[[Category:WikiProject Military history template instructions|Command structure box]]</noinclude>
<includeonly>{{Sandbox other||
{{#ifeq:{{{noheader|}}}|yes||
[[Category:Military auxiliary infobox templates|Command structure]]
}}}}</includeonly>
2651b99c1bdf7a14acb98cc60f6372038868fa29
Template:Infobox service record/doc
10
273
655
2023-05-17T08:51:50Z
wikipedia>WOSlinker
0
syntaxhighlight lang="wikitext"
wikitext
text/x-wiki
{{#ifeq:{{{noheader|}}}|yes||{{Documentation subpage}}
==Usage==
}}
==== Infobox service record ====
{{Infobox service record
| label = Combat service
| partof = [[7. Unterseebootsflottille]] (1938–41)
| codes = M 18 837 (''feldpost'')
| commanders = [[Günther Prien]] (1938–41)
| operations = 10 patrols
| victories = 30 ships (162,769 [[Tonnage|GRT]]) sunk,<br>1 warship (29,150 tons) sunk,<br>8 ships (62,751 GRT) damaged
| awards =
}}
A service record box may be used to summarize information about an individual military unit's or ship's service history; it should generally be used in conjunction with the appropriate [[WP:MILMOS#Primary infoboxes|primary infobox]]. If needed, multiple boxes may be used to separate the service record for different periods; for example, a unit that fought in several wars may have separate boxes for each.
The box should be added using the {{tlx|Infobox service record}} template, as shown below:
<div style="width:350px;background:#dddddd;border: 1px solid black;"><syntaxhighlight lang="wikitext" style="overflow:auto; margin:0.5em">
{{Infobox service record
| is_ship =
| is_multi =
| label =
| partof =
| codes =
| commanders =
| operations =
| victories =
| awards =
}}
</syntaxhighlight></div>
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
* '''is_ship''' – ''optional'' – "''yes''" if the box is being used inside a compound ship infobox.
* '''is_multi''' – ''optional'' – "''yes''" if multiple instances of the box are being used inside a single compound ship infobox.
* '''label''' – ''optional'' – the label to use for the box; this defaults to "Service record" if left blank.
* '''partof''' – ''optional'' – the unit or formation of which the subject unit or ship was a part; multiple units may be listed with the corresponding dates.
* '''codes''' – ''optional'' – the identification codes carried by the unit or ship; these should generally be labeled according to what the code indicates.
* '''commanders''' – ''optional'' – the notable commanding officers for the period covered.
* '''operations''' – ''optional'' – the operations (such as battles, wars, campaigns, patrols, cruises, etc.) in which the subject unit or ship participated; these may be given as a list, or described in a more condensed form.
* '''victories''' – ''optional'' – the victories or successes in the subject's service history. For units, this may be battles won; for submarines or merchant raiders, the ships and tonnage sunk; and so forth.
* '''awards''' – ''optional'' – the awards, decorations, or other honors received by the subject unit or ship. <noinclude>[[Category:WikiProject Military history template instructions|Service record box]]</noinclude>
<includeonly>{{Sandbox other||
{{#ifeq:{{{noheader|}}}|yes||
[[Category:Military auxiliary infobox templates|Service Record]]
}}}}</includeonly>
fdc36320486e459c82f51dca7ed4b2e8d13fe441
Module:TNT
828
22
51
2023-05-20T18:33:54Z
meta>Dmehus
0
Undid revision 335077 by [[Special:Contributions/Dmehus|Dmehus]] ([[User talk:Dmehus|talk]]) Revert. Did not fix it
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
params[k - 2] = mw.text.trim(v)
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in ipairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in ipairs(data.data) do
local newVal = {}
local name = nil
for pos, columnName in ipairs(names) do
if columnName == 'name' then
name = row[pos]
else
newVal[columnName] = row[pos]
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
2c570369c78089aef29c72768918373f61b7075d
Template:Law sidebar style
10
289
692
2023-05-21T19:22:18Z
wikipedia>WOSlinker
0
syntaxhighlight lang="wikitext"
wikitext
text/x-wiki
{{#switch:{{{1|}}}
| title =
| heading = background:#aaddff; color:#000;
| above = font-weight:normal;
| below = padding:0.4em;border-top:1px #aaa solid;font-weight:normal;font-size:smaller;
}}<noinclude>
{{documentation
|content =
This auxiliary template is used by various [[:Category:Law templates|law-related templates]] to set [[Template:Sidebar|Sidebar]] coloring and padding style parameters.
== Example ==
<syntaxhighlight lang="wikitext">
{{Sidebar
| titlestyle = {{law sidebar style|title}}
| headingstyle = {{law sidebar style|heading}}
| abovestyle = {{law sidebar style|above}}
| belowstyle = {{law sidebar style|below}}
...
}}
</syntaxhighlight>
[[Category:Law templates|τ]]
}}<!--(end documentation)--></noinclude>
71bf873685fc3d691b81575c1520d763cdfdc300
Module:Coordinates/styles.css
828
201
502
2023-05-24T21:17:17Z
wikipedia>Izno
0
per tper
sanitized-css
text/css
/* {{pp-template}} */
/* Geographical coordinates defaults. The classes "geo", "longitude", and
"latitude" are used by the [[Geo microformat]]. */
.geo-default,
.geo-dms,
.geo-dec {
display: inline;
}
.geo-nondefault,
.geo-multi-punct,
.geo-inline-hidden {
display: none;
}
.longitude,
.latitude {
white-space: nowrap;
}
1b5d036501a9f6bc9dcf3c9117e8d6bc97507290
Module:Navbox
828
94
283
2023-05-28T13:26:56Z
wikipedia>Uzume
0
strict
Scribunto
text/plain
require('strict')
local p = {}
local navbar = require('Module:Navbar')._navbar
local cfg = mw.loadData('Module:Navbox/configuration')
local getArgs -- lazily initialized
local args
local format = string.format
local function striped(wikitext, border)
-- Return wikitext with markers replaced for odd/even striping.
-- Child (subgroup) navboxes are flagged with a category that is removed
-- by parent navboxes. The result is that the category shows all pages
-- where a child navbox is not contained in a parent navbox.
local orphanCat = cfg.category.orphan
if border == cfg.keyword.border_subgroup and args[cfg.arg.orphan] ~= cfg.keyword.orphan_yes then
-- No change; striping occurs in outermost navbox.
return wikitext .. orphanCat
end
local first, second = cfg.class.navbox_odd_part, cfg.class.navbox_even_part
if args[cfg.arg.evenodd] then
if args[cfg.arg.evenodd] == cfg.keyword.evenodd_swap then
first, second = second, first
else
first = args[cfg.arg.evenodd]
second = first
end
end
local changer
if first == second then
changer = first
else
local index = 0
changer = function (code)
if code == '0' then
-- Current occurrence is for a group before a nested table.
-- Set it to first as a valid although pointless class.
-- The next occurrence will be the first row after a title
-- in a subgroup and will also be first.
index = 0
return first
end
index = index + 1
return index % 2 == 1 and first or second
end
end
local regex = orphanCat:gsub('([%[%]])', '%%%1')
return (wikitext:gsub(regex, ''):gsub(cfg.marker.regex, changer)) -- () omits gsub count
end
local function processItem(item, nowrapitems)
if item:sub(1, 2) == '{|' then
-- Applying nowrap to lines in a table does not make sense.
-- Add newlines to compensate for trim of x in |parm=x in a template.
return '\n' .. item ..'\n'
end
if nowrapitems == cfg.keyword.nowrapitems_yes then
local lines = {}
for line in (item .. '\n'):gmatch('([^\n]*)\n') do
local prefix, content = line:match('^([*:;#]+)%s*(.*)')
if prefix and not content:match(cfg.pattern.nowrap) then
line = format(cfg.nowrap_item, prefix, content)
end
table.insert(lines, line)
end
item = table.concat(lines, '\n')
end
if item:match('^[*:;#]') then
return '\n' .. item ..'\n'
end
return item
end
local function has_navbar()
return args[cfg.arg.navbar] ~= cfg.keyword.navbar_off
and args[cfg.arg.navbar] ~= cfg.keyword.navbar_plain
and (
args[cfg.arg.name]
or mw.getCurrentFrame():getParent():getTitle():gsub(cfg.pattern.sandbox, '')
~= cfg.pattern.navbox
)
end
local function renderNavBar(titleCell)
if has_navbar() then
titleCell:wikitext(navbar{
[cfg.navbar.name] = args[cfg.arg.name],
[cfg.navbar.mini] = 1,
[cfg.navbar.fontstyle] = (args[cfg.arg.basestyle] or '') .. ';' ..
(args[cfg.arg.titlestyle] or '') ..
';background:none transparent;border:none;box-shadow:none;padding:0;'
})
end
end
local function renderTitleRow(tbl)
if not args[cfg.arg.title] then return end
local titleRow = tbl:tag('tr')
local titleCell = titleRow:tag('th'):attr('scope', 'col')
local titleColspan = 2
if args[cfg.arg.imageleft] then titleColspan = titleColspan + 1 end
if args[cfg.arg.image] then titleColspan = titleColspan + 1 end
titleCell
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.titlestyle])
:addClass(cfg.class.navbox_title)
:attr('colspan', titleColspan)
renderNavBar(titleCell)
titleCell
:tag('div')
-- id for aria-labelledby attribute
:attr('id', mw.uri.anchorEncode(args[cfg.arg.title]))
:addClass(args[cfg.arg.titleclass])
:css('font-size', '114%')
:css('margin', '0 4em')
:wikitext(processItem(args[cfg.arg.title]))
end
local function getAboveBelowColspan()
local ret = 2
if args[cfg.arg.imageleft] then ret = ret + 1 end
if args[cfg.arg.image] then ret = ret + 1 end
return ret
end
local function renderAboveRow(tbl)
if not args[cfg.arg.above] then return end
tbl:tag('tr')
:tag('td')
:addClass(cfg.class.navbox_abovebelow)
:addClass(args[cfg.arg.aboveclass])
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.abovestyle])
:attr('colspan', getAboveBelowColspan())
:tag('div')
-- id for aria-labelledby attribute, if no title
:attr('id', (not args[cfg.arg.title]) and mw.uri.anchorEncode(args[cfg.arg.above]) or nil)
:wikitext(processItem(args[cfg.arg.above], args[cfg.arg.nowrapitems]))
end
local function renderBelowRow(tbl)
if not args[cfg.arg.below] then return end
tbl:tag('tr')
:tag('td')
:addClass(cfg.class.navbox_abovebelow)
:addClass(args[cfg.arg.belowclass])
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.belowstyle])
:attr('colspan', getAboveBelowColspan())
:tag('div')
:wikitext(processItem(args[cfg.arg.below], args[cfg.arg.nowrapitems]))
end
local function renderListRow(tbl, index, listnum, listnums_size)
local row = tbl:tag('tr')
if index == 1 and args[cfg.arg.imageleft] then
row
:tag('td')
:addClass(cfg.class.noviewer)
:addClass(cfg.class.navbox_image)
:addClass(args[cfg.arg.imageclass])
:css('width', '1px') -- Minimize width
:css('padding', '0 2px 0 0')
:cssText(args[cfg.arg.imageleftstyle])
:attr('rowspan', listnums_size)
:tag('div')
:wikitext(processItem(args[cfg.arg.imageleft]))
end
local group_and_num = format(cfg.arg.group_and_num, listnum)
local groupstyle_and_num = format(cfg.arg.groupstyle_and_num, listnum)
if args[group_and_num] then
local groupCell = row:tag('th')
-- id for aria-labelledby attribute, if lone group with no title or above
if listnum == 1 and not (args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group2]) then
groupCell
:attr('id', mw.uri.anchorEncode(args[cfg.arg.group1]))
end
groupCell
:attr('scope', 'row')
:addClass(cfg.class.navbox_group)
:addClass(args[cfg.arg.groupclass])
:cssText(args[cfg.arg.basestyle])
-- If groupwidth not specified, minimize width
:css('width', args[cfg.arg.groupwidth] or '1%')
groupCell
:cssText(args[cfg.arg.groupstyle])
:cssText(args[groupstyle_and_num])
:wikitext(args[group_and_num])
end
local listCell = row:tag('td')
if args[group_and_num] then
listCell
:addClass(cfg.class.navbox_list_with_group)
else
listCell:attr('colspan', 2)
end
if not args[cfg.arg.groupwidth] then
listCell:css('width', '100%')
end
local rowstyle -- usually nil so cssText(rowstyle) usually adds nothing
if index % 2 == 1 then
rowstyle = args[cfg.arg.oddstyle]
else
rowstyle = args[cfg.arg.evenstyle]
end
local list_and_num = format(cfg.arg.list_and_num, listnum)
local listText = args[list_and_num]
local oddEven = cfg.marker.oddeven
if listText:sub(1, 12) == '</div><table' then
-- Assume list text is for a subgroup navbox so no automatic striping for this row.
oddEven = listText:find(cfg.pattern.navbox_title) and cfg.marker.restart or cfg.class.navbox_odd_part
end
local liststyle_and_num = format(cfg.arg.liststyle_and_num, listnum)
local listclass_and_num = format(cfg.arg.listclass_and_num, listnum)
listCell
:css('padding', '0')
:cssText(args[cfg.arg.liststyle])
:cssText(rowstyle)
:cssText(args[liststyle_and_num])
:addClass(cfg.class.navbox_list)
:addClass(cfg.class.navbox_part .. oddEven)
:addClass(args[cfg.arg.listclass])
:addClass(args[listclass_and_num])
:tag('div')
:css('padding',
(index == 1 and args[cfg.arg.list1padding]) or args[cfg.arg.listpadding] or '0 0.25em'
)
:wikitext(processItem(listText, args[cfg.arg.nowrapitems]))
if index == 1 and args[cfg.arg.image] then
row
:tag('td')
:addClass(cfg.class.noviewer)
:addClass(cfg.class.navbox_image)
:addClass(args[cfg.arg.imageclass])
:css('width', '1px') -- Minimize width
:css('padding', '0 0 0 2px')
:cssText(args[cfg.arg.imagestyle])
:attr('rowspan', listnums_size)
:tag('div')
:wikitext(processItem(args[cfg.arg.image]))
end
end
local function has_list_class(htmlclass)
local patterns = {
'^' .. htmlclass .. '$',
'%s' .. htmlclass .. '$',
'^' .. htmlclass .. '%s',
'%s' .. htmlclass .. '%s'
}
for arg, _ in pairs(args) do
if type(arg) == 'string' and mw.ustring.find(arg, cfg.pattern.class) then
for _, pattern in ipairs(patterns) do
if mw.ustring.find(args[arg] or '', pattern) then
return true
end
end
end
end
return false
end
-- there are a lot of list classes in the wild, so we add their TemplateStyles
local function add_list_styles()
local frame = mw.getCurrentFrame()
local function add_list_templatestyles(htmlclass, templatestyles)
if has_list_class(htmlclass) then
return frame:extensionTag{
name = 'templatestyles', args = { src = templatestyles }
}
else
return ''
end
end
local hlist_styles = add_list_templatestyles('hlist', cfg.hlist_templatestyles)
local plainlist_styles = add_list_templatestyles('plainlist', cfg.plainlist_templatestyles)
-- a second workaround for [[phab:T303378]]
-- when that issue is fixed, we can actually use has_navbar not to emit the
-- tag here if we want
if has_navbar() and hlist_styles == '' then
hlist_styles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.hlist_templatestyles }
}
end
-- hlist -> plainlist is best-effort to preserve old Common.css ordering.
-- this ordering is not a guarantee because most navboxes will emit only
-- one of these classes [hlist_note]
return hlist_styles .. plainlist_styles
end
local function needsHorizontalLists(border)
if border == cfg.keyword.border_subgroup or args[cfg.arg.tracking] == cfg.keyword.tracking_no then
return false
end
return not has_list_class(cfg.pattern.hlist) and not has_list_class(cfg.pattern.plainlist)
end
local function hasBackgroundColors()
for _, key in ipairs({cfg.arg.titlestyle, cfg.arg.groupstyle,
cfg.arg.basestyle, cfg.arg.abovestyle, cfg.arg.belowstyle}) do
if tostring(args[key]):find('background', 1, true) then
return true
end
end
return false
end
local function hasBorders()
for _, key in ipairs({cfg.arg.groupstyle, cfg.arg.basestyle,
cfg.arg.abovestyle, cfg.arg.belowstyle}) do
if tostring(args[key]):find('border', 1, true) then
return true
end
end
return false
end
local function isIllegible()
local styleratio = require('Module:Color contrast')._styleratio
for key, style in pairs(args) do
if tostring(key):match(cfg.pattern.style) then
if styleratio{mw.text.unstripNoWiki(style)} < 4.5 then
return true
end
end
end
return false
end
local function getTrackingCategories(border)
local cats = {}
if needsHorizontalLists(border) then table.insert(cats, cfg.category.horizontal_lists) end
if hasBackgroundColors() then table.insert(cats, cfg.category.background_colors) end
if isIllegible() then table.insert(cats, cfg.category.illegible) end
if hasBorders() then table.insert(cats, cfg.category.borders) end
return cats
end
local function renderTrackingCategories(builder, border)
local title = mw.title.getCurrentTitle()
if title.namespace ~= 10 then return end -- not in template space
local subpage = title.subpageText
if subpage == cfg.keyword.subpage_doc or subpage == cfg.keyword.subpage_sandbox
or subpage == cfg.keyword.subpage_testcases then return end
for _, cat in ipairs(getTrackingCategories(border)) do
builder:wikitext('[[Category:' .. cat .. ']]')
end
end
local function renderMainTable(border, listnums)
local tbl = mw.html.create('table')
:addClass(cfg.class.nowraplinks)
:addClass(args[cfg.arg.bodyclass])
local state = args[cfg.arg.state]
if args[cfg.arg.title] and state ~= cfg.keyword.state_plain and state ~= cfg.keyword.state_off then
if state == cfg.keyword.state_collapsed then
state = cfg.class.collapsed
end
tbl
:addClass(cfg.class.collapsible)
:addClass(state or cfg.class.autocollapse)
end
tbl:css('border-spacing', 0)
if border == cfg.keyword.border_subgroup or border == cfg.keyword.border_none then
tbl
:addClass(cfg.class.navbox_subgroup)
:cssText(args[cfg.arg.bodystyle])
:cssText(args[cfg.arg.style])
else -- regular navbox - bodystyle and style will be applied to the wrapper table
tbl
:addClass(cfg.class.navbox_inner)
:css('background', 'transparent')
:css('color', 'inherit')
end
tbl:cssText(args[cfg.arg.innerstyle])
renderTitleRow(tbl)
renderAboveRow(tbl)
local listnums_size = #listnums
for i, listnum in ipairs(listnums) do
renderListRow(tbl, i, listnum, listnums_size)
end
renderBelowRow(tbl)
return tbl
end
local function add_navbox_styles(hiding_templatestyles)
local frame = mw.getCurrentFrame()
-- This is a lambda so that it doesn't need the frame as a parameter
local function add_user_styles(templatestyles)
if templatestyles and templatestyles ~= '' then
return frame:extensionTag{
name = 'templatestyles', args = { src = templatestyles }
}
end
return ''
end
-- get templatestyles. load base from config so that Lua only needs to do
-- the work once of parser tag expansion
local base_templatestyles = cfg.templatestyles
local templatestyles = add_user_styles(args[cfg.arg.templatestyles])
local child_templatestyles = add_user_styles(args[cfg.arg.child_templatestyles])
-- The 'navbox-styles' div exists to wrap the styles to work around T200206
-- more elegantly. Instead of combinatorial rules, this ends up being linear
-- number of CSS rules.
return mw.html.create('div')
:addClass(cfg.class.navbox_styles)
:wikitext(
add_list_styles() .. -- see [hlist_note] applied to 'before base_templatestyles'
base_templatestyles ..
templatestyles ..
child_templatestyles ..
table.concat(hiding_templatestyles)
)
:done()
end
-- work around [[phab:T303378]]
-- for each arg: find all the templatestyles strip markers, insert them into a
-- table. then remove all templatestyles markers from the arg
local function move_hiding_templatestyles(args)
local gfind = string.gfind
local gsub = string.gsub
local templatestyles_markers = {}
local strip_marker_pattern = '(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)'
for k, arg in pairs(args) do
for marker in gfind(arg, strip_marker_pattern) do
table.insert(templatestyles_markers, marker)
end
args[k] = gsub(arg, strip_marker_pattern, '')
end
return templatestyles_markers
end
function p._navbox(navboxArgs)
args = navboxArgs
local hiding_templatestyles = move_hiding_templatestyles(args)
local listnums = {}
for k, _ in pairs(args) do
if type(k) == 'string' then
local listnum = k:match(cfg.pattern.listnum)
if listnum then table.insert(listnums, tonumber(listnum)) end
end
end
table.sort(listnums)
local border = mw.text.trim(args[cfg.arg.border] or args[1] or '')
if border == cfg.keyword.border_child then
border = cfg.keyword.border_subgroup
end
-- render the main body of the navbox
local tbl = renderMainTable(border, listnums)
local res = mw.html.create()
-- render the appropriate wrapper for the navbox, based on the border param
if border == cfg.keyword.border_none then
res:node(add_navbox_styles(hiding_templatestyles))
local nav = res:tag('div')
:attr('role', 'navigation')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args[cfg.arg.title] or args[cfg.arg.above] or (args[cfg.arg.group1]
and not args[cfg.arg.group2]) then
nav:attr(
'aria-labelledby',
mw.uri.anchorEncode(
args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1]
)
)
else
nav:attr('aria-label', cfg.aria_label)
end
elseif border == cfg.keyword.border_subgroup then
-- We assume that this navbox is being rendered in a list cell of a
-- parent navbox, and is therefore inside a div with padding:0em 0.25em.
-- We start with a </div> to avoid the padding being applied, and at the
-- end add a <div> to balance out the parent's </div>
res
:wikitext('</div>')
:node(tbl)
:wikitext('<div>')
else
res:node(add_navbox_styles(hiding_templatestyles))
local nav = res:tag('div')
:attr('role', 'navigation')
:addClass(cfg.class.navbox)
:addClass(args[cfg.arg.navboxclass])
:cssText(args[cfg.arg.bodystyle])
:cssText(args[cfg.arg.style])
:css('padding', '3px')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args[cfg.arg.title] or args[cfg.arg.above]
or (args[cfg.arg.group1] and not args[cfg.arg.group2]) then
nav:attr(
'aria-labelledby',
mw.uri.anchorEncode(args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1])
)
else
nav:attr('aria-label', cfg.aria_label)
end
end
if (args[cfg.arg.nocat] or cfg.keyword.nocat_false):lower() == cfg.keyword.nocat_false then
renderTrackingCategories(res, border)
end
return striped(tostring(res), border)
end
function p.navbox(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {wrappers = {cfg.pattern.navbox}})
-- Read the arguments in the order they'll be output in, to make references
-- number in the right order.
local _
_ = args[cfg.arg.title]
_ = args[cfg.arg.above]
-- Limit this to 20 as covering 'most' cases (that's a SWAG) and because
-- iterator approach won't work here
for i = 1, 20 do
_ = args[format(cfg.arg.group_and_num, i)]
_ = args[format(cfg.arg.list_and_num, i)]
end
_ = args[cfg.arg.below]
return p._navbox(args)
end
return p
05be9a97c035ab3f0fac69423779e261949d473c
Template:High-use
10
76
239
2023-05-30T09:39:48Z
wikipedia>Lectonar
0
Changed protection settings for "[[Template:High-use]]": [[WP:High-risk templates|High-risk template or module]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
{{#invoke:High-use|main|1={{{1|}}}|2={{{2|}}}|info={{{info|}}}|demo={{{demo|}}}|form={{{form|}}}|expiry={{{expiry|}}}|system={{{system|}}}}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! -->
</noinclude>
a3322d1bd47ac03df14fa2090855cff4fede9bc7
Module:High-use
828
79
245
2023-05-30T11:20:32Z
wikipedia>Lectonar
0
Changed protection settings for "[[Module:High-use]]": [[WP:High-risk templates|High-risk template or module]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
Scribunto
text/plain
local p = {}
-- _fetch looks at the "demo" argument.
local _fetch = require('Module:Transclusion_count').fetch
local yesno = require('Module:Yesno')
function p.num(frame, count)
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
-- Build output string
local return_value = ""
if count == nil then
if frame.args[1] == "risk" then
return_value = "a very large number of"
else
return_value = "many"
end
else
-- Use 2 significant figures for smaller numbers and 3 for larger ones
local sigfig = 2
if count >= 100000 then
sigfig = 3
end
-- Prepare to round to appropriate number of sigfigs
local f = math.floor(math.log10(count)) - sigfig + 1
-- Round and insert "approximately" or "+" when appropriate
if (frame.args[2] == "yes") or (mw.ustring.sub(frame.args[1],-1) == "+") then
-- Round down
return_value = string.format("%s+", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )
else
-- Round to nearest
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
end
end
end
return return_value
end
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
local return_value = ""
if frame.args[1] == "risk" then
return_value = "risk"
else
local count = _fetch(frame)
if count and count >= 100000 then return_value = "risk" end
end
return return_value
end
function p.text(frame, count)
-- Only show the information about how this template gets updated if someone
-- is actually editing the page and maybe trying to update the count.
local bot_text = (frame:preprocess("{{REVISIONID}}") == "") and "\n\n----\n'''Preview message''': Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]])." or ''
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" or title.subpageText == "sandbox" then
title = title.basePageTitle
end
local systemMessages = frame.args['system']
if frame.args['system'] == '' then
systemMessages = nil
end
-- This retrieves the project URL automatically to simplify localiation.
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and ("''', and " .. templateCount) or ("'''"))
else
used_on_text = used_on_text .. templateCount .. "'''"
end
local sandbox_text = ("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. "):format(
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
mw.title.getCurrentTitle().namespace == 828 and "Module:Sandbox|module sandbox" or "Wikipedia:User pages#SUB|user subpage"
)
local infoArg = frame.args["info"] ~= "" and frame.args["info"]
if (systemMessages or frame.args[1] == "risk" or (count and count >= 100000) ) then
local info = systemMessages and '.<br/>Changes to it can cause immediate changes to the Wikipedia user interface.' or '.'
if infoArg then
info = info .. "<br />" .. infoArg
end
sandbox_text = info .. '<br /> To avoid major disruption' ..
(count and count >= 100000 and ' and server load' or '') ..
', any changes should be tested in the ' .. sandbox_text ..
'The tested changes can be added to this page in a single edit. '
else
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
'hanges may be widely noticed. Test changes in the ' .. sandbox_text
end
local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
else
discussion_text = string.format("%son the [[%s|talk page]]", discussion_text, title.talkPageTitle.fullText )
end
return used_on_text .. sandbox_text .. discussion_text .. " before implementing them." .. bot_text
end
function p.main(frame)
local count = nil
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
local type_param = "style"
local epilogue = ''
if frame.args['system'] and frame.args['system'] ~= '' then
image = "[[File:Ambox important.svg|40px|alt=Warning|link=]]"
type_param = "content"
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local categorise = (nocat == '' or not yesno(nocat))
if categorise then
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
end
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"
type_param = "content"
end
if frame.args["form"] == "editnotice" then
return frame:expandTemplate{
title = 'editnotice',
args = {
["image"] = image,
["text"] = p.text(frame, count),
["expiry"] = (frame.args["expiry"] or "")
}
} .. epilogue
else
return require('Module:Message box').main('ombox', {
type = type_param,
image = image,
text = p.text(frame, count),
expiry = (frame.args["expiry"] or "")
}) .. epilogue
end
end
return p
134551888e066954a89c109d2faa8af71a4454a4
Module:Transclusion count
828
80
247
2023-05-30T20:51:38Z
wikipedia>Isabelle Belato
0
Changed protection settings for "[[Module:Transclusion count]]": [[WP:High-risk templates|Highly visible template]]; requested at [[WP:RfPP]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
Scribunto
text/plain
local p = {}
function p.fetch(frame)
local template = nil
local return_value = nil
-- Use demo parameter if it exists, otherswise use current template name
local namespace = mw.title.getCurrentTitle().namespace
if frame.args["demo"] and frame.args["demo"] ~= "" then
template = mw.ustring.gsub(frame.args["demo"],"^[Tt]emplate:","")
elseif namespace == 10 then -- Template namespace
template = mw.title.getCurrentTitle().text
elseif namespace == 828 then -- Module namespace
template = (mw.site.namespaces[828].name .. ":" .. mw.title.getCurrentTitle().text)
end
-- If in template or module namespace, look up count in /data
if template ~= nil then
namespace = mw.title.new(template, "Template").namespace
if namespace == 10 or namespace == 828 then
template = mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end
template = mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end
local index = mw.ustring.sub(mw.title.new(template).text,1,1)
local status, data = pcall(function ()
return(mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other")))
end)
if status then
return_value = tonumber(data[mw.ustring.gsub(template, " ", "_")])
end
end
end
-- If database value doesn't exist, use value passed to template
if return_value == nil and frame.args[1] ~= nil then
local arg1=mw.ustring.match(frame.args[1], '[%d,]+')
if arg1 and arg1 ~= '' then
return_value = tonumber(frame:callParserFunction('formatnum', arg1, 'R'))
end
end
return return_value
end
-- Tabulate this data for [[Wikipedia:Database reports/Templates transcluded on the most pages]]
function p.tabulate(frame)
local list = {}
for i = 65, 91 do
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i)))
for name, count in pairs(data) do
table.insert(list, {mw.title.new(name, "Template").fullText, count})
end
end
table.sort(list, function(a, b)
return (a[2] == b[2]) and (a[1] < b[1]) or (a[2] > b[2])
end)
local lang = mw.getContentLanguage();
for i = 1, #list do
list[i] = ('|-\n| %d || [[%s]] || %s\n'):format(i, list[i][1]:gsub('_', ' '), lang:formatNum(list[i][2]))
end
return table.concat(list)
end
return p
000ef6bcbf7b66e727870b0c300c4009da300513
Module:Coordinates
828
200
500
2023-06-21T17:33:40Z
wikipedia>Ladsgroup
0
Switch from proto-relative urls (//foo.bar.com) to HTTPS (https://foo.bar.com). Since we are only serving https in Wikimedia now, it always outputs https links. At the same time, proto-relative add two duplicate rows to externallinks table meaning this is adding tens of millions of extra and useless rows bloating the table
Scribunto
text/plain
--[[
This module is intended to replace the functionality of {{Coord}} and related
templates. It provides several methods, including
{{#invoke:Coordinates | coord }} : General function formatting and displaying
coordinate values.
{{#invoke:Coordinates | dec2dms }} : Simple function for converting decimal
degree values to DMS format.
{{#invoke:Coordinates | dms2dec }} : Simple function for converting DMS format
to decimal degree format.
{{#invoke:Coordinates | link }} : Export the link used to reach the tools
]]
require('strict')
local math_mod = require("Module:Math")
local coordinates = {};
local isSandbox = mw.getCurrentFrame():getTitle():find('sandbox', 1, true);
local current_page = mw.title.getCurrentTitle()
local page_name = mw.uri.encode( current_page.prefixedText, 'WIKI' );
local coord_link = 'https://geohack.toolforge.org/geohack.php?pagename=' .. page_name .. '¶ms='
--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(coords)
return mw.getCurrentFrame():extensionTag{
name = 'indicator',
args = { name = 'coordinates' },
content = '<span id="coordinates">[[Geographic coordinate system|Coordinates]]: ' .. coords .. '</span>'
}
end
--[[ Helper function, used in detecting DMS formatting ]]
local function dmsTest(first, second)
if type(first) ~= 'string' or type(second) ~= 'string' then
return nil
end
local s = (first .. second):upper()
return s:find('^[NS][EW]$') or s:find('^[EW][NS]$')
end
--[[ Wrapper function to grab args, see Module:Arguments for this function's documentation. ]]
local function makeInvokeFunc(funcName)
return function (frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Coord'
})
return coordinates[funcName](args, frame)
end
end
--[[ Helper function, handle optional args. ]]
local function optionalArg(arg, supplement)
return arg and arg .. supplement or ''
end
--[[
Formats any error messages generated for display
]]
local function errorPrinter(errors)
local result = ""
for i,v in ipairs(errors) do
result = result .. '<strong class="error">Coordinates: ' .. v[2] .. '</strong><br />'
end
return result
end
--[[
Determine the required CSS class to display coordinates
Usually geo-nondefault is hidden by CSS, unless a user has overridden this for himself
default is the mode as specificied by the user when calling the {{coord}} template
mode is the display mode (dec or dms) that we will need to determine the css class for
]]
local function displayDefault(default, mode)
if default == "" then
default = "dec"
end
if default == mode then
return "geo-default"
else
return "geo-nondefault"
end
end
--[[
specPrinter
Output formatter. Takes the structure generated by either parseDec
or parseDMS and formats it for inclusion on Wikipedia.
]]
local function specPrinter(args, coordinateSpec)
local uriComponents = coordinateSpec["param"]
if uriComponents == "" then
-- RETURN error, should never be empty or nil
return "ERROR param was empty"
end
if args["name"] then
uriComponents = uriComponents .. "&title=" .. mw.uri.encode(coordinateSpec["name"])
end
local geodmshtml = '<span class="geo-dms" title="Maps, aerial photos, and other data for this location">'
.. '<span class="latitude">' .. coordinateSpec["dms-lat"] .. '</span> '
.. '<span class="longitude">' ..coordinateSpec["dms-long"] .. '</span>'
.. '</span>'
local lat = tonumber( coordinateSpec["dec-lat"] ) or 0
local geodeclat
if lat < 0 then
-- FIXME this breaks the pre-existing precision
geodeclat = tostring(coordinateSpec["dec-lat"]):sub(2) .. "°S"
else
geodeclat = (coordinateSpec["dec-lat"] or 0) .. "°N"
end
local long = tonumber( coordinateSpec["dec-long"] ) or 0
local geodeclong
if long < 0 then
-- FIXME does not handle unicode minus
geodeclong = tostring(coordinateSpec["dec-long"]):sub(2) .. "°W"
else
geodeclong = (coordinateSpec["dec-long"] or 0) .. "°E"
end
local geodechtml = '<span class="geo-dec" title="Maps, aerial photos, and other data for this location">'
.. geodeclat .. ' '
.. geodeclong
.. '</span>'
local geonumhtml = '<span class="geo">'
.. coordinateSpec["dec-lat"] .. '; '
.. coordinateSpec["dec-long"]
.. '</span>'
local inner = '<span class="' .. displayDefault(coordinateSpec["default"], "dms" ) .. '">' .. geodmshtml .. '</span>'
.. '<span class="geo-multi-punct"> / </span>'
.. '<span class="' .. displayDefault(coordinateSpec["default"], "dec" ) .. '">';
if not args["name"] then
inner = inner .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span></span>'
else
inner = inner .. '<span class="vcard">' .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span>'
.. '<span style="display:none"> (<span class="fn org">'
.. args["name"] .. '</span>)</span></span></span>'
end
local stylesheetLink = 'Module:Coordinates' .. ( isSandbox and '/sandbox' or '' ) .. '/styles.css'
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = stylesheetLink }
} .. '<span class="plainlinks nourlexpansion">[' .. coord_link .. uriComponents ..
' ' .. inner .. ']</span>'
end
--[[ Helper function, convert decimal to degrees ]]
local function convert_dec2dms_d(coordinate)
local d = math_mod._round( coordinate, 0 ) .. "°"
return d .. ""
end
--[[ Helper function, convert decimal to degrees and minutes ]]
local function convert_dec2dms_dm(coordinate)
coordinate = math_mod._round( coordinate * 60, 0 );
local m = coordinate % 60;
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."°"
return d .. string.format( "%02d′", m )
end
--[[ Helper function, convert decimal to degrees, minutes, and seconds ]]
local function convert_dec2dms_dms(coordinate)
coordinate = math_mod._round( coordinate * 60 * 60, 0 );
local s = coordinate % 60
coordinate = math.floor( (coordinate - s) / 60 );
local m = coordinate % 60
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."°"
return d .. string.format( "%02d′", m ) .. string.format( "%02d″", s )
end
--[[
Helper function, convert decimal latitude or longitude to
degrees, minutes, and seconds format based on the specified precision.
]]
local function convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
local coord = tonumber(coordinate)
local postfix
if coord >= 0 then
postfix = firstPostfix
else
postfix = secondPostfix
end
precision = precision:lower();
if precision == "dms" then
return convert_dec2dms_dms( math.abs( coord ) ) .. postfix;
elseif precision == "dm" then
return convert_dec2dms_dm( math.abs( coord ) ) .. postfix;
elseif precision == "d" then
return convert_dec2dms_d( math.abs( coord ) ) .. postfix;
end
end
--[[
Convert DMS format into a N or E decimal coordinate
]]
local function convert_dms2dec(direction, degrees_str, minutes_str, seconds_str)
local degrees = tonumber(degrees_str)
local minutes = tonumber(minutes_str) or 0
local seconds = tonumber(seconds_str) or 0
local factor = 1
if direction == "S" or direction == "W" then
factor = -1
end
local precision = 0
if seconds_str then
precision = 5 + math.max( math_mod._precision(seconds_str), 0 );
elseif minutes_str and minutes_str ~= '' then
precision = 3 + math.max( math_mod._precision(minutes_str), 0 );
else
precision = math.max( math_mod._precision(degrees_str), 0 );
end
local decimal = factor * (degrees+(minutes+seconds/60)/60)
return string.format( "%." .. precision .. "f", decimal ) -- not tonumber since this whole thing is string based.
end
--[[
Checks input values to for out of range errors.
]]
local function validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, source, strong )
local errors = {};
lat_d = tonumber( lat_d ) or 0;
lat_m = tonumber( lat_m ) or 0;
lat_s = tonumber( lat_s ) or 0;
long_d = tonumber( long_d ) or 0;
long_m = tonumber( long_m ) or 0;
long_s = tonumber( long_s ) or 0;
if strong then
if lat_d < 0 then
table.insert(errors, {source, "latitude degrees < 0 with hemisphere flag"})
end
if long_d < 0 then
table.insert(errors, {source, "longitude degrees < 0 with hemisphere flag"})
end
--[[
#coordinates is inconsistent about whether this is an error. If globe: is
specified, it won't error on this condition, but otherwise it will.
For not simply disable this check.
if long_d > 180 then
table.insert(errors, {source, "longitude degrees > 180 with hemisphere flag"})
end
]]
end
if lat_d > 90 then
table.insert(errors, {source, "latitude degrees > 90"})
end
if lat_d < -90 then
table.insert(errors, {source, "latitude degrees < -90"})
end
if lat_m >= 60 then
table.insert(errors, {source, "latitude minutes >= 60"})
end
if lat_m < 0 then
table.insert(errors, {source, "latitude minutes < 0"})
end
if lat_s >= 60 then
table.insert(errors, {source, "latitude seconds >= 60"})
end
if lat_s < 0 then
table.insert(errors, {source, "latitude seconds < 0"})
end
if long_d >= 360 then
table.insert(errors, {source, "longitude degrees >= 360"})
end
if long_d <= -360 then
table.insert(errors, {source, "longitude degrees <= -360"})
end
if long_m >= 60 then
table.insert(errors, {source, "longitude minutes >= 60"})
end
if long_m < 0 then
table.insert(errors, {source, "longitude minutes < 0"})
end
if long_s >= 60 then
table.insert(errors, {source, "longitude seconds >= 60"})
end
if long_s < 0 then
table.insert(errors, {source, "longitude seconds < 0"})
end
return errors;
end
--[[
parseDec
Transforms decimal format latitude and longitude into the
structure to be used in displaying coordinates
]]
local function parseDec( lat, long, format )
local coordinateSpec = {}
local errors = {}
if not long then
return nil, {{"parseDec", "Missing longitude"}}
elseif not tonumber(long) then
return nil, {{"parseDec", "Longitude could not be parsed as a number: " .. long}}
end
errors = validate( lat, nil, nil, long, nil, nil, 'parseDec', false );
coordinateSpec["dec-lat"] = lat;
coordinateSpec["dec-long"] = long;
local mode = coordinates.determineMode( lat, long );
coordinateSpec["dms-lat"] = convert_dec2dms( lat, "N", "S", mode) -- {{coord/dec2dms|{{{1}}}|N|S|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
coordinateSpec["dms-long"] = convert_dec2dms( long, "E", "W", mode) -- {{coord/dec2dms|{{{2}}}|E|W|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dec"
end
return coordinateSpec, errors
end
--[[
parseDMS
Transforms degrees, minutes, seconds format latitude and longitude
into the a structure to be used in displaying coordinates
]]
local function parseDMS( lat_d, lat_m, lat_s, lat_f, long_d, long_m, long_s, long_f, format )
local coordinateSpec, errors, backward = {}, {}
lat_f = lat_f:upper();
long_f = long_f:upper();
-- Check if specified backward
if lat_f == 'E' or lat_f == 'W' then
lat_d, long_d, lat_m, long_m, lat_s, long_s, lat_f, long_f, backward = long_d, lat_d, long_m, lat_m, long_s, lat_s, long_f, lat_f, true;
end
errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true );
if not long_d then
return nil, {{"parseDMS", "Missing longitude" }}
elseif not tonumber(long_d) then
return nil, {{"parseDMS", "Longitude could not be parsed as a number:" .. long_d }}
end
if not lat_m and not lat_s and not long_m and not long_s and #errors == 0 then
if math_mod._precision( lat_d ) > 0 or math_mod._precision( long_d ) > 0 then
if lat_f:upper() == 'S' then
lat_d = '-' .. lat_d;
end
if long_f:upper() == 'W' then
long_d = '-' .. long_d;
end
return parseDec( lat_d, long_d, format );
end
end
coordinateSpec["dms-lat"] = lat_d.."°"..optionalArg(lat_m,"′") .. optionalArg(lat_s,"″") .. lat_f
coordinateSpec["dms-long"] = long_d.."°"..optionalArg(long_m,"′") .. optionalArg(long_s,"″") .. long_f
coordinateSpec["dec-lat"] = convert_dms2dec(lat_f, lat_d, lat_m, lat_s) -- {{coord/dms2dec|{{{4}}}|{{{1}}}|0{{{2}}}|0{{{3}}}}}
coordinateSpec["dec-long"] = convert_dms2dec(long_f, long_d, long_m, long_s) -- {{coord/dms2dec|{{{8}}}|{{{5}}}|0{{{6}}}|0{{{7}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dms"
end
return coordinateSpec, errors, backward
end
--[[
Check the input arguments for coord to determine the kind of data being provided
and then make the necessary processing.
]]
local function formatTest(args)
local result, errors
local backward, primary = false, false
local function getParam(args, lim)
local ret = {}
for i = 1, lim do
ret[i] = args[i] or ''
end
return table.concat(ret, '_')
end
if not args[1] then
-- no lat logic
return errorPrinter( {{"formatTest", "Missing latitude"}} )
elseif not tonumber(args[1]) then
-- bad lat logic
return errorPrinter( {{"formatTest", "Unable to parse latitude as a number:" .. args[1]}} )
elseif not args[4] and not args[5] and not args[6] then
-- dec logic
result, errors = parseDec(args[1], args[2], args.format)
if not result then
return errorPrinter(errors);
end
-- formatting for geohack: geohack expects D_N_D_E notation or D;D notation
-- wikiminiatlas doesn't support D;D notation
-- #coordinates parserfunction doesn't support negative decimals with NSWE
result.param = table.concat({
math.abs(tonumber(args[1])),
((tonumber(args[1]) or 0) < 0) and 'S' or 'N',
math.abs(tonumber(args[2])),
((tonumber(args[2]) or 0) < 0) and 'W' or 'E',
args[3] or ''}, '_')
elseif dmsTest(args[4], args[8]) then
-- dms logic
result, errors, backward = parseDMS(args[1], args[2], args[3], args[4],
args[5], args[6], args[7], args[8], args.format)
if args[10] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 9)
elseif dmsTest(args[3], args[6]) then
-- dm logic
result, errors, backward = parseDMS(args[1], args[2], nil, args[3],
args[4], args[5], nil, args[6], args['format'])
if args[8] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 7)
elseif dmsTest(args[2], args[4]) then
-- d logic
result, errors, backward = parseDMS(args[1], nil, nil, args[2],
args[3], nil, nil, args[4], args.format)
if args[6] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 5)
else
-- Error
return errorPrinter({{"formatTest", "Unknown argument format"}}) .. '[[Category:Pages with malformed coordinate tags]]'
end
result.name = args.name
local extra_param = {'dim', 'globe', 'scale', 'region', 'source', 'type'}
for _, v in ipairs(extra_param) do
if args[v] then
table.insert(errors, {'formatTest', 'Parameter: "' .. v .. '=" should be "' .. v .. ':"' })
end
end
local ret = specPrinter(args, result)
if #errors > 0 then
ret = ret .. ' ' .. errorPrinter(errors) .. '[[Category:Pages with malformed coordinate tags]]'
end
return ret, backward
end
--[[
Generate Wikidata tracking categories.
]]
local function makeWikidataCategories(qid)
local ret
local qid = qid or mw.wikibase.getEntityIdForCurrentPage()
if mw.wikibase and current_page.namespace == 0 then
if qid and mw.wikibase.entityExists(qid) and mw.wikibase.getBestStatements(qid, "P625") and mw.wikibase.getBestStatements(qid, "P625")[1] then
local snaktype = mw.wikibase.getBestStatements(qid, "P625")[1].mainsnak.snaktype
if snaktype == 'value' then
-- coordinates exist both here and on Wikidata, and can be compared.
ret = 'Coordinates on Wikidata'
elseif snaktype == 'somevalue' then
ret = 'Coordinates on Wikidata set to unknown value'
elseif snaktype == 'novalue' then
ret = 'Coordinates on Wikidata set to no value'
end
else
-- We have to either import the coordinates to Wikidata or remove them here.
ret = 'Coordinates not on Wikidata'
end
end
if ret then
return string.format('[[Category:%s]]', ret)
else
return ''
end
end
--[[
link
Simple function to export the coordinates link for other uses.
Usage:
{{#invoke:Coordinates | link }}
]]
function coordinates.link(frame)
return coord_link;
end
--[[
dec2dms
Wrapper to allow templates to call dec2dms directly.
Usage:
{{#invoke:Coordinates | dec2dms | decimal_coordinate | positive_suffix |
negative_suffix | precision }}
decimal_coordinate is converted to DMS format. If positive, the positive_suffix
is appended (typical N or E), if negative, the negative suffix is appended. The
specified precision is one of 'D', 'DM', or 'DMS' to specify the level of detail
to use.
]]
coordinates.dec2dms = makeInvokeFunc('_dec2dms')
function coordinates._dec2dms(args)
local coordinate = args[1]
local firstPostfix = args[2] or ''
local secondPostfix = args[3] or ''
local precision = args[4] or ''
return convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
end
--[[
Helper function to determine whether to use D, DM, or DMS
format depending on the precision of the decimal input.
]]
function coordinates.determineMode( value1, value2 )
local precision = math.max( math_mod._precision( value1 ), math_mod._precision( value2 ) );
if precision <= 0 then
return 'd'
elseif precision <= 2 then
return 'dm';
else
return 'dms';
end
end
--[[
dms2dec
Wrapper to allow templates to call dms2dec directly.
Usage:
{{#invoke:Coordinates | dms2dec | direction_flag | degrees |
minutes | seconds }}
Converts DMS values specified as degrees, minutes, seconds too decimal format.
direction_flag is one of N, S, E, W, and determines whether the output is
positive (i.e. N and E) or negative (i.e. S and W).
]]
coordinates.dms2dec = makeInvokeFunc('_dms2dec')
function coordinates._dms2dec(args)
local direction = args[1]
local degrees = args[2]
local minutes = args[3]
local seconds = args[4]
return convert_dms2dec(direction, degrees, minutes, seconds)
end
--[[
coord
Main entry point for Lua function to replace {{coord}}
Usage:
{{#invoke:Coordinates | coord }}
{{#invoke:Coordinates | coord | lat | long }}
{{#invoke:Coordinates | coord | lat | lat_flag | long | long_flag }}
...
Refer to {{coord}} documentation page for many additional parameters and
configuration options.
Note: This function provides the visual display elements of {{coord}}. In
order to load coordinates into the database, the {{#coordinates:}} parser
function must also be called, this is done automatically in the Lua
version of {{coord}}.
]]
coordinates.coord = makeInvokeFunc('_coord')
function coordinates._coord(args)
if not tonumber(args[1]) and not args[2] then
args[3] = args[1]; args[1] = nil
local entity = mw.wikibase.getEntityObject(args.qid)
if entity
and entity.claims
and entity.claims.P625
and entity.claims.P625[1].mainsnak.snaktype == 'value'
then
local precision = entity.claims.P625[1].mainsnak.datavalue.value.precision
args[1] = entity.claims.P625[1].mainsnak.datavalue.value.latitude
args[2] = entity.claims.P625[1].mainsnak.datavalue.value.longitude
if precision then
precision = -math_mod._round(math.log(precision)/math.log(10),0)
args[1] = math_mod._round(args[1],precision)
args[2] = math_mod._round(args[2],precision)
end
end
end
local contents, backward = formatTest(args)
local Notes = args.notes or ''
local Display = args.display and args.display:lower() or 'inline'
-- it and ti are short for inline,title and title,inline
local function isInline(s)
-- Finds whether coordinates are displayed inline.
return s:find('inline') ~= nil or s == 'i' or s == 'it' or s == 'ti'
end
local function isInTitle(s)
-- Finds whether coordinates are displayed in the title.
return s:find('title') ~= nil or s == 't' or s == 'it' or s == 'ti'
end
local function coord_wrapper(in_args)
-- Calls the parser function {{#coordinates:}}.
return mw.getCurrentFrame():callParserFunction('#coordinates', in_args) or ''
end
local text = ''
if isInline(Display) then
text = text .. '<span class="geo-inline">' .. contents .. Notes .. '</span>'
end
if isInTitle(Display) then
-- Add to output since indicator content is invisible to Lua later on
if not isInline(Display) then
text = text .. '<span class="geo-inline-hidden noexcerpt">' .. contents .. Notes .. '</span>'
end
text = text .. displaytitle(contents .. Notes) .. makeWikidataCategories(args.qid)
end
if not args.nosave then
local page_title, count = mw.title.getCurrentTitle(), 1
if backward then
local tmp = {}
while not string.find((args[count-1] or ''), '[EW]') do tmp[count] = (args[count] or ''); count = count+1 end
tmp.count = count; count = 2*(count-1)
while count >= tmp.count do table.insert(tmp, 1, (args[count] or '')); count = count-1 end
for i, v in ipairs(tmp) do args[i] = v end
else
while count <= 9 do args[count] = (args[count] or ''); count = count+1 end
end
if isInTitle(Display) and not page_title.isTalkPage and page_title.subpageText ~= 'doc' and page_title.subpageText ~= 'testcases' then args[10] = 'primary' end
args.notes, args.format, args.display = nil
text = text .. coord_wrapper(args)
end
return text
end
--[[
coord2text
Extracts a single value from a transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coord2text | {{Coord}} | parameter }}
Valid values for the second parameter are: lat (signed integer), long (signed integer), type, scale, dim, region, globe, source
]]
function coordinates._coord2text(coord,type)
if coord == '' or type == '' or not type then return nil end
type = mw.text.trim(type)
if type == 'lat' or type == 'long' then
local result, negative = mw.text.split((mw.ustring.match(coord,'[%.%d]+°[NS] [%.%d]+°[EW]') or ''), ' ')
if type == 'lat' then
result, negative = result[1], 'S'
else
result, negative = result[2], 'W'
end
result = mw.text.split(result, '°')
if result[2] == negative then result[1] = '-'..result[1] end
return result[1]
else
return mw.ustring.match(coord, 'params=.-_' .. type .. ':(.-)[ _]')
end
end
function coordinates.coord2text(frame)
return coordinates._coord2text(frame.args[1],frame.args[2])
end
--[[
coordinsert
Injects some text into the Geohack link of a transclusion of {{Coord}} (if that text isn't already in the transclusion). Outputs the modified transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coordinsert | {{Coord}} | parameter:value | parameter:value | … }}
Do not make Geohack unhappy by inserting something which isn't mentioned in the {{Coord}} documentation.
]]
function coordinates.coordinsert(frame)
-- for the 2nd or later integer parameter (the first is the coord template, as above)
for i, v in ipairs(frame.args) do
if i ~= 1 then
-- if we cannot find in the coord_template the i_th coordinsert parameter e.g. region
if not mw.ustring.find(frame.args[1], (mw.ustring.match(frame.args[i], '^(.-:)') or '')) then
-- find from the params= up to the first possibly-present underscore
-- and append the i_th coordinsert parameter and a space
-- IDK why we're adding a space but it does seem somewhat convenient
frame.args[1] = mw.ustring.gsub(frame.args[1], '(params=.-)_? ', '%1_'..frame.args[i]..' ')
end
end
end
if frame.args.name then
-- if we can't find the vcard class
if not mw.ustring.find(frame.args[1], '<span class="vcard">') then
-- take something that looks like a coord template and add the vcard span with class and fn org class
local namestr = frame.args.name
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(<span class="geo%-default">)(<span[^<>]*>[^<>]*</span><span[^<>]*>[^<>]*<span[^<>]*>[^<>]*</span></span>)(</span>)',
'%1<span class="vcard">%2<span style="display:none"> (<span class="fn org">' .. namestr .. '</span>)</span></span>%3'
)
-- then find anything from coordinates parameters to the 'end' and attach the title parameter
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(¶ms=[^&"<>%[%] ]*) ',
'%1&title=' .. mw.uri.encode(namestr) .. ' '
)
end
end
-- replace the existing indicator with a new indicator using the modified content
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(<span class="geo%-inline[^"]*">(.+)</span>)\127[^\127]*UNIQ%-%-indicator%-%x+%-%-?QINU[^\127]*\127',
function (inline, coord) return inline .. displaytitle(coord) end
)
return frame.args[1]
end
return coordinates
6162d7e98fcf6faab5809049e0a48bb3e67d88e3
Template:Userbox/doc
10
127
351
2023-06-24T14:05:06Z
wikipedia>Anarchyte
0
may → must
wikitext
text/x-wiki
{{Documentation subpage}}
{{Lua|Module:Userbox}}
{{High-use}}
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
This template can be used to quickly create a [[Wikipedia:Userboxes|userbox]] for display on a user's [[Wikipedia:User pages|user page]] without having to know HTML or Wikitable syntax.
'''''[[WP:NFCC|Nonfree]] images must not be displayed in userboxes, and are subject to summary removal by any editor without any notice being required.'''''
== Sandbox reminder==
* Always practice or experiment in the [[Template:Userbox/sandbox]] or [[Template:Userbox/testcases]]
* Once you are satisfied: Copy your code!
* In your Browser's address bar, change "sandbox" or "testcases" to the name of your new Userbox.
** Example:
** '''CHANGE''' [{{Fullurl:Template:Userbox/sandbox}} http://en.wikipedia.org/wiki/Template:Userbox/sandbox]<!--Display http://, but allow possibility of https:// access.-->
** '''TO''' [{{Fullurl:Template:Userbox/sandbox}} https://en.wikipedia.org/wiki/Template:Userbox/WhateverYourNewBoxNameIs]
** If the name of your new Userbox is taken, create a different name.
* You will be prompted to Start or Create your new Template Userbox!
* Paste your code into the space provided.
== Usage ==
<!-- Abstract usage of the template, one variable per row. -->
<syntaxhighlight lang="wikitext" style="overflow: auto">
{{userbox
| bodyclass = <!--Adds an HTML class attribute to the entire template's HTML table, to allow for styling, emission of microformats, etc.-->
| border-c = <!--border color (default=id-c or #999999)-->
| border-s = <!--border width in pixels (default=1)-->
| float = <!--left|right|none (default=left)-->
| id = <!--id image or text (image size should normally not exceed 90x45px)-->
| id-a = <!--id horizontal alignment left/center/right/justify (default=center)-->
| id-c = <!--id background color (default=#DDDDDD)-->
| id-fc = <!--id font color (default=info-fc or black)-->
| id-h = <!--id box height in pixels (default=45)-->
| id-lh = <!--id line height (default=1.25em)-->
| id-op = <!--id other CSS parameters-->
| id-p = <!--id cell padding (default=0 1px 0 0)-->
| id-s = <!--id text size in points (default=14)-->
| id-w = <!--id box width in pixels (default=45)-->
| info-class = <!--Adds an HTML class attribute to the "info" HTML table-row, to allow for styling, emission of microformats, etc.-->
| info = <!--info text or image-->
| info-a = <!--info horizontal alignment left/center/right/justify (default=left)-->
| info-c = <!--info background color (default=#EEEEEE)-->
| info-fc = <!--info font color (default=black)-->
| info-lh = <!--info line height (default=1.25em)-->
| info-op = <!--info other CSS parameters-->
| info-p = <!--info padding (default=0 4px 0 4px)-->
| info-s = <!--info text size in points (default=8)-->
| nocat = <!--block page category declarations; see [[WP:NOCAT]] (default=false)-->
| usercategory = <!--user category (optional, unlinked and without the "Category:" part)-->
| usercategory2 = <!--user category (optional)-->
| usercategory3 = <!--user category (optional)-->
| usercategory4 = <!--user category (optional)-->
| usercategory5 = <!--user category (optional)-->
}}
</syntaxhighlight>
* All parameters are optional.
* Images should normally be scaled to x45px or less.
<!-- Explain what this template's parameters do -- if no params, delete the definition. -->
Most HTML-based tables use only a handful of these attributes. The following subset can be used to quickly convert an HTML userbox into the format used here:
<syntaxhighlight lang="wikitext">
{{userbox
| border-c =
| id =
| id-c =
| id-fc =
| id-s =
| info =
| info-c =
| info-fc =
| info-lh =
| info-s =
}}</syntaxhighlight>
== Examples ==
{|
! style="width: 300px;" | Code
! Result
|-
| <syntaxhighlight lang="wikitext">{{userbox
| border-c = #aaffaa
| border-s = 2
| id = foo
| id-c = #ffffee
| id-s = 20
| info = ''foo bar''
| info-c = #ffeeff
| info-s = 12
}}</syntaxhighlight> || {{userbox|id=foo|id-s=20|id-c=#ffffee|info=''foo bar''|info-c=#ffeeff|info-s=12|border-c=#aaffaa|border-s=2}}
|-
| colspan="2"| Below example shows the default appearance of a userbox, which is (much) higher than the 45px.<br>Compare the height of the one below with the above userbox.
|-
| <syntaxhighlight lang="wikitext">{{userbox
| border-c = #aaffaa
| border-s = 2
| id = foo logo
| id-c = #ffffee
| info = ''We are trying to see
default distance in between text
lines, see the distance in
between cell content and its border,
and also see total height.''
| info-c = #ffeeff
}}</syntaxhighlight> || {{userbox|id=foo logo|id-c=#ffffee|info=''We are trying to see default distance in between text lines, see the distance in between cell content and its border, and also see total height.''|info-c=#ffeeff|border-c=#aaffaa|border-s=2}}
|-
| colspan="2"| Below example shows how we can change that userbox and further specify parameters to bring down<br>the overall height of the userbox to the recommended height of 45px, even with four text lines.<br>Cell padding parameter "''info-p''" can also be set at "''1pt 1pt 1pt 2pt''", or "''1pt 2pt''" for better appearance,<br>when there are 4 text lines.
|-
| <syntaxhighlight lang="wikitext">{{userbox
| border-c = #aaffaa
| border-s = 1
| id = foo logo
| id-c = #ffffee
| id-lh = 1.1em
| id-s = 14
| info = ''We have specified values
to lessen the distance between
text lines and padding space between
cell content and its border.''
| info-c = #ffeeff
| info-lh = 1.05em
| info-p = 1pt
| info-s = 8
}}</syntaxhighlight> || {{userbox|id=foo logo|id-s=14|id-lh=1.1em|id-c=#ffffee|info=''We have specified values to lessen the distance between text lines and padding space between cell content and its border.''|info-c=#ffeeff|info-s=8|info-p=1pt|info-lh=1.05em|border-c=#aaffaa|border-s=1}}
|-
| colspan="2"| Below example is for advanced users, showing how we can specify other [[Cascading Style Sheets|CSS]] properties,for example, "''font-family''",<br>to change the font or "''text-decoration''" to add lines around the text. Below, on the right side are two userboxes:<br>the top one is displayed without either parameters; and the bottom userbox is displayed by using the below code,<br>with the help of the "''info-op''" field.
|-
| <syntaxhighlight lang="wikitext">{{userbox
| border-c = #afa
| border-s = 2
| id = foo logo
| id-c = #ffe
| id-lh = 1.1em
| id-s = 14
| info = foo bar
| info-c = #fef
| info-op = font-family: 'Courier New', monospace; text-decoration: wavy overline green;
| info-s = 14
}}</syntaxhighlight> || colspan="2"| {{Userbox|id=foo logo|id-s=14|id-lh=1.1em|id-c=#ffe|info=foo bar|info-c=#fef|info-s=14|border-c=#afa|border-s=2}} <br style="clear:both"> <br /> {{Userbox|id=foo logo|id-s=14|id-lh=1.1em|id-c=#ffe|info=foo bar|info-c=#fef|info-s=14|info-op=font-family: 'Courier New', monospace; text-decoration: wavy overline green;|border-c=#afa|border-s=2}}
|}
==Microformats==
; bodyclass : This parameter is inserted into the "class" attribute for the userbox as a whole.
; info-class : This parameter is inserted into the "class" attribute for the info component.
This template supports the addition of [[microformat]] information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. To flag a userbox as containing [[hCard]] information about a person, for example, add the following parameter:
<syntaxhighlight lang="wikitext">
| bodyclass = vcard
</syntaxhighlight>
''or''
<syntaxhighlight lang="wikitext">
| info-class = vcard
</syntaxhighlight>
''then'' (for example):
<syntaxhighlight lang="wikitext"><nowiki>
| title = …the books of <span class="fn">[[Iain Banks]]</span>
</nowiki></syntaxhighlight>
...and so forth.
Examples include:
* <code>{{tlu|User:UBX/Iain Banks}}</code> - person
* {{tlx|User Microformats}} - group (WikiProject Microformats)
* {{tlx|User Brum}} - place (Birmingham)
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia.
== Template Data ==
{{TemplateData header}}
<TemplateData>{
"description": "This template can be used to quickly create a userbox for display on a user's user page without having to know HTML or Wikitable syntax.",
"params": {
"bodyclass": {
"label": "Body class",
"description": "Adds an HTML class attribute to the entire template's HTML table, to allow for styling, emission of microformats, etc.",
"type": "string",
"required": false
},
"border-c": {
"label": "Border color",
"description": "Color of the outer border",
"type": "string",
"default": "#999",
"required": false,
"aliases": [
"border-color"
]
},
"border-s": {
"label": "Border width",
"description": "border width in pixels",
"type": "number",
"default": "1",
"required": false,
"aliases": [
"border-width"
]
},
"float": {
"label": "Float",
"description": "left|right|none",
"type": "string",
"default": "left",
"required": false,
"suggestedvalues": [
"left",
"right",
"none"
]
},
"id": {
"label": "Logo",
"description": "id image or text",
"type": "content",
"required": false,
"aliases": [
"3",
"logo"
],
"suggested": true
},
"id-a": {
"label": "Logo content horizontal alignment",
"description": "Horizontal alignment of logo content; left/center/right/justify",
"type": "string",
"default": "center",
"required": false,
"suggestedvalues": [
"left",
"center",
"right",
"justify"
]
},
"id-c": {
"label": "id-c",
"description": "Two-in-one alias for border color and logo background color. Lower priority than border-c and logo-background",
"type": "string",
"required": false,
"aliases": [
"1"
],
"example": "#d0d0d0"
},
"id-fc": {
"label": "Logo font color",
"description": "Logo font color; if not specified, defaults to info font color",
"type": "string",
"default": "black",
"required": false,
"aliases": [
"logo-color"
]
},
"id-h": {
"label": "Logo height",
"description": "Logo box height in pixels",
"type": "number",
"default": "45",
"required": false,
"aliases": [
"logo-height"
]
},
"id-lh": {
"label": "Logo line height",
"description": "Logo line height",
"type": "string",
"default": "1.25em",
"required": false,
"aliases": [
"logo-line-height"
]
},
"id-op": {
"label": "Extra logo styling",
"description": "Add additional arbitrary CSS styling to the logo",
"type": "string",
"required": false,
"aliases": [
"logo-other-param"
],
"example": "opacity: 0.25"
},
"id-p": {
"label": "Logo padding",
"description": "Logo cell padding",
"type": "string",
"default": "0 1px 0 0",
"required": false,
"aliases": [
"logo-padding"
]
},
"id-s": {
"label": "Logo font size",
"description": "Logo text size in points",
"type": "string",
"default": "14",
"required": false,
"aliases": [
"5",
"logo-size"
]
},
"id-w": {
"label": "Logo width",
"description": "id box width in pixels",
"type": "number",
"default": "45",
"required": false,
"aliases": [
"logo-width"
]
},
"info-class": {
"label": "Info CSS classes",
"description": "Adds an HTML class attribute to the \"info\" HTML table-row, to allow for styling, emission of microformats, etc.",
"type": "string",
"required": false
},
"info": {
"label": "Info",
"description": "info text or image",
"type": "content",
"required": true,
"aliases": [
"4"
]
},
"info-a": {
"label": "Info content horizontal alignment",
"description": "Horizontal alignment of info content; left/center/right/justify",
"type": "string",
"default": "left",
"required": false,
"suggestedvalues": [
"left",
"center",
"right",
"justify"
]
},
"info-c": {
"label": "Info background color",
"description": "Info background color",
"type": "string",
"default": "#e0e0e0",
"required": false,
"aliases": [
"2",
"info-background"
]
},
"info-fc": {
"label": "Info font color",
"description": "info font color",
"type": "string",
"default": "black",
"required": false,
"aliases": [
"info-color"
]
},
"info-lh": {
"label": "Info line height",
"description": "Info line height",
"type": "string",
"default": "1.25em",
"required": false,
"aliases": [
"info-line-height"
]
},
"info-op": {
"label": "Extra info styling",
"description": "Add additional arbitrary CSS styling to the info",
"type": "string",
"required": false,
"aliases": [
"info-other-param"
],
"example": "opacity: 0.25"
},
"info-p": {
"label": "Info padding",
"description": "info padding",
"type": "string",
"default": "0 4px 0 4px",
"required": false,
"aliases": [
"info-padding"
]
},
"info-s": {
"label": "Info font size",
"description": "info text size in points",
"type": "number",
"default": "8",
"required": false,
"aliases": [
"info-size"
]
},
"nocat": {
"label": "nocat",
"description": "block page category declarations (see WP:NOCAT)",
"type": "string",
"default": "false",
"required": false
},
"usercategory": {
"label": "usercategory",
"description": "user category (optional)",
"type": "string",
"required": false
},
"usercategory2": {
"label": "usercategory2",
"description": "user category (optional)",
"type": "string",
"required": false
},
"usercategory3": {
"label": "usercategory3",
"description": "user category (optional)",
"type": "string",
"required": false
},
"usercategory4": {
"label": "usercategory4",
"description": "user category (optional)",
"type": "string",
"required": false
},
"usercategory5": {
"label": "usercategory5",
"description": "user category (optional)",
"type": "string",
"required": false
},
"logo-background": {
"label": "Logo background color",
"description": "Background color of logo",
"type": "string",
"default": "#ddd"
},
"id-class": {
"label": "Logo CSS classes",
"description": "CSS class or classes for the logo; optional",
"type": "string",
"default": "(none)"
}
},
"format": "block",
"paramOrder": [
"bodyclass",
"float",
"border-c",
"border-s",
"id",
"id-a",
"logo-background",
"id-c",
"id-fc",
"id-h",
"id-s",
"id-lh",
"id-p",
"id-w",
"id-class",
"id-op",
"info",
"info-a",
"info-c",
"info-fc",
"info-lh",
"info-p",
"info-s",
"info-class",
"info-op",
"nocat",
"usercategory",
"usercategory2",
"usercategory3",
"usercategory4",
"usercategory5"
]
}</TemplateData>
==See also==
{{UBT}}
<includeonly>{{Sandbox other||
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Userboxes|*]]
[[Category:User namespace templates]]
[[Category:Wikipedia metatemplates]]
}}</includeonly>
3b4eea4f8fc3ef69464386f3c3e9a0e08f76f0f6
Template:Tick
10
97
289
2023-06-27T05:39:15Z
wikipedia>Jonesey95
0
Fix [[Special:LintErrors|Linter]] errors. (bogus image options). strip trailing "px" off size parameter if present
wikitext
text/x-wiki
[[{{ safesubst:<noinclude/>#switch:{{ safesubst:<noinclude/>lc:{{{color|{{{colour|}}}}}} }}
|green |grn |gn =File:Yes check.svg
|lightgreen |lgreen |lgrn |lgn =File:Light green check.svg
|red |rd |r =File:Red check.svg
|darkred |dkred |drd |dr =File:Check-188-25-49-red.svg
|pink |pnk |pk =File:Pink check.svg
|orange |or |o =File:Check.svg
|yellow |yel |y =File:Yellow check.svg
|black |blk |k =File:Black check.svg
|blue |blu |u =File:Check-blue.svg
|lightblue |lblue |lblu |lb =File:Cornflower blue check.svg
|cyan |cy |c =File:B-check.svg
|purple |pur |pu =File:Purple check.svg
|grey |gray |gry |gy =File:SemiTransBlack v.svg
|brown |brn |bn =File:Brown check.svg
<!--default--> |File:Yes check.svg
}}|{{ safesubst:<noinclude/>#if:{{{1|}}}|{{Str number/trim|{{{1}}}}}|20}}px|link=|alt={{#if:{{{alt|}}}|{{{alt}}}|check}}]]<span style="display:none">Y</span><!--template:tick--><noinclude>
{{documentation}}
</noinclude>
2a5da56c38689fc7e1a8ccfd7a51892df49d6253
Template:Polparty
10
216
534
2023-06-30T16:59:55Z
wikipedia>Paine Ellsworth
0
per edit request on talk page - remove duplicate "NL"
wikitext
text/x-wiki
{{#switch: {{ucfirst:{{{1}}}}}
| AT | Austria | [[Austria]] = {{#switch: {{uc:{{{2}}}}}
| SPÖ = [[Social Democratic Party of Austria|SPÖ]]
| ÖVP = [[Austrian People's Party|ÖVP]]
| FPÖ = [[Freedom Party of Austria|FPÖ]]
| BZÖ = [[Alliance for the Future of Austria|BZÖ]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Greens | Grün | Grüne = [[The Greens – The Green Alternative|Green]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| AU | Australia | [[Australia]] = {{#switch: {{uc:{{{2}}}}}
| ALP = [[Australian Labor Party|ALP]]
| CLP = [[Country Liberal Party|CLP]]
| LP = [[Liberal Party of Australia|Lib.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Democrats | Dem = [[Australian Democrats|Dem.]]
| Greens | Green = [[Australian Greens|Greens]]
| Labor | Lab = [[Australian Labor Party|ALP]]
| Liberal | Lib = [[Liberal Party of Australia|Lib.]]
| National | Nat = [[National Party of Australia|Nat.]]
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| CA | Canada | [[Canada]] = {{#switch: {{uc:{{{2}}}}}
| BQ = [[Bloc Québécois|BQ]]
| CPC = [[Conservative Party of Canada|CPC]]
| LPC = [[Liberal Party of Canada|LPC]]
| NDP = [[New Democratic Party|NDP]]
| GPC = [[Green Party of Canada|Green]]
| FPNP = [[First Peoples National Party of Canada|FPNP]]
| CHP = [[Christian Heritage Party of Canada|CHP]]
| WBP = [[Western Block Party|WBP]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| CZ | Czechia | [[Czechia]] | [[Czech Republic]] | Czech Republic = {{#switch: {{uc:{{{2}}}}}
| ODS = [[Civic Democratic Party (Czech Republic)|ODS]]
| CSSD = [[Czech Social Democratic Party|ČSSD]]
| KSCM = [[Communist Party of Bohemia and Moravia|KSČM]]
| KDU-CSL = [[Christian and Democratic Union – Czechoslovak People's Party|KDU-ČSL]]
| ANO = [[ANO 2011|ANO]]
| TOP09 = [[TOP 09]]
| STAN = [[Mayors and Independents|STAN]]
| Pirati = [[Czech Pirate Party|Piráti]]
| SPD = [[Freedom and Direct Democracy|SPD]]
| SZ = [[Green Party (Czech Republic)|Greens]]
| US-DEU = [[Freedom Union–Democratic Union|US-DEU]]
| LIRA = [[Liberal Reform Party|LIRA]]
| SNK = [[SNK European Democrats|SNK ED]]
| NEZDEM = [[Independent Democrats (Czech Republic)|Ind. Dem.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| DE | Germany | [[Germany]] = {{#switch: {{uc:{{{2}}}}}
| CDU = [[Christian Democratic Union of Germany|CDU]]
| CSU = [[Christian Social Union in Bavaria|CSU]]
| SPD = [[Social Democratic Party of Germany|SPD]]
| FDP = [[Free Democratic Party (Germany)|FDP]]
| PDS = [[The Left (Germany)|Left]]
| FW |FWG = [[Free Voters|FW]]
| DDP = [[German Democratic Party|DDP]]
| NS | NSDAP = [[Nazi Party|NSDAP]]
| ODP | ÖDP = [[Ecological Democratic Party|ÖDP]]
| AfD | AFD = [[Alternative for Germany|AfD]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Left | Linke | The Left = [[The Left (Germany)|Left]]
| Green | Greens | Grün | Grüne | Bündnis 90/Die Grünen = [[Alliance 90/The Greens|Greens]]
| Freie Wähler | Freie wähler = [[Free Voters|FW]]
| Centre | Zentrum = [[Centre Party (Germany)|Centre]]
| Volt = [[Volt Germany|Volt]]
| PARTEI = [[die PARTEI|PARTEI]]
| Pirates | Piraten = [[Pirate Party Germany|Pirates]]
| Nazi = [[Nazi Party|NSDAP]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| NL | Netherlands | [[Netherlands]] | The Netherlands | [[The Netherlands]] | Holland = {{#switch: {{uc:{{{2}}}}}
| CDA = [[Christian Democratic Appeal|CDA]]
| CU = [[ChristianUnion|CU]]
| D66 = [[Democrats 66|D66]]
| GL = [[GreenLeft|GL]]
| PVV = [[Party for Freedom|PVV]]
| SGP = [[Reformed Political Party|SGP]]
| SP = [[Socialist Party (Netherlands)|SP]]
| VVD = [[People's Party for Freedom and Democracy|VVD]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Groen = [[GreenLeft|GL]]
| PvdA | Pvda = [[Labour Party (Netherlands)|PvdA]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| CH | Switzerland | [[Switzerland]] = {{#switch: {{uc:{{{2}}}}}
| FDP | PRD | RAD | FDP/PRD = [[Free Democratic Party of Switzerland|FDP/PRD]]
| PLR = [[Free Democratic Party of Switzerland|FDP/PRD/PLR]]
| PLC = [[Free Democratic Party of Switzerland|FDP/PRD/PLC]]
| SPS | PSS | SP | PS | SP/PS | SPS/PSS | SOC = [[Social Democratic Party of Switzerland|SPS/PSS]]
| SVP | UDC | SVP/UDC = [[Swiss People's Party|SVP/UDC]]
| PPS = [[Swiss People's Party|SVP/UDC/PPS]]
| CVP | PDC | CVP/PDC = [[Christian Democratic People's Party of Switzerland|CVP/PDC]]
| PPD = [[Christian Democratic People's Party of Switzerland|CVP/PDC/PPD]]
| PCD = [[Christian Democratic People's Party of Switzerland|CVP/PDC/PCD]]
| GPS | PES = [[Green Party of Switzerland|GPS/PES]]
| GLP = [[Green Liberal Party of Switzerland|GLP]]
| PLS | LPS | LIB = [[Liberal Party of Switzerland|LPS/PLS]]
| EVP | PEV = [[Evangelical People's Party of Switzerland|EVP/PEV]]
| Ticino League | Lega = [[Ticino League]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green = [[Green Party of Switzerland|GPS]]
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = [[List of political parties in Switzerland|{{{2}}}]] }}
}}
| RO | Romania | [[Romania]] = {{#switch: {{uc:{{{2}}}}}
| PSD = [[Social Democratic Party (Romania)|PSD]]
| PNL = [[National Liberal Party (Romania)|PNL]]
| UDMR | RMDSZ = [[Democratic Alliance of Hungarians in Romania|UDMR]]
| PNȚ-CD | PNT-CD = [[Christian Democratic National Peasants' Party|PNȚ-CD]]
| ALDE = [[Alliance of Liberals and Democrats (Romania)|ALDE]]
| PDL = [[Democratic Liberal Party (Romania)|PDL]]
| FDGR = [[Democratic Forum of Germans in Romania|FDGR]]
| PD = [[Democratic Party (Romania)|PD]]
| PCM | MPP | HCP = [[Hungarian Civic Party (Romania)|PCM]]
| PND = [[National Democratic Party (Romania)|PND]]
| PRM = [[Greater Romania Party|PRM]]
| USL = [[Social Liberal Union|USL]]
| PMP = [[People's Movement Party|PMP]]
| UNPR = [[National Union for the Progress of Romania|UNPR]]
| PPMT | EMNP = [[Hungarian People's Party of Transylvania|PPMT]]
| PC = [[Conservative Party (Romania)|PC]]
| PER = [[Ecologist Party of Romania|PER]]
| PSRO = [[Romanian Social Party|PSRO]]
| PRO = [[PRO Romania|PRO]]
| PLUS = [[Freedom, Unity and Solidarity Party|PLUS]]
| USR = [[Save Romania Union|USR]]
| USR PLUS = [[USR PLUS]]
| AD = [[The Right Alternative|AD]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| TR | Turkey | [[Turkey]] = {{#switch: {{uc:{{{2}}}}}
| AKP = [[Justice and Development Party (Turkey)|AKP]]
| CHP = [[Republican People's Party|CHP]]
| HDP = [[Peoples' Democratic Party (Turkey)|HDP]]
| MHP = [[Nationalist Movement Party|MHP]]
| İYİ | IYI = [[Good Party|İYİ]]
| SP = [[Felicity Party|SP]]
| TKP = [[Communist Party of Turkey (modern)|TKP]]
| BBP = [[Great Unity Party|BBP]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| US | United States | [[United States]] | USA | [[USA]] = {{#switch: {{uc:{{{2}}}}}
| D = [[Democratic Party (United States)|D]]
| R = [[Republican Party (United States)|R]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Democrat = [[Democratic Party (United States)|D]]
| Republican = [[Republican Party (United States)|R]]
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| ZA | South Africa | [[South Africa]] = {{#switch: {{uc:{{{2}}}}}
| ANC | African National Congress = [[African National Congress|ANC]]
| DA | Democratic Alliance = [[Democratic Alliance (South Africa)|DA]]
| IFP | Inkatha Freedom Party = [[Inkatha Freedom Party|IFP]]
| NFP | National Freedom Party = [[National Freedom Party|NFP]]
| COPE | Congress of the People = [[Congress of the People (South African political party)|COPE]]
| FF+ | Freedom Front Plus = [[Freedom Front Plus]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Greens | Grün | Grüne = [[The Greens – The Green Alternative|Green]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| Independent | [[Independent]] | Ind | Ind. | Neutral = [[Independent politician|Ind.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2|{{{1|}}}}}} }}
}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
24a6705d4a914d795e49dc847104481597d47019
Template:Italics correction
10
284
682
2023-07-03T21:20:48Z
wikipedia>Quondum
0
Undoing "font-style:italic" change: this is explicitly not supposed to be part of the template function (see template documentation) and creates double italics; which is highly undesirable since this is in many articles
wikitext
text/x-wiki
<span style="padding-right:0.15em;">{{{1}}}</span><noinclude>
{{Documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKI LINK ON THE DOCUMENTATION PAGE. -->
</noinclude>
e03ce33da89b58bc1b12b6ecfe93700d98be1ab5
Module:Location map
828
203
506
2023-07-04T08:09:33Z
wikipedia>TheDJ
0
Avoid resizing on mobile skin and make scrollable instead
Scribunto
text/plain
require('strict')
local p = {}
local getArgs = require('Module:Arguments').getArgs
local function round(n, decimals)
local pow = 10^(decimals or 0)
return math.floor(n * pow + 0.5) / pow
end
function p.getMapParams(map, frame)
if not map then
error('The name of the location map definition to use must be specified', 2)
end
local moduletitle = mw.title.new('Module:Location map/data/' .. map)
if not moduletitle then
error(string.format('%q is not a valid name for a location map definition', map), 2)
elseif moduletitle.exists then
local mapData = mw.loadData('Module:Location map/data/' .. map)
return function(name, params)
if name == nil then
return 'Module:Location map/data/' .. map
elseif mapData[name] == nil then
return ''
elseif params then
return mw.message.newRawMessage(tostring(mapData[name]), unpack(params)):plain()
else
return mapData[name]
end
end
else
error('Unable to find the specified location map definition: "Module:Location map/data/' .. map .. '" does not exist', 2)
end
end
function p.data(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local params = {}
for k,v in ipairs(args) do
if k > 2 then
params[k-2] = v
end
end
return map(args[2], #params ~= 0 and params)
end
local hemisphereMultipliers = {
longitude = { W = -1, w = -1, E = 1, e = 1 },
latitude = { S = -1, s = -1, N = 1, n = 1 }
}
local function decdeg(degrees, minutes, seconds, hemisphere, decimal, direction)
if decimal then
if degrees then
error('Decimal and DMS degrees cannot both be provided for ' .. direction, 2)
elseif minutes then
error('Minutes can only be provided with DMS degrees for ' .. direction, 2)
elseif seconds then
error('Seconds can only be provided with DMS degrees for ' .. direction, 2)
elseif hemisphere then
error('A hemisphere can only be provided with DMS degrees for ' .. direction, 2)
end
local retval = tonumber(decimal)
if retval then
return retval
end
error('The value "' .. decimal .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not minutes then
error('Seconds were provided for ' .. direction .. ' without minutes also being provided', 2)
elseif not degrees then
if minutes then
error('Minutes were provided for ' .. direction .. ' without degrees also being provided', 2)
elseif hemisphere then
error('A hemisphere was provided for ' .. direction .. ' without degrees also being provided', 2)
end
return nil
end
decimal = tonumber(degrees)
if not decimal then
error('The degree value "' .. degrees .. '" provided for ' .. direction .. ' is not valid', 2)
elseif minutes and not tonumber(minutes) then
error('The minute value "' .. minutes .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not tonumber(seconds) then
error('The second value "' .. seconds .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal + (minutes or 0)/60 + (seconds or 0)/3600
if hemisphere then
local multiplier = hemisphereMultipliers[direction][hemisphere]
if not multiplier then
error('The hemisphere "' .. hemisphere .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal * multiplier
end
return decimal
end
-- Finds a parameter in a transclusion of {{Coord}}.
local function coord2text(para,coord) -- this should be changed for languages which do not use Arabic numerals or the degree sign
local lat, long = mw.ustring.match(coord,'<span class="p%-latitude latitude">([^<]+)</span><span class="p%-longitude longitude">([^<]+)</span>')
if lat then
return tonumber(para == 'longitude' and long or lat)
end
local result = mw.text.split(mw.ustring.match(coord,'%-?[%.%d]+°[NS] %-?[%.%d]+°[EW]') or '', '[ °]')
if para == 'longitude' then result = {result[3], result[4]} end
if not tonumber(result[1]) or not result[2] then
mw.log('Malformed coordinates value')
mw.logObject(para, 'para')
mw.logObject(coord, 'coord')
return error('Malformed coordinates value', 2)
end
return tonumber(result[1]) * hemisphereMultipliers[para][result[2]]
end
-- effectively make removeBlanks false for caption and maplink, and true for everything else
-- if useWikidata is present but blank, convert it to false instead of nil
-- p.top, p.bottom, and their callers need to use this
function p.valueFunc(key, value)
if value then
value = mw.text.trim(value)
end
if value ~= '' or key == 'caption' or key == 'maplink' then
return value
elseif key == 'useWikidata' then
return false
end
end
local function getContainerImage(args, map)
if args.AlternativeMap then
return args.AlternativeMap
elseif args.relief and map('image1') ~= '' then
return map('image1')
else
return map('image')
end
end
function p.top(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local width
local default_as_number = tonumber(mw.ustring.match(tostring(args.default_width),"%d*"))
if not args.width then
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
elseif mw.ustring.sub(args.width, -2) == 'px' then
width = mw.ustring.sub(args.width, 1, -3)
else
width = args.width
end
local width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
if width_as_number == 0 then
-- check to see if width is junk. If it is, then use default calculation
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
end
if args.max_width ~= "" and args.max_width ~= nil then
-- check to see if width bigger than max_width
local max_as_number = tonumber(mw.ustring.match(args.max_width,"%d*")) or 0;
if width_as_number>max_as_number and max_as_number>0 then
width = args.max_width;
end
end
local retval = frame:extensionTag{name = 'templatestyles', args = {src = 'Module:Location map/styles.css'}}
if args.float == 'center' then
retval = retval .. '<div class="center">'
end
if args.caption and args.caption ~= '' and args.border ~= 'infobox' then
retval = retval .. '<div class="locmap noviewer noresize thumb '
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'tleft'
elseif args.float == '"center"' or args.float == 'center' or args.float == '"none"' or args.float == 'none' then
retval = retval .. 'tnone'
else
retval = retval .. 'tright'
end
retval = retval .. '"><div class="thumbinner" style="width:' .. (width + 2) .. 'px'
if args.border == 'none' then
retval = retval .. ';border:none'
elseif args.border then
retval = retval .. ';border-color:' .. args.border
end
retval = retval .. '"><div style="position:relative;width:' .. width .. 'px' .. (args.border ~= 'none' and ';border:1px solid lightgray">' or '">')
else
retval = retval .. '<div class="locmap" style="width:' .. width .. 'px;'
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'float:left;clear:left'
elseif args.float == '"center"' or args.float == 'center' then
retval = retval .. 'float:none;clear:both;margin-left:auto;margin-right:auto'
elseif args.float == '"none"' or args.float == 'none' then
retval = retval .. 'float:none;clear:none'
else
retval = retval .. 'float:right;clear:right'
end
retval = retval .. '"><div style="width:' .. width .. 'px;padding:0"><div style="position:relative;width:' .. width .. 'px">'
end
local image = getContainerImage(args, map)
local currentTitle = mw.title.getCurrentTitle()
retval = string.format(
'%s[[File:%s|%spx|%s%s|class=notpageimage]]',
retval,
image,
width,
args.alt or ((args.label or currentTitle.text) .. ' is located in ' .. map('name')),
args.maplink and ('|link=' .. args.maplink) or ''
)
if args.caption and args.caption ~= '' then
if (currentTitle.namespace == 0) and mw.ustring.find(args.caption, '##') then
retval = retval .. '[[Category:Pages using location map with a double number sign in the caption]]'
end
end
if args.overlay_image then
return retval .. '<div style="position:absolute;top:0;left:0">[[File:' .. args.overlay_image .. '|' .. width .. 'px|class=notpageimage]]</div>'
else
return retval
end
end
function p.bottom(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local retval = '</div>'
local currentTitle = mw.title.getCurrentTitle()
if not args.caption or args.border == 'infobox' then
if args.border then
retval = retval .. '<div style="padding-top:0.2em">'
else
retval = retval .. '<div style="font-size:91%;padding-top:3px">'
end
retval = retval
.. (args.caption or (args.label or currentTitle.text) .. ' (' .. map('name') .. ')')
.. '</div>'
elseif args.caption ~= '' then
-- This is not the pipe trick. We're creating a link with no text on purpose, so that CSS can give us a nice image
retval = retval .. '<div class="thumbcaption"><div class="magnify">[[:File:' .. getContainerImage(args, map) .. '|class=notpageimage| ]]</div>' .. args.caption .. '</div>'
end
if args.switcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">' .. args.switcherLabel .. '</span>'
elseif args.autoSwitcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">Show map of ' .. map('name') .. '</span>'
end
retval = retval .. '</div></div>'
if args.caption_undefined then
mw.log('Removed parameter caption_undefined used.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with removed parameters|caption_undefined]]'
end
end
if map('skew') ~= '' or map('lat_skew') ~= '' or map('crosses180') ~= '' or map('type') ~= '' then
mw.log('Removed parameter used in map definition ' .. map())
if currentTitle.namespace == 0 then
local key = (map('skew') ~= '' and 'skew' or '') ..
(map('lat_skew') ~= '' and 'lat_skew' or '') ..
(map('crosses180') ~= '' and 'crosses180' or '') ..
(map('type') ~= '' and 'type' or '')
retval = retval .. '[[Category:Location maps with removed parameters|' .. key .. ' ]]'
end
end
if string.find(map('name'), '|', 1, true) then
mw.log('Pipe used in name of map definition ' .. map())
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with a name containing a pipe]]'
end
end
if args.float == 'center' then
retval = retval .. '</div>'
end
return retval
end
local function markOuterDiv(x, y, imageDiv, labelDiv)
return mw.html.create('div')
:addClass('od')
:cssText('top:' .. round(y, 3) .. '%;left:' .. round(x, 3) .. '%')
:node(imageDiv)
:node(labelDiv)
end
local function markImageDiv(mark, marksize, label, link, alt, title)
local builder = mw.html.create('div')
:addClass('id')
:cssText('left:-' .. round(marksize / 2) .. 'px;top:-' .. round(marksize / 2) .. 'px')
:attr('title', title)
if marksize ~= 0 then
builder:wikitext(string.format(
'[[File:%s|%dx%dpx|%s|link=%s%s|class=notpageimage]]',
mark,
marksize,
marksize,
label,
link,
alt and ('|alt=' .. alt) or ''
))
end
return builder
end
local function markLabelDiv(label, label_size, label_width, position, background, x, marksize)
if tonumber(label_size) == 0 then
return mw.html.create('div'):addClass('l0'):wikitext(label)
end
local builder = mw.html.create('div')
:cssText('font-size:' .. label_size .. '%;width:' .. label_width .. 'em')
local distance = round(marksize / 2 + 1)
if position == 'top' then -- specified top
builder:addClass('pv'):cssText('bottom:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em')
elseif position == 'bottom' then -- specified bottom
builder:addClass('pv'):cssText('top:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em')
elseif position == 'left' or (tonumber(x) > 70 and position ~= 'right') then -- specified left or autodetected to left
builder:addClass('pl'):cssText('right:' .. distance .. 'px')
else -- specified right or autodetected to right
builder:addClass('pr'):cssText('left:' .. distance .. 'px')
end
builder = builder:tag('div')
:wikitext(label)
if background then
builder:cssText('background-color:' .. background)
end
return builder:done()
end
local function getX(longitude, left, right)
local width = (right - left) % 360
if width == 0 then
width = 360
end
local distanceFromLeft = (longitude - left) % 360
-- the distance needed past the map to the right equals distanceFromLeft - width. the distance needed past the map to the left equals 360 - distanceFromLeft. to minimize page stretching, go whichever way is shorter
if distanceFromLeft - width / 2 >= 180 then
distanceFromLeft = distanceFromLeft - 360
end
return 100 * distanceFromLeft / width
end
local function getY(latitude, top, bottom)
return 100 * (top - latitude) / (top - bottom)
end
function p.mark(frame, args, map)
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map~'})
end
local mapnames = {}
if not map then
if args[1] then
map = {}
for mapname in mw.text.gsplit(args[1], '#', true) do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
mapnames[#mapnames + 1] = mapname
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
args[1] = 'World'
end
end
if type(map) == 'table' then
local outputs = {}
local oldargs = args[1]
for k,v in ipairs(map) do
args[1] = mapnames[k]
outputs[k] = tostring(p.mark(frame, args, v))
end
args[1] = oldargs
return table.concat(outputs, '#PlaceList#') .. '#PlaceList#'
end
local x, y, longitude, latitude
longitude = decdeg(args.lon_deg, args.lon_min, args.lon_sec, args.lon_dir, args.long, 'longitude')
latitude = decdeg(args.lat_deg, args.lat_min, args.lat_sec, args.lat_dir, args.lat, 'latitude')
if args.excludefrom then
-- If this mark is to be excluded from certain maps entirely (useful in the context of multiple maps)
for exclusionmap in mw.text.gsplit(args.excludefrom, '#', true) do
-- Check if this map is excluded. If so, return an empty string.
if args[1] == exclusionmap then
return ''
end
end
end
local builder = mw.html.create()
local currentTitle = mw.title.getCurrentTitle()
if args.coordinates then
-- Temporarily removed to facilitate infobox conversion. See [[Wikipedia:Coordinates in infoboxes]]
-- if longitude or latitude then
-- error('Coordinates from [[Module:Coordinates]] and individual coordinates cannot both be provided')
-- end
longitude = coord2text('longitude', args.coordinates)
latitude = coord2text('latitude', args.coordinates)
elseif not longitude and not latitude and args.useWikidata then
-- If they didn't provide either coordinate, try Wikidata. If they provided one but not the other, don't.
local entity = mw.wikibase.getEntity()
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1].mainsnak.snaktype == 'value' then
local value = entity.claims.P625[1].mainsnak.datavalue.value
longitude, latitude = value.longitude, value.latitude
end
if args.link and (currentTitle.namespace == 0) then
builder:wikitext('[[Category:Location maps with linked markers with coordinates from Wikidata]]')
end
end
if not longitude then
error('No value was provided for longitude')
elseif not latitude then
error('No value was provided for latitude')
end
if currentTitle.namespace > 0 then
if (not args.lon_deg) ~= (not args.lat_deg) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Degrees]]')
elseif (not args.lon_min) ~= (not args.lat_min) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Minutes]]')
elseif (not args.lon_sec) ~= (not args.lat_sec) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Seconds]]')
elseif (not args.lon_dir) ~= (not args.lat_dir) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Hemisphere]]')
elseif (not args.long) ~= (not args.lat) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Decimal]]')
end
end
if ((tonumber(args.lat_deg) or 0) < 0) and ((tonumber(args.lat_min) or 0) ~= 0 or (tonumber(args.lat_sec) or 0) ~= 0 or (args.lat_dir and args.lat_dir ~='')) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if ((tonumber(args.lon_deg) or 0) < 0) and ((tonumber(args.lon_min) or 0) ~= 0 or (tonumber(args.lon_sec) or 0) ~= 0 or (args.lon_dir and args.lon_dir ~= '')) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if (((tonumber(args.lat_min) or 0) < 0) or ((tonumber(args.lat_sec) or 0) < 0)) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if (((tonumber(args.lon_min) or 0) < 0) or ((tonumber(args.lon_sec) or 0) < 0)) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if args.skew or args.lon_shift or args.markhigh then
mw.log('Removed parameter used in invocation.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
local key = (args.skew and 'skew' or '') ..
(args.lon_shift and 'lon_shift' or '') ..
(args.markhigh and 'markhigh' or '')
builder:wikitext('[[Category:Location maps with removed parameters|' .. key ..' ]]')
end
end
if map('x') ~= '' then
x = tonumber(mw.ext.ParserFunctions.expr(map('x', { latitude, longitude })))
else
x = tonumber(getX(longitude, map('left'), map('right')))
end
if map('y') ~= '' then
y = tonumber(mw.ext.ParserFunctions.expr(map('y', { latitude, longitude })))
else
y = tonumber(getY(latitude, map('top'), map('bottom')))
end
if (x < 0 or x > 100 or y < 0 or y > 100) and not args.outside then
mw.log('Mark placed outside map boundaries without outside flag set. x = ' .. x .. ', y = ' .. y)
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
local key = currentTitle.prefixedText
builder:wikitext('[[Category:Location maps with marks outside map and outside parameter not set|' .. key .. ' ]]')
end
end
local mark = args.mark or map('mark')
if mark == '' then
mark = 'Red pog.svg'
end
local marksize = tonumber(args.marksize) or tonumber(map('marksize')) or 8
local imageDiv = markImageDiv(mark, marksize, args.label or mw.title.getCurrentTitle().text, args.link or '', args.alt, args[2])
local labelDiv
if args.label and args.position ~= 'none' then
labelDiv = markLabelDiv(args.label, args.label_size or 91, args.label_width or 6, args.position, args.background, x, marksize)
end
return builder:node(markOuterDiv(x, y, imageDiv, labelDiv))
end
local function switcherSeparate(s)
if s == nil then return {} end
local retval = {}
for i in string.gmatch(s .. '#', '([^#]*)#') do
i = mw.text.trim(i)
retval[#retval + 1] = (i ~= '' and i)
end
return retval
end
function p.main(frame, args, map)
local caption_list = {}
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map', valueFunc = p.valueFunc})
end
if args.useWikidata == nil then
args.useWikidata = true
end
if not map then
if args[1] then
map = {}
for mapname in string.gmatch(args[1], '[^#]+') do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
end
if args['caption'] then
if args['caption'] == "" then
while #caption_list < #map do
caption_list[#caption_list + 1] = args['caption']
end
else
for caption in mw.text.gsplit(args['caption'], '##', true) do
caption_list[#caption_list + 1] = caption
end
end
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
end
end
if type(map) == 'table' then
local altmaps = switcherSeparate(args.AlternativeMap)
if #altmaps > #map then
error(string.format('%d AlternativeMaps were provided, but only %d maps were provided', #altmaps, #map))
end
local overlays = switcherSeparate(args.overlay_image)
if #overlays > #map then
error(string.format('%d overlay_images were provided, but only %d maps were provided', #overlays, #map))
end
if #caption_list > #map then
error(string.format('%d captions were provided, but only %d maps were provided', #caption_list, #map))
end
local outputs = {}
args.autoSwitcherLabel = true
for k,v in ipairs(map) do
args.AlternativeMap = altmaps[k]
args.overlay_image = overlays[k]
args.caption = caption_list[k]
outputs[k] = p.main(frame, args, v)
end
return '<div class="switcher-container">' .. table.concat(outputs) .. '</div>'
else
return p.top(frame, args, map) .. tostring( p.mark(frame, args, map) ) .. p.bottom(frame, args, map)
end
end
return p
7291f35931f7e18eb3de0e5668f94abf73d34135
Module:Parameter names example
828
81
251
2023-07-10T09:41:44Z
wikipedia>Gonnym
0
if these are wanted, they should be handled differently (by passing a parameter to this module) as these cause pages to appear as unknown parameters for templates that don't use them
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
--targs['nocat'] = 'yes';
--targs['categories'] = 'no';
--targs['demo'] = 'yes';
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
fdf94fb7a5dc1fabf118d60488a02f1e65b0df24
Module:Collapsible list
828
209
518
2023-07-13T14:29:43Z
wikipedia>Frietjes
0
we don't need to track this anymore after it was all cleaned up back in [[Template_talk:Collapsible_list/Archive_1#titlestyle_again|2018 to 2019]]
Scribunto
text/plain
local p = {}
local function getListItem( data )
if not type( data ) == 'string' then
return ''
end
return mw.ustring.format( '<li style="line-height: inherit; margin: 0">%s</li>', data )
end
-- Returns an array containing the keys of all positional arguments
-- that contain data (i.e. non-whitespace values).
local function getArgNums( args )
local nums = {}
for k, v in pairs( args ) do
if type( k ) == 'number' and
k >= 1 and
math.floor( k ) == k and
type( v ) == 'string' and
mw.ustring.match( v, '%S' ) then
table.insert( nums, k )
end
end
table.sort( nums )
return nums
end
-- Formats a list of classes, styles or other attributes.
local function formatAttributes( attrType, ... )
local attributes = { ... }
local nums = getArgNums( attributes )
local t = {}
for i, num in ipairs( nums ) do
table.insert( t, attributes[ num ] )
end
if #t == 0 then
return '' -- Return the blank string so concatenation will work.
end
return mw.ustring.format( ' %s="%s"', attrType, table.concat( t, ' ' ) )
end
-- TODO: use Module:List. Since the update for this comment is routine,
-- this is blocked without a consensus discussion by
-- [[MediaWiki_talk:Common.css/Archive_15#plainlist_+_hlist_indentation]]
-- if we decide hlist in plainlist in this template isn't an issue, we can use
-- module:list directly
-- [https://en.wikipedia.org/w/index.php?title=Module:Collapsible_list/sandbox&oldid=1130172480]
-- is an implementation (that will code rot slightly I expect)
local function buildList( args )
-- Get the list items.
local listItems = {}
local argNums = getArgNums( args )
for i, num in ipairs( argNums ) do
table.insert( listItems, getListItem( args[ num ] ) )
end
if #listItems == 0 then
return ''
end
listItems = table.concat( listItems )
-- hack around mw-collapsible show/hide jumpiness by looking for text-alignment
-- by setting a margin if centered
local textAlignmentCentered = 'text%-align%s*:%s*center'
local centeredTitle = (args.title_style and args.title_style:lower():match(textAlignmentCentered)
or args.titlestyle and args.titlestyle:lower():match(textAlignmentCentered))
local centeredTitleSpacing
if centeredTitle then
centeredTitleSpacing = 'margin: 0 4em'
else
centeredTitleSpacing = ''
end
-- Get class, style and title data.
local collapsibleContainerClass = formatAttributes(
'class',
'collapsible-list',
'mw-collapsible',
not args.expand and 'mw-collapsed'
)
local collapsibleContainerStyle = formatAttributes(
'style',
-- mostly work around .infobox-full-data defaulting to centered
'text-align: left;',
args.frame_style,
args.framestyle
)
local collapsibleTitleStyle = formatAttributes(
'style',
'line-height: 1.6em; font-weight: bold;',
args.title_style,
args.titlestyle
)
local jumpyTitleStyle = formatAttributes(
'style',
centeredTitleSpacing
)
local title = args.title or 'List'
local ulclass = formatAttributes( 'class', 'mw-collapsible-content', args.hlist and 'hlist' )
local ulstyle = formatAttributes(
'style',
'margin-top: 0; margin-bottom: 0; line-height: inherit;',
not args.bullets and 'list-style: none; margin-left: 0;',
args.list_style,
args.liststyle
)
local hlist_templatestyles = ''
if args.hlist then
hlist_templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
end
-- Build the list.
return mw.ustring.format(
'%s<div%s%s>\n<div%s><div%s>%s</div></div>\n<ul%s%s>%s</ul>\n</div>',
hlist_templatestyles, collapsibleContainerClass, collapsibleContainerStyle,
collapsibleTitleStyle, jumpyTitleStyle, title, ulclass, ulstyle, listItems
)
end
function p.main( frame )
local origArgs
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
for k, v in pairs( frame.args ) do
origArgs = frame.args
break
end
else
origArgs = frame
end
local args = {}
for k, v in pairs( origArgs ) do
if type( k ) == 'number' or v ~= '' then
args[ k ] = v
end
end
return buildList( args )
end
return p
5b7e779e7529bcb12a219726ef6c948ea98874fd
Template:Infobox law enforcement agency/doc
10
144
387
2023-07-14T11:35:49Z
wikipedia>Melbguy05
0
/* Parameter names and description */ removed paramilitary deprecated
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
{{tlc|{{BASEPAGENAME}}}} is an infobox template for use in articles on individual [[Law enforcement agency|law enforcement agencies]]. See also: [[Wikipedia:Naming conventions (law enforcement agency categories)|Naming conventions (law enforcement agency categories)]].
== Usage ==
{{Parameter names example | agencyname | nativename | nativenamea | nativenamer | fictional | patch | patchcaption | logo | logocaption | badge | badgecaption | flag | flagcaption | image_size | commonname | abbreviation | motto | mottotranslated | formed | preceding1 | preceding2 | preceding3 | preceding4 | preceding5 | preceding6 | dissolved | superseding | employees | volunteers | budget | legalpersonality | legaljuris | national | country | countryabbr | federal | international | divname | subdivname | map | mapcaption | dmap | sizearea | sizepopulation | governingbody | governingbodyscnd | constitution1 | constitution2 | constitution3 | constitution4 | constitution5 | constitution6 | gendarmerie | provost | military | police | local | secret | religious | speciality1 | speciality2 | speciality3 | speciality4 | speciality5 | speciality6 | overviewtype | overviewbody | headquarters | hqlocmap | hqlocmapsize | hqlocmappoptitle | sworntype | sworn | unsworntype | unsworn | multinational | electeetype | minister1name | minister1pfo | minister2name | minister2pfo | minister3name | minister3pfo | minister4name | minister4pfo | minister5name | minister5pfo | minister6name | minister6pfo | chief1name | chief1position | chief2name | chief2position | chief3name | chief3position | chief4name | chief4position | chief5name | chief5position | chief6name | chief6position | parentagency | child1agency | child2agency | child3agency | child4agency | child5agency | child6agency | child7agency | unittype | unitname | officetype | officename | provideragency | uniformedas | stationtype | stations | airbases | lockuptype | lockups | vehicle1type | vehicles1 | vehicle2type | vehicles2 | vehicle3type | vehicles3 | boat1type | boats1 | boat2type | boats2 | boat3type | boats3 | aircraft1type | aircraft1 | aircraft2type | aircraft2 | aircraft3type | aircraft3 | animal1type | animals1 | animal2type | animals2 | animal3type | animals3 | person1name | person1reason | person1type | person2name | person2reason | person2type | person3name | person3reason | person3type | person4name | person4reason | person4type | person5name | person5reason | person5type | person6name | person6reason | person6type | programme1 | programme2 | programme3 | programme4 | programme5 | programme6 | activitytype| activity1name | activity2name | activity3name | activity4name | activity5name | activity6name | anniversary1 | anniversary2 | anniversary3 | anniversary4 | anniversary5 | anniversary6 | award1 | award2 | award3 | award4 | award5 | award6 | website | footnotes }}
<syntaxhighlight lang="wikitext" style="overflow: hidden; background: unset;">
{{Infobox law enforcement agency
| agencyname =
| nativename =
| nativenamea =
| nativenamer =
| fictional =
| patch =
| patchcaption =
| logo =
| logocaption =
| badge =
| badgecaption =
| flag =
| flagcaption =
| image_size =
| commonname =
| abbreviation =
| motto =
| mottotranslated =
| formed =
| preceding1 = <!-- up to | preceding6 = -->
| dissolved =
| superseding =
| employees =
| volunteers =
| budget =
| legalpersonality =
| legaljuris =
| national =
| country =
| countryabbr =
| federal =
| international = <!-- NNN or {{collapsible list |title=NNN |[[country1]] . . |[[countryNNN]]}} -->
| divname =
| subdivname =
| map =
| mapcaption =
| dmap =
| sizearea =
| sizepopulation =
| governingbody =
| governingbodyscnd =
| constitution1 = <!-- up to | constitution6 = -->
| gendarmerie =
| provost =
| military =
| police =
| local =
| secret =
| religious =
| speciality1 = <!-- up to | speciality6 = -->
| overviewtype =
| overviewbody =
| headquarters =
| hqlocmap =
| hqlocmapsize =
| hqlocmappoptitle =
| sworntype =
| sworn =
| unsworntype =
| unsworn =
| multinational = <!-- NNN or {{collapsible list |title=NNN |[[country1]] . . |[[countryNNN]]}} -->
| electeetype =
| minister1name = <!-- up to | minister6name = -->
| minister1pfo = <!-- up to | minister6pfo = -->
| chief1name = <!-- up to | chief6name = -->
| chief1position = <!-- up to | chief6position = -->
| parentagency =
| child1agency = <!-- up to | child7agency = -->
| unittype =
| unitname = <!-- NNN or {{collapsible list |title=NNN |[[Unit1]] . . |[[UnitNNN]]}} -->
| officetype =
| officename = <!-- NNN or {{collapsible list |title=NNN |[[Office1]] . . |[[OfficeNNN]]}} -->
| provideragency =
| uniformedas =
| stationtype =
| stations = <!-- NNN or {{collapsible list |title=NNN |[[Station1]] . . |[[StationNNN]]}} -->
| airbases = <!-- NNN or {{collapsible list |title=NNN |[[Airbase1]] . . |[[AirbaseNNN]]}} -->
| lockuptype =
| lockups = <!-- NNN or {{collapsible list |title=NNN |[[Lockup1]] . . |[[LockupNNN]]}} -->
| vehicle1type = <!-- up to | vehicle3type = -->
| vehicles1 = <!-- NNN or {{collapsible list |title=NNN |[[Vehicle1]] . . |[[VehicleNNN]]}} --><!-- up to | vehicles3 = -->
| boat1type = <!-- up to | boat3type = -->
| boats1 = <!-- NNN or {{collapsible list |title=NNN |[[Boat1]] . . |[[BoatNNN]]}} --><!-- up to | boats3 = -->
| aircraft1type = <!-- up to | aircraft3type = -->
| aircraft1 = <!-- NNN or {{collapsible list |title=NNN |[[Aircraft1]] . . |[[AircraftNNN]]}} --><!-- up to | aircraft3 = -->
| animal1type = <!-- up to | animal3type = -->
| animals1 = <!-- NNN or {{collapsible list |title=NNN |[[Animal1]] . . |[[AnimalNNN]]}} --><!-- up to | animals3 = -->
| person1name = <!-- up to | person6name = -->
| person1reason = <!-- up to | person6reason = -->
| person1type = <!-- up to |person6type = -->
| programme1 = <!-- or | program1 = --><!-- up to | programme6 = or | program6 = -->
| activitytype =
| activity1name = <!-- up to | activity6name = -->
| anniversary1 = <!-- up to | anniversary6 = -->
| award1 = <!-- up to | award6 = -->
| website =
| footnotes =
}}
</syntaxhighlight>
{{Clear}}
== Parameter names and description ==
{| class="wikitable" style="background-color:white"
! Parameter name
! Required
! Description
! Values
|- style="background-color:#ddd"
| '''Agency header''' || yes || agencyname is provided automatically based on PAGENAME if not provided. ||
|-
| agencyname || no || Name of the agency. Defaults to the name of the current page. || Text. Do not link.
|-
| nativename || no || Agency name in a native language using Western characters (French, German, Spanish, etc.), such as Port Lotniczy im. Fryderyka Chopina. Can also be used for two different names in the same language. || Text.
|-
| nativenamea || no || Agency name in a native language with non-Western characters (Chinese, Japanese, Korean, Arabic, etc.), such as 北京首都国际机场. || Text.
|-
| nativenamer || no || Use in conjunction with nativenamea for Romanized name of the agency, such as Běijīng Shǒudū Guójì Jīcháng. || Text.
|-
| fictional || no || 'Yes' if the agency is a fictional agency || Text == Yes.
|-
| patch || no || Patch for the agency. || Image file name.
|-
| patchcaption || no || Caption for the agency patch. || Optionally linked text.
|-
| logo || no || Logo for the agency. || Image file name.
|-
| logocaption || no || Caption for the agency logo. || Optionally linked text.
|-
| badge || no || Badge for the agency. || Image file name.
|-
| badgecaption || no || Caption for the agency badge. || Optionally linked text.
|-
| flag || no || Flag for the agency. || Image file name.
|-
| flagcaption || no || Caption for the agency flag. || Optionally linked text.
|-
| image_size || no || Size in px of the images for patch, logo, badge, flag. Defaults to 140. || Single number.
|-
| commonname || no || Common name for the agency. || Text. Do not link.
|-
| abbreviation || no || Abbreviation of the agency name. || Text.
|-
| motto || no || The motto of the agency. || Optionally linked text.
|-
| mottotranslated || no || The English translation of the motto of the agency. || Optionally linked text.
|- style="background-color:#ddd"
| '''Agency overview''' || yes || At least one parameter should be provided. ||
|-
| formed || no || Date of formation of the agency. || Linked text, for example, 25 July 2005, or 1876..
|-
| <s>formedmonthday</s> || no || The month and day of month the agency was formed. Ignored if formedyear not set. This parameter has been deprecated by formed. || Month name followed by day of month number. [[Wikipedia:Manual of Style (dates and numbers)#Date autoformatting|Do not link]].
|-
| <s>formedyear</s> || no || The year the agency was formed. This parameter has been deprecated by formed. || yyyy. [[Wikipedia:Manual of Style (dates and numbers)#Date autoformatting|Do not link]]
|-
| preceding1 || no || Name of preceding agency. Can be repeated up to preceding6.<br>'''Note:''' Title of box will automatically pluralise upon use of preceding2. || Text. Do not link. The template will link.
|-
| dissolved || no || Date of dissolution of the agency. || Text, for example, 25 July 2005, or 1876].
|-
| superseding || no || Name of superseding agency. || Optionally linked text.
|-
| employees || no || Number of employees of the agency. || Number with optional citation or comment.
|-
| volunteers || no || Number of volunteers to the agency. || Number with optional citation or comment.
|-
| budget || no || Annual budget of the agency || Linked and referenced text, for example, <nowiki>$95M [[USD]] (2006)</nowiki>.
|-
| legalpersonality || no || The legal personality of the agency either Governmental or Non-governmental. Governmental examples: [[government agency]]; [[government-owned corporation]]; [[government ministry]]. Non-governmental examples: [[partnership]]; [[privately-held company]]; [[cooperative]]; [[body corporate]].|| Text. Do not link. The template will link.
|- style="background-color:#ddd"
| '''Jurisdictional structure''' || yes || At least one parameter should be provided. ||
|-
| legaljuris || no || Name of area in which the agency is legally empowered to act. If the same as the operational area then set value to 'opsjuris'. || Optionally linked text, or Text == opsjuris.
|-
| country || yes || Name of the country or name of the group of countries the agency operates in or across. || Text. Do not link. The template will link.
|-
| countryabbr || no || Abbreviation for the country. || Text. Do not link. The template will link.
|-
| [[Law enforcement agency#natlea|national]] || no || 'Yes' if the agency services a single national jurisdiction. || Text == Yes.
|-
| [[Law enforcement agency#fedlea|federal]] || no || 'Yes' if the agency services a jurisdiction established by a [[Federation]]. || Text == Yes.
|-
| [[Law enforcement agency#internat|international]] || no || Number of, or optionally linked list of, the countries the agency has jurisdiction in or across. || Number or template reference with parameters.
|-
| divname|| no || Name of a division of a country, for example, [[Queensland]], [[Pennsylvania]], etc. The template will attempt to [[#Automatic disambiguation|disambiguate]] if required. || Text. Do not link. The template will link.
|-
| subdivname || no || Name of a sub-division of a country, for example, [[Sydney]], [[Buckinghamshire|Bucks]], etc. The template will attempt to [[#Automatic disambiguation|disambiguate]] if required. || Text. Do not link. The template will link.
|-
| map || no || Map of jurisdiction of the agency. || Image file name.
|-
| mapcaption || no || Caption for the agency map. Linking is recommended to a more detailed description of the geography of the jurisdiction. Defaults to 'Map of the agencyname's jurisdiction.'. It is recommended that this parameter and its corresponding image file name NOT be overridden to another image type. || Optionally linked text.
|-
| dmap || no || Location Map of jurisdiction of the agency. || Use [[Template:Location map]] to get image.
|-
| sizearea || no || Size of geographic area covered by the jurisdiction. || Number and area unit, preferably metric.
|-
| sizepopulation || no || Size of the population covered by the jurisdiction. || Number.
|-
| governingbody || no || Name of the governing body which is responsible for the agency, the law making body. Do not confuse with the overviewbody parameter below. The title will change from 'Governing body' to 'Primary governing body' if the governingbodyscnd parameter is set. || Text, for example, Government of Western Australia or United States Government. Do not link. The template will link.
|-
| governingbodyscnd || no || Name of a secondary governing body which is responsible for the agency, for example, a local or state government versus as state of federal government respectively, and a law making body. Do not confuse with the overviewbody or overview_body parameter below. || Text. Do not link. The template will link.
|-
| constitution1 || no || Titles and references to the instruments of the governing body which constitute and create the agency. Can be repeated up to constitution6.<br>'''Note:''' Title of box will automatically pluralise upon use of constitution2. || Text, linked and-or referenced.
|-
| [[Gendarmerie|gendarmerie]] || no || 'Yes' if the agency is a [[gendarmerie]]. Forces military parameter to 'Yes'. || Text == Yes.
|-
| [[Law enforcement agency#provost|provost]] || no || 'Yes' if the agency is a [[Provost (military police)|military provost]]. Forces military parameter to 'Yes'. || Text == Yes.
|-
| [[Law enforcement agency#milpol|military]] || no || 'Yes' if the agency is a [[military police]] agency. || Text == Yes.
|-
| [[Law enforcement agency#police|police]] || no || 'Yes' if the agency also provides services related to general social order and public safety. Displays "Civilian police" in infobox. '''Note:''' if used in combination with {{para|local}} changes to "Local civilian police". 'footnote' if qualified provision and use footnotes below.|| Text == Yes, or Text == footnote.
|-
| [[Law enforcement agency#locpol|local]] || no || 'Yes' if the agency is [[police]] and for the type of services provided is a local or territorial police. '''Note:''' For use in combination with {{para|police}}.'footnote' if qualified provision and use footnoes below. || Text == Yes, or Text == footnote.
|-
| [[Secret police|secret]] || no || A (robust) source reference for the fact that the organisation is known as a [[secret police]] organisation. || Optionally templated and-or linked text.
|-
| [[Law enforcement agency#relpol|religious]] || no || 'Yes' if the agency is involved in enforcing religious law. || Text == Yes, or Text == footnote.
|-
| [[Specialist law enforcement agency|speciality1]] || no || Identifies the specialist roles of the agency. The [[Template:Specialist lea type descr|Specialist roles template]] has a table of specialist role descriptions with corresponding codes. Entering a code, for example "institution", will display the description in the infobox. Can be repeated up to speciality6.
|| Enumerated text value, one of: institution, education, primary, secondary, nontertiary, tertiary, water, envher, postal, property, road, customs, corruption, rail, vehicle, protection, specops, fraud, paramilitary, diplomatic, border, coast.
|- style="background-color:#ddd"
| '''Operational structure''' || yes || At least one parameter value should be provided. ||
|-
| overviewtype || no || Type of overview authority for the operations of and community engagement by the agency. Defaults to 'Overviewed by', and becomes 'Overviewed by overviewtype'. || Optionally linked text.
|-
| overviewbody || no || Name of the overview body. || Optionally linked text.
|-
| headquarters || no || Location of the agencies's headquarters. || Text, for example, <nowiki>[[Sydney, New South Wales]], [[Australia]]</nowiki>
|-
| hqlocmap || no || Map containing location of the headquarters. || Image file name.
|-
| hqlocmappoptitle || no || Pop up title on mouse over map. Defaults to 'Map indicating the location of the headquarters'. || Text.
|-
| hqlocmapsize || no || Size of headquarters map. || Number.
|-
| sworntype || no || Type or title of sworn members, for example 'Police officer', 'Federal agent'. Defaults to 'Sworn member'. The 's' is added by the template. || Optionally linked text.
|-
| sworn || no || Number of sworn members of the agency. || Number with optional citation or comment.
|-
| unsworntype || no || Type or title of unsworn members, for example 'Staff member', 'Civilian'. Defaults to 'Unsworn member'. The 's' is added by the template. || Optionally linked text.
|-
| unsworn || no || Number of unsworn members of the agency. || Number with optional citation or comment.
|-
| [[Law enforcement agency#multinat|multinational]] || no || Number of, or optionally linked list of, the countries the agency draws personnel from. Note that an international agency does not necessarily draw personnel from all countries in its jurisdiction. || Number or template reference with parameters.
|-
| electeetype || no || Type of governing body official overseeing the agency, example is 'Minister' for "Minister responsible". Defaults to "Elected officer responsible". '''Note:''' will automatically pluralise governing body official type with an 's' upon use of minister2name.|| Optionally linked text.
|-
| minister1name || no || Elected or overseeing governing body member. For [[Westminster system]]s: Name of current minister responsible for the agency. Can be repeated up to minister6name.<br/> || Optionally linked text.
|-
| minister1pfo || no || Elected or overseeing governing body member. For Westminster systems: Portfolio title of responsible minister. Can be repeated up to minister6pfo. || Optionally linked text.
|-
| chief1name || no || Name of current agency chief/director/executive director. Can be repeated up to chief6name.<br>'''Note:''' Title of box will automatically pluralise upon use of chief2name. || Text.
|-
| chief1position || no || Position title of current agency chief/director/executive director. Can be repeated up to chief6position. || Optionally linked text.
|-
| parentagency || no || Parent agency of this agency || Optionally linked text.
|-
| child1agency || no || List of current child agencies reporting to this agency. Can be repeated up to child7agency.<br>'''Note:''' Title of box will automatically pluralise upon use of child2agency. || Optionally linked text.
|-
| unittype || no || Generic name or title of a unit if the agency, for example, Function, Division, Command. Defaults to 'Unit'. || Optionally linked text.
|-
| unitname || no || Optionally linked list of the units in the agency, for example, Crime Stoppers, Counter Terrorism. The intent here is to list operations, and operations support units, for example Crimes Scenes, Forensics, and not administration units. || Number or template reference with parameters.
|-
| officetype || no || Generic name or title of the operation area of the agency, for example, Office, Precinct, District. Defaults to 'Command'. || Text.
|-
| officename || no || Optionally linked list of the operation areas of the agency. || Number or template reference with parameters.
|-
| provideragency || no || Name of the agency to which the services are outsourced to. || Optionally linked text.
|-
| uniformedas || no || Name of agency if not uniformed as the 'agencyname'. Defaults to agencyname || Optionally linked text.
|- style="background-color:#ddd"
| '''Facilities''' || no || Each of the following facilities can be "type" overridden but will still display in the set order. For example, lockuptype/lockups can be used as vehicle0type/vehicle0s, boat1type/boats1 can be used as vehicle4type/vehicles4, boat2type/boats2 can be used vehicle5type/vehicles5, etc. There are up to 14 facilities which can be typed as required. ||
|-
| stationtype || no || Generic name or title of a work location of the agency, for example, Station, Office, Precinct. Defaults to 'Station'. || Optionally linked text.
|-
| stations || no || Number of or optionally linked list of the work locations of the agency. || Number or template reference with parameters.
|-
| airbases || no || Number of or optionally linked list of the airbases of the agency. || Number or template reference with parameters.
|-
| lockuptype || no || Generic name or title of a temporary detention centre of the agency, for example, Lockup, Watch house, Remand centre. Defaults to 'Lockup'. || Optionally linked text.
|-
| lockups || no || Number of or optionally linked list of the temporary detention centres of the agency. || Number or template reference with parameters.
|-
| vehicle1type || no || Generic name or title of a vehicle of the agency, for example, Patrol car, Forward command vehicle, Tactical vehicle. Defaults to 'Patrol car'. Can be repeated up to vehicle3type. || Optionally linked text.
|-
| vehicles1 || no || Number of or optionally linked list of the vehicles of the agency. Can be repeated up to vehicles3. || Number or template reference with parameters.
|-
| boat1type || no || Generic name or title of a water craft of the agency, for example, Boat, Patrol craft. Defaults to 'Boat'. Can be repeated up to boat3type. || Optionally linked text.
|-
| boats1 || no || Number of or optionally linked list of the water craft of the agency. Can be repeated up to boats3. || Number or template reference with parameters.
|-
| aircraft1type || no || Generic name or title of an air craft of the agency, for example, Plane, Helicopter. Defaults to 'Plane'. Can be repeated up to aircraft3type. || Optionally linked text.
|-
| aircraft1 || no || Number of or optionally linked list of the air craft of the agency. Can be repeated up to aircraft3. || Number or template reference with parameters.
|-
| animal1type || no || Generic name or title of an animal of the agency, for example, Dog, Horse. Defaults to 'Dog'. Can be repeated up to animal3type. || Optionally linked text.
|-
| animal1 || no || Number of or optionally linked list of the animals of the agency. Can be repeated up to animal3. || Number or template reference with parameters.
|- style="background-color:#ddd"
| '''Notables''' || no || Key significant notables for the agency. These and other, more numerous, notables should appear in article sections or even separate supporting articles. || Show / Hide collapsible only if more than one item.
|-
| person1name || no || Name of agency member notable for special reason. Can be repeated up to person6name. || Optionally linked text.
|-
| person1type || no || Type of peson, for example 'Inspector', 'Federal agent', 'Director', 'Commissioner'. Can be repeated up to person6type. || Optionally linked text.
|-
| person1reason || no || Reason the agency is notable, for example, bravery, reform, corruption (yes the bad too). Can be repeated up to person6reason. || Optionally linked text.
|-
| programme1 || no || Name of a key agency programme, or campaign, for example, [[most wanted]]. Can be repeated up to programme6. For American English spelling, use <code>program1</code>, <code>program2</code>, ...|| Optionally linked text.
|-
| activitytype || no || Type of 'Significant' activity or event, example is 'investigation' for "Significant investigation". Default is 'operation' for "Significant operation". '''Note:''' will automatically pluralise with an 's' upon use of activity2name. || Optionally linked text.
|-
| activity1name || no || Name of an activity or event which is notable. Can be repeated up to activity6name. || Optionally linked text.
|-
| anniversary1 || no || Name of notable event to be commemorated. Can be repeated up to anniversary6. || Optionally linked text. Recommended format: <nowiki>[[optionally piped text]] ([[Year]], [[dd Month]])</nowiki>
|-
| award1 || no || Name of award, decoration, honour, or other significant recognition. Can be repeated up to award6. || Optionally linked text. Recommended format: <nowiki>[[optionally piped text]] ([[Year]], [[dd Month]])</nowiki>
|- style="background-color:#ddd"
| '''Website and footnotes''' || no || ||
|-
| website || no || Web address for agency website || WWW address. Use <nowiki>{{URL|example.com}}</nowiki>
|-
| footnotes || no || Footnotes or references for included information || Text.
|}
==TemplateData==
{{collapse top|[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": "Infobox law enforcement agency is an infobox template for use in articles on individual law enforcement agencies.",
"format": "{{_\n| _________________ = _\n}}\n",
"params": {
"agencyname": {
"label": "Agency name",
"description": "Name of the agency defaults to {{PAGENAME}} if not provided.",
"type": "string",
"required": false
},
"nativename": {
"label": "Native name",
"description": "Agency name in a native language using Western characters (French, German, Spanish, etc.), such as Port Lotniczy im. Fryderyka Chopina. Can also be used for two different names in the same language.",
"example": "{{lang|pl|Port Lotniczy im}}",
"type": "string",
"required": false
},
"nativenamea": {
"label": "Direct native name",
"description": "Agency name in a native language with non-Western characters (Chinese, Japanese, Korean, Arabic, etc.)",
"example": "{{lang|zh|北京首都国际机场}}",
"type": "string",
"required": false
},
"nativenamer": {
"label": "Romanised native name",
"description": "Use in conjunction with nativenamea or native_name_a for Romanized name of the agency.",
"example": "{{lang|zh-p|Běijīng Shǒudū Guójì Jīcháng}}",
"type": "string",
"required": false
},
"fictional": {
"label": "Fictional",
"description": "'Yes' if the agency is a fictional agency",
"type": "string",
"required": false
},
"patch": {
"label": "Patch",
"description": "Patch for the agency.",
"type": "wiki-file-name",
"required": false
},
"patchcaption": {
"label": "Patch caption",
"description": "Caption for the agency patch.",
"type": "string",
"default": "Patch of the agencyname",
"example": "coat of arms",
"required": false
},
"logo": {
"label": "Logo",
"description": "Logo for the agency.",
"type": "wiki-file-name",
"required": false
},
"logocaption": {
"label": "Logo caption",
"description": "Caption for the agency logo.",
"type": "string",
"default": "Logo of the agencyname",
"example": "coat of arms",
"required": false
},
"badge": {
"label": "Badge",
"description": "Badge for the agency.",
"type": "wiki-file-name",
"required": false
},
"badgecaption": {
"label": "Badge Caption",
"description": "Caption for the agency badge.",
"type": "string",
"default": "Badge of the agencyname",
"example": "coat of arms",
"required": false
},
"flag": {
"label": "Flag",
"description": "Flag for the agency.",
"type": "wiki-file-name",
"required": false
},
"flagcaption": {
"label": "Flag caption",
"description": "Caption for the agency flag.",
"type": "string",
"default": "Flag of the agencyname",
"example": "coat of arms",
"required": false
},
"image_size": {
"label": "Image sizes",
"description": "Size in px of the images for patch, logo, badge, flag.",
"type": "number",
"default": "140",
"required": false
},
"commonname": {
"label": "Common Name",
"description": "Common name for the agency.",
"type": "string",
"required": false
},
"abbreviation": {
"label": "Abbreviation",
"description": "Abbreviation of the agency name.",
"type": "string",
"required": false
},
"motto": {
"label": "Motto",
"description": "The motto of the agency.",
"type": "string",
"required": false
},
"mottotranslated": {
"label": "Motto translated",
"description": "The English translation of the motto of the agency.",
"type": "string",
"required": false
},
"formed": {
"label": "Formed",
"description": "Date of formation of the agency.",
"type": "string",
"example": "25 July 2005, or 1876.",
"required": false
},
"formedmonthday": {
"label": "Formed",
"description": "The month and day of month the agency was formed. Ignored if formedyear not set. This parameter has been deprecated by formed.",
"type": "string",
"example": "Month name followed by day of month number.",
"deprecated": true,
"required": false
},
"formedyear": {
"label": "Formed",
"description": "The year the agency was formed. This parameter has been deprecated by formed.",
"type": "string",
"example": "yyyy.",
"deprecated": true,
"required": false
},
"preceding1": {
"label": "Preceding agency 1",
"description": "Name of a preceding agency. Title of box will automatically pluralise upon use of more than one.",
"type": "string"
},
"preceding2": {
"label": "Preceding agency 2",
"inherits": "preceding1"
},
"preceding3": {
"label": "Preceding agency 3",
"inherits": "preceding1"
},
"preceding4": {
"label": "Preceding agency 4",
"inherits": "preceding1"
},
"preceding5": {
"label": "Preceding agency 5",
"inherits": "preceding1"
},
"preceding6": {
"label": "Preceding agency 6",
"inherits": "preceding1"
},
"dissolved": {
"label": "Date dissolved",
"description": "Date of dissolution of the agency.",
"type": "string",
"example": "{{end date|1782}}",
"required": false
},
"superseding": {
"label": "Superseding agency",
"description": "Name of superseding agency.",
"type": "string",
"required": false
},
"employees": {
"label": "Employees",
"description": "Number of employees of the agency.",
"type": "number",
"required": false
},
"volunteers": {
"label": "Volunteers",
"description": "Number of volunteers to the agency.",
"type": "number",
"required": false
},
"budget": {
"label": "Annual budget",
"description": "Annual budget of the agency.",
"type": "string",
"example": "$95 m [[United States dollar|USD]] (2006)",
"required": false
},
"legalpersonality": {
"label": "Legal personality",
"description": "The legal personality of the agency.",
"type": "string",
"example": "government agency; government-owned corporation; government ministry; partnership; privately-held company; cooperative; body corporate; or, the full legal name of organisation if the type of organisation is not known.",
"required": false
},
"country": {
"label": "Country",
"description": "Name of the country or name of the group of countries the agency operates in or across.",
"type": "string",
"required": true
},
"countryabbr": {
"label": "Country Abbreviation",
"description": "Abbreviation for the country.",
"type": "string",
"required": false
},
"national": {
"label": "National",
"description": "'Yes' if the agency services a single national jurisdiction.",
"type": "string",
"required": false
},
"federal": {
"label": "Federal",
"description": "'Yes' if the agency services a jurisdiction established by a Federation.",
"type": "string",
"required": false
},
"international": {
"label": "International",
"description": "Number of, or optionally linked list of, the countries the agency has jurisdiction in or across.",
"type": "string",
"required": false
},
"divtype": {
"label": "divtype",
"description": "Title of a division of a country.",
"type": "string",
"example": "State, Territory, etc., or 'Police area' if the jurisdiction is specifically constructed.",
"required": false,
"deprecated": true
},
"divname": {
"label": "divname",
"description": "Name of a division of a country.",
"type": "string",
"example": "Queensland, Pennsylvania",
"required": false
},
"subdivtype": {
"label": "subdivtype",
"description": "Title of a sub-division of a country.",
"type": "string",
"example": "City, County, etc., or 'Police area' if the jurisdiction is specifically constructed.",
"required": false,
"deprecated": true
},
"subdivname": {
"label": "subdivname",
"description": "Name of a sub-division of a country.",
"type": "string",
"example": "Sydney, Bucks",
"required": false
},
"map": {
"label": "map",
"description": "Map of jurisdiction of the agency.",
"type": "wiki-file-name",
"required": false
},
"dmap": {
"label": "dmap",
"description": "Location Map of jurisdiction of the agency. Use Template:Location map to get image.",
"type": "unknown",
"required": false
},
"mapcaption": {
"label": "mapcaption",
"description": "Caption for the agency map.",
"type": "string",
"default": "Map of the agencyname's jurisdiction",
"required": false
},
"sizearea": {
"label": "sizearea",
"description": "Size of geographic area covered by the jurisdiction.",
"type": "string",
"required": false
},
"sizepopulation": {
"label": "sizepopulation",
"description": "Size of the population covered by the jurisdiction.",
"type": "number",
"required": false
},
"legaljuris": {
"label": "Legal Jurisdiction",
"description": "Name of area in which the agency is legally empowered to act. If the same as the operational area then set value to 'opsjuris'.",
"type": "string",
"required": false
},
"governingbody": {
"label": "Governing Body",
"description": "Name of the governing body which is responsible for the agency, the law making body. Do not confuse with the overviewbody parameter below. The title will change from 'Governing body' to 'Primary governing body' if the governingbodyscnd parameter is set.",
"type": "string",
"example": "Government of Western Australia, United States Government",
"required": false
},
"governingbodyscnd": {
"label": "Secondary Governing Body",
"description": "Name of a secondary governing body which is responsible for the agency. Do not confuse with the overviewbody parameter below.",
"type": "string",
"example": "Local or state government versus as state of federal government respectively, and a law making body.",
"required": false
},
"constitution1": {
"label": "constitution1",
"description": "Titles and references to the instruments of the governing body which constitute and create the agency.",
"type": "string",
"required": false
},
"constitution2": {
"label": "constitution2",
"inherits": "constitution1"
},
"constitution3": {
"label": "constitution3",
"inherits": "constitution1"
},
"constitution4": {
"label": "constitution4",
"inherits": "constitution1"
},
"constitution5": {
"label": "constitution5",
"inherits": "constitution1"
},
"constitution6": {
"label": "constitution6",
"inherits": "constitution1"
},
"gendarmerie": {
"label": "Gendarmerie",
"description": "'Yes' if the agency is a gendarmerie. Forces military parameter to 'Yes'.",
"type": "string",
"required": false
},
"provost": {
"label": "Provost",
"description": "'Yes' if the agency is a military provost. Forces military parameter to 'Yes'.",
"type": "string",
"required": false
},
"police": {
"label": "Police",
"description": "'Yes' if the agency also provides services related to general social order and public safety.",
"type": "string",
"required": false
},
"local": {
"label": "Local",
"description": "'Yes' if the agency is the local or territorial agency for the type of services provided.",
"type": "string",
"required": false
},
"military": {
"label": "Military",
"description": "'Yes' if the agency is a military police agency.",
"type": "string",
"required": false
},
"secret": {
"label": "Secret",
"description": "Yes' if the agency is known as a secret police organisation.",
"type": "string",
"required": false
},
"religious": {
"label": "Religious",
"description": "Yes' if the agency is involved in enforcing religious law.",
"type": "string",
"required": false
},
"speciality1": {
"label": "speciality1",
"description": "Identifies the agency as having a specialist jurisdiction of particular types of geography, property, etc.",
"type": "string",
"required": false
},
"speciality2": {
"label": "speciality2",
"inherits": "speciality1"
},
"speciality3": {
"label": "speciality3",
"inherits": "speciality1"
},
"speciality4": {
"label": "speciality4",
"inherits": "speciality1"
},
"speciality5": {
"label": "speciality5",
"inherits": "speciality1"
},
"speciality6": {
"label": "speciality6",
"inherits": "speciality1"
},
"overviewtype": {
"label": "Overview Type",
"description": "Type of overview authority for the operations of and community engagement by the agency.",
"type": "string",
"default": "Overviewed by', and becomes 'Overviewed by overview type'.",
"required": false
},
"overviewbody": {
"label": "Overview Body",
"description": "Name of the overview body.",
"type": "string",
"required": false
},
"headquarters": {
"label": "Headquarters",
"description": "Location of the agencies's headquarters.",
"type": "string",
"example": "[[Sydney, New South Wales]], [[Australia]]",
"required": false
},
"hqlocmap": {
"label": "hqlocmap",
"description": "Map containing location of the headquarters.",
"type": "wiki-file-name",
"required": false
},
"hqlocmapsize": {
"label": "hqlocmapsize",
"description": "Size of the map.",
"type": "number",
"required": false
},
"hqlocmappoptitle": {
"label": "hqlocmappoptitle",
"description": "Pop up title on mouse over map.",
"type": "string",
"default": "Map indicating the location of the headquarters",
"required": false
},
"sworntype": {
"label": "Sworn Type",
"description": "Type or title of sworn members.",
"type": "string",
"default": "Sworn member",
"example": "Police officer, Federal agent",
"required": false
},
"sworn": {
"label": "Sworn",
"description": "Number of sworn members of the agency.",
"type": "string",
"required": false
},
"unsworntype": {
"label": "Unsworn Type",
"description": "Type or title of unsworn members.",
"type": "string",
"default": "Unsworn member",
"example": "Staff member, Civilian",
"required": false
},
"unsworn": {
"label": "Unsworn",
"description": "Number of unsworn members of the agency.",
"type": "string",
"required": false
},
"multinational": {
"label": "multinational",
"description": "Number of, or optionally linked list of, the countries the agency draws personnel from. Note that an international agency does not necessarily draw personnel from all countries in its jurisdiction.",
"type": "string",
"required": false
},
"electeetype": {
"label": "Electee Type",
"description": "Generic type of governing body officials overseeing the agency.",
"type": "string",
"default": "Elected officer",
"required": false
},
"minister1name": {
"label": "minister1name",
"description": "Elected or overseeing governing body member.",
"type": "string",
"example": "For Westminster systems: Name of current minister responsible for the agency",
"required": false
},
"minister1pfo": {
"label": "minister1pfo",
"description": "Elected or overseeing governing body member.",
"type": "string",
"example": "For Westminster systems: Portfolio title of responsible minister.",
"required": false
},
"minister2name": {
"label": "minister2name",
"inherits": "minister1name"
},
"minister2pfo": {
"label": "minister2pfo",
"inherits": "minister1pfo"
},
"minister3name": {
"label": "minister3name",
"inherits": "minister1name"
},
"minister3pfo": {
"label": "minister3pfo",
"inherits": "minister1pfo"
},
"minister4name": {
"label": "minister4name",
"inherits": "minister1name"
},
"minister4pfo": {
"label": "minister4pfo",
"inherits": "minister1pfo"
},
"minister5name": {
"label": "minister5name",
"inherits": "minister1name"
},
"minister5pfo": {
"label": "minister5pfo",
"inherits": "minister1pfo"
},
"minister6name": {
"label": "minister6name",
"inherits": "minister1name"
},
"minister6pfo": {
"label": "minister6pfo",
"inherits": "minister1pfo"
},
"chief1name": {
"label": "chief1name",
"description": "Name of current agency chief/director/executive director.",
"type": "string",
"required": false
},
"chief1position": {
"label": "chief1position",
"description": "Position title of current agency chief/director/executive director.",
"type": "string",
"required": false
},
"chief2name": {
"label": "chief2name",
"inherits": "chief1name"
},
"chief2position": {
"label": "chief2position",
"inherits": "chief1position"
},
"chief3name": {
"label": "chief3name",
"inherits": "chief1name"
},
"chief3position": {
"label": "chief3position",
"inherits": "chief1position"
},
"chief4name": {
"label": "chief4name",
"inherits": "chief1name"
},
"chief4position": {
"label": "chief4position",
"inherits": "chief1position"
},
"chief5name": {
"label": "chief5name",
"inherits": "chief1name"
},
"chief5position": {
"label": "chief5position",
"inherits": "chief1position"
},
"chief6name": {
"label": "chief6name",
"inherits": "chief1name"
},
"chief6position": {
"label": "chief6position",
"inherits": "chief1position"
},
"parentagency": {
"label": "Parent Agency",
"description": "Parent agency of this agency.",
"type": "string",
"required": false
},
"child1agency": {
"label": "child1agency",
"description": "List of current child agencies reporting to this agency.",
"type": "string",
"required": false
},
"child2agency": {
"label": "child2agency",
"inherits": "child1agency"
},
"child3agency": {
"label": "child3agency",
"inherits": "child1agency"
},
"child4agency": {
"label": "child4agency",
"inherits": "child1agency"
},
"child5agency": {
"label": "child5agency",
"inherits": "child1agency"
},
"child6agency": {
"label": "child6agency",
"inherits": "child1agency"
},
"child7agency": {
"label": "child7agency",
"inherits": "child1agency"
},
"unittype": {
"label": "Unit Type",
"description": "Generic name or title of a unit if the agency.",
"type": "string",
"default": "Unit",
"example": "Function, Division, Command",
"required": false
},
"unitname": {
"label": "Unit Name",
"description": "Optionally linked list of the units in the agency.",
"type": "string",
"example": "Crime Stoppers, Counter Terrorism. The intent here is to list operations, and operations support units, for example Crimes Scenes, Forensics, and not administration units.",
"required": false
},
"officetype": {
"label": "Office Type",
"description": "Generic name or title of the operation area of the agency.",
"type": "string",
"default": "Command",
"example": "Office, Precinct, District",
"required": false
},
"officename": {
"label": "Office Name",
"description": "Optionally linked list of the operation areas of the agency.",
"type": "string",
"required": false
},
"provideragency": {
"label": "Provider Agency",
"description": "Name of the agency to which the services are outsourced to.",
"type": "string",
"required": false
},
"uniformedas": {
"label": "Uniformed as",
"description": "Name of agency if not uniformed as the Agency Name.",
"type": "string",
"default": "Agency Name",
"required": false
},
"stationtype": {
"label": "Station Type",
"description": "Generic name or title of a work location of the agency.",
"type": "string",
"example": "Station, Office, Precinct.",
"default": "Station",
"required": false
},
"stations": {
"label": "Stations",
"description": "Number of or optionally linked list of the work locations of the agency.",
"type": "string",
"required": false
},
"airbases": {
"label": "Airbases",
"description": "Number of or optionally linked list of the airbases of the agency.",
"type": "string",
"required": false
},
"lockuptype": {
"label": "Lockup Type",
"description": "Generic name or title of a temporary detention centre of the agency.",
"type": "string",
"example": "Lockup, Watch house, Remand centre.",
"default": "Lockup",
"required": false
},
"lockups": {
"label": "Lockups",
"description": "Number of or optionally linked list of the temporary detention centres of the agency.",
"type": "string",
"required": false
},
"vehicle1type": {
"label": "vehicle1type",
"description": "Generic name or title of a vehicle of the agency.",
"type": "string",
"example": "Patrol car, Forward command vehicle, Tactical vehicle.",
"default": "Patrol car",
"required": false
},
"vehicles1": {
"label": "vehicles1",
"description": "Number of or optionally linked list of the vehicles of the agency.",
"type": "string",
"required": false
},
"vehicle2type": {
"label": "vehicle2type",
"inherits": "vehicle1type"
},
"vehicles2": {
"label": "vehicles2",
"inherits": "vehicles1"
},
"vehicle3type": {
"label": "vehicle3type",
"inherits": "vehicle1type"
},
"vehicles3": {
"label": "vehicles3",
"inherits": "vehicles1"
},
"boat1type": {
"label": "boat1type",
"description": "Generic name or title of a water craft of the agency.",
"type": "string",
"example": "Boat, Patrol craft.",
"default": "Boat",
"required": false
},
"boats1": {
"label": "boats1",
"description": "Number of or optionally linked list of the water craft of the agency.",
"type": "string",
"required": false
},
"boat2type": {
"label": "boat2type",
"inherits": "boat1type"
},
"boats2": {
"label": "boats2",
"inherits": "boats1"
},
"boat3type": {
"label": "boat3type",
"inherits": "boat1type"
},
"boats3": {
"label": "boats3",
"inherits": "boats1"
},
"aircraft1type": {
"label": "aircraft1type",
"description": "Generic name or title of an air craft of the agency, for example.",
"type": "string",
"example": "Plane, helicopter.",
"default": "Plane",
"required": false
},
"aircraft1": {
"label": "aircraft1",
"description": "Number of or optionally linked list of the air craft of the agency.",
"type": "string",
"required": false
},
"aircraft2type": {
"label": "aircraft2type",
"inherits": "aircraft1type"
},
"aircraft2": {
"label": "aircraft2",
"inherits": "aircraft1"
},
"aircraft3type": {
"label": "aircraft3type",
"inherits": "aircraft1type"
},
"aircraft3": {
"label": "aircraft3",
"inherits": "aircraft1"
},
"animal1type": {
"label": "animal1type",
"description": "Generic name or title of an animal of the agency.",
"type": "string",
"example": "Dog, Horse.",
"default": "Dog",
"required": false
},
"animals1": {
"label": "animals1",
"description": "Number of or optionally linked list of the animals of the agency.",
"type": "string",
"required": false
},
"animal2type": {
"label": "animal2type",
"inherits": "animal1type"
},
"animals2": {
"label": "animals2",
"inherits": "animals1"
},
"animal3type": {
"label": "animal3type",
"inherits": "animal1type"
},
"animals3": {
"label": "animals3",
"inherits": "animals1"
},
"person1name": {
"label": "person1name",
"description": "Name of agency person notable for special reason.",
"type": "string",
"required": false
},
"person1type": {
"label": "person1type",
"description": "Type of person.",
"type": "string",
"example": "Inspector, Federal agent, Director, Commissioner",
"required": false
},
"person1reason": {
"label": "person1reason",
"description": "Reason the agency person is notable.",
"type": "string",
"example": "Bravery, reform, corruption (yes the bad too)",
"required": false
},
"person2name": {
"label": "person2name",
"inherits": "person1name"
},
"person2type": {
"label": "person2type",
"inherits": "person1type"
},
"person2reason": {
"label": "person2reason",
"inherits": "person1reason"
},
"person3name": {
"label": "person3name",
"inherits": "person1name"
},
"person3type": {
"label": "person3type",
"inherits": "person1type"
},
"person3reason": {
"label": "person3reason",
"inherits": "person1reason"
},
"person4name": {
"label": "person4name",
"inherits": "person1name"
},
"person4type": {
"label": "person4type",
"inherits": "person1type"
},
"person4reason": {
"label": "person4reason",
"inherits": "person1reason"
},
"person5name": {
"label": "person5name",
"inherits": "person1name"
},
"person5type": {
"label": "person5type",
"inherits": "person1type"
},
"person5reason": {
"label": "person5reason",
"inherits": "person1reason"
},
"person6name": {
"label": "person6name",
"inherits": "person1name"
},
"person6type": {
"label": "person6type",
"inherits": "person1type"
},
"person6reason": {
"label": "person6reason",
"inherits": "person1reason"
},
"programme1": {
"label": "programme1",
"description": "Name of a key agency programme, or campaign.",
"type": "string",
"example": "Most wanted",
"required": false,
"aliases": [
"program1"
]
},
"programme2": {
"label": "programme2",
"inherits": "programme1",
"aliases": [
"program2"
]
},
"programme3": {
"label": "programme3",
"inherits": "programme1",
"aliases": [
"program3"
]
},
"programme4": {
"label": "programme4",
"inherits": "programme1",
"aliases": [
"program4"
]
},
"programme5": {
"label": "programme5",
"inherits": "programme1",
"aliases": [
"program5"
]
},
"programme6": {
"label": "programme6",
"inherits": "programme1",
"aliases": [
"program6"
]
},
"activitytype": {
"label": "activitytype",
"description": "Type of activity or event.",
"type": "string",
"default": "Operation",
"example": "Investigation",
"required": false
},
"activity1name": {
"label": "activity1name",
"description": "Name of an activity or event which is notable.",
"type": "string",
"required": false
},
"activity2name": {
"label": "activity2name",
"inherits": "activity1name"
},
"activity3name": {
"label": "activity3name",
"inherits": "activity1name"
},
"activity4name": {
"label": "activity4name",
"inherits": "activity1name"
},
"activity5name": {
"label": "activity5name",
"inherits": "activity1name"
},
"activity6name": {
"label": "activity6name",
"inherits": "activity1name"
},
"anniversary1": {
"label": "anniversary1",
"description": "Name of notable event to be commemorated.",
"type": "string",
"example": "[[optionally piped text]] ([[Year]], [[dd Month]])",
"required": false
},
"anniversary2": {
"label": "anniversary2",
"inherits": "anniversary1"
},
"anniversary3": {
"label": "anniversary3",
"inherits": "anniversary1"
},
"anniversary4": {
"label": "anniversary4",
"inherits": "anniversary1"
},
"anniversary5": {
"label": "anniversary5",
"inherits": "anniversary1"
},
"anniversary6": {
"label": "anniversary6",
"inherits": "anniversary1"
},
"award1": {
"label": "award1",
"description": "Name of award, decoration, honour, or other significant recognition.",
"type": "string",
"example": "[[optionally piped text]] ([[Year]], [[dd Month]])",
"required": false
},
"award2": {
"label": "award2",
"inherits": "award1"
},
"award3": {
"label": "award3",
"inherits": "award1"
},
"award4": {
"label": "award4",
"inherits": "award1"
},
"award5": {
"label": "award5",
"inherits": "award1"
},
"award6": {
"label": "award6",
"inherits": "award1"
},
"website": {
"label": "Website",
"description": "Web address for agency website.",
"type": "url",
"example": "WWW address",
"required": false
},
"footnotes": {
"label": "Footnotes",
"description": "Footnotes or references for included information.",
"type": "string",
"required": false
},
"embed": {},
"paramilitary": {
"deprecated": true
}
},
"paramOrder": [
"agencyname",
"nativename",
"nativenamea",
"nativenamer",
"fictional",
"patch",
"patchcaption",
"logo",
"logocaption",
"badge",
"badgecaption",
"flag",
"flagcaption",
"image_size",
"commonname",
"abbreviation",
"motto",
"mottotranslated",
"formed",
"formedmonthday",
"formedyear",
"preceding1",
"preceding2",
"preceding3",
"preceding4",
"preceding5",
"preceding6",
"dissolved",
"superseding",
"employees",
"volunteers",
"budget",
"legalpersonality",
"country",
"countryabbr",
"national",
"federal",
"international",
"divtype",
"divname",
"subdivtype",
"subdivname",
"map",
"dmap",
"mapcaption",
"sizearea",
"sizepopulation",
"legaljuris",
"governingbody",
"governingbodyscnd",
"constitution1",
"constitution2",
"constitution3",
"constitution4",
"constitution5",
"constitution6",
"gendarmerie",
"provost",
"police",
"local",
"military",
"secret",
"religious",
"speciality1",
"speciality2",
"speciality3",
"speciality4",
"speciality5",
"speciality6",
"overviewtype",
"overviewbody",
"headquarters",
"hqlocmap",
"hqlocmapsize",
"hqlocmappoptitle",
"sworntype",
"sworn",
"unsworntype",
"unsworn",
"multinational",
"electeetype",
"minister1name",
"minister1pfo",
"minister2name",
"minister2pfo",
"minister3name",
"minister3pfo",
"minister4name",
"minister4pfo",
"minister5name",
"minister5pfo",
"minister6name",
"minister6pfo",
"chief1name",
"chief1position",
"chief2name",
"chief2position",
"chief3name",
"chief3position",
"chief4name",
"chief4position",
"chief5name",
"chief5position",
"chief6name",
"chief6position",
"parentagency",
"child1agency",
"child2agency",
"child3agency",
"child4agency",
"child5agency",
"child6agency",
"child7agency",
"unittype",
"unitname",
"officetype",
"officename",
"provideragency",
"uniformedas",
"stationtype",
"stations",
"airbases",
"lockuptype",
"lockups",
"vehicle1type",
"vehicles1",
"vehicle2type",
"vehicles2",
"vehicle3type",
"vehicles3",
"boat1type",
"boats1",
"boat2type",
"boats2",
"boat3type",
"boats3",
"aircraft1type",
"aircraft1",
"aircraft2type",
"aircraft2",
"aircraft3type",
"aircraft3",
"animal1type",
"animals1",
"animal2type",
"animals2",
"animal3type",
"animals3",
"person1name",
"person1type",
"person1reason",
"person2name",
"person2type",
"person2reason",
"person3name",
"person3type",
"person3reason",
"person4name",
"person4type",
"person4reason",
"person5name",
"person5type",
"person5reason",
"person6name",
"person6type",
"person6reason",
"programme1",
"programme2",
"programme3",
"programme4",
"programme5",
"programme6",
"activitytype",
"activity1name",
"activity2name",
"activity3name",
"activity4name",
"activity5name",
"activity6name",
"anniversary1",
"anniversary2",
"anniversary3",
"anniversary4",
"anniversary5",
"anniversary6",
"award1",
"award2",
"award3",
"award4",
"award5",
"award6",
"website",
"footnotes",
"embed",
"paramilitary"
]
}
</templatedata>
{{collapse bottom}}
== Tracking categories ==
* {{clc|Pages using law enforcement agency with local civilian police general nature}}
* {{clc|Pages using law enforcement agency with civilian police general nature}}
* {{Category link with count|Pages using infobox law enforcement agency with unknown parameters}}
* {{clc|Pages using infobox law enforcement agency with paramilitary parameter}}
== See also ==
{{Organization infoboxes}}
<includeonly>{{Sandbox other||
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Law enforcement infobox templates|Law Enforcement Agency]]
[[Category:Organization infobox templates|Law Enforcement Agency]]
[[Category:Politics and government infobox templates|Law Enforcement Agency]]
[[Category:Embeddable templates]]
}}</includeonly>
57fd62e2a5d1ae90f274a57c083507399108dfa0
Module:Plain text
828
236
576
2023-07-24T05:28:17Z
wikipedia>Jonesey95
0
keep contents of sub, sup, and underline (see talk)
Scribunto
text/plain
--converts text with wikilinks to plain text, e.g "[[foo|gah]] is [[bar]]" to "gah is bar"
--removes anything enclosed in tags that isn't nested, mediawiki strip markers (references etc), files, italic and bold markup
require[[strict]]
local p = {}
function p.main(frame)
local text = frame.args[1]
local encode = require('Module:yesno')(frame.args.encode)
return p._main(text, encode)
end
function p._main(text, encode)
if not text then return end
text = mw.text.killMarkers(text)
:gsub(' ', ' ') --replace nbsp spaces with regular spaces
:gsub('<br ?/?>', ', ') --replace br with commas
:gsub('<span.->(.-)</span>', '%1') --remove spans while keeping text inside
:gsub('<i.->(.-)</i>', '%1') --remove italics while keeping text inside
:gsub('<b.->(.-)</b>', '%1') --remove bold while keeping text inside
:gsub('<em.->(.-)</em>', '%1') --remove emphasis while keeping text inside
:gsub('<strong.->(.-)</strong>', '%1') --remove strong while keeping text inside
:gsub('<sub.->(.-)</sub>', '%1') --remove subscript markup; retain contents
:gsub('<sup.->(.-)</sup>', '%1') --remove superscript markup; retain contents
:gsub('<u.->(.-)</u>', '%1') --remove underline markup; retain contents
:gsub('<.->.-<.->', '') --strip out remaining tags and the text inside
:gsub('<.->', '') --remove any other tag markup
:gsub('%[%[%s*[Ff][Ii][Ll][Ee]%s*:.-%]%]', '') --strip out files
:gsub('%[%[%s*[Ii][Mm][Aa][Gg][Ee]%s*:.-%]%]', '') --strip out use of image:
:gsub('%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:.-%]%]', '') --strip out categories
:gsub('%[%[[^%]]-|', '') --strip out piped link text
:gsub('([^%[])%[[^%[%]][^%]]-%s', '%1') --strip out external link text
:gsub('^%[[^%[%]][^%]]-%s', '') --strip out external link text
:gsub('[%[%]]', '') --then strip out remaining [ and ]
:gsub("'''''", "") --strip out bold italic markup
:gsub("'''?", "") --not stripping out '''' gives correct output for bolded text in quotes
:gsub('----+', '') --remove ---- lines
:gsub("^%s+", "") --strip leading
:gsub("%s+$", "") --and trailing spaces
:gsub("%s+", " ") --strip redundant spaces
if encode then
return mw.text.encode(text)
else
return text
end
end
return p
8d406c43e8cf1dadf34be7d3b395f44ba4c48b75
Module:Lang
828
149
398
2023-07-28T21:46:18Z
wikipedia>Trappist the monk
0
Scribunto
text/plain
--[=[
Lua support for the {{lang}}, {{lang-xx}}, and {{transliteration}} templates and replacement of various supporting templates.
]=]
require('strict');
local getArgs = require ('Module:Arguments').getArgs;
local unicode = require ("Module:Unicode data"); -- for is_latin() and is_rtl()
local yesno = require ('Module:Yesno');
local lang_data = mw.loadData ('Module:Lang/data'); -- language name override and transliteration tool-tip tables
local lang_name_table = lang_data.lang_name_table; -- language codes, names, regions, scripts, suppressed scripts
local lang_table = lang_data.lang_name_table.lang;
local lang_dep_table = lang_data.lang_name_table.lang_dep;
local script_table = lang_data.lang_name_table.script;
local region_table = lang_data.lang_name_table.region;
local variant_table = lang_data.lang_name_table.variant;
local suppressed_table = lang_data.lang_name_table.suppressed;
local override_table = lang_data.override;
local synonym_table = mw.loadData ('Module:Lang/ISO 639 synonyms'); -- ISO 639-2/639-2T code translation to 639-1 code
local namespace = mw.title.getCurrentTitle().namespace; -- used for categorization
local content_lang = mw.language.getContentLanguage();
local this_wiki_lang_tag = content_lang.code; -- get this wiki's language tag
local this_wiki_lang_dir = content_lang:getDir(); -- get this wiki's language direction
local initial_style_state; -- set by lang_xx_normal() and lang_xx_italic()
local maint_cats = {}; -- maintenance categories go here
local maint_msgs = {}; -- and their messages go here
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set( var )
return not (var == nil or var == '');
end
--[[--------------------------< I N V E R T _ I T A L I C S >-------------------------------------------------
This function attempts to invert the italic markup a args.text by adding/removing leading/trailing italic markup
in args.text. Like |italic=unset, |italic=invert disables automatic italic markup. Individual leading/trailing
apostrophes are converted to their html numeric entity equivalent so that the new italic markup doesn't become
bold markup inadvertently.
Leading and trailing wiki markup is extracted from args.text into separate table elements. Addition, removal,
replacement of wiki markup is handled by a string.gsub() replacement table operating only on these separate elements.
In the string.gsub() matching pattern, '.*' matches empty string as well as the three expected wiki markup patterns.
This function expects that markup in args.text is complete and correct; if it is not, oddness may result.
]]
local function invert_italics (source)
local invert_pattern_table = { -- leading/trailing markup add/remove/replace patterns
[""]="\'\'", -- empty string becomes italic markup
["\'\'"]="", -- italic markup becomes empty string
["\'\'\'"]="\'\'\'\'\'", -- bold becomes bold italic
["\'\'\'\'\'"]="\'\'\'", -- bold italic become bold
};
local seg = {};
source = source:gsub ("%f[\']\'%f[^\']", '''); -- protect single quote marks from being interpreted as bold markup
seg[1] = source:match ('^(\'\'+%f[^\']).+') or ''; -- get leading markup, if any; ignore single quote
seg[3] = source:match ('.+(%f[\']\'\'+)$') or ''; -- get trailing markup, if any; ignore single quote
if '' ~= seg[1] and '' ~= seg[3] then -- extract the 'text'
seg[2] = source:match ('^\'\'+%f[^\'](.+)%f[\']\'\'+$') -- from between leading and trailing markup
elseif '' ~= seg[1] then
seg[2] = source:match ('^\'\'+%f[^\'](.+)') -- following leading markup
elseif '' ~= seg[3] then
seg[2] = source:match ('(.+)%f[\']\'\'+$') -- preceding trailing markup
else
seg[2] = source -- when there is no markup
end
seg[1] = invert_pattern_table[seg[1]] or seg[1]; -- replace leading markup according to pattern table
seg[3] = invert_pattern_table[seg[3]] or seg[3]; -- replace leading markup according to pattern table
return table.concat (seg); -- put it all back together and done
end
--[[--------------------------< V A L I D A T E _ I T A L I C >------------------------------------------------
validates |italic= or |italics= assigned values.
When |italic= is set and has an acceptible assigned value, return the matching css font-style property value or,
for the special case 'default', return nil.
When |italic= is not set, or has an unacceptible assigned value, return nil and a nil error message.
When both |italic= and |italics= are set, returns nil and a 'conflicting' error message.
The return value nil causes the calling lang, lang_xx, or transl function to set args.italic according to the template's
defined default ('inherit' for {{lang}}, 'inherit' or 'italic' for {{lang-xx}} depending on
the individual template's requirements, 'italic' for {{transliteration}}) or to the value appropriate to |script=, if set ({{lang}}
and {{lang-xx}} only).
Accepted values and the values that this function returns are are:
nil - when |italic= absent or not set; returns nil
default - for completeness, should rarely if ever be used; returns nil
yes - force args.text to be rendered in italic font; returns 'italic'
no - force args.text to be rendered in normal font; returns 'normal'
unset - disables font control so that font-style applied to text is dictated by markup inside or outside the template; returns 'inherit'
invert - disables font control so that font-style applied to text is dictated by markup outside or inverted inside the template; returns 'invert'
]]
local function validate_italic (args)
local properties = {['yes'] = 'italic', ['no'] = 'normal', ['unset'] = 'inherit', ['invert'] = 'invert', ['default'] = nil};
local count = 0
for _, arg in pairs {'italic', 'italics', 'i'} do
if args[arg] then
count = count + 1
end
end
if count > 1 then -- return nil and an error message if more than one is set
return nil, 'only one of |italic=, |italics=, or |i= can be specified';
end
return properties[args.italic or args.italics or args.i], nil; -- return an appropriate value and a nil error message
end
--[=[--------------------------< V A L I D A T E _ C A T _ A R G S >----------------------------------------------------------
Default behavior of the {{lang}} and {{lang-xx}} templates is to add categorization when the templates are used in mainspace.
This default functionality may be suppressed by setting |nocat=yes or |cat=no. This function selects one of these two parameters
to control categorization.
Because having two parameters with 'opposite' names and 'opposite' values is confusing, this function accepts only affirmative
values for |nocat= and only negative values for |cat=; in both cases the 'other' sense (and non-sense) is not accepted and the
parameter is treated as if it were not set in the template.
Sets args.nocat to true if categorization is to be turned off; to nil if the default behavior should apply.
Accepted values for |nocat= are the text strings:
'yes', 'y', 'true', 't', on, '1' -- [[Module:Yesno]] returns logical true for all of these; false or nil else
for |cat=
'no', 'n', 'false', 'f', 'off', '0' -- [[Module:Yesno]] returns logical false for all of these; true or nil else
]=]
local function validate_cat_args (args)
if not (args.nocat or args.cat) then -- both are nil, so categorize
return;
end
if false == yesno (args.cat) or true == yesno (args.nocat) then
args.nocat = true; -- set to true when args.nocat is affirmative; nil else (as if the parameter were not set in the template)
else -- args.nocat is the parameter actually used.
args.nocat = nil;
end
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array ( needle, haystack )
if needle == nil then
return false;
end
for n,v in ipairs( haystack ) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< F O R M A T _ I E T F _ T A G >------------------------------------------------
prettify ietf tags to use recommended subtag formats:
code: lower case
script: sentence case
region: upper case
variant: lower case
private: lower case prefixed with -x-
]]
local function format_ietf_tag (code, script, region, variant, private)
local out = {};
if is_set (private) then
return table.concat ({code:lower(), 'x', private:lower()}, '-'); -- if private, all other tags ignored
end
table.insert (out, code:lower());
if is_set (script) then
script = script:lower():gsub ('^%a', string.upper);
table.insert (out, script);
end
if is_set (region) then
table.insert (out, region:upper());
end
if is_set (variant) then
table.insert (out, variant:lower());
end
return table.concat (out, '-');
end
--[[--------------------------< G E T _ I E T F _ P A R T S >--------------------------------------------------
extracts and returns IETF language tag parts:
primary language subtag (required) - 2 or 3 character IANA language code
script subtag - four character IANA script code
region subtag - two-letter or three digit IANA region code
variant subtag - four digit or 5-8 alnum variant code; only one variant subtag supported
private subtag - x- followed by 1-8 alnum private code; only supported with the primary language tag
in any one of these forms
lang lang-variant
lang-script lang-script-variant
lang-region lang-region-variant
lang-script-region lang-script-region-variant
lang-x-private
each of lang, script, region, variant, and private, when used, must be valid
Languages with both two- and three-character code synonyms are promoted to the two-character synonym because
the IANA registry file omits the synonymous three-character code; we cannot depend on browsers understanding
the synonymous three-character codes in the lang= attribute.
For {{lang-xx}} templates, the parameters |script=, |region=, and |variant= are supported (not supported in {{lang}}
because those parameters are superfluous to the IETF subtags in |code=)
returns six values; all lower case. Valid parts are returned as themselves; omitted parts are returned as empty strings, invalid
parts are returned as nil; the sixth returned item is an error message (if an error detected) or nil.
see http://www.rfc-editor.org/rfc/bcp/bcp47.txt section 2.1
]]
local function get_ietf_parts (source, args_script, args_region, args_variant)
local code, script, region, variant, private; -- ietf tag parts
if not is_set (source) then
return nil, nil, nil, nil, nil, 'missing language tag';
end
local pattern = { -- table of tables holding acceptibe ietf tag patterns and short names of the ietf part captured by the pattern
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)%-(%d%d%d%d)$', 's', 'r', 'v'}, -- 1 - ll-Ssss-RR-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)%-(%d%d%d%d)$', 's', 'r', 'v'}, -- 2 - ll-Ssss-DDD-variant (where region is 3 digits; variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'r', 'v'}, -- 3 - ll-Ssss-RR-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'r', 'v'}, -- 4 - ll-Ssss-DDD-variant (where region is 3 digits; variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d%d)$', 's', 'v'}, -- 5 - ll-Ssss-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'v'}, -- 6 - ll-Ssss-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a)%-(%d%d%d%d)$', 'r', 'v'}, -- 7 - ll-RR-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%d%d%d)%-(%d%d%d%d)$', 'r', 'v'}, -- 8 - ll-DDD-variant (where region is 3 digits; variant is 4 digits)
{'^(%a%a%a?)%-(%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 'r', 'v'}, -- 9 - ll-RR-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%d%d%d)%-(%w%w%w%w%w%w?%w?%w?)$', 'r', 'v'}, -- 10 - ll-DDD-variant (where region is 3 digits; variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%d%d%d%d)$', 'v'}, -- 11 - ll-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%w%w%w%w%w%w?%w?%w?)$', 'v'}, -- 12 - ll-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)$', 's', 'r'}, -- 13 - ll-Ssss-RR
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)$', 's', 'r'}, -- 14 - ll-Ssss-DDD (region is 3 digits)
{'^(%a%a%a?)%-(%a%a%a%a)$', 's'}, -- 15 - ll-Ssss
{'^(%a%a%a?)%-(%a%a)$', 'r'}, -- 16 - ll-RR
{'^(%a%a%a?)%-(%d%d%d)$', 'r'}, -- 17 - ll-DDD (region is 3 digits)
{'^(%a%a%a?)$'}, -- 18 - ll
{'^(%a%a%a?)%-x%-(%w%w?%w?%w?%w?%w?%w?%w?)$', 'p'}, -- 19 - ll-x-pppppppp (private is 1-8 alnum characters)
}
local t = {}; -- table of captures; serves as a translator between captured ietf tag parts and named variables
for i, v in ipairs (pattern) do -- spin through the pattern table looking for a match
local c1, c2, c3, c4; -- captures in the 'pattern' from the pattern table go here
c1, c2, c3, c4 = source:match (pattern[i][1]); -- one or more captures set if source matches pattern[i])
if c1 then -- c1 always set on match
code = c1; -- first capture is always code
t = {
[pattern[i][2] or 'x'] = c2, -- fill the table of captures with the rest of the captures
[pattern[i][3] or 'x'] = c3, -- take index names from pattern table and assign sequential captures
[pattern[i][4] or 'x'] = c4, -- index name may be nil in pattern[i] table so "or 'x'" spoofs a name for this index in this table
};
script = t.s or ''; -- translate table contents to named variables;
region = t.r or ''; -- absent table entries are nil so set named ietf parts to empty string for concatenation
variant= t.v or '';
private = t.p or '';
break; -- and done
end
end
if not code then
return nil, nil, nil, nil, nil, table.concat ({'unrecognized language tag: ', source}); -- don't know what we got but it is malformed
end
code = code:lower(); -- ensure that we use and return lower case version of this
if not (override_table[code] or lang_table[code] or synonym_table[code] or lang_dep_table[code]) then
return nil, nil, nil, nil, nil, table.concat ({'unrecognized language code: ', code}); -- invalid language code, don't know about the others (don't care?)
end
if synonym_table[code] then -- if 639-2/639-2T code has a 639-1 synonym
table.insert (maint_cats, table.concat ({'Lang and lang-xx code promoted to ISO 639-1|', code}));
table.insert (maint_msgs, table.concat ({'code: ', code, ' promoted to code: ', synonym_table[code]}));
code = synonym_table[code]; -- use the synonym
end
if is_set (script) then
if is_set (args_script) then
return code, nil, nil, nil, nil, 'redundant script tag'; -- both code with script and |script= not allowed
end
else
script = args_script or ''; -- use args.script if provided
end
if is_set (script) then
script = script:lower(); -- ensure that we use and return lower case version of this
if not script_table[script] then
return code, nil, nil, nil, nil, table.concat ({'unrecognized script: ', script, ' for code: ', code}); -- language code ok, invalid script, don't know about the others (don't care?)
end
end
if suppressed_table[script] then -- ensure that code-script does not use a suppressed script
if in_array (code, suppressed_table[script]) then
return code, nil, nil, nil, nil, table.concat ({'script: ', script, ' not supported for code: ', code}); -- language code ok, script is suppressed for this code
end
end
if is_set (region) then
if is_set (args_region) then
return code, nil, nil, nil, nil, 'redundant region tag'; -- both code with region and |region= not allowed
end
else
region = args_region or ''; -- use args.region if provided
end
if is_set (region) then
region = region:lower(); -- ensure that we use and return lower case version of this
if not region_table[region] then
return code, script, nil, nil, nil, table.concat ({'unrecognized region: ', region, ' for code: ', code});
end
end
if is_set (variant) then
if is_set (args_variant) then
return code, nil, nil, nil, nil, 'redundant variant tag'; -- both code with variant and |variant= not allowed
end
else
variant = args_variant or ''; -- use args.variant if provided
end
if is_set (variant) then
variant = variant:lower(); -- ensure that we use and return lower case version of this
if not variant_table[variant] then -- make sure variant is valid
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant});
end -- does this duplicate/replace tests in lang() and lang_xx()?
if is_set (script) then -- if script set it must be part of the 'prefix'
if not in_array (table.concat ({code, '-', script}), variant_table[variant]['prefixes']) then
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code-script pair: ', code, '-', script});
end
elseif is_set (region) then -- if region set, there are some prefixes that require lang code and region (en-CA-newfound)
if not in_array (code, variant_table[variant]['prefixes']) then -- first see if lang code is all that's required (en-oxendict though en-GB-oxendict is preferred)
if not in_array (table.concat ({code, '-', region}), variant_table[variant]['prefixes']) then -- now try for lang code and region (en-CA-newfound)
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code-region pair: ', code, '-', region});
end
end
else -- cheap way to determine if there are prefixes; fonipa and others don't have prefixes; # operator always returns 0
if variant_table[variant]['prefixes'][1] and not in_array (code, variant_table[variant]['prefixes']) then
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code: ', code});
end
end
end
if is_set (private) then
private = private:lower(); -- ensure that we use and return lower case version of this
if not override_table[table.concat ({code, '-x-', private})] then -- make sure private tag is valid; note that index
return code, script, region, nil, nil, table.concat ({'unrecognized private tag: ', private});
end
end
return code, script, region, variant, private, nil; -- return the good bits; make sure that msg is nil
end
--[[--------------------------< M A K E _ E R R O R _ M S G >--------------------------------------------------
assembles an error message from template name, message text, help link, and error category.
]]
local function make_error_msg (msg, args, template)
local out = {};
local category;
if 'Transliteration' == template then
category = 'Transliteration';
else
category = 'Lang and lang-xx'
end
table.insert (out, table.concat ({'[', args.text or 'undefined', '] '})); -- for error messages output args.text if available
table.insert (out, table.concat ({'<span style=\"color:#d33\">Error: {{', template, '}}: '}));
table.insert (out, msg);
table.insert (out, table.concat ({' ([[:Category:', category, ' template errors|help]])'}));
table.insert (out, '</span>');
if (0 == namespace or 10 == namespace) and not args.nocat then -- categorize in article space (and template space to take care of broken usages)
table.insert (out, table.concat ({'[[Category:', category, ' template errors]]'}));
end
return table.concat (out);
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided, returns a wikilink in the form [[L]]; if neither are provided or link is omitted, returns an
empty string.
]=]
local function make_wikilink (link, display)
if is_set (link) then
if is_set (display) then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
else
return '';
end
end
--[[--------------------------< D I V _ M A R K U P _ A D D >--------------------------------------------------
adds <i> and </i> tags to list-item text or to implied <p>..</p> text. mixed not supported
]]
local function div_markup_add (text, style)
local implied_p = {};
if text:find ('^\n[%*:;#]') then -- look for list markup; list markup must begin at start of text
if 'italic' == style then
return text:gsub ('(\n[%*:;#]+)([^\n]+)', '%1<i>%2</i>'); -- insert italic markup at each list item
else
return text;
end
end
if text:find ('\n+') then -- look for any number of \n characters in text
text = text:gsub ('([^\n])\n([^\n])', '%1 %2'); -- replace single newline characters with a space character which mimics mediawiki
if 'italic' == style then
text = text:gsub('[^\n]+', '<p><i>%1</i></p>'); -- insert p and italic markup tags at each impled p (two or more consecutive '\n\n' sequences)
else
text = text:gsub ('[^\n]+', '<p>%1</p>'); -- insert p markup at each impled p
text = text:gsub ('\n', ''); -- strip newline characters
end
end
return text;
end
--[[--------------------------< T I T L E _ W R A P P E R _ M A K E >------------------------------------------
makes a <span title="<title text>"><content_text></span> or <div title="<title text>"><content_text></div> where
<title text> is in the tool-tip in the wiki's local language and <content_text> is non-local-language text in
html markup. This because the lang= attibute applies to the content of its enclosing tag.
<tag> holds a string 'div' or 'span' used to choose the correct wrapping tag
]]
local function title_wrapper_make (title_text, content_text, tag)
local wrapper_t = {};
table.insert (wrapper_t, table.concat ({'<', tag})); -- open opening wrapper tag
table.insert (wrapper_t, ' title=\"'); -- begin title attribute
table.insert (wrapper_t, title_text); -- add <title_text>
table.insert (wrapper_t, '\">'); -- end title attribute and close opening wrapper tag
table.insert (wrapper_t, content_text); -- add <content_text>
table.insert (wrapper_t, table.concat ({'</', tag, '>'})); -- add closing wrapper tag
return table.concat (wrapper_t); -- make a big string and done
end
--[[--------------------------< M A K E _ T E X T _ H T M L >--------------------------------------------------
Add the html markup to text according to the type of content that it is: <span> or <i> tags for inline content or
<div> tags for block content
The lang= attribute also applies to the content of the tag where it is placed so this is wrong because 'Spanish
language text' is English:
<i lang="es" title="Spanish language text">casa</i>
should be:
<span title="Spanish language text"><i lang="es">casa</i></span>
or for <div>...</div>:
<div title="Spanish language text"><div lang="es"><spanish-language-text></div></div>
]]
local function make_text_html (code, text, tag, rtl, style, size, language)
local html_t = {};
local style_added = '';
local wrapper_tag = tag; -- <tag> gets modified so save a copy for use when/if we create a wrapper span or div
if text:match ('^%*') then
table.insert (html_t, '*'); -- move proto language text prefix outside of italic markup if any; use numeric entity because plain splat confuses MediaWiki
text = text:gsub ('^%*', ''); -- remove the splat from the text
end
if 'span' == tag then -- default html tag for inline content
if 'italic' == style then -- but if italic
tag = 'i'; -- change to <i> tags
end
else -- must be div so go
text = div_markup_add (text, style); -- handle implied <p>, implied <p> with <i>, and list markup (*;:#) with <i>
end
table.insert (html_t, table.concat ({'<', tag})); -- open the <i>, <span>, or <div> html tag
code = code:gsub ('%-x%-.*', ''); -- strip private use subtag from code tag because meaningless outside of wikipedia
table.insert (html_t, table.concat ({' lang="', code, '\"'})); -- add language attribute
if (rtl or unicode.is_rtl(text)) and ('ltr' == this_wiki_lang_dir) then -- text is right-to-left on a left-to-right wiki
table.insert (html_t, ' dir="rtl"'); -- add direction attribute for right-to-left languages
elseif not (rtl or unicode.is_rtl(text)) and ('rtl' == this_wiki_lang_dir) then -- text is left-to-right on a right-to-left wiki
table.insert (html_t, ' dir="ltr"'); -- add direction attribute for left-to-right languages
end
if 'normal' == style then -- when |italic=no
table.insert (html_t, ' style=\"font-style: normal;'); -- override external markup, if any
style_added = '\"'; -- remember that style attribute added and is not yet closed
end
if is_set (size) then -- when |size=<something>
if is_set (style_added) then
table.insert (html_t, table.concat ({' font-size: ', size, ';'})); -- add when style attribute already inserted
else
table.insert (html_t, table.concat ({' style=\"font-size: ', size, ';'})); -- create style attribute
style_added = '\"'; -- remember that style attribute added and is not yet closed
end
end
table.insert (html_t, table.concat ({style_added, '>'})); -- close the opening html tag
table.insert (html_t, text); -- insert the text
table.insert (html_t, table.concat ({'</', tag, '>'})); -- close the 'text' <i>, <span>, or <div> html tag
if is_set (language) then -- create a <title_text> string for the title= attribute in a wrapper span or div
local title_text;
if 'zxx' == code then -- special case for this tag 'no linguistic content'
title_text = table.concat ({language, ' text'}); -- not a language so don't use 'language' in title text
elseif mw.ustring.find (language, 'languages', 1, true) then
title_text = table.concat ({language, ' collective text'}); -- for collective languages
else
title_text = table.concat ({language, '-language text'}); -- for individual languages
end
return title_wrapper_make (title_text, table.concat (html_t), wrapper_tag);
else
return table.concat (html_t);
end
end
--[=[-------------------------< M A K E _ C A T E G O R Y >----------------------------------------------------
For individual language, <language>, returns:
[[Category:Articles containing <language>-language text]]
for English:
[[Category:Articles containing explicitly cited English-language text]]
for ISO 639-2 collective languages (and for 639-1 bh):
[[Category:Articles with text in <language> languages]]
]=]
local function make_category (code, language_name, nocat, name_get)
local cat = {};
local retval;
if ((0 ~= namespace) or nocat) and not name_get then -- only categorize in article space
return ''; -- return empty string for concatenation
end
if mw.ustring.find (language_name, 'languages', 1, true) then
return table.concat ({'[[Category:Articles with text in ', language_name, ']]'});
end
table.insert (cat, '[[Category:Articles containing ');
if this_wiki_lang_tag == code then
table.insert (cat, 'explicitly cited ' .. language_name); -- unique category name for the local language
else
table.insert (cat, language_name);
end
table.insert (cat, '-language text]]');
return table.concat (cat);
end
--[[--------------------------< M A K E _ T R A N S L I T >----------------------------------------------------
return translit <i lang=xx-Latn>...</i> where xx is the language code; else return empty string
The value |script= is not used in {{transliteration}} for this purpose; instead it uses |code. Because language scripts
are listed in the {{transliteration}} switches they are included in the data tables. The script parameter is introduced
at {{Language with name and transliteration}}. If |script= is set, this function uses it in preference to code.
To avoid confusion, in this module and the templates that use it, the transliteration script parameter is renamed
to be |translit-script= (in this function, tscript)
This function is used by both lang_xx() and transl()
lang_xx() always provides code, language_name, and translit; may provide tscript; never provides style
transl() always provides language_name, translit, and one of code or tscript, never both; always provides style
For {{transliteration}}, style only applies when a language code is provided
]]
local function make_translit (code, language_name, translit, std, tscript, style)
local title;
local out_t = {};
local title_t = lang_data.translit_title_table; -- table of transliteration standards and the language codes and scripts that apply to those standards
local title_text = ''; -- tool tip text for title= attribute
std = std and std:lower(); -- lower case for table indexing
if not is_set (std) and not is_set (tscript) then -- when neither standard nor script specified
title_text = language_name; -- write a generic tool tip
if not mw.ustring.find (language_name, 'languages', 1, true) then -- collective language names (plural 'languages' is part of the name)
title_text = title_text .. '-language'; -- skip this text (individual and macro languages only)
end
title_text = title_text .. ' romanization'; -- finish the tool tip; use romanization when neither script nor standard supplied
elseif is_set (std) and is_set (tscript) then -- when both are specified
if title_t[std] then -- and if standard is legitimate
if title_t[std][tscript] then -- and if script for that standard is legitimate
if script_table[tscript] then
title_text = title_text .. table.concat ({title_t[std][tscript:lower()], ' (', script_table[tscript], ' script) transliteration'}); -- add the appropriate text to the tool tip
else
title_text = title_text .. title_t[std]['default']; -- use the default if script not in std table; TODO: maint cat? error message because script not found for this standard?
end
else
title_text = title_text .. title_t[std]['default']; -- use the default if script not in std table; TODO: maint cat? error message because script not found for this standard?
end
else
return ''; -- invalid standard, setup for error message
end
elseif is_set (std) then -- translit-script not set, use language code
if not title_t[std] then return ''; end -- invalid standard, setup for error message
if title_t[std][code] then -- if language code is in the table (transl may not provide a language code)
title_text = title_text .. table.concat ({title_t[std][code:lower()], ' (', language_name, ' language) transliteration'}); -- add the appropriate text to the tool tip
else -- code doesn't match
title_text = title_text .. title_t[std]['default']; -- so use the standard's default
end
else -- here if translit-script set but translit-std not set
if title_t['no_std'][tscript] then
title_text = title_text .. title_t['no_std'][tscript]; -- use translit-script if set
elseif title_t['no_std'][code] then
title_text = title_text .. title_t['no_std'][code]; -- use language code
else
if is_set (tscript) then
title_text = title_text .. table.concat ({language_name, '-script transliteration'}); -- write a script tool tip
elseif is_set (code) then
if not mw.ustring.find (language_name, 'languages', 1, true) then -- collective language names (plural 'languages' is part of the name)
title_text = title_text .. '-language'; -- skip this text (individual and macro languages only)
end
title_text = title_text .. ' transliteration'; -- finish the tool tip
else
title_text = title_text .. ' transliteration'; -- generic tool tip (can we ever get here?)
end
end
end
local close_tag;
if is_set (code) then -- when a language code is provided (always with {{lang-xx}} templates, not always with {{transliteration}})
code = code:match ('^(%a%a%a?)'); -- strip all subtags leaving only the language subtag
if not style then -- nil for the default italic style
table.insert (out_t, "<i lang=\""); -- so use <i> tag
close_tag = '</i>'; -- tag to be used when closing
else
table.insert (out_t, table.concat ({'<span style=\"font-style: ', style, '\" lang=\"'})); -- non-standard style, construct a span tag for it
close_tag = '</span>'; -- tag to be used when closing
end
table.insert (out_t, code);
table.insert (out_t, "-Latn\">"); -- transliterations are always Latin script
else
table.insert (out_t, "<span>"); -- when no language code: no lang= attribute, not italic ({{transliteration}} only)
close_tag = '</span>';
end
table.insert (out_t, translit); -- add the translit text
table.insert (out_t, close_tag); -- and add the appropriate </i> or </span>
if '' == title_text then -- when there is no need for a tool-tip
return table.concat (out_t); -- make a string and done
else
return title_wrapper_make (title_text, table.concat (out_t), 'span'); -- wrap with a tool-tip span and don
end
end
--[[--------------------------< V A L I D A T E _ T E X T >----------------------------------------------------
This function checks the content of args.text and returns empty string if nothing is amiss else it returns an
error message. The tests are for empty or missing text and for improper or disallowed use of apostrophe markup.
Italic rendering is controlled by the |italic= template parameter so italic markup should never appear in args.text
either as ''itself'' or as '''''bold italic''''' unless |italic=unset or |italic=invert.
]]
local function validate_text (template, args)
if not is_set (args.text) then
return make_error_msg ('no text', args, template);
end
if args.text:find ("%f[\']\'\'\'\'%f[^\']") or args.text:find ("\'\'\'\'\'[\']+") then -- because we're looking, look for 4 appostrophes or 6+ appostrophes
return make_error_msg ('text has malformed markup', args, template);
end
local style = args.italic;
if ('unset' ~= style) and ('invert' ~=style) then
if args.text:find ("%f[\']\'\'%f[^\']") or args.text:find ("%f[\']\'\'\'\'\'%f[^\']") then -- italic but not bold, or bold italic
return make_error_msg ('text has italic markup', args, template);
end
end
end
--[[--------------------------< R E N D E R _ M A I N T >------------------------------------------------------
render mainenance messages and categories
]]
local function render_maint(nocat)
local maint = {};
if 0 < #maint_msgs then -- when there are maintenance messages
table.insert (maint, table.concat ({'<span class="lang-comment" style="font-style: normal; display: none; color: #33aa33; margin-left: 0.3em;">'})); -- opening <span> tag
for _, msg in ipairs (maint_msgs) do
table.insert (maint, table.concat ({msg, ' '})); -- add message strings
end
table.insert (maint, '</span>'); -- close the span
end
if (0 < #maint_cats) and (0 == namespace) and not nocat then -- when there are maintenance categories; article namespace only
for _, cat in ipairs (maint_cats) do
table.insert (maint, table.concat ({'[[Category:', cat, ']]'})); -- format and add the categories
end
end
return table.concat (maint);
end
--[[--------------------------< P R O T O _ P R E F I X >------------------------------------------------------
for proto languages, text is prefixed with a splat. We do that here as a flag for make_text_html() so that a splat
will be rendered outside of italic markup (if used). If the first character in text here is already a splat, we
do nothing
proto_param is boolean or nil; true adds splat prefix regardless of language name; false removes and / or inhibits
regardless of language name; nil does nothing; presumes that the value in text is correct but removes extra splac
]]
local function proto_prefix (text, language_name, proto_param)
if false == proto_param then -- when forced by |proto=no
return text:gsub ('^%**', ''); -- return text without splat prefix regardless of language name or existing splat prefix in text
elseif (language_name:find ('^Proto%-') or (true == proto_param)) then -- language is a proto or forced by |proto=yes
return text:gsub ('^%**', '*'); -- prefix proto-language text with a splat; also removes duplicate prefixing splats
end
return text:gsub ('^%*+', '*'); -- return text unmolested except multiple splats reduced to one splat
end
--[[--------------------------< H A S _ P O E M _ T A G >------------------------------------------------------
looks for a poem strip marker in text; returns true when found; false else
auto-italic detection disabled when text has poem stripmarker because it is not possible for this code to know
the content that will replace the stripmarker.
]]
local function has_poem_tag (text)
return text:find ('\127[^\127]*UNIQ%-%-poem%-[%a%d]+%-QINU[^\127]*\127') and true or false;
end
--[[--------------------------< H T M L _ T A G _ S E L E C T >------------------------------------------------
Inspects content of and selectively trims text. Returns text and the name of an appropriate html tag for text.
If text contains:
\n\n text has implied <p>..</p> tags - trim leading and trailing whitespace and return
If text begins with list markup:
\n* unordered
\n; definition
\n: definition
\n# ordered
trim all leading whitespace except \n and trim all trailing whitespace
If text contains <poem>...</poem> stripmarker, return text unmodified and choose <div>..</div> tags because
the stripmarker is replaced with text wrapped in <div>..</div> tags.
If the text contains any actual <div>...</div> tags, then it's again returned unmodified and <div>...</div>
tags are used to wrap it, to prevent div/span inversion.
]]
local function html_tag_select (text)
local tag;
if has_poem_tag (text) then -- contains poem stripmarker (we can't know the content of that)
tag = 'div'; -- poem replacement is in div tags so lang must use div tags
elseif text:find ('<div') then -- reductive; if the text contains a div tag, we must use div tags
tag = 'div';
elseif mw.text.trim (text):find ('\n\n+') then -- contains implied p tags
text = mw.text.trim (text); -- trim leading and trailing whitespace characters
tag = 'div'; -- must be div because span may not contain p tags (added later by MediaWiki); poem replacement is in div tags
elseif text:find ('\n[%*:;%#]') then -- if text has list markup
text = text:gsub ('^[\t\r\f ]*', ''):gsub ('%s*$', ''); -- trim all whitespace except leading newline character '\n'
tag = 'div'; -- must be div because span may not contain ul, dd, dl, ol tags (added later by MediaWiki)
else
text = mw.text.trim (text); -- plain text
tag = 'span'; -- so span is fine
end
return text, tag;
end
--[[--------------------------< V A L I D A T E _ P R O T O >--------------------------------------------------
validates value assigned to |proto=; permitted values are yes and no; yes returns as true, no returns as false,
empty string (or parameter omitted) returns as nil; any other value returns as nil with a second return value of
true indicating that some other value has been assigned to |proto=
]]
local function validate_proto (proto_param)
if 'yes' == proto_param then
return true;
elseif 'no' == proto_param then
return false;
elseif is_set (proto_param) then
return nil, true; -- |proto= something other than 'yes' or 'no'
else
return nil; -- missing or empty
end
end
--[[--------------------------< L A N G U A G E _ N A M E _ G E T >--------------------------------------------
common function to return language name from the data set according to IETF tag
returns language name if found in data tables; nil else
]]
local function language_name_get (ietf, code, cat)
ietf = ietf:lower(); -- ietf:lower() because format_ietf_tag() returns mixed case
local name; -- remains nil if not found
if override_table[ietf] then -- look for whole IETF tag in override table
name = override_table[ietf];
elseif override_table[code] then -- not there so try basic language tag
name = override_table[code];
elseif lang_table[code] then -- shift to iana active tag/name table
name = lang_table[code];
elseif lang_dep_table[code] then -- try the iana deprecated tag/name table
name = lang_dep_table[code];
end
if lang_dep_table[code] and cat then -- because deprecated code may have been overridden to en.wiki preferred name
table.insert (maint_cats, table.concat ({'Lang and lang-xx using deprecated ISO 639 codes|', code}));
table.insert (maint_msgs, table.concat ({'code: ', code, ' is deprecated'}));
end
return name; -- name from data tables or nil
end
--[[--------------------------< _ L A N G >--------------------------------------------------------------------
entry point for {{lang}}
there should be no reason to set parameters in the {{lang}} {{#invoke:}}
<includeonly>{{#invoke:lang|lang}}</includeonly>
parameters are received from the template's frame (parent frame)
]]
local function _lang (args)
local out = {};
local language_name; -- used to make category names
local category_name; -- same as language_name except that it retains any parenthetical disambiguators (if any) from the data set
local subtags = {}; -- IETF subtags script, region, variant, and private
local code; -- the language code
local msg; -- for error messages
local tag = 'span'; -- initial value for make_text_html()
local template = args.template or 'Lang';
maint_cats = {}; -- initialize because when this module required into another module, these only declared once so only initialzed once
maint_msgs = {};
validate_cat_args (args); -- determine if categorization should be suppressed
if args[1] and args.code then
return make_error_msg ('conflicting: {{{1}}} and |code=', args, template);
else
args.code = args[1] or args.code; -- prefer args.code
end
if args[2] and args.text then
return make_error_msg ('conflicting: {{{2}}} and |text=', args, template);
else
args.text = args[2] or args.text; -- prefer args.text
end
msg = validate_text (template, args); -- ensure that |text= is set
if is_set (msg) then -- msg is an already-formatted error message
return msg;
end
args.text, tag = html_tag_select (args.text); -- inspects text; returns appropriate html tag with text trimmed accordingly
args.rtl = args.rtl == 'yes'; -- convert to boolean: 'yes' -> true, other values -> false
args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag
if msg then
return make_error_msg (table.concat ({'invalid |proto=: ', args.proto}), args, template);
end
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (args.code); -- |script=, |region=, |variant= not supported because they should be part of args.code ({{{1}}} in {{lang}})
if msg then
return make_error_msg ( msg, args, template);
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, template);
end
if nil == args.italic then -- nil when |italic= absent or not set or |italic=default; args.italic controls
if ('latn' == subtags.script) or -- script is latn
(this_wiki_lang_tag ~= code and not is_set (subtags.script) and not has_poem_tag (args.text) and unicode.is_Latin (args.text)) then -- text not this wiki's language, no script specified and not in poem markup but is wholly latn script (auto-italics)
args.italic = 'italic'; -- DEFAULT for {{lang}} templates is upright; but if latn script set for font-style:italic
else
args.italic = 'inherit'; -- italic not set; script not latn; inherit current style
end
end
if is_set (subtags.script) then -- if script set, override rtl setting
if in_array (subtags.script, lang_data.rtl_scripts) then
args.rtl = true; -- script is an rtl script
else
args.rtl = false; -- script is not an rtl script
end
end
args.code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles
language_name = language_name_get (args.code, code, true); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
if 'invert' == args.italic and 'span' == tag then -- invert only supported for in-line content
args.text = invert_italics (args.text)
end
args.text = proto_prefix (args.text, language_name, args.proto); -- prefix proto-language text with a splat
table.insert (out, make_text_html (args.code, args.text, tag, args.rtl, args.italic, args.size, language_name));
table.insert (out, make_category (code, language_name, args.nocat));
table.insert (out, render_maint(args.nocat)); -- maintenance messages and categories
return table.concat (out); -- put it all together and done
end
--[[--------------------------< L A N G >----------------------------------------------------------------------
entry point for {{lang}}
there should be no reason to set parameters in the {{lang}} {{#invoke:}}
<includeonly>{{#invoke:lang|lang}}</includeonly>
parameters are received from the template's frame (parent frame)
]]
local function lang (frame)
local args = getArgs (frame, { -- this code so that we can detect and handle wiki list markup in text
valueFunc = function (key, value)
if 2 == key or 'text' == key then -- the 'text' parameter; do not trim wite space
return value; -- return untrimmed 'text'
elseif value then -- all other values: if the value is not nil
value = mw.text.trim (value); -- trim whitespace
if '' ~= value then -- empty string when value was only whitespace
return value;
end
end
return nil; -- value was empty or contained only whitespace
end -- end of valueFunc
});
return _lang (args);
end
--[[--------------------------< T R A N S L A T I O N _ M A K E >----------------------------------------------
stand-alone function to create literal translation of main text
Also used by {{lang-x2}}
]]
local function translation_make (args_t)
local translation_t = {', '}; -- initialize output
if 'none' ~= args_t.label then -- if we want a label
table.insert (translation_t, '<small>'); -- open the <small> html tag
if 'no' == args_t.link then
table.insert (translation_t, '<abbr title="literal translation">lit.</abbr>'); -- unlinked form
else
table.insert (translation_t, make_wikilink ('Literal translation', 'lit.')); -- linked form
end
table.insert (translation_t, " </small>"); -- close the <small> html tag
end
table.insert (translation_t, table.concat ({''', args_t.translation, '''})); -- use html entities to avoid wiki markup confusion
return table.concat (translation_t); -- make a big string and done
end
--[[--------------------------< L A N G _ X X >----------------------------------------------------------------
For the {{lang-xx}} templates, the only parameter required to be set in the template is the language code. All
other parameters can, usually should, be written in the template call. For {{lang-xx}} templates for languages
that can have multiple writing systems, it may be appropriate to set |script= as well.
For each {{lang-xx}} template choose the appropriate entry-point function so that this function knows the default
styling that should be applied to text.
For normal, upright style:
<includeonly>{{#invoke:lang|lang_xx_inherit|code=xx}}</includeonly>
For italic style:
<includeonly>{{#invoke:lang|lang_xx_italic|code=xx}}</includeonly>
All other parameters should be received from the template's frame (parent frame)
Supported parameters are:
|code = (required) the IANA language code
|script = IANA script code; especially for use with languages that use multiple writing systems
|region = IANA region code
|variant = IANA variant code
|text = (required) the displayed text in language specified by code
|link = boolean false ('no') does not link code-spcified language name to associated language article
|rtl = boolean true ('yes') identifies the language specified by code as a right-to-left language
|nocat = boolean true ('yes') inhibits normal categorization; error categories are not affected
|cat = boolian false ('no') opposite form of |nocat=
|italic = boolean true ('yes') renders displayed text in italic font; boolean false ('no') renders displayed text in normal font; not set renders according to initial_style_state
|lit = text that is a literal translation of text
|label = 'none' to suppress all labeling (language name, 'translit.', 'lit.')
any other text replaces language-name label - automatic wikilinking disabled
for those {{lang-xx}} templates that support transliteration (those templates where |text= is not entirely latn script):
|translit = text that is a transliteration of text
|translit-std = the standard that applies to the transliteration
|translit-script = ISO 15924 script name; falls back to code
For {{lang-xx}}, the positional parameters are:
{{{1}}} text
{{{2}}} transliterated text
{{{3}}} literal translation text
no other positional parameters are allowed
]]
local function _lang_xx (args)
local out = {};
local language_name; -- used to make display text, article links
local category_name; -- same as language_name except that it retains any parenthetical disambiguators (if any) from the data set
local subtags = {}; -- IETF subtags script, region, and variant
local code; -- the language code
local translit_script_name; -- name associated with IANA (ISO 15924) script code
local translit;
local translit_title;
local msg; -- for error messages
local tag = 'span'; -- initial value for make_text_html()
local template = args.template or 'Lang-xx';
maint_cats = {}; -- initialize because when this module required into another module, these only declared once so only initialzed once
maint_msgs = {};
if args[1] and args.text then
return make_error_msg ('conflicting: {{{1}}} and |text=', args, template);
else
args.text = args[1] or args.text; -- prefer args.text
end
msg = validate_text (template, args); -- ensure that |text= is set, does not contain italic markup and is protected from improper bolding
if is_set (msg) then
return msg;
end
args.text, tag = html_tag_select (args.text); -- inspects text; returns appropriate html tag with text trimmed accordingly
if args[2] and args.translit then
return make_error_msg ('conflicting: {{{2}}} and |translit=', args, template);
else
args.translit = args[2] or args.translit -- prefer args.translit
end
if args[3] and (args.translation or args.lit) then
return make_error_msg ('conflicting: {{{3}}} and |lit= or |translation=', args, template);
elseif args.translation and args.lit then
return make_error_msg ('conflicting: |lit= and |translation=', args, template);
else
args.translation = args[3] or args.translation or args.lit; -- prefer args.translation
end
if args.links and args.link then
return make_error_msg ('conflicting: |links= and |link=', args, template);
else
args.link = args.link or args.links; -- prefer args.link
end
validate_cat_args (args); -- determine if categorization should be suppressed
args.rtl = args.rtl == 'yes'; -- convert to boolean: 'yes' -> true, other values -> false
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (args.code, args.script, args.region, args.variant); -- private omitted because private
if msg then -- if an error detected then there is an error message
return make_error_msg (msg, args, template);
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, template);
end
if nil == args.italic then -- args.italic controls
if is_set (subtags.script) then
if 'latn' == subtags.script then
args.italic = 'italic'; -- |script=Latn; set for font-style:italic
else
args.italic = initial_style_state; -- italic not set; script is not latn; set for font-style:<initial_style_state>
end
else
args.italic = initial_style_state; -- here when |italic= and |script= not set; set for font-style:<initial_style_state>
end
end
if is_set (subtags.script) then -- if script set override rtl setting
if in_array (subtags.script, lang_data.rtl_scripts) then
args.rtl = true; -- script is an rtl script
else
args.rtl = false; -- script is not an rtl script
end
end
args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag
if msg then
return make_error_msg (table.concat ({'invalid |proto=: ', args.proto}), args, template);
end
args.code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles
language_name = language_name_get (args.code, code, true); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
category_name = language_name; -- category names retain IANA parenthetical diambiguators (if any)
language_name = language_name:gsub ('%s+%b()', ''); -- remove IANA parenthetical disambiguators or qualifiers from names that have them
if args.label then
if 'none' ~= args.label then
table.insert (out, table.concat ({args.label, ': '})); -- custom label
end
else
if 'no' == args.link then
table.insert (out, language_name); -- language name without wikilink
else
if mw.ustring.find (language_name, 'languages', 1, true) then
table.insert (out, make_wikilink (language_name)); -- collective language name uses simple wikilink
elseif lang_data.article_name[code] then
table.insert (out, make_wikilink (lang_data.article_name[code], language_name)); -- language name with wikilink from override data
else
table.insert (out, make_wikilink (language_name .. ' language', language_name)); -- language name with wikilink
end
end
table.insert (out, ': '); -- separator
end
if 'invert' == args.italic then
args.text = invert_italics (args.text)
end
args.text = proto_prefix (args.text, language_name, args.proto); -- prefix proto-language text with a splat
table.insert (out, make_text_html (args.code, args.text, tag, args.rtl, args.italic, args.size, ('none' == args.label) and language_name or nil))
if is_set (args.translit) and not unicode.is_Latin (args.text) then -- transliteration (not supported in {{lang}}); not supported when args.text is wholly latn text (this is an imperfect test)
table.insert (out, ', '); -- comma to separate text from translit
if 'none' ~= args.label then
table.insert (out, '<small>');
if script_table[args['translit-script']] then -- when |translit-script= is set, try to use the script's name
translit_script_name = script_table[args['translit-script']];
else
translit_script_name = language_name; -- fall back on language name
end
translit_title = mw.title.makeTitle (0, table.concat ({'Romanization of ', translit_script_name})); -- make a title object
if translit_title.exists and ('no' ~= args.link) then
table.insert (out, make_wikilink ('Romanization of ' .. translit_script_name or language_name, 'romanized') .. ':'); -- make a wikilink if there is an article to link to
else
table.insert (out, 'romanized:'); -- else plain text
end
table.insert (out, ' </small>'); -- close the small tag
end
translit = make_translit (args.code, language_name, args.translit, args['translit-std'], args['translit-script'])
if is_set (translit) then
table.insert (out, translit);
else
return make_error_msg (table.concat ({'invalid translit-std: \'', args['translit-std'] or '[missing]'}), args, template);
end
end
if is_set (args.translation) then -- translation (not supported in {{lang}})
table.insert (out, translation_make (args));
end
table.insert (out, make_category (code, category_name, args.nocat));
table.insert (out, render_maint(args.nocat)); -- maintenance messages and categories
return table.concat (out); -- put it all together and done
end
--[[--------------------------< L A N G _ X X _ A R G S _ G E T >----------------------------------------------
common function to get args table from {{lang-??}} templates
returns table of args
]]
local function lang_xx_args_get (frame)
local args = getArgs(frame,
{
parentFirst= true, -- parameters in the template override parameters set in the {{#invoke:}}
valueFunc = function (key, value)
if 1 == key then -- the 'text' parameter; do not trim wite space
return value; -- return untrimmed 'text'
elseif value then -- all other values: if the value is not nil
value = mw.text.trim (value); -- trim whitespace
if '' ~= value then -- empty string when value was only whitespace
return value;
end
end
return nil; -- value was empty or contained only whitespace
end -- end of valueFunc
});
return args;
end
--[[--------------------------< L A N G _ X X _ I T A L I C >--------------------------------------------------
Entry point for those {{lang-xx}} templates that call lang_xx_italic(). Sets the initial style state to italic.
]]
local function lang_xx_italic (frame)
local args = lang_xx_args_get (frame);
initial_style_state = 'italic';
return _lang_xx (args);
end
--[[--------------------------< _ L A N G _ X X _ I T A L I C >------------------------------------------------
Entry point ffrom another module. Sets the initial style state to italic.
]]
local function _lang_xx_italic (args)
initial_style_state = 'italic';
return _lang_xx (args);
end
--[[--------------------------< L A N G _ X X _ I N H E R I T >------------------------------------------------
Entry point for those {{lang-xx}} templates that call lang_xx_inherit(). Sets the initial style state to inherit.
]]
local function lang_xx_inherit (frame)
local args = lang_xx_args_get (frame);
initial_style_state = 'inherit';
return _lang_xx (args);
end
--[[--------------------------< _ L A N G _ X X _ I N H E R I T >----------------------------------------------
Entry point from another module. Sets the initial style state to inherit.
]]
local function _lang_xx_inherit (args)
initial_style_state = 'inherit';
return _lang_xx (args);
end
--[[--------------------------< _ I S _ I E T F _ T A G >------------------------------------------------------
Returns true when a language name associated with IETF language tag exists; nil else. IETF language tag must be valid.
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Module entry point from another module
]]
local function _is_ietf_tag (tag) -- entry point when this module is require()d into another
local c, s, r, v, p, err; -- code, script, region, variant, private, error message
c, s, r, v, p, err = get_ietf_parts (tag); -- disassemble tag into constituent part and validate
return ((c and not err) and true) or nil; -- return true when code portion has a value without error message; nil else
end
--[[--------------------------< I S _ I E T F _ T A G >--------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function is_ietf_tag (frame)
return _is_ietf_tag (getArgs (frame)[1]); -- args[1] is the ietf language tag to be tested; also get parent frame
end
--[[--------------------------< I S _ I E T F _ T A G _ F R A M E >--------------------------------------------
Module entry point from an {{#invoke:}}; same as is_ietf_tag() except does not get parameters from the parent
(template) frame. This function not useful when called by {{lang|fn=is_ietf_tag_frame|<tag>}} because <tag>
is in the parent frame.
]]
local function is_ietf_tag_frame (frame)
return _is_ietf_tag (getArgs (frame, {frameOnly = true,})[1]); -- args[1] is the ietf language tag to be tested; do not get parent frame
end
--[[--------------------------< _ N A M E _ F R O M _ T A G >--------------------------------------------------
Returns language name associated with IETF language tag if valid; error message else.
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Set invoke's |link= parameter to yes to get wikilinked version of the language name.
Module entry point from another module
]]
local function _name_from_tag (args)
local subtags = {}; -- IETF subtags script, region, variant, and private
local raw_code = args[1]; -- save a copy of the input IETF subtag
local link = 'yes' == args['link']; -- make a boolean
local label = args.label;
local code; -- the language code
local msg; -- gets an error message if IETF language tag is malformed or invalid
local language_name = '';
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (raw_code);
if msg then
local template = (args['template'] and table.concat ({'{{', args['template'], '}}: '})) or ''; -- make template name (if provided by the template)
return table.concat ({'<span style=\"color:#d33\">Error: ', template, msg, '</span>'});
end
raw_code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles; private omitted because private
language_name = language_name_get (raw_code, code); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
language_name = language_name:gsub ('%s+%b()', ''); -- remove IANA parenthetical disambiguators or qualifiers from names that have them
if link then -- when |link=yes, wikilink the language name
if mw.ustring.find (language_name, 'languages', 1, true) then
language_name = make_wikilink (language_name, label); -- collective language name uses simple wikilink
elseif lang_data.article_name[code] then
language_name = make_wikilink (lang_data.article_name[code], label or language_name); -- language name with wikilink from override data
else
language_name = make_wikilink (language_name .. ' language', label or language_name); -- language name with wikilink
end
end
return language_name;
end
--[[--------------------------< N A M E _ F R O M _ T A G >----------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function name_from_tag (frame) -- entry point from an {{#invoke:Lang|name_from_tag|<ietf tag>|link=<yes>|template=<template name>}}
return _name_from_tag (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame
end
--[[--------------------------< _ T A G _ F R O M _ N A M E >--------------------------------------------------
Returns the ietf language tag associated with the language name. Spelling of language name must be correct
according to the spelling in the source tables. When a standard language name has a parenthetical disambiguator,
that disambiguator must be omitted (they are not present in the data name-to-tag tables).
Module entry point from another module
]]
local function _tag_from_name (args) -- entry point from another module
local msg;
if args[1] and '' ~= args[1] then
local data = mw.loadData ('Module:Lang/tag from name'); -- get the reversed data tables TODO: change when going live
local lang = args[1]:lower(); -- allow any-case for the language name (speeling must till be correct)
local tag = data.rev_override_table[lang] or data.rev_lang_table[lang] or data.rev_lang_dep_table[lang]; -- get the code; look first in the override then in the standard
if tag then
return tag, true; -- language name found so return tag and done; second return used by is_lang_name()
else
msg = 'language: ' .. args[1] .. ' not found' -- language name not found, error message
end
else
msg = 'missing language name' -- language name not provided, error message
end
local template = '';
if args.template and '' ~= args.template then
template = table.concat ({'{{', args['template'], '}}: '}); -- make template name (if provided by the template)
end
return table.concat ({'<span style=\"color:#d33\">Error: ', template, msg, '</span>'});
end
--[[--------------------------< T A G _ F R O M _ N A M E >----------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function tag_from_name (frame) -- entry point from an {{#invoke:Lang|tag_from_name|<language name>|link=<yes>|template=<template name>}}
local result, _ = _tag_from_name (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame; supress second return used by is_lang_name()
return result;
end
--[[--------------------------< I S _ L A N G _ N A M E >------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function is_lang_name (frame)
local _, result = _tag_from_name (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame; supress second return used by tag_from_name()
return result and true or nil;
end
--[[--------------------------< _ T R A N S L >----------------------------------------------------------------
Module entry point from another module
]]
local function _transl (args)
local title_table = lang_data.translit_title_table; -- table of transliteration standards and the language codes and scripts that apply to those standards
local language_name; -- language name that matches language code; used for tool tip
local translit; -- transliterated text to display
local script; -- IANA script
local msg; -- for when called functions return an error message
maint_cats = {}; -- initialize because when this module required into another module, these only declared once so only initialzed once
maint_msgs = {};
if is_set (args[3]) then -- [3] set when {{transliteration|code|standard|text}}
args.text = args[3]; -- get the transliterated text
args.translit_std = args[2] and args[2]:lower(); -- get the standard; lower case for table indexing
if not title_table[args.translit_std] then
return make_error_msg (table.concat ({'unrecognized transliteration standard: ', args.translit_std}), args, 'Transliteration');
end
else
if is_set (args[2]) then -- [2] set when {{transliteration|code|text}}
args.text = args[2]; -- get the transliterated text
else
if args[1] and (args[1]:match ('^%a%a%a?%a?$') or -- args[2] missing; is args[1] a language or script tag or is it the transliterated text?
args[1]:match ('^%a%a%a?%-x%-')) then -- or is args[1] a private-use tag
return make_error_msg ('no text', args, 'Transliteration'); -- args[1] is a code so we're missing text
else
args.text = args[1]; -- args[1] is not a code so we're missing that; assign args.text for error message
return make_error_msg ('missing language / script code', args, 'Transliteration');
end
end
end
if is_set (args[1]) then -- IANA language code used for html lang= attribute; or ISO 15924 script code
if args[1]:match ('^%a%a%a?%a?$') or args[1]:match ('^%a%a%a?%-x%-') then -- args[1] has correct form?
args.code = args[1]:lower(); -- use the language/script code; only (2, 3, or 4 alpha characters) or private-use; lower case because table indexes are lower case
else
return make_error_msg (table.concat ({'unrecognized language / script code: ', args[1]}), args, 'Transliteration'); -- invalid language / script code
end
else
return make_error_msg ('missing language / script code', args, 'Transliteration'); -- missing language / script code so quit
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, 'Transliteration');
end
if 'italic' == args.italic then -- 'italic' when |italic=yes; because that is same as absent or not set and |italic=default
args.italic = nil; -- set to nil;
end
if override_table[args.code] then -- is code a language code defined in the override table?
language_name = override_table[args.code];
args.code = args.code:match ('^%a%a%a?'); -- if private use, strip all but language subtag
elseif lang_table[args.code] then -- is code a language code defined in the standard language code tables?
language_name = lang_table[args.code];
elseif lang_dep_table[args.code] then -- is code a language code defined in the deprecated language code tables?
language_name = lang_dep_table[args.code];
elseif script_table[args.code] then -- if here, code is not a language code; is it a script code?
language_name = script_table[args.code];
script = args.code; -- code was an ISO 15924 script so use that instead
args.code = ''; -- unset because not a language code
else
return make_error_msg (table.concat ({'unrecognized language / script code: ', args.code}), args, 'Transliteration'); -- invalid language / script code
end
-- here only when all parameters passed to make_translit() are valid
return make_translit (args.code, language_name, args.text, args.translit_std, script, args.italic);
end
--[[--------------------------< T R A N S L >------------------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function transl (frame)
return _transl (getArgs(frame));
end
--[[--------------------------< C A T E G O R Y _ F R O M _ T A G >--------------------------------------------
Returns category name associated with IETF language tag if valid; error message else
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Module entry point from another module
]]
local function _category_from_tag (args_t)
local subtags = {}; -- IETF subtags script, region, variant, and private
local raw_code = args_t[1]; -- save a copy of the input IETF subtag
local link = 'yes' == args_t.link; -- make a boolean
local label = args_t.label;
local code; -- the language code
local msg; -- gets an error message if IETF language tag is malformed or invalid
local category_name = '';
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (raw_code);
if msg then
local template = (args_t.template and table.concat ({'{{', args_t.template, '}}: '})) or ''; -- make template name (if provided by the template)
return table.concat ({'<span style=\"color:#d33\">Error: ', template, msg, '</span>'});
end
raw_code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles; private omitted because private
category_name = language_name_get (raw_code, code); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
category_name = make_category (code, category_name, nil, true):gsub ('[%[%]]', '');
if link then
return table.concat ({'[[:', category_name, ']]'});
else
return category_name;
end
end
--[[--------------------------< C A T E G O R Y _ F R O M _ T A G >--------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function category_from_tag (frame) -- entry point from an {{#invoke:Lang|category_from_tag|<ietf tag>|template=<template name>}}
return _category_from_tag (getArgs (frame)); -- pass-on the args table, nothing else; getArgs() so we also get parent frame
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
category_from_tag = category_from_tag,
lang = lang, -- entry point for {{lang}}
lang_xx_inherit = lang_xx_inherit, -- entry points for {{lang-??}}
lang_xx_italic = lang_xx_italic,
is_ietf_tag = is_ietf_tag,
is_ietf_tag_frame = is_ietf_tag_frame,
is_lang_name = is_lang_name,
tag_from_name = tag_from_name, -- returns ietf tag associated with language name
name_from_tag = name_from_tag, -- used for template documentation; possible use in ISO 639 name from code templates
transl = transl, -- entry point for {{transliteration}}
_category_from_tag = _category_from_tag, -- entry points when this module is require()d into other modules
_lang = _lang,
_lang_xx_inherit = _lang_xx_inherit,
_lang_xx_italic = _lang_xx_italic,
_is_ietf_tag = _is_ietf_tag,
get_ietf_parts = get_ietf_parts,
_tag_from_name = _tag_from_name,
_name_from_tag = _name_from_tag,
_transl = _transl,
_translation_make = translation_make,
};
b4bf37fa610695625e5f1ff5d33471dfaaf8af34
Module:Documentation
828
13
225
47
2023-07-31T17:22:10Z
wikipedia>Izno
0
add a comment to make it obvious
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
local format = mw.ustring.format
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return format('[[%s|%s]]', page, display)
else
return format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return format(
'<span class="%s">(%s)</span>',
message('toolbar-class'),
table.concat(ret, ' | ')
)
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:attr('role', 'complementary')
:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)
:attr('aria-label', args.heading == '' and 'Documentation' or nil)
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.canonicalUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[File:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
return {
title = title,
docTitle = docTitle,
-- View, display, edit, and purge links if /doc exists.
viewLinkDisplay = message('view-link-display'),
editLinkDisplay = message('edit-link-display'),
historyLinkDisplay = message('history-link-display'),
purgeLinkDisplay = message('purge-link-display'),
preload = preload,
createLinkDisplay = message('create-link-display')
}
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local docTitle = data.docTitle
-- yes, we do intend to purge the template page on which the documentation appears
local purgeLink = makeWikilink("Special:Purge/" .. data.title.prefixedText, data.purgeLinkDisplay)
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, data.editLinkDisplay)
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, data.historyLinkDisplay)
return "[" .. viewLink .. "] [" .. editLink .. "] [" .. historyLink .. "] [" .. purgeLink .. "]"
else
local createLink = makeUrlLink(docTitle:canonicalUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
return "[" .. createLink .. "] [" .. purgeLink .. "]"
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:attr('id', 'documentation-heading')
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editDisplay = message('edit-link-display')
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, editDisplay)
local historyDisplay = message('history-link-display')
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:canonicalUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeWikilink("Special:EditPage/" .. sandboxPage, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:canonicalUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeWikilink("Special:EditPage/" .. testcasesPage, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:canonicalUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
268dc89480af10873bfbca5439ae8e61b404f770
Template:Hatnote templates
10
109
313
2023-08-04T18:41:52Z
wikipedia>FooBarBaz
0
Moved.
wikitext
text/x-wiki
{{Navbox
| name = Hatnote templates
| state = {{{state|<includeonly>autocollapse</includeonly>}}}
| bodyclass = hlist
| belowclass = hlist
| title = [[WP:Hatnote#Hatnote templates|Hatnote templates]]
| above =
*[[Wikipedia:Hatnote]]
*[[Wikipedia:Disambiguation]]
*[[Wikipedia:Redirect]]
| group1 = Generic
| list1 =
*{{tl|Hatnote}}
*{{tl|Self-reference}}
| group2 = For and about
| list2 =
*{{tl|For}}
*{{tl|For-text}} (for custom text)
*{{tl|For-multi}} (for multiple uses)
*{{tl|About}}
*Variations: {{tl|Other uses}}
*{{tl|Other uses of}}
*{{tl|Redirect-distinguish-for}}
*{{tl|About-distinguish}}
*{{tl|About-distinguish-text}}
| group3 = Other topics
| list3 =
*{{tl|Other people}}
*{{tl|About other people}} (adds "about" description)
*{{tl|Similar names}}
*{{tl|Other storms}}
*{{tl|Other places}}
*{{tl|Other ships}}
| group4 = Redirect
| list4 =
*{{tl|Redirect}}
*{{tl|Redirect2}} (for two redirects)
*{{tl|Redirect-multi}} (for multiple redirects)
*{{tl|Redirect-several}} (for several redirects, without listing each)
*{{tl|Redirect-synonym}}
*{{tl|Redirect-distinguish}}
*{{tl|Redirect-distinguish-text}}
*{{tl|Redirect-distinguish-for}}
*{{tl|Technical reasons}}
| group5 = Distinguish
| list5 =
*{{tl|Distinguish}} (supports custom text)
*{{tl|About-distinguish}}
*{{tl|About-distinguish-text}} (for custom text)
*{{tl|Redirect-distinguish}}
*{{tl|Redirect-distinguish-text}} (for custom text)
*{{tl|Redirect-distinguish-for}}
| group6 = For use in sections
| list6 =
*{{tl|Main}}
*{{tl|Main if exists}}
*{{tl|Main list}}
*{{tl|Further}}
*{{tl|Further-text}} (for custom text)
*{{tl|Further interlanguage link}}
*{{tl|See also}}
*{{tl|See also if exists}}
*{{tl|See also-text}} (for custom text)
*{{tl|For outline}}
*{{tl|For timeline}}
| group7 = Special
| list7 =
*{{tl|Broader}}
*{{tl|For introduction}}
*{{tl|See Wiktionary}}
*{{tl|Transcluding article}}
*{{tl|Transcluded section}}
| group8 = Subject specific
| list8 =
* {{tl|About year}}
* {{tl|Highway detail hatnote}}
* {{tl|For LMST}}
* {{tl|WikiIPA}}
| below =
*{{Icon|cat}} [[:Category:Hatnote templates]]
**[[:Category:Hatnote modules|modules]]
**[[:Category:Hatnote templates for names|for [family] names]]
**[[:Category:Hatnote templates for lists|for lists]]
*[[Template:Category hatnote templates|hatnote templates for category pages]]
}}<noinclude>
{{Documentation}}
</noinclude>
5ea17ab2381b3c2002e4846f08d462d2574b6015
Template:Documentation
10
12
45
2023-08-07T07:13:50Z
meta>Nieuwsgierige Gebruiker
0
Undid revision 342625 by [[Special:Contributions/67.163.114.70|67.163.114.70]] ([[User talk:67.163.114.70|talk]])
wikitext
text/x-wiki
{{#invoke:Documentation|main}}
bb08b6773a4c1e1d528cefda2d7c305d8b5193ec
Template:Infobox settlement
10
148
396
2023-08-08T12:47:25Z
wikipedia>Paine Ellsworth
0
per edit request on talk page - remove redundant "%"
wikitext
text/x-wiki
<includeonly>{{main other|{{#invoke:Settlement short description|main}}|}}{{Infobox
| child = {{yesno|{{{embed|}}}}}
| templatestyles = Infobox settlement/styles.css
| bodyclass = ib-settlement vcard
<!--** names, type, and transliterations ** -->
| above = <div class="fn org">{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}</div>
{{#if:{{{native_name|}}}|<div class="nickname ib-settlement-native" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</div>}}{{#if:{{{other_name|}}}|<div class="nickname ib-settlement-other-name">{{{other_name}}}</div>}}
| subheader = {{#if:{{{settlement_type|{{{type|}}}}}}|<div class="category">{{{settlement_type|{{{type}}}}}}</div>}}
| rowclass1 = mergedtoprow ib-settlement-official
| data1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
<!-- ***Transliteration language 1*** -->
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|{{{translit_lang1}}} transcription(s)}}
| rowclass3 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
| label3 = • {{{translit_lang1_type}}}
| data3 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}}}
| rowclass4 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
| label4 = • {{{translit_lang1_type1}}}
| data4 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}}}
| rowclass5 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
| label5 = • {{{translit_lang1_type2}}}
| data5 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}}}
| rowclass6 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
| label6 = • {{{translit_lang1_type3}}}
| data6 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}}}
| rowclass7 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
| label7 = • {{{translit_lang1_type4}}}
| data7 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}}}
| rowclass8 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
| label8 = • {{{translit_lang1_type5}}}
| data8 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}}}
| rowclass9 = mergedbottomrow
| label9 = • {{{translit_lang1_type6}}}
| data9 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}}}}}}
<!-- ***Transliteration language 2*** -->
| rowclass10 = mergedtoprow
| header10 = {{#if:{{{translit_lang2|}}}|{{{translit_lang2}}} transcription(s)}}
| rowclass11 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
| label11 = • {{{translit_lang2_type}}}
| data11 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}}}
| rowclass12 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
| label12 = • {{{translit_lang2_type1}}}
| data12 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}}}
| rowclass13 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
| label13 = • {{{translit_lang2_type2}}}
| data13 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}}}
| rowclass14 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
| label14 = • {{{translit_lang2_type3}}}
| data14 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}}}
| rowclass15 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
| label15 = • {{{translit_lang2_type4}}}
| data15 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}}}
| rowclass16 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
| label16 = • {{{translit_lang2_type5}}}
| data16 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}}}
| rowclass17 = mergedbottomrow
| label17 = • {{{translit_lang2_type6}}}
| data17 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}}}}}}
<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| rowclass18 = mergedtoprow
| data18 = {{#if:{{{image_skyline|}}}|<!--
-->{{#invoke:InfoboxImage|InfoboxImage<!--
-->|image={{{image_skyline|}}}<!--
-->|size={{if empty|{{{image_size|}}}|{{{imagesize|}}}}}|sizedefault=250px<!--
-->|alt={{if empty|{{{image_alt|}}}|{{{alt|}}}}}<!--
-->|title={{if empty|{{{image_caption|}}}|{{{caption|}}}|{{{image_alt|}}}|{{{alt|}}}}}}}<!--
-->{{#if:{{{image_caption|}}}{{{caption|}}}|<div class="ib-settlement-caption">{{if empty|{{{image_caption|}}}|{{{caption|}}}}}</div>}} }}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass19 = mergedtoprow
| class19 = maptable
| data19 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|125px|100x100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Flag of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Flag|link={{{flag_link|}}}|name={{{official_name}}}}}</div>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{seal_alt|}}}|title=Official seal of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Seal}}|link={{{seal_link|}}}|name={{{official_name}}}}}</div>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{shield_alt|}}}|title=Coat of arms of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Coat of arms|link={{{shield_link|}}}|name={{{official_name}}}}}</div>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}</div>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100x100px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption-link">{{{map_caption}}}</div>}}}}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{{map_caption}}}}}}}}}
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
}} }}
<!-- ***Etymology*** -->
| rowclass20 = mergedtoprow
| data20 = {{#if:{{{etymology|}}}|Etymology: {{{etymology}}} }}
<!-- ***Nickname*** -->
| rowclass21 = {{#if:{{{etymology|}}}|mergedrow|mergedtoprow}}
| data21 = {{#if:{{{nickname|}}}{{{nicknames|}}}|<!--
-->{{Pluralize from text|parse_links=1|{{if empty|{{{nickname|}}}|{{{nicknames|}}}{{force plural}}}}|<!--
-->link={{{nickname_link|}}}|singular=Nickname|likely=Nickname(s)|plural=Nicknames}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{nickname|}}}|{{{nicknames|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|parse_links=1|{{{nickname|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible nickname list]]}}}}}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}{{{mottoes|}}}|<!--
-->{{Pluralize from text|{{if empty|{{{motto|}}}|{{{mottoes|}}}{{force plural}}}}|<!--
-->link={{{motto_link|}}}|singular=Motto|likely=Motto(s)|plural=Mottoes}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{motto|}}}|{{{mottoes|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|{{{motto|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible motto list]]}}}}}}
<!-- ***Anthem*** -->
| rowclass23 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}{{{motto|}}}{{{mottoes|}}}|mergedrow|mergedtoprow}}
| data23 = {{#if:{{{anthem|}}}|{{#if:{{{anthem_link|}}}|[[{{{anthem_link|}}}|Anthem:]]|Anthem:}} {{{anthem}}}}}
<!-- ***Map*** -->
| rowclass24 = mergedtoprow
| data24 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption">{{{map_caption}}}</div>}}
}}}}
| rowclass25 = mergedrow
| data25 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<div class="ib-settlement-caption">{{{map_caption1}}}</div>}} }}
<!-- ***Pushpin Map*** -->
| rowclass26 = mergedtoprow
| data26 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{#if:{{{image_map|}}}||{{{map_caption}}}}}}}}}}}
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| rowclass27 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|{{#if:{{{grid_position|}}}|mergedrow|mergedbottomrow}}}}
| data27 = {{#if:{{{coordinates|}}}
|Coordinates{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})}}: {{#invoke:ISO 3166|geocoordinsert|nocat=true|1={{{coordinates|}}}|country={{{subdivision_name|}}}|subdivision1={{{subdivision_name1|}}}|subdivision2={{{subdivision_name2|}}}|subdivision3={{{subdivision_name3|}}}|type=city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{replace|{{{population_total}}}|,|}}|R}})}}}} }}{{{coordinates_footnotes|}}} }}
| rowclass28 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label28 = {{if empty|{{{grid_name|}}}|Grid position}}
| data28 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass29 = mergedtoprow
| label29 = {{{subdivision_type}}}
| data29 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass30 = mergedrow
| label30 = {{{subdivision_type1}}}
| data30 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass31 = mergedrow
| label31 = {{{subdivision_type2}}}
| data31 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type3}}}
| data32 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type4}}}
| data33 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type5}}}
| data34 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type6}}}
| data35 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass36 = mergedtoprow
| label36 = {{{established_title}}}
| data36 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass37 = mergedrow
| label37 = {{{established_title1}}}
| data37 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass38 = mergedrow
| label38 = {{{established_title2}}}
| data38 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass39 = mergedrow
| label39 = {{{established_title3}}}
| data39 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title4}}}
| data40 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title5}}}
| data41 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title6}}}
| data42 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title7}}}
| data43 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass44 = mergedrow
| label44 = {{{extinct_title}}}
| data44 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass45 = mergedrow
| label45 = Founded by
| data45 = {{{founder|}}}
| rowclass46 = mergedrow
| label46 = [[Namesake|Named for]]
| data46 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass47 = mergedtoprow
| label47 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Seat}}
| data47 = {{{seat|}}}
| rowclass48 = mergedrow
| label48 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Former seat}}
| data48 = {{{seat1|}}}
| rowclass49 = mergedrow
| label49 = {{#if:{{{seat2_type|}}}|{{{seat2_type}}}|Former seat}}
| data49 = {{{seat2|}}}
| rowclass51 = {{#if:{{{seat|}}}{{{seat1|}}}{{{seat2|}}}|mergedrow|mergedtoprow}}
| label51 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|Boroughs}}
| data51 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass52 = mergedtoprow
| header52 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Government<div class="ib-settlement-fn">{{{government_footnotes|}}}</div>}}
<!-- ***Government*** -->
| rowclass53 = mergedrow
| label53 = • Type
| data53 = {{{government_type|}}}
| rowclass54 = mergedrow
| label54 = • Body
| class54 = agent
| data54 = {{{governing_body|}}}
| rowclass55 = mergedrow
| label55 = • {{{leader_title}}}
| data55 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title1}}}
| data56 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title2}}}
| data57 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass58 = mergedrow
| label58 = • {{{leader_title3}}}
| data58 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass59 = mergedrow
| label59 = • {{{leader_title4}}}
| data59 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
| rowclass60 = mergedrow
| label60 = {{{government_blank1_title}}}
| data60 = {{#if:{{{government_blank1|}}}|{{{government_blank1|}}}}}
| rowclass61 = mergedrow
| label61 = {{{government_blank2_title}}}
| data61 = {{#if:{{{government_blank2|}}}|{{{government_blank2|}}}}}
| rowclass62 = mergedrow
| label62 = {{{government_blank3_title}}}
| data62 = {{#if:{{{government_blank3|}}}|{{{government_blank3|}}}}}
| rowclass63 = mergedrow
| label63 = {{{government_blank4_title}}}
| data63 = {{#if:{{{government_blank4|}}}|{{{government_blank4|}}}}}
| rowclass64 = mergedrow
| label64 = {{{government_blank5_title}}}
| data64 = {{#if:{{{government_blank5|}}}|{{{government_blank5|}}}}}
| rowclass65 = mergedrow
| label65 = {{{government_blank6_title}}}
| data65 = {{#if:{{{government_blank6|}}}|{{{government_blank6|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass66 = mergedtoprow
| header66 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
}}
}}
| rowclass67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
}}
| data67 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass68 = mergedrow
| label68 = • Land
| data68 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass69 = mergedrow
| label69 = • Water
| data69 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}{{#ifeq:%|{{#invoke:string|sub|{{{area_water_percent|}}}|-1}}||%}}}}}}
| rowclass70 = mergedrow
| label70 = • Urban<div class="ib-settlement-fn">{{{area_urban_footnotes|}}}</div>
| data70 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass71 = mergedrow
| label71 = • Rural<div class="ib-settlement-fn">{{{area_rural_footnotes|}}}</div>
| data71 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass72 = mergedrow
| label72 = • Metro<div class="ib-settlement-fn">{{{area_metro_footnotes|}}}</div>
| data72 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass73 = mergedrow
| label73 = • Rank
| data73 = {{{area_rank|}}}
| rowclass74 = mergedrow
| label74 = • {{{area_blank1_title}}}
| data74 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass75 = mergedrow
| label75 = • {{{area_blank2_title}}}
| data75 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass76 = mergedrow
| label76 =
| data76 = {{{area_note|}}}
<!-- ***Dimensions*** -->
| rowclass77 = mergedtoprow
| header77 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<div class="ib-settlement-fn">{{{dimensions_footnotes|}}}</div>}}
| rowclass78 = mergedrow
| label78 = • Length
| data78 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass79 = mergedrow
| label79 = • Width
| data79 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass80 = mergedtoprow
| label80 = {{#if:{{{elevation_link|}}}|[[{{{elevation_link|}}}|Elevation]]|Elevation}}<div class="ib-settlement-fn">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</div>
| data80 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass81 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}|mergedrow|mergedtoprow}}
| label81 = Highest elevation<div class="ib-settlement-fn">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</div>
| data81 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass82 = mergedrow
| label82 = • Rank
| data82 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass83 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label83 = Lowest elevation<div class="ib-settlement-fn">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</div>
| data83 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass84 = mergedrow
| label84 = • Rank
| data84 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass85 = mergedtoprow
| label85 = Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
| data85 = {{fix comma category|{{#if:{{{population|}}}
| {{formatnum:{{replace|{{{population}}}|,|}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{replace|{{{population_total}}}|,|}}}}
}}
}}
}}}}
| rowclass86 = mergedtoprow
| header86 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
}}
}}
}}
| rowclass87 = mergedrow
| label87 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
| data87 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{fix comma category|{{formatnum:{{replace|{{{population_total}}}|,|}}}}}}
}}
}}
}}
| rowclass88 = mergedrow
| label88 = • Estimate <div class="ib-settlement-fn">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</div>
| data88 = {{#if:{{{population_est|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_est}}}|,|}}}}}} }}
<!-- ***Population rank*** -->
| rowclass89 = mergedrow
| label89 = • Rank
| data89 = {{{population_rank|}}}
| rowclass90 = mergedrow
| label90 = • Density
| data90 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass91 = mergedrow
| label91 = • Rank
| data91 = {{{population_density_rank|}}}
| rowclass92 = mergedrow
| label92 = • [[Urban area|Urban]]<div class="ib-settlement-fn">{{{population_urban_footnotes|}}}</div>
| data92 = {{#if:{{{population_urban|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_urban}}}|,|}}}}}} }}
| rowclass93 = mergedrow
| label93 = • Urban density
| data93 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass94 = mergedrow
| label94 = • [[Rural area|Rural]]<div class="ib-settlement-fn">{{{population_rural_footnotes|}}}</div>
| data94 = {{#if:{{{population_rural|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_rural}}}|,|}}}}}}}}
| rowclass95 = mergedrow
| label95 = • Rural density
| data95 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass96 = mergedrow
| label96 = • [[Metropolitan area|Metro]]<div class="ib-settlement-fn">{{{population_metro_footnotes|}}}</div>
| data96 = {{#if:{{{population_metro|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_metro}}}|,|}}}}}} }}
| rowclass97 = mergedrow
| label97 = • Metro density
| data97 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass98 = mergedrow
| label98 = • {{{population_blank1_title|}}}<div class="ib-settlement-fn">{{{population_blank1_footnotes|}}}</div>
| data98 = {{#if:{{{population_blank1|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank1}}}|,|}}}}}}}}
| rowclass99 = mergedrow
| label99 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data99 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass100 = mergedrow
| label100 = • {{{population_blank2_title|}}}<div class="ib-settlement-fn">{{{population_blank2_footnotes|}}}</div>
| data100 = {{#if:{{{population_blank2|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank2}}}|,|}}}}}}}}
| rowclass101 = mergedrow
| label101 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data101 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass102 = mergedrow
| label102 =
| data102 = {{{population_note|}}}
| rowclass103 = mergedtoprow
| label103 = {{Pluralize from text|{{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}{{force plural}}}}|<!--
-->link=Demonym|singular=Demonym|likely=Demonym(s)|plural=Demonyms}}
| data103 = {{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}}}{{Main other|{{Pluralize from text|{{{population_demonym|}}}|likely=[[Category:Pages using infobox settlement with possible demonym list]]}}}}
<!-- ***Demographics 1*** -->
| rowclass104 = mergedtoprow
| header104 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<div class="ib-settlement-fn">{{{demographics1_footnotes|}}}</div>}}
| rowclass105 = mergedrow
| label105 = • {{{demographics1_title1}}}
| data105 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass106 = mergedrow
| label106 = • {{{demographics1_title2}}}
| data106 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass107 = mergedrow
| label107 = • {{{demographics1_title3}}}
| data107 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics1_title4}}}
| data108 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics1_title5}}}
| data109 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics1_title6}}}
| data110 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics1_title7}}}
| data111 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
| rowclass112 = mergedrow
| label112 = • {{{demographics1_title8}}}
| data112 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title8|}}}|{{{demographics1_info8|}}}}}}}
| rowclass113 = mergedrow
| label113 = • {{{demographics1_title9}}}
| data113 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title9|}}}|{{{demographics1_info9|}}}}}}}
| rowclass114 = mergedrow
| label114 = • {{{demographics1_title10}}}
| data114 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title10|}}}|{{{demographics1_info10|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass115 = mergedtoprow
| header115 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<div class="ib-settlement-fn">{{{demographics2_footnotes|}}}</div>}}
| rowclass116 = mergedrow
| label116 = • {{{demographics2_title1}}}
| data116 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass117 = mergedrow
| label117 = • {{{demographics2_title2}}}
| data117 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass118 = mergedrow
| label118 = • {{{demographics2_title3}}}
| data118 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass119 = mergedrow
| label119 = • {{{demographics2_title4}}}
| data119 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass120 = mergedrow
| label120 = • {{{demographics2_title5}}}
| data120 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass121 = mergedrow
| label121 = • {{{demographics2_title6}}}
| data121 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass122 = mergedrow
| label122 = • {{{demographics2_title7}}}
| data122 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
| rowclass123 = mergedrow
| label123 = • {{{demographics2_title8}}}
| data123 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title8|}}}|{{{demographics2_info8|}}}}}}}
| rowclass124 = mergedrow
| label124 = • {{{demographics2_title9}}}
| data124 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title9|}}}|{{{demographics2_info9|}}}}}}}
| rowclass125 = mergedrow
| label125 = • {{{demographics2_title10}}}
| data125 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title10|}}}|{{{demographics2_info10|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass126 = mergedtoprow
| header126 = {{#if:{{{timezone1_location|}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}|}}
| rowclass127 = {{#if:{{{timezone1_location|}}}|mergedrow|mergedtoprow}}
| label127 = {{#if:{{{timezone1_location|}}}|{{{timezone1_location}}}|{{#if:{{{timezone2_location|}}}|{{{timezone2_location}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}}}}}
| data127 = {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}
|[[UTC{{{utc_offset1|{{{utc_offset}}}}}}]] {{#if:{{{timezone1|{{{timezone|}}}}}}|({{{timezone1|{{{timezone}}}}}})}}
|{{{timezone1|{{{timezone|}}}}}}
}}
| rowclass128 = mergedrow
| label128 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data128 = {{#if:{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}
|[[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]] {{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|({{{timezone1_DST|{{{timezone_DST}}}}}})}}
|{{{timezone1_DST|{{{timezone_DST|}}}}}}
}}
| rowclass129 = mergedrow
| label129 = {{#if:{{{timezone2_location|}}}| {{{timezone2_location|}}}|<nowiki />}}
| data129 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}
|[[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]] {{#if:{{{timezone2|}}}|({{{timezone2}}})}}
|{{{timezone2|}}}
}}
}}
| rowclass130 = mergedrow
| label130 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data130 = {{#if:{{{utc_offset2_DST|}}}|[[UTC{{{utc_offset2_DST|}}}]] {{#if:{{{timezone2_DST|}}}|({{{timezone2_DST|}}})}}
|{{{timezone2_DST|}}}
}}
| rowclass131 = mergedrow
| label131 = {{#if:{{{timezone3_location|}}}| {{{timezone3_location|}}}|<nowiki />}}
| data131 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset3|{{{utc_offset3|}}} }}}
|[[UTC{{{utc_offset3|{{{utc_offset3}}}}}}]] {{#if:{{{timezone3|}}}|({{{timezone3}}})}}
|{{{timezone3|}}}
}}
}}
| rowclass132 = mergedrow
| label132 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data132 = {{#if:{{{utc_offset3_DST|}}}|[[UTC{{{utc_offset3_DST|}}}]] {{#if:{{{timezone3_DST|}}}|({{{timezone3_DST|}}})}}
|{{{timezone3_DST|}}}
}}
| rowclass133 = mergedrow
| label133 = {{#if:{{{timezone4_location|}}}| {{{timezone4_location|}}}|<nowiki />}}
| data133 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset4|{{{utc_offset4|}}} }}}
|[[UTC{{{utc_offset4|{{{utc_offset4}}}}}}]] {{#if:{{{timezone4|}}}|({{{timezone4}}})}}
|{{{timezone4|}}}
}}
}}
| rowclass134 = mergedrow
| label134 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data134 = {{#if:{{{utc_offset4_DST|}}}|[[UTC{{{utc_offset4_DST|}}}]] {{#if:{{{timezone4_DST|}}}|({{{timezone4_DST|}}})}}
|{{{timezone4_DST|}}}
}}
| rowclass135 = mergedrow
| label135 = {{#if:{{{timezone5_location|}}}| {{{timezone5_location|}}}|<nowiki />}}
| data135 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset5|{{{utc_offset5|}}} }}}
|[[UTC{{{utc_offset5|{{{utc_offset5}}}}}}]] {{#if:{{{timezone5|}}}|({{{timezone5}}})}}
|{{{timezone5|}}}
}}
}}
| rowclass136 = mergedrow
| label136 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data136 = {{#if:{{{utc_offset5_DST|}}}|[[UTC{{{utc_offset5_DST|}}}]] {{#if:{{{timezone5_DST|}}}|({{{timezone5_DST|}}})}}
|{{{timezone5_DST|}}}
}}
<!-- ***Postal Code(s)*** -->
| rowclass137 = mergedtoprow
| label137 = {{{postal_code_type}}}
| class137 = adr
| data137 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<div class="postal-code">{{{postal_code}}}</div>}}}}
| rowclass138 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}|mergedbottomrow|mergedtoprow}}
| label138 = {{{postal2_code_type}}}
| class138 = adr
| data138 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<div class="postal-code">{{{postal2_code}}}</div>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass139 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}|mergedrow|mergedtoprow}}
| label139 = {{if empty|{{{area_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{if empty|{{{area_code|}}}|{{{area_codes|}}}{{force plural}}}}|<!--
-->link=Telephone numbering plan|singular=Area code|likely=Area code(s)|plural=Area codes}}}}
| data139 = {{if empty|{{{area_code|}}}|{{{area_codes|}}}}}{{#if:{{{area_code_type|}}}||{{Main other|{{Pluralize from text|any_comma=1|parse_links=1|{{{area_code|}}}|||[[Category:Pages using infobox settlement with possible area code list]]}}}}}}
<!-- Geocode-->
| rowclass140 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label140 = [[Geocode]]
| class140 = nickname
| data140 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass141 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label141 = [[ISO 3166|ISO 3166 code]]
| class141 = nickname
| data141 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass142 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label142 = {{#if:{{{registration_plate_type|}}}|{{{registration_plate_type}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data142 = {{{registration_plate|}}}
<!-- Other codes -->
| rowclass143 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label143 = {{{code1_name|}}}
| class143 = nickname
| data143 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass144 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label144 = {{{code2_name|}}}
| class144 = nickname
| data144 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass145 = mergedtoprow
| label145 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data145 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass146 = mergedrow
| label146 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data146 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass147 = mergedrow
| label147 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data147 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass148 = mergedrow
| label148 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data148 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass149 = mergedrow
| label149 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data149 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass150 = mergedrow
| label150 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data150 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass151 = mergedrow
| label151 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data151 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass152 = mergedrow
| label152 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data152 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass153 = mergedtoprow
| label153 = {{{blank_name_sec2}}}
| data153 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass154 = mergedrow
| label154 = {{{blank1_name_sec2}}}
| data154 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass155 = mergedrow
| label155 = {{{blank2_name_sec2}}}
| data155 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass156 = mergedrow
| label156 = {{{blank3_name_sec2}}}
| data156 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass157 = mergedrow
| label157 = {{{blank4_name_sec2}}}
| data157 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass158 = mergedrow
| label158 = {{{blank5_name_sec2}}}
| data158 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass159 = mergedrow
| label159 = {{{blank6_name_sec2}}}
| data159 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass160 = mergedrow
| label160 = {{{blank7_name_sec2}}}
| data160 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass161 = mergedtoprow
| label161 = Website
| data161 = {{#if:{{{website|}}}|{{{website}}}}}
| class162 = maptable
| data162 = {{#if:{{{module|}}}|{{{module}}}}}
<!-- ***Footnotes*** -->
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!-- Check for unknowns
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox settlement with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox settlement]] with unknown parameter "_VALUE_"|ignoreblank=y
| alt | anthem | anthem_link | area_blank1_acre | area_blank1_dunam | area_blank1_ha | area_blank1_km2 | area_blank1_sq_mi | area_blank1_title | area_blank2_acre | area_blank2_dunam | area_blank2_ha | area_blank2_km2 | area_blank2_sq_mi | area_blank2_title | area_code | area_code_type | area_codes | area_footnotes | area_land_acre | area_land_dunam | area_land_ha | area_land_km2 | area_land_sq_mi | area_metro_acre | area_metro_dunam | area_metro_footnotes | area_metro_ha | area_metro_km2 | area_metro_sq_mi | area_note | area_rank | area_rural_acre | area_rural_dunam | area_rural_footnotes | area_rural_ha | area_rural_km2 | area_rural_sq_mi | area_total_acre | area_total_dunam | area_total_ha | area_total_km2 | area_total_sq_mi | area_urban_acre | area_urban_dunam | area_urban_footnotes | area_urban_ha | area_urban_km2 | area_urban_sq_mi | area_water_acre | area_water_dunam | area_water_ha | area_water_km2 | area_water_percent | area_water_sq_mi | blank_emblem_alt | blank_emblem_link | blank_emblem_size | blank_emblem_type | blank_info | blank_info_sec1 | blank_info_sec2 | blank_name | blank_name_sec1 | blank_name_sec2 | blank1_info | blank1_info_sec1 | blank1_info_sec2 | blank1_name | blank1_name_sec1 | blank1_name_sec2 | blank2_info | blank2_info_sec1 | blank2_info_sec2 | blank2_name | blank2_name_sec1 | blank2_name_sec2 | blank3_info | blank3_info_sec1 | blank3_info_sec2 | blank3_name | blank3_name_sec1 | blank3_name_sec2 | blank4_info | blank4_info_sec1 | blank4_info_sec2 | blank4_name | blank4_name_sec1 | blank4_name_sec2 | blank5_info | blank5_info_sec1 | blank5_info_sec2 | blank5_name | blank5_name_sec1 | blank5_name_sec2 | blank6_info | blank6_info_sec1 | blank6_info_sec2 | blank6_name | blank6_name_sec1 | blank6_name_sec2 | blank7_info | blank7_info_sec1 | blank7_info_sec2 | blank7_name | blank7_name_sec1 | blank7_name_sec2 | caption | code1_info | code1_name | code2_info | code2_name | coor_pinpoint | coor_type | coordinates | coordinates_footnotes | demographics_type1 | demographics_type2 | demographics1_footnotes | demographics1_info1 | demographics1_info10 | demographics1_info2 | demographics1_info3 | demographics1_info4 | demographics1_info5 | demographics1_info6 | demographics1_info7 | demographics1_info8 | demographics1_info9 | demographics1_title1 | demographics1_title10 | demographics1_title2 | demographics1_title3 | demographics1_title4 | demographics1_title5 | demographics1_title6 | demographics1_title7 | demographics1_title8 | demographics1_title9 | demographics2_footnotes | demographics2_info1 | demographics2_info10 | demographics2_info2 | demographics2_info3 | demographics2_info4 | demographics2_info5 | demographics2_info6 | demographics2_info7 | demographics2_info8 | demographics2_info9 | demographics2_title1 | demographics2_title10 | demographics2_title2 | demographics2_title3 | demographics2_title4 | demographics2_title5 | demographics2_title6 | demographics2_title7 | demographics2_title8 | demographics2_title9 | dimensions_footnotes | dunam_link | elevation_footnotes | elevation_ft | elevation_link | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_max_rank | elevation_min_footnotes | elevation_min_ft | elevation_min_m | elevation_min_point | elevation_min_rank | elevation_point | embed | established_date | established_date1 | established_date2 | established_date3 | established_date4 | established_date5 | established_date6 | established_date7 | established_title | established_title1 | established_title2 | established_title3 | established_title4 | established_title5 | established_title6 | established_title7 | etymology | extinct_date | extinct_title | flag_alt | flag_border | flag_link | flag_size | footnotes | founder | geocode | governing_body | government_footnotes | government_type | government_blank1_title | government_blank1 | government_blank2_title | government_blank2 | government_blank2_title | government_blank3 | government_blank3_title | government_blank3 | government_blank4_title | government_blank4 | government_blank5_title | government_blank5 | government_blank6_title | government_blank6 | grid_name | grid_position | image_alt | image_blank_emblem | image_caption | image_flag | image_map | image_map1 | image_seal | image_shield | image_size | image_skyline | imagesize | iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | length_km | length_mi | map_alt | map_alt1 | map_caption | map_caption1 | mapsize | mapsize1 | module | motto | motto_link | mottoes | name | named_for | native_name | native_name_lang | nickname | nickname_link | nicknames | official_name | other_name | p1 | p10 | p11 | p12 | p13 | p14 | p15 | p16 | p17 | p18 | p19 | p2 | p20 | p21 | p22 | p23 | p24 | p25 | p26 | p27 | p28 | p29 | p3 | p30 | p31 | p32 | p33 | p34 | p35 | p36 | p37 | p38 | p39 | p4 | p40 | p41 | p42 | p43 | p44 | p45 | p46 | p47 | p48 | p49 | p5 | p50 | p6 | p7 | p8 | p9 | parts | parts_style | parts_type | pop_est_as_of | pop_est_footnotes | population | population_as_of | population_blank1 | population_blank1_footnotes | population_blank1_title | population_blank2 | population_blank2_footnotes | population_blank2_title | population_demonym | population_demonyms | population_density_blank1_km2 | population_density_blank1_sq_mi | population_density_blank2_km2 | population_density_blank2_sq_mi | population_density_km2 | population_density_metro_km2 | population_density_metro_sq_mi | population_density_rank | population_density_rural_km2 | population_density_rural_sq_mi | population_density_sq_mi | population_density_urban_km2 | population_density_urban_sq_mi | population_est | population_footnotes | population_metro | population_metro_footnotes | population_note | population_rank | population_rural | population_rural_footnotes | population_total | population_urban | population_urban_footnotes | postal_code | postal_code_type | postal2_code | postal2_code_type | pushpin_image | pushpin_label | pushpin_label_position | pushpin_map | pushpin_map_alt | pushpin_map_caption | pushpin_map_caption_notsmall | pushpin_map_narrow | pushpin_mapsize | pushpin_outside | pushpin_overlay | pushpin_relief | registration_plate | registration_plate_type | seal_alt | seal_link | seal_size | seal_type | seat | seat_type | seat1 | seat1_type | seat2 | seat2_type | settlement_type | shield_alt | shield_link | shield_size | short_description | subdivision_name | subdivision_name1 | subdivision_name2 | subdivision_name3 | subdivision_name4 | subdivision_name5 | subdivision_name6 | subdivision_type | subdivision_type1 | subdivision_type2 | subdivision_type3 | subdivision_type4 | subdivision_type5 | subdivision_type6 | timezone | timezone_DST | timezone_link | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | timezone3 | timezone3_DST | timezone3_location | timezone4 | timezone4_DST | timezone4_location | timezone5 | timezone5_DST | timezone5_location | total_type | translit_lang1 | translit_lang1_info | translit_lang1_info1 | translit_lang1_info2 | translit_lang1_info3 | translit_lang1_info4 | translit_lang1_info5 | translit_lang1_info6 | translit_lang1_type | translit_lang1_type1 | translit_lang1_type2 | translit_lang1_type3 | translit_lang1_type4 | translit_lang1_type5 | translit_lang1_type6 | translit_lang2 | translit_lang2_info | translit_lang2_info1 | translit_lang2_info2 | translit_lang2_info3 | translit_lang2_info4 | translit_lang2_info5 | translit_lang2_info6 | translit_lang2_type | translit_lang2_type1 | translit_lang2_type2 | translit_lang2_type3 | translit_lang2_type4 | translit_lang2_type5 | translit_lang2_type6 | type | unit_pref | utc_offset | utc_offset_DST | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | utc_offset3 | utc_offset3_DST | utc_offset4 | utc_offset4_DST | utc_offset5 | utc_offset5_DST | website | width_km | width_mi
}}<!--
-->{{#invoke:Check for clobbered parameters|check
| template = Infobox settlement
| cat = {{main other|Category:Pages using infobox settlement with conflicting parameters}}
| population; population_total
| image_size; imagesize
| image_alt; alt
| image_caption; caption
}}<!-- Wikidata
-->{{#if:{{{coordinates_wikidata|}}}{{{wikidata|}}}
|[[Category:Pages using infobox settlement with the wikidata parameter]]
}}{{main other|<!-- Missing country
-->{{#if:{{{subdivision_name|}}}||[[Category:Pages using infobox settlement with missing country]]}}<!-- No map
-->{{#if:{{{pushpin_map|}}}{{{image_map|}}}{{{image_map1|}}}||[[Category:Pages using infobox settlement with no map]]}}<!-- Image_map1 without image_map
-->{{#if:{{{image_map1|}}}|{{#if:{{{image_map|}}}||[[Category:Pages using infobox settlement with image_map1 but not image_map]]}}}}<!-- No coordinates
-->{{#if:{{{coordinates|}}}||[[Category:Pages using infobox settlement with no coordinates]]}}<!--
-->{{#if:{{{type|}}}|{{#ifeq:{{{settlement_type|a}}}|{{{settlement_type|b}}}|[[Category:Pages using infobox settlement with ignored type]]|}}|}}<!-- Ignored type parameter
-->{{#if:{{{embed|}}}|[[Category:Pages using infobox settlement with embed]]}}
}}</includeonly><noinclude>
{{documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
f793562757697511bcbaf05e1a004a887ca760f8
Template:Template parameter usage
10
78
243
2023-08-10T01:28:48Z
wikipedia>Jonesey95
0
clarify that the linked report applies only to article space
wikitext
text/x-wiki
{{#switch:{{{label|}}}
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|this template}} in articles{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|[[Template:{{ROOTPAGENAME}}]]}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|#default=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{{label|}}}]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
}}<noinclude>
{{documentation}}
</noinclude>
10a89e6a4bc63a1427518ea21bf94b8f623a7391
Module:Citation/CS1/COinS
828
164
428
2023-08-12T19:19:02Z
wikipedia>Trappist the monk
0
sync from sandbox;
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local has_accept_as_written, is_set, in_array, remove_wiki_link, strip_apostrophe_markup; -- functions in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< M A K E _ C O I N S _ T I T L E >----------------------------------------------
Makes a title for COinS from Title and / or ScriptTitle (or any other name-script pairs)
Apostrophe markup (bold, italics) is stripped from each value so that the COinS metadata isn't corrupted with strings
of %27%27...
]]
local function make_coins_title (title, script)
title = has_accept_as_written (title);
if is_set (title) then
title = strip_apostrophe_markup (title); -- strip any apostrophe markup
else
title = ''; -- if not set, make sure title is an empty string
end
if is_set (script) then
script = script:gsub ('^%l%l%s*:%s*', ''); -- remove language prefix if present (script value may now be empty string)
script = strip_apostrophe_markup (script); -- strip any apostrophe markup
else
script = ''; -- if not set, make sure script is an empty string
end
if is_set (title) and is_set (script) then
script = ' ' .. script; -- add a space before we concatenate
end
return title .. script; -- return the concatenation
end
--[[--------------------------< E S C A P E _ L U A _ M A G I C _ C H A R S >----------------------------------
Returns a string where all of Lua's magic characters have been escaped. This is important because functions like
string.gsub() treat their pattern and replace strings as patterns, not literal strings.
]]
local function escape_lua_magic_chars (argument)
argument = argument:gsub("%%", "%%%%"); -- replace % with %%
argument = argument:gsub("([%^%$%(%)%.%[%]%*%+%-%?])", "%%%1"); -- replace all other Lua magic pattern characters
return argument;
end
--[[--------------------------< G E T _ C O I N S _ P A G E S >------------------------------------------------
Extract page numbers from external wikilinks in any of the |page=, |pages=, or |at= parameters for use in COinS.
]]
local function get_coins_pages (pages)
local pattern;
if not is_set (pages) then return pages; end -- if no page numbers then we're done
while true do
pattern = pages:match("%[(%w*:?//[^ ]+%s+)[%w%d].*%]"); -- pattern is the opening bracket, the URL and following space(s): "[url "
if nil == pattern then break; end -- no more URLs
pattern = escape_lua_magic_chars (pattern); -- pattern is not a literal string; escape Lua's magic pattern characters
pages = pages:gsub(pattern, ""); -- remove as many instances of pattern as possible
end
pages = pages:gsub("[%[%]]", ""); -- remove the brackets
pages = pages:gsub("–", "-" ); -- replace endashes with hyphens
pages = pages:gsub("&%w+;", "-" ); -- and replace HTML entities (– etc.) with hyphens; do we need to replace numerical entities like   and the like?
return pages;
end
--[=[-------------------------< C O I N S _ R E P L A C E _ M A T H _ S T R I P M A R K E R >------------------
There are three options for math markup rendering that depend on the editor's math preference settings. These
settings are at [[Special:Preferences#mw-prefsection-rendering]] and are
PNG images
TeX source
MathML with SVG or PNG fallback
All three are heavy with HTML and CSS which doesn't belong in the metadata.
Without this function, the metadata saved in the raw wikitext contained the rendering determined by the settings
of the last editor to save the page.
This function gets the rendered form of an equation according to the editor's preference before the page is saved. It
then searches the rendering for the text equivalent of the rendered equation and replaces the rendering with that so
that the page is saved without extraneous HTML/CSS markup and with a reasonably readable text form of the equation.
When a replacement is made, this function returns true and the value with replacement; otherwise false and the initial
value. To replace multipe equations it is necessary to call this function from within a loop.
]=]
local function coins_replace_math_stripmarker (value)
local stripmarker = cfg.stripmarkers['math'];
local rendering = value:match (stripmarker); -- is there a math stripmarker
if not rendering then -- when value doesn't have a math stripmarker, abandon this test
return false, value;
end
rendering = mw.text.unstripNoWiki (rendering); -- convert stripmarker into rendered value (or nil? ''? when math render error)
if rendering:match ('alt="[^"]+"') then -- if PNG math option
rendering = rendering:match ('alt="([^"]+)"'); -- extract just the math text
elseif rendering:match ('$%s+.+%s+%$') then -- if TeX math option; $ is legit character that is escapes as \$
rendering = rendering:match ('$%s+(.+)%s+%$') -- extract just the math text
elseif rendering:match ('<annotation[^>]+>.+</annotation>') then -- if MathML math option
rendering = rendering:match ('<annotation[^>]+>(.+)</annotation>') -- extract just the math text
else
return false, value; -- had math stripmarker but not one of the three defined forms
end
return true, value:gsub (stripmarker, rendering, 1);
end
--[[--------------------------< C O I N S _ C L E A N U P >----------------------------------------------------
Cleanup parameter values for the metadata by removing or replacing invisible characters and certain HTML entities.
2015-12-10: there is a bug in mw.text.unstripNoWiki (). It replaces math stripmarkers with the appropriate content
when it shouldn't. See https://phabricator.wikimedia.org/T121085 and Wikipedia_talk:Lua#stripmarkers_and_mw.text.unstripNoWiki.28.29
TODO: move the replacement patterns and replacement values into a table in /Configuration similar to the invisible
characters table?
]]
local function coins_cleanup (value)
local replaced = true; -- default state to get the do loop running
while replaced do -- loop until all math stripmarkers replaced
replaced, value = coins_replace_math_stripmarker (value); -- replace math stripmarker with text representation of the equation
end
value = value:gsub (cfg.stripmarkers['math'], "MATH RENDER ERROR"); -- one or more couldn't be replaced; insert vague error message
value = mw.text.unstripNoWiki (value); -- replace nowiki stripmarkers with their content
value = value:gsub ('<span class="nowrap" style="padding%-left:0%.1em;">'(s?)</span>', "'%1"); -- replace {{'}} or {{'s}} with simple apostrophe or apostrophe-s
value = value:gsub (' ', ' '); -- replace entity with plain space
value = value:gsub ('\226\128\138', ' '); -- replace hair space with plain space
if not mw.ustring.find (value, cfg.indic_script) then -- don't remove zero-width joiner characters from indic script
value = value:gsub ('‍', ''); -- remove ‍ entities
value = mw.ustring.gsub (value, '[\226\128\141\226\128\139\194\173]', ''); -- remove zero-width joiner, zero-width space, soft hyphen
end
value = value:gsub ('[\009\010\013 ]+', ' '); -- replace horizontal tab, line feed, carriage return with plain space
return value;
end
--[[--------------------------< C O I N S >--------------------------------------------------------------------
COinS metadata (see <http://ocoins.info/>) allows automated tools to parse the citation information.
]]
local function COinS(data, class)
if 'table' ~= type(data) or nil == next(data) then
return '';
end
for k, v in pairs (data) do -- spin through all of the metadata parameter values
if 'ID_list' ~= k and 'Authors' ~= k then -- except the ID_list and Author tables (author nowiki stripmarker done when Author table processed)
data[k] = coins_cleanup (v);
end
end
local ctx_ver = "Z39.88-2004";
-- treat table strictly as an array with only set values.
local OCinSoutput = setmetatable( {}, {
__newindex = function(self, key, value)
if is_set(value) then
rawset( self, #self+1, table.concat{ key, '=', mw.uri.encode( remove_wiki_link( value ) ) } );
end
end
});
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn', 'journal', 'news', 'magazine'}) or
(in_array (class, {'conference', 'interview', 'map', 'press release', 'web'}) and is_set(data.Periodical)) or
('citation' == class and is_set(data.Periodical) and not is_set (data.Encyclopedia)) then
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:journal"; -- journal metadata identifier
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) then -- set genre according to the type of citation template we are rendering
OCinSoutput["rft.genre"] = "preprint"; -- cite arxiv, cite biorxiv, cite citeseerx, cite medrxiv, cite ssrn
elseif 'conference' == class then
OCinSoutput["rft.genre"] = "conference"; -- cite conference (when Periodical set)
elseif 'web' == class then
OCinSoutput["rft.genre"] = "unknown"; -- cite web (when Periodical set)
else
OCinSoutput["rft.genre"] = "article"; -- journal and other 'periodical' articles
end
OCinSoutput["rft.jtitle"] = data.Periodical; -- journal only
OCinSoutput["rft.atitle"] = data.Title; -- 'periodical' article titles
-- these used only for periodicals
OCinSoutput["rft.ssn"] = data.Season; -- keywords: winter, spring, summer, fall
OCinSoutput["rft.quarter"] = data.Quarter; -- single digits 1->first quarter, etc.
OCinSoutput["rft.chron"] = data.Chron; -- free-form date components
OCinSoutput["rft.volume"] = data.Volume; -- does not apply to books
OCinSoutput["rft.issue"] = data.Issue;
OCinSoutput['rft.artnum'] = data.ArticleNumber; -- {{cite journal}} only
OCinSoutput["rft.pages"] = data.Pages; -- also used in book metadata
elseif 'thesis' ~= class then -- all others except cite thesis are treated as 'book' metadata; genre distinguishes
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:book"; -- book metadata identifier
if 'report' == class or 'techreport' == class then -- cite report and cite techreport
OCinSoutput["rft.genre"] = "report";
elseif 'conference' == class then -- cite conference when Periodical not set
OCinSoutput["rft.genre"] = "conference";
OCinSoutput["rft.atitle"] = data.Chapter; -- conference paper as chapter in proceedings (book)
elseif in_array (class, {'book', 'citation', 'encyclopaedia', 'interview', 'map'}) then
if is_set (data.Chapter) then
OCinSoutput["rft.genre"] = "bookitem";
OCinSoutput["rft.atitle"] = data.Chapter; -- book chapter, encyclopedia article, interview in a book, or map title
else
if 'map' == class or 'interview' == class then
OCinSoutput["rft.genre"] = 'unknown'; -- standalone map or interview
else
OCinSoutput["rft.genre"] = 'book'; -- book and encyclopedia
end
end
else -- {'audio-visual', 'AV-media-notes', 'DVD-notes', 'episode', 'interview', 'mailinglist', 'map', 'newsgroup', 'podcast', 'press release', 'serial', 'sign', 'speech', 'web'}
OCinSoutput["rft.genre"] = "unknown";
end
OCinSoutput["rft.btitle"] = data.Title; -- book only
OCinSoutput["rft.place"] = data.PublicationPlace; -- book only
OCinSoutput["rft.series"] = data.Series; -- book only
OCinSoutput["rft.pages"] = data.Pages; -- book, journal
OCinSoutput["rft.edition"] = data.Edition; -- book only
OCinSoutput["rft.pub"] = data.PublisherName; -- book and dissertation
else -- cite thesis
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:dissertation"; -- dissertation metadata identifier
OCinSoutput["rft.title"] = data.Title; -- dissertation (also patent but that is not yet supported)
OCinSoutput["rft.degree"] = data.Degree; -- dissertation only
OCinSoutput['rft.inst'] = data.PublisherName; -- book and dissertation
end
-- NB. Not currently supported are "info:ofi/fmt:kev:mtx:patent", "info:ofi/fmt:kev:mtx:dc", "info:ofi/fmt:kev:mtx:sch_svc", "info:ofi/fmt:kev:mtx:ctx"
-- and now common parameters (as much as possible)
OCinSoutput["rft.date"] = data.Date; -- book, journal, dissertation
for k, v in pairs( data.ID_list ) do -- what to do about these? For now assume that they are common to all?
if k == 'ISBN' then v = v:gsub( "[^-0-9X]", "" ); end
local id = cfg.id_handlers[k].COinS;
if string.sub( id or "", 1, 4 ) == 'info' then -- for ids that are in the info:registry
OCinSoutput["rft_id"] = table.concat{ id, "/", v };
elseif string.sub (id or "", 1, 3 ) == 'rft' then -- for isbn, issn, eissn, etc. that have defined COinS keywords
OCinSoutput[ id ] = v;
elseif 'url' == id then -- for urls that are assembled in ~/Identifiers; |asin= and |ol=
OCinSoutput["rft_id"] = table.concat ({data.ID_list[k], "#id-name=", cfg.id_handlers[k].label});
elseif id then -- when cfg.id_handlers[k].COinS is not nil so urls created here
OCinSoutput["rft_id"] = table.concat{ cfg.id_handlers[k].prefix, v, cfg.id_handlers[k].suffix or '', "#id-name=", cfg.id_handlers[k].label }; -- others; provide a URL and indicate identifier name as #fragment (human-readable, but transparent to browsers)
end
end
local last, first;
for k, v in ipairs( data.Authors ) do
last, first = coins_cleanup (v.last), coins_cleanup (v.first or ''); -- replace any nowiki stripmarkers, non-printing or invisible characters
if k == 1 then -- for the first author name only
if is_set(last) and is_set(first) then -- set these COinS values if |first= and |last= specify the first author name
OCinSoutput["rft.aulast"] = last; -- book, journal, dissertation
OCinSoutput["rft.aufirst"] = first; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation -- otherwise use this form for the first name
end
else -- for all other authors
if is_set(last) and is_set(first) then
OCinSoutput["rft.au"] = table.concat{ last, ", ", first }; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation
end
-- TODO: At present we do not report "et al.". Add anything special if this condition applies?
end
end
OCinSoutput.rft_id = data.URL;
OCinSoutput.rfr_id = table.concat{ "info:sid/", mw.site.server:match( "[^/]*$" ), ":", data.RawPage };
-- TODO: Add optional extra info:
-- rfr_dat=#REVISION<version> (referrer private data)
-- ctx_id=<data.RawPage>#<ref> (identifier for the context object)
-- ctx_tim=<ts> (timestamp in format yyyy-mm-ddThh:mm:ssTZD or yyyy-mm-dd)
-- ctx_enc=info:ofi/enc:UTF-8 (character encoding)
OCinSoutput = setmetatable( OCinSoutput, nil );
-- sort with version string always first, and combine.
-- table.sort( OCinSoutput );
table.insert( OCinSoutput, 1, "ctx_ver=" .. ctx_ver ); -- such as "Z39.88-2004"
return table.concat(OCinSoutput, "&");
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
has_accept_as_written = utilities_page_ptr.has_accept_as_written; -- import functions from selected Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
remove_wiki_link = utilities_page_ptr.remove_wiki_link;
strip_apostrophe_markup = utilities_page_ptr.strip_apostrophe_markup;
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
make_coins_title = make_coins_title,
get_coins_pages = get_coins_pages,
COinS = COinS,
set_selected_modules = set_selected_modules,
}
4fe549c532af319223cc4d9da2c6d33a786131c1
Module:Citation/CS1/Date validation
828
162
424
2023-08-12T19:19:06Z
wikipedia>Trappist the monk
0
sync from sandbox;
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local add_prop_cat, is_set, in_array, set_message, substitute, wrap_style; -- imported functions from selected Module:Citation/CS1/Utilities
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< F I L E - S C O P E D E C L A R A T I O N S >--------------------------------
File-scope variables are declared here
]]
local lang_object = mw.getContentLanguage(); -- used by is_valid_accessdate(), is_valid_year(), date_name_xlate(); TODO: move to ~/Configuration?
local year_limit; -- used by is_valid_year()
--[=[-------------------------< I S _ V A L I D _ A C C E S S D A T E >----------------------------------------
returns true if:
Wikipedia start date <= accessdate < today + 2 days
Wikipedia start date is 2001-01-15T00:00:00 UTC which is 979516800 seconds after 1970-01-01T00:00:00 UTC (the start of Unix time)
accessdate is the date provided in |access-date= at time 00:00:00 UTC
today is the current date at time 00:00:00 UTC plus 48 hours
if today is 2015-01-01T00:00:00 then
adding 24 hours gives 2015-01-02T00:00:00 – one second more than today
adding 24 hours gives 2015-01-03T00:00:00 – one second more than tomorrow
This function does not work if it is fed month names for languages other than English. Wikimedia #time: parser
apparently doesn't understand non-English date month names. This function will always return false when the date
contains a non-English month name because good1 is false after the call to lang.formatDate(). To get around that
call this function with YYYY-MM-DD format dates.
]=]
local function is_valid_accessdate (accessdate)
local good1, good2;
local access_ts, tomorrow_ts; -- to hold Unix time stamps representing the dates
good1, access_ts = pcall (lang_object.formatDate, lang_object, 'U', accessdate ); -- convert accessdate value to Unix timestamp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which which tonumber() may not understand
access_ts = tonumber (access_ts) or lang_object:parseFormattedNumber (access_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to Unix time stamp
end
if 979516800 <= access_ts and access_ts < tomorrow_ts then -- Wikipedia start date <= accessdate < tomorrow's date
return true;
else
return false; -- accessdate out of range
end
end
--[[--------------------------< G E T _ M O N T H _ N U M B E R >----------------------------------------------
returns a number according to the month in a date: 1 for January, etc. Capitalization and spelling must be correct.
If not a valid month, returns 0
]]
local function get_month_number (month)
return cfg.date_names['local'].long[month] or cfg.date_names['local'].short[month] or -- look for local names first
cfg.date_names['en'].long[month] or cfg.date_names['en'].short[month] or -- failing that, look for English names
0; -- not a recognized month name
end
--[[--------------------------< G E T _ S E A S O N _ N U M B E R >--------------------------------------------
returns a number according to the sequence of seasons in a year: 21 for Spring, etc. Capitalization and spelling
must be correct. If not a valid season, returns 0.
21-24 = Spring, Summer, Autumn, Winter, independent of “Hemisphere”
returns 0 when <param> is not |date=
Season numbering is defined by Extended Date/Time Format (EDTF) specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard defines various divisions using
numbers 21-41. cs1|2 only supports generic seasons. EDTF does support the distinction between north and south
hemisphere seasons but cs1|2 has no way to make that distinction.
These additional divisions not currently supported:
25-28 = Spring - Northern Hemisphere, Summer- Northern Hemisphere, Autumn - Northern Hemisphere, Winter - Northern Hemisphere
29-32 = Spring – Southern Hemisphere, Summer– Southern Hemisphere, Autumn – Southern Hemisphere, Winter - Southern Hemisphere
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_season_number (season, param)
if 'date' ~= param then
return 0; -- season dates only supported by |date=
end
return cfg.date_names['local'].season[season] or -- look for local names first
cfg.date_names['en'].season[season] or -- failing that, look for English names
0; -- not a recognized season name
end
--[[--------------------------< G E T _ Q U A R T E R _ N U M B E R >------------------------------------------
returns a number according to the sequence of quarters in a year: 33 for first quarter, etc. Capitalization and spelling
must be correct. If not a valid quarter, returns 0.
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
returns 0 when <param> is not |date=
Quarter numbering is defined by Extended Date/Time Format (EDTF) specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard defines various divisions using
numbers 21-41. cs1|2 only supports generic seasons and quarters.
These additional divisions not currently supported:
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_quarter_number (quarter, param)
if 'date' ~= param then
return 0; -- quarter dates only supported by |date=
end
quarter = mw.ustring.gsub (quarter, ' +', ' '); -- special case replace multiple space chars with a single space char
return cfg.date_names['local'].quarter[quarter] or -- look for local names first
cfg.date_names['en'].quarter[quarter] or -- failing that, look for English names
0; -- not a recognized quarter name
end
--[[--------------------------< G E T _ P R O P E R _ N A M E _ N U M B E R >----------------------------------
returns a non-zero number if date contains a recognized proper-name. Capitalization and spelling must be correct.
returns 0 when <param> is not |date=
]]
local function get_proper_name_number (name, param)
if 'date' ~= param then
return 0; -- proper-name dates only supported by |date=
end
return cfg.date_names['local'].named[name] or -- look for local names dates first
cfg.date_names['en'].named[name] or -- failing that, look for English names
0; -- not a recognized named date
end
--[[--------------------------< G E T _ E L E M E N T _ N U M B E R <------------------------------------------
returns true if month or season or quarter or proper name is valid (properly spelled, capitalized, abbreviated)
]]
local function get_element_number (element, param)
local num;
local funcs = {get_month_number, get_season_number, get_quarter_number, get_proper_name_number}; -- list of functions to execute in order
for _, func in ipairs (funcs) do -- spin through the function list
num = func (element, param); -- call the function and get the returned number
if 0 ~= num then -- non-zero when valid month season quarter
return num; -- return that number
end
end
return nil; -- not valid
end
--[[--------------------------< I S _ V A L I D _ Y E A R >----------------------------------------------------
Function gets current year from the server and compares it to year from a citation parameter. Years more than one
year in the future are not acceptable.
Special case for |pmc-embargo-date=: years more than two years in the future are not acceptable
]]
local function is_valid_year (year, param)
if not is_set (year_limit) then
year_limit = tonumber(os.date("%Y"))+1; -- global variable so we only have to fetch it once
end
year = tonumber (year) or lang_object:parseFormattedNumber (year); -- convert to number for the comparison
if year and (100 > year) then -- years less than 100 not supported
return false;
end
if 'pmc-embargo-date' == param then -- special case for |pmc-embargo-date=
return year and (year <= tonumber(os.date("%Y"))+2) or false; -- years more than two years in the future are not accepted
end
return year and (year <= year_limit) or false;
end
--[[--------------------------< I S _ V A L I D _ D A T E >----------------------------------------------------
Returns true if day is less than or equal to the number of days in month and year is no farther into the future
than next year; else returns false.
Assumes Julian calendar prior to year 1582 and Gregorian calendar thereafter. Accounts for Julian calendar leap
years before 1582 and Gregorian leap years after 1582. Where the two calendars overlap (1582 to approximately
1923) dates are assumed to be Gregorian.
]]
local function is_valid_date (year, month, day, param)
local days_in_month = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
local month_length;
if not is_valid_year (year, param) then -- no farther into the future than next year except |pmc-embargo-date= no more than two years in the future
return false;
end
month = tonumber (month); -- required for YYYY-MM-DD dates
if (2 == month) then -- if February
month_length = 28; -- then 28 days unless
if 1582 > tonumber(year) then -- Julian calendar
if 0 == (year%4) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
else -- Gregorian calendar
if (0 == (year%4) and (0 ~= (year%100) or 0 == (year%400))) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
end
else
month_length = days_in_month[month];
end
if tonumber (day) > month_length then
return false;
end
return true;
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ R A N G E _ S T Y L E >--------------------------
Months in a range are expected to have the same style: Jan–Mar or October–December but not February–Mar or Jul–August.
This function looks in cfg.date_names{} to see if both month names are listed in the long subtable or both are
listed in the short subtable. When both have the same style (both are listed in the same table), returns true; false else
]]
local function is_valid_month_range_style (month1, month2)
if (cfg.date_names.en.long[month1] and cfg.date_names.en.long[month2]) or -- are both English names listed in the long subtable?
(cfg.date_names.en.short[month1] and cfg.date_names.en.short[month2]) or -- are both English names listed in the short subtable?
(cfg.date_names['local'].long[month1] and cfg.date_names['local'].long[month2]) or -- are both local names listed in the long subtable?
(cfg.date_names['local'].short[month1] and cfg.date_names['local'].short[month2]) then -- are both local names listed in the short subtable?
return true;
end
return false; -- names are mixed
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ S E A S O N _ R A N G E >------------------------
Check a pair of months or seasons to see if both are valid members of a month or season pair.
Month pairs are expected to be left to right, earliest to latest in time.
All season ranges are accepted as valid because there are publishers out there who have published a Summer–Spring YYYY issue, hence treat as ok
]]
local function is_valid_month_season_range(range_start, range_end, param)
local range_start_number = get_month_number (range_start);
local range_end_number;
if 0 == range_start_number then -- is this a month range?
range_start_number = get_season_number (range_start, param); -- not a month; is it a season? get start season number
range_end_number = get_season_number (range_end, param); -- get end season number
if (0 ~= range_start_number) and (0 ~= range_end_number) and (range_start_number ~= range_end_number) then
return true; -- any season pairing is accepted except when both are the same
end
return false; -- range_start and/or range_end is not a season
end
-- here when range_start is a month
range_end_number = get_month_number (range_end); -- get end month number
if range_start_number < range_end_number and -- range_start is a month; does range_start precede range_end?
is_valid_month_range_style (range_start, range_end) then -- do months have the same style?
return true; -- proper order and same style
end
return false; -- range_start month number is greater than or equal to range end number; or range end isn't a month
end
--[[--------------------------< M A K E _ C O I N S _ D A T E >------------------------------------------------
This function receives a table of date parts for one or two dates and an empty table reference declared in
Module:Citation/CS1. The function is called only for |date= parameters and only if the |date=<value> is
determined to be a valid date format. The question of what to do with invalid date formats is not answered here.
The date parts in the input table are converted to an ISO 8601 conforming date string:
single whole dates: yyyy-mm-dd
month and year dates: yyyy-mm
year dates: yyyy
ranges: yyyy-mm-dd/yyyy-mm-dd
yyyy-mm/yyyy-mm
yyyy/yyyy
Dates in the Julian calendar are reduced to year or year/year so that we don't have to do calendar conversion from
Julian to Proleptic Gregorian.
The input table has:
year, year2 – always present; if before 1582, ignore months and days if present
month, month2 – 0 if not provided, 1-12 for months, 21-24 for seasons; 99 Christmas
day, day2 – 0 if not provided, 1-31 for days
the output table receives:
rftdate: an ISO 8601 formatted date
rftchron: a free-form version of the date, usually without year which is in rftdate (season ranges and proper-name dates)
rftssn: one of four season keywords: winter, spring, summer, fall (lowercase)
rftquarter: one of four values: 1, 2, 3, 4
]]
local function make_COinS_date (input, tCOinS_date)
local date; -- one date or first date in a range
local date2 = ''; -- end of range date
input.year = tonumber (input.year) or lang_object:parseFormattedNumber (input.year); -- language-aware tonumber()
input.year2 = tonumber (input.year2) or lang_object:parseFormattedNumber (input.year2); -- COinS dates are pseudo-ISO 8601 so convert to Arabic numerals
-- start temporary Julian / Gregorian calendar uncertainty detection
local year = input.year; -- this temporary code to determine the extent of sources dated to the Julian/Gregorian
local month = tonumber(input.month); -- interstice 1 October 1582 – 1 January 1926
local day = tonumber (input.day);
if (0 ~= day) and -- day must have a value for this to be a whole date
(((1582 == year) and (10 <= month) and (12 >= month)) or -- any whole 1582 date from 1 October to 31 December or
((1926 == year) and (1 == month) and (1 == input.day)) or -- 1 January 1926 or
((1582 < year) and (1925 >= year))) then -- any date 1 January 1583 – 31 December 1925
tCOinS_date.inter_cal_cat = true; -- set category flag true
end
-- end temporary Julian / Gregorian calendar uncertainty detection
if ((1582 == year) and (10 > month)) or (1582 > year) then -- if a Julian calendar date
tCOinS_date.rftdate = tostring (input.year); -- &rft.date gets year only
return; -- done
end
-- here for all forms of Gregorian dates
if 20 < tonumber (input.month) then -- if season, quarter, or proper-name date
date = input.year; -- &rft.date gets year only
if 0 ~= input.year2 and input.year ~= input.year2 then -- if a range, only the second year portion when not the same as range start year
date = string.format ('%.4d/%.4d', input.year, input.year2) -- assemble the date range
end
local season = {[24] = 'winter', [21] = 'spring', [22] = 'summer', [23] = 'fall', [33] = '1', [34] = '2', [35] = '3', [36] = '4', [98] = 'Easter', [99] = 'Christmas'}; -- seasons lowercase, no autumn; proper-names use title case
if 0 == input.month2 then -- single season, quarter, or proper-name date
if 40 < tonumber(input.month) then
tCOinS_date.rftchron = season[input.month]; -- proper-name date; used in journal metadata only
elseif 30 < tonumber(input.month) then
tCOinS_date.rftquarter = season[input.month]; -- quarter date; used in journal metadata only
else
tCOinS_date.rftssn = season[input.month]; -- season date; used in journal metadata only
end
else -- season ranges are lumped into &rft.chron; &rft.ssn and &rft.quarter are left blank
if input.year ~= input.year2 then -- season year – season year range or season year–year
if 0 ~= input.month2 then
tCOinS_date.rftchron = string.format ('%s %s – %s %s', season[input.month], input.year, season[input.month2], input.year2); -- used in journal metadata only
end
else -- season–season year range
tCOinS_date.rftchron = season[input.month] .. '–' .. season[input.month2]; -- season–season year range; used in journal metadata only
end
end
tCOinS_date.rftdate = tostring (date);
return; -- done
end
-- here for gregorian calendar dates
if 0 ~= input.day then
date = string.format ('%s-%.2d-%.2d', input.year, tonumber(input.month), tonumber(input.day)); -- whole date
elseif 0 ~= input.month then
date = string.format ('%s-%.2d', input.year, tonumber(input.month)); -- year and month
else
date = string.format ('%s', input.year); -- just year
end
if 0 ~= input.year2 then
if 0 ~= input.day2 then
date2 = string.format ('/%s-%.2d-%.2d', input.year2, tonumber(input.month2), tonumber(input.day2)); -- whole date
elseif 0 ~= input.month2 then
date2 = string.format ('/%s-%.2d', input.year2, tonumber(input.month2)); -- year and month
else
date2 = string.format ('/%s', input.year2); -- just year
end
end
tCOinS_date.rftdate = date .. date2; -- date2 has the '/' separator
return;
end
--[[--------------------------< P A T T E R N S >--------------------------------------------------------------
this is the list of patterns for date formats that this module recognizes. Approximately the first half of these
patterns represent formats that might be reformatted into another format. Those that might be reformatted have
'indicator' letters that identify the content of the matching capture: 'd' (day), 'm' (month), 'a' (anchor year),
'y' (year); second day, month, year have a '2' suffix.
These patterns are used for both date validation and for reformatting. This table should not be moved to ~/Configuration
because changes to this table require changes to check_date() and to reformatter() and reformat_date()
]]
local patterns = {
-- year-initial numerical year-month-day
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'},
-- month-initial: month day, year
['Mdy'] = {'^(%D-) +([1-9]%d?), +((%d%d%d%d?)%a?)$', 'm', 'd', 'a', 'y'},
-- month-initial day range: month day–day, year; days are separated by endash
['Md-dy'] = {'^(%D-) +([1-9]%d?)[%-–]([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'd2', 'a', 'y'},
-- day-initial: day month year
['dMy'] = {'^([1-9]%d?) +(%D-) +((%d%d%d%d?)%a?)$', 'd', 'm', 'a', 'y'},
-- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed; not supported at en.wiki
-- ['yMd'] = {'^((%d%d%d%d?)%a?) +(%D-) +(%d%d?)$', 'a', 'y', 'm', 'd'},
-- day-range-initial: day–day month year; days are separated by endash
['d-dMy'] = {'^([1-9]%d?)[%-–]([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'd2', 'm', 'a', 'y'},
-- day initial month-day-range: day month - day month year; uses spaced endash
['dM-dMy'] = {'^([1-9]%d?) +(%D-) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'd2', 'm2', 'a', 'y'},
-- month initial month-day-range: month day – month day, year; uses spaced endash
['Md-Mdy'] = {'^(%D-) +([1-9]%d?) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$','m', 'd', 'm2', 'd2', 'a', 'y'},
-- day initial month-day-year-range: day month year - day month year; uses spaced endash
['dMy-dMy'] = {'^([1-9]%d?) +(%D-) +(%d%d%d%d) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'y', 'd2', 'm2', 'a', 'y2'},
-- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
['Mdy-Mdy'] = {'^(%D-) +([1-9]%d?), +(%d%d%d%d) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'y', 'm2', 'd2', 'a', 'y2'},
-- these date formats cannot be converted, per se, but month name can be rendered short or long
-- month/season year - month/season year; separated by spaced endash
['My-My'] = {'^(%D-) +(%d%d%d%d) +[%-–] +(%D-) +((%d%d%d%d)%a?)$', 'm', 'y', 'm2', 'a', 'y2'},
-- month/season range year; months separated by endash
['M-My'] = {'^(%D-)[%-–](%D-) +((%d%d%d%d)%a?)$', 'm', 'm2', 'a', 'y'},
-- month/season year or proper-name year; quarter year when First Quarter YYYY etc.
['My'] = {'^([^%d–]-) +((%d%d%d%d)%a?)$', 'm', 'a', 'y'}, -- this way because endash is a member of %D; %D- will match January–March 2019 when it shouldn't
-- these date formats cannot be converted
['Sy4-y2'] = {'^(%D-) +((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
['Sy-y'] = {'^(%D-) +(%d%d%d%d)[%-–]((%d%d%d%d)%a?)$'}, -- special case Winter/Summer year-year; year separated with unspaced endash
['y-y'] = {'^(%d%d%d%d?)[%-–]((%d%d%d%d?)%a?)$'}, -- year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
['y4-y2'] = {'^((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- year range: YYYY–YY; separated by unspaced endash
['y'] = {'^((%d%d%d%d?)%a?)$'}, -- year; here accept either YYY or YYYY
}
--[[--------------------------< I S _ V A L I D _ E M B A R G O _ D A T E >------------------------------------
returns true and date value if that value has proper dmy, mdy, ymd format.
returns false and 9999 (embargoed forever) when date value is not proper format; assumes that when |pmc-embargo-date= is
set, the editor intended to embargo a PMC but |pmc-embargo-date= does not hold a single date.
]]
local function is_valid_embargo_date (v)
if v:match (patterns['ymd'][1]) or -- ymd
v:match (patterns['Mdy'][1]) or -- dmy
v:match (patterns['dMy'][1]) then -- mdy
return true, v;
end
return false, '9999'; -- if here not good date so return false and set embargo date to long time in future
end
--[[--------------------------< C H E C K _ D A T E >----------------------------------------------------------
Check date format to see that it is one of the formats approved by WP:DATESNO or WP:DATERANGE. Exception: only
allowed range separator is endash. Additionally, check the date to see that it is a real date: no 31 in 30-day
months; no 29 February when not a leap year. Months, both long-form and three character abbreviations, and seasons
must be spelled correctly. Future years beyond next year are not allowed.
If the date fails the format tests, this function returns false and does not return values for anchor_year and
COinS_date. When this happens, the date parameter is (DEBUG: not?) used in the COinS metadata and the CITEREF identifier gets
its year from the year parameter if present otherwise CITEREF does not get a date value.
Inputs:
date_string - date string from date-holding parameters (date, year, publication-date, access-date, pmc-embargo-date, archive-date, lay-date)
Returns:
false if date string is not a real date; else
true, anchor_year, COinS_date
anchor_year can be used in CITEREF anchors
COinS_date is ISO 8601 format date; see make_COInS_date()
]]
local function check_date (date_string, param, tCOinS_date)
local year; -- assume that year2, months, and days are not used;
local year2 = 0; -- second year in a year range
local month = 0;
local month2 = 0; -- second month in a month range
local day = 0;
local day2 = 0; -- second day in a day range
local anchor_year;
local coins_date;
if date_string:match (patterns['ymd'][1]) then -- year-initial numerical year month day format
year, month, day = date_string:match (patterns['ymd'][1]);
if 12 < tonumber(month) or 1 > tonumber(month) or 1582 > tonumber(year) or 0 == tonumber(day) then return false; end -- month or day number not valid or not Gregorian calendar
anchor_year = year;
elseif mw.ustring.match(date_string, patterns['Mdy'][1]) then -- month-initial: month day, year
month, day, anchor_year, year = mw.ustring.match(date_string, patterns['Mdy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
elseif mw.ustring.match(date_string, patterns['Md-dy'][1]) then -- month-initial day range: month day–day, year; days are separated by endash
month, day, day2, anchor_year, year = mw.ustring.match(date_string, patterns['Md-dy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2=month; -- for metadata
year2 = year;
elseif mw.ustring.match(date_string, patterns['dMy'][1]) then -- day-initial: day month year
day, month, anchor_year, year = mw.ustring.match(date_string, patterns['dMy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
--[[ NOT supported at en.wiki
elseif mw.ustring.match(date_string, patterns['yMd'][1]) then -- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed
anchor_year, year, month, day = mw.ustring.match(date_string, patterns['yMd'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
-- end NOT supported at en.wiki ]]
elseif mw.ustring.match(date_string, patterns['d-dMy'][1]) then -- day-range-initial: day–day month year; days are separated by endash
day, day2, month, anchor_year, year = mw.ustring.match(date_string, patterns['d-dMy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2 = month; -- for metadata
year2 = year;
elseif mw.ustring.match(date_string, patterns['dM-dMy'][1]) then -- day initial month-day-range: day month - day month year; uses spaced endash
day, month, day2, month2, anchor_year, year = mw.ustring.match(date_string, patterns['dM-dMy'][1]);
if (not is_valid_month_season_range(month, month2)) or not is_valid_year(year) then return false; end -- date range order is left to right: earlier to later;
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2 = year;
elseif mw.ustring.match(date_string, patterns['Md-Mdy'][1]) then -- month initial month-day-range: month day – month day, year; uses spaced endash
month, day, month2, day2, anchor_year, year = mw.ustring.match(date_string, patterns['Md-Mdy'][1]);
if (not is_valid_month_season_range(month, month2, param)) or not is_valid_year(year) then return false; end
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2 = year;
elseif mw.ustring.match(date_string, patterns['dMy-dMy'][1]) then -- day initial month-day-year-range: day month year - day month year; uses spaced endash
day, month, year, day2, month2, anchor_year, year2 = mw.ustring.match(date_string, patterns['dMy-dMy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
if 0 == month or 0 == month2 then return false; end -- both must be valid
elseif mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]) then -- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
month, day, year, month2, day2, anchor_year, year2 = mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number(month2);
if 0 == month or 0 == month2 then return false; end -- both must be valid
elseif mw.ustring.match(date_string, patterns['Sy4-y2'][1]) then -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
local century;
month, year, century, anchor_year, year2 = mw.ustring.match(date_string, patterns['Sy4-y2'][1]);
if 'Winter' ~= month and 'Summer' ~= month then return false end; -- 'month' can only be Winter or Summer
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
year2 = century..year2; -- add the century to year2 for comparisons
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
month = get_season_number(month, param);
elseif mw.ustring.match(date_string, patterns['Sy-y'][1]) then -- special case Winter/Summer year-year; year separated with unspaced endash
month, year, anchor_year, year2 = mw.ustring.match(date_string, patterns['Sy-y'][1]);
month = get_season_number (month, param); -- <month> can only be winter or summer; also for metadata
if (month ~= cfg.date_names['en'].season['Winter']) and (month ~= cfg.date_names['en'].season['Summer']) then
return false; -- not Summer or Winter; abandon
end
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['My-My'][1]) then -- month/season year - month/season year; separated by spaced endash
month, year, month2, anchor_year, year2 = mw.ustring.match(date_string, patterns['My-My'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
if 0 ~= get_month_number(month) and 0 ~= get_month_number(month2) and is_valid_month_range_style(month, month2) then -- both must be month year, same month style
month = get_month_number(month);
month2 = get_month_number(month2);
elseif 0 ~= get_season_number(month, param) and 0 ~= get_season_number(month2, param) then -- both must be season year, not mixed
month = get_season_number(month, param);
month2 = get_season_number(month2, param);
else
return false;
end
elseif mw.ustring.match(date_string, patterns['M-My'][1]) then -- month/season range year; months separated by endash
month, month2, anchor_year, year = mw.ustring.match(date_string, patterns['M-My'][1]);
if (not is_valid_month_season_range(month, month2, param)) or (not is_valid_year(year)) then return false; end
if 0 ~= get_month_number(month) then -- determined to be a valid range so just check this one to know if month or season
month = get_month_number(month);
month2 = get_month_number(month2);
if 0 == month or 0 == month2 then return false; end
else
month = get_season_number(month, param);
month2 = get_season_number(month2, param);
end
year2 = year;
elseif mw.ustring.match(date_string, patterns['My'][1]) then -- month/season/quarter/proper-name year
month, anchor_year, year = mw.ustring.match(date_string, patterns['My'][1]);
if not is_valid_year(year) then return false; end
month = get_element_number(month, param); -- get month season quarter proper-name number or nil
if not month then return false; end -- not valid whatever it is
elseif mw.ustring.match(date_string, patterns['y-y'][1]) then -- Year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
year, anchor_year, year2 = mw.ustring.match(date_string, patterns['y-y'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['y4-y2'][1]) then -- Year range: YYYY–YY; separated by unspaced endash
local century;
year, century, anchor_year, year2 = mw.ustring.match(date_string, patterns['y4-y2'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor year from both years
if 13 > tonumber(year2) then return false; end -- don't allow 2003-05 which might be May 2003
year2 = century .. year2; -- add the century to year2 for comparisons
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
if in_array (param, {'date', 'publication-date', 'year'}) then -- here when 'valid' abbreviated year range; if one of these parameters
add_prop_cat ('year-range-abbreviated'); -- add properties cat
end
elseif mw.ustring.match(date_string, patterns['y'][1]) then -- year; here accept either YYY or YYYY
anchor_year, year = mw.ustring.match(date_string, patterns['y'][1]);
if false == is_valid_year(year) then
return false;
end
else
return false; -- date format not one of the MOS:DATE approved formats
end
if param ~= 'date' then -- CITEREF disambiguation only allowed in |date=; |year= & |publication-date= promote to date
if anchor_year:match ('%l$') then
return false;
end
end
if 'access-date' == param then -- test access-date here because we have numerical date parts
if 0 ~= year and 0 ~= month and 0 ~= day and -- all parts of a single date required
0 == year2 and 0 == month2 and 0 == day2 then -- none of these; access-date must not be a range
if not is_valid_accessdate(year .. '-' .. month .. '-' .. day) then
return false; -- return false when access-date out of bounds
end
else
return false; -- return false when access-date is a range of two dates
end
end
if 'archive-date' == param then -- test archive-date here because we have numerical date parts
if not (0 ~= year and 0 ~= month and 0 ~= day and -- all parts of a single date required
0 == year2 and 0 == month2 and 0 == day2) then -- none of these; archive-date must not be a range
return false; -- return false when archive-date is a range of two dates
end
end
local result=true; -- check whole dates for validity; assume true because not all dates will go through this test
if 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 == day2 then -- YMD (simple whole date)
result = is_valid_date (year, month, day, param); -- <param> for |pmc-embargo-date=
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 ~= day2 then -- YMD-d (day range)
result = is_valid_date (year, month, day);
result = result and is_valid_date (year, month, day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-md (day month range)
result = is_valid_date (year, month, day);
result = result and is_valid_date (year, month2, day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 ~= year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-ymd (day month year range)
result = is_valid_date(year, month, day);
result = result and is_valid_date(year2, month2, day2);
end
if false == result then return false; end
if nil ~= tCOinS_date then -- this table only passed into this function when testing |date= parameter values
make_COinS_date ({year = year, month = month, day = day, year2 = year2, month2 = month2, day2 = day2}, tCOinS_date); -- make an ISO 8601 date string for COinS
end
return true, anchor_year; -- format is good and date string represents a real date
end
--[[--------------------------< D A T E S >--------------------------------------------------------------------
Cycle the date-holding parameters in passed table date_parameters_list through check_date() to check compliance with MOS:DATE. For all valid dates, check_date() returns
true. The |date= parameter test is unique, it is the only date holding parameter from which values for anchor_year (used in CITEREF identifiers) and COinS_date (used in
the COinS metadata) are derived. The |date= parameter is the only date-holding parameter that is allowed to contain the no-date keywords "n.d." or "nd" (without quotes).
Unlike most error messages created in this module, only one error message is created by this function. Because all of the date holding parameters are processed serially,
parameters with errors are added to the <error_list> sequence table as the dates are tested.
]]
local function dates(date_parameters_list, tCOinS_date, error_list)
local anchor_year; -- will return as nil if the date being tested is not |date=
local COinS_date; -- will return as nil if the date being tested is not |date=
local embargo_date; -- if embargo date is a good dmy, mdy, ymd date then holds original value else reset to 9999
local good_date = false;
for k, v in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(v.val) then -- if the parameter has a value
v.val = mw.ustring.gsub(v.val, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
if v.val:match("^c%. [1-9]%d%d%d?%a?$") then -- special case for c. year or with or without CITEREF disambiguator - only |date= and |year=
local year = v.val:match("c%. ([1-9]%d%d%d?)%a?"); -- get the year portion so it can be tested
if 'date' == k then
anchor_year, COinS_date = v.val:match("((c%. [1-9]%d%d%d?)%a?)"); -- anchor year and COinS_date only from |date= parameter
good_date = is_valid_year(year);
elseif 'year' == k then
good_date = is_valid_year(year);
end
elseif 'date' == k then -- if the parameter is |date=
if v.val:match("^n%.d%.%a?$") then -- ToDo: I18N -- if |date=n.d. with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((n%.d%.)%a?)"); -- ToDo: I18N -- "n.d."; no error when date parameter is set to no date
elseif v.val:match("^nd%a?$") then -- ToDo: I18N -- if |date=nd with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((nd)%a?)"); -- ToDo: I18N -- "nd"; no error when date parameter is set to no date
else
good_date, anchor_year, COinS_date = check_date (v.val, k, tCOinS_date); -- go test the date
end
elseif 'year' == k then -- if the parameter is |year= it should hold only a year value
if v.val:match("^[1-9]%d%d%d?%a?$") then -- if |year = 3 or 4 digits only with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((%d+)%a?)");
end
elseif 'pmc-embargo-date' == k then -- if the parameter is |pmc-embargo-date=
good_date = check_date (v.val, k); -- go test the date
if true == good_date then -- if the date is a valid date
good_date, embargo_date = is_valid_embargo_date (v.val); -- is |pmc-embargo-date= date a single dmy, mdy, or ymd formatted date? yes: returns embargo date; no: returns 9999
end
else -- any other date-holding parameter
good_date = check_date (v.val, k); -- go test the date
end
if false == good_date then -- assemble one error message so we don't add the tracking category multiple times
table.insert (error_list, wrap_style ('parameter', v.name)); -- make parameter name suitable for error message list
end
end
end
return anchor_year, embargo_date; -- and done
end
--[[--------------------------< Y E A R _ D A T E _ C H E C K >------------------------------------------------
Compare the value provided in |year= with the year value(s) provided in |date=. This function sets a local numeric value:
0 - year value does not match the year value in date
1 - (default) year value matches the year value in date or one of the year values when date contains two years
2 - year value matches the year value in date when date is in the form YYYY-MM-DD and year is disambiguated (|year=YYYYx)
the numeric value in <result> determines the 'output' if any from this function:
0 – adds error message to error_list sequence table
1 – adds maint cat
2 – does nothing
]]
local function year_date_check (year_string, year_origin, date_string, date_origin, error_list)
local year;
local date1;
local date2;
local result = 1; -- result of the test; assume that the test passes
year = year_string:match ('(%d%d%d%d?)');
if date_string:match ('%d%d%d%d%-%d%d%-%d%d') and year_string:match ('%d%d%d%d%a') then --special case where both date and year are required YYYY-MM-DD and YYYYx
date1 = date_string:match ('(%d%d%d%d)');
year = year_string:match ('(%d%d%d%d)');
if year ~= date1 then
result = 0; -- years don't match
else
result = 2; -- years match; but because disambiguated, don't add to maint cat
end
elseif date_string:match ("%d%d%d%d?.-%d%d%d%d?") then -- any of the standard range formats of date with two three- or four-digit years
date1, date2 = date_string:match ("(%d%d%d%d?).-(%d%d%d%d?)");
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif mw.ustring.match(date_string, "%d%d%d%d[%-–]%d%d") then -- YYYY-YY date ranges
local century;
date1, century, date2 = mw.ustring.match(date_string, "((%d%d)%d%d)[%-–]+(%d%d)");
date2 = century..date2; -- convert YY to YYYY
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif date_string:match ("%d%d%d%d?") then -- any of the standard formats of date with one year
date1 = date_string:match ("(%d%d%d%d?)");
if year ~= date1 then
result = 0;
end
else -- should never get here; this function called only when no other date errors
result = 0; -- no recognizable year in date
end
if 0 == result then -- year / date mismatch
table.insert (error_list, substitute (cfg.messages['mismatch'], {year_origin, date_origin})); -- add error message to error_list sequence table
elseif 1 == result then -- redundant year / date
set_message ('maint_date_year'); -- add a maint cat
end
end
--[[--------------------------< R E F O R M A T T E R >--------------------------------------------------------
reformat 'date' into new format specified by format_param if pattern_idx (the current format of 'date') can be
reformatted. Does the grunt work for reformat_dates().
The table re_formats maps pattern_idx (current format) and format_param (desired format) to a table that holds:
format string used by string.format()
identifier letters ('d', 'm', 'y', 'd2', 'm2', 'y2') that serve as indexes into a table t{} that holds captures
from mw.ustring.match() for the various date parts specified by patterns[pattern_idx][1]
Items in patterns{} have the general form:
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'}, where:
['ymd'] is pattern_idx
patterns['ymd'][1] is the match pattern with captures for mw.ustring.match()
patterns['ymd'][2] is an indicator letter identifying the content of the first capture
patterns['ymd'][3] ... the second capture etc.
when a pattern matches a date, the captures are loaded into table t{} in capture order using the idemtifier
characters as indexes into t{} For the above, a ymd date is in t{} as:
t.y = first capture (year), t.m = second capture (month), t.d = third capture (day)
To reformat, this function is called with the pattern_idx that matches the current format of the date and with
format_param set to the desired format. This function loads table t{} as described and then calls string.format()
with the format string specified by re_format[pattern_idx][format_param][1] using values taken from t{} according
to the capture identifier letters specified by patterns[pattern_idx][format_param][n] where n is 2..
]]
local re_formats = {
['ymd'] = { -- date format is ymd; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Mdy'] = { -- date format is Mdy; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['dMy'] = { -- date format is dMy; reformat to:
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Md-dy'] = { -- date format is Md-dy; reformat to:
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- |df=dmy -> d-dMy
},
['d-dMy'] = { -- date format is d-d>y; reformat to:
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- |df=mdy -> Md-dy
},
['dM-dMy'] = { -- date format is dM-dMy; reformat to:
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- |df=mdy -> Md-Mdy
},
['Md-Mdy'] = { -- date format is Md-Mdy; reformat to:
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- |df=dmy -> dM-dMy
},
['dMy-dMy'] = { -- date format is dMy-dMy; reformat to:
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- |df=mdy -> Mdy-Mdy
},
['Mdy-Mdy'] = { -- date format is Mdy-Mdy; reformat to:
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- for long/short reformatting
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- |df=dmy -> dMy-dMy
},
['My-My'] = { -- these for long/short reformatting
['any'] = {'%s %s – %s %s', 'm', 'y', 'm2', 'y2'}, -- dmy/mdy agnostic
},
['M-My'] = { -- these for long/short reformatting
['any'] = {'%s–%s %s', 'm', 'm2', 'y'}, -- dmy/mdy agnostic
},
['My'] = { -- these for long/short reformatting
['any'] = {'%s %s', 'm', 'y'}, -- dmy/mdy agnostic
},
-- ['yMd'] = { -- not supported at en.wiki
-- ['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
-- ['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- },
}
local function reformatter (date, pattern_idx, format_param, mon_len)
if not in_array (pattern_idx, {'ymd', 'Mdy', 'Md-dy', 'dMy', 'yMd', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- not in this set of date format patterns then not a reformattable date
end
if 'ymd' == format_param and in_array (pattern_idx, {'ymd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- ymd date ranges not supported at en.wiki; no point in reformatting ymd to ymd
end
if in_array (pattern_idx, {'My', 'M-My', 'My-My'}) then -- these are not dmy/mdy so can't be 'reformatted' into either
format_param = 'any'; -- so format-agnostic
end
-- yMd is not supported at en.wiki; when yMd is supported at your wiki, uncomment the next line
-- if 'yMd' == format_param and in_array (pattern_idx, {'yMd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy'}) then -- these formats not convertable; yMd not supported at en.wiki
if 'yMd' == format_param then -- yMd not supported at en.wiki; when yMd is supported at your wiki, remove or comment-out this line
return; -- not a reformattable date
end
local c1, c2, c3, c4, c5, c6, c7; -- these hold the captures specified in patterns[pattern_idx][1]
c1, c2, c3, c4, c5, c6, c7 = mw.ustring.match (date, patterns[pattern_idx][1]); -- get the captures
local t = { -- table that holds k/v pairs of date parts from the captures and patterns[pattern_idx][2..]
[patterns[pattern_idx][2]] = c1; -- at minimum there is always one capture with a matching indicator letter
[patterns[pattern_idx][3] or 'x'] = c2; -- patterns can have a variable number of captures; each capture requires an indicator letter;
[patterns[pattern_idx][4] or 'x'] = c3; -- where there is no capture, there is no indicator letter so n in patterns[pattern_idx][n] will be nil;
[patterns[pattern_idx][5] or 'x'] = c4; -- the 'x' here spoofs an indicator letter to prevent 'table index is nil' error
[patterns[pattern_idx][6] or 'x'] = c5;
[patterns[pattern_idx][7] or 'x'] = c6;
[patterns[pattern_idx][8] or 'x'] = c7;
};
if t.a then -- if this date has an anchor year capture (all convertable date formats except ymd)
if t.y2 then -- for year range date formats
t.y2 = t.a; -- use the anchor year capture when reassembling the date
else -- here for single date formats (except ymd)
t.y = t.a; -- use the anchor year capture when reassembling the date
end
end
if tonumber(t.m) then -- if raw month is a number (converting from ymd)
if 's' == mon_len then -- if we are to use abbreviated month names
t.m = cfg.date_names['inv_local_short'][tonumber(t.m)]; -- convert it to a month name
else
t.m = cfg.date_names['inv_local_long'][tonumber(t.m)]; -- convert it to a month name
end
t.d = t.d:gsub ('0(%d)', '%1'); -- strip leading '0' from day if present
elseif 'ymd' == format_param then -- when converting to ymd
t.y = t.y:gsub ('%a', ''); -- strip CITREF disambiguator if present; anchor year already known so process can proceed; TODO: maint message?
if 1582 > tonumber (t.y) then -- ymd format dates not allowed before 1582
return;
end
t.m = string.format ('%02d', get_month_number (t.m)); -- make sure that month and day are two digits
t.d = string.format ('%02d', t.d);
elseif mon_len then -- if mon_len is set to either 'short' or 'long'
for _, mon in ipairs ({'m', 'm2'}) do -- because there can be two month names, check both
if t[mon] then
t[mon] = get_month_number (t[mon]); -- get the month number for this month (is length agnostic)
if 0 == t[mon] then return; end -- seasons and named dates can't be converted
t[mon] = (('s' == mon_len) and cfg.date_names['inv_local_short'][t[mon]]) or cfg.date_names['inv_local_long'][t[mon]]; -- fetch month name according to length
end
end
end
local new_date = string.format (re_formats[pattern_idx][format_param][1], -- format string
t[re_formats[pattern_idx][format_param][2]], -- named captures from t{}
t[re_formats[pattern_idx][format_param][3]],
t[re_formats[pattern_idx][format_param][4]],
t[re_formats[pattern_idx][format_param][5]],
t[re_formats[pattern_idx][format_param][6]],
t[re_formats[pattern_idx][format_param][7]],
t[re_formats[pattern_idx][format_param][8]]
);
return new_date;
end
--[[-------------------------< R E F O R M A T _ D A T E S >--------------------------------------------------
Reformats existing dates into the format specified by format.
format is one of several manual keywords: dmy, dmy-all, mdy, mdy-all, ymd, ymd-all. The -all version includes
access- and archive-dates; otherwise these dates are not reformatted.
This function allows automatic date formatting. In ~/Configuration, the article source is searched for one of
the {{use xxx dates}} templates. If found, xxx becomes the global date format as xxx-all. If |cs1-dates= in
{{use xxx dates}} has legitimate value then that value determines how cs1|2 dates will be rendered. Legitimate
values for |cs1-dates= are:
l - all dates are rendered with long month names
ls - publication dates use long month names; access-/archive-dates use abbreviated month names
ly - publication dates use long month names; access-/archive-dates rendered in ymd format
s - all dates are rendered with abbreviated (short) month names
sy - publication dates use abbreviated month names; access-/archive-dates rendered in ymd format
y - all dates are rendered in ymd format
the format argument for automatic date formatting will be the format specified by {{use xxx dates}} with the
value supplied by |cs1-dates so one of: xxx-l, xxx-ls, xxx-ly, xxx-s, xxx-sy, xxx-y, or simply xxx (|cs1-dates=
empty, omitted, or invalid) where xxx shall be either of dmy or mdy.
dates are extracted from date_parameters_list, reformatted (if appropriate), and then written back into the
list in the new format. Dates in date_parameters_list are presumed here to be valid (no errors). This function
returns true when a date has been reformatted, false else. Actual reformatting is done by reformatter().
]]
local function reformat_dates (date_parameters_list, format)
local all = false; -- set to false to skip access- and archive-dates
local len_p = 'l'; -- default publication date length shall be long
local len_a = 'l'; -- default access-/archive-date length shall be long
local result = false;
local new_date;
if format:match('%a+%-all') then -- manual df keyword; auto df keyword when length not specified in {{use xxx dates}};
format = format:match('(%a+)%-all'); -- extract the format
all = true; -- all dates are long format dates because this keyword doesn't specify length
elseif format:match('%a+%-[lsy][sy]?') then -- auto df keywords; internal only
all = true; -- auto df applies to all dates; use length specified by capture len_p for all dates
format, len_p, len_a = format:match('(%a+)%-([lsy])([sy]?)'); -- extract the format and length keywords
if 'y' == len_p then -- because allowed by MOS:DATEUNIFY (sort of) range dates and My dates not reformatted
format = 'ymd'; -- override {{use xxx dates}}
elseif (not is_set(len_a)) or (len_p == len_a) then -- no access-/archive-date length specified or same length as publication dates then
len_a = len_p; -- in case len_a not set
end
end -- else only publication dates and they are long
for param_name, param_val in pairs (date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) then -- if the parameter has a value
if not (not all and in_array (param_name, {'access-date', 'archive-date'})) then -- skip access- or archive-date unless format is xxx-all; yeah, ugly; TODO: find a better way
for pattern_idx, pattern in pairs (patterns) do
if mw.ustring.match (param_val.val, pattern[1]) then
if all and in_array (param_name, {'access-date', 'archive-date'}) then -- if this date is an access- or archive-date
new_date = reformatter (param_val.val, pattern_idx, (('y' == len_a) and 'ymd') or format, len_a); -- choose ymd or dmy/mdy according to len_a setting
else -- all other dates
new_date = reformatter (param_val.val, pattern_idx, format, len_p);
end
if new_date then -- set when date was reformatted
date_parameters_list[param_name].val = new_date; -- update date in date list
result = true; -- and announce that changes have been made
break;
end
end -- if
end -- for
end -- if
end -- if
end -- for
return result; -- declare boolean result and done
end
--[[--------------------------< D A T E _ H Y P H E N _ T O _ D A S H >----------------------------------------
Loops through the list of date-holding parameters and converts any hyphen to an ndash. Not called if the cs1|2
template has any date errors.
Modifies the date_parameters_list and returns true if hyphens are replaced, else returns false.
]]
local function date_hyphen_to_dash (date_parameters_list)
local result = false;
local n;
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) and
not mw.ustring.match (param_val.val, patterns.ymd[1]) then -- for those that are not ymd dates (ustring because here digits may not be Western)
param_val.val, n = param_val.val:gsub ('%-', '–'); -- replace any hyphen with ndash
if 0 ~= n then
date_parameters_list[param_name].val = param_val.val; -- update the list
result = true;
end
end
end
return result; -- so we know if any hyphens were replaced
end
--[[-------------------------< D A T E _ N A M E _ X L A T E >------------------------------------------------
Attempts to translate English date names to local-language date names using names supplied by MediaWiki's
date parser function. This is simple name-for-name replacement and may not work for all languages.
if xlat_dig is true, this function will also translate Western (English) digits to the local language's digits.
This will also translate ymd dates.
]]
local function date_name_xlate (date_parameters_list, xlt_dig)
local xlate;
local mode; -- long or short month names
local modified = false;
local date;
local sources_t = {
{cfg.date_names.en.long, cfg.date_names.inv_local_long}, -- for translating long English month names to long local month names
{cfg.date_names.en.short, cfg.date_names.inv_local_short}, -- short month names
{cfg.date_names.en.quarter, cfg.date_names.inv_local_quarter}, -- quarter date names
{cfg.date_names.en.season, cfg.date_names.inv_local_season}, -- season date nam
{cfg.date_names.en.named, cfg.date_names.inv_local_named}, -- named dates
}
local function is_xlateable (month) -- local function to get local date name that replaces existing English-language date name
for _, date_names_t in ipairs (sources_t) do -- for each sequence table in date_names_t
if date_names_t[1][month] then -- if date name is English month (long or short), quarter, season or named and
if date_names_t[2][date_names_t[1][month]] then -- if there is a matching local date name
return date_names_t[2][date_names_t[1][month]]; -- return the local date name
end
end
end
end
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(param_val.val) then -- if the parameter has a value
date = param_val.val;
for month in mw.ustring.gmatch (date, '[%a ]+') do -- iterate through all date names in the date (single date or date range)
month = mw.text.trim (month); -- this because quarterly dates contain whitespace
xlate = is_xlateable (month); -- get translate <month>; returns translation or nil
if xlate then
date = mw.ustring.gsub (date, month, xlate); -- replace the English with the translation
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
if xlt_dig then -- shall we also translate digits?
date = date:gsub ('%d', cfg.date_names.xlate_digits); -- translate digits from Western to 'local digits'
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
end
return modified;
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
add_prop_cat = utilities_page_ptr.add_prop_cat ; -- import functions from selected Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
set_message = utilities_page_ptr.set_message;
substitute = utilities_page_ptr.substitute;
wrap_style = utilities_page_ptr.wrap_style;
cfg = cfg_table_ptr; -- import tables from selected Module:Citation/CS1/Configuration
end
--[[--------------------------< A R C H I V E _ D A T E _ C H E C K >------------------------------------------
Compare value in |archive-date= with the timestamp in Wayback machine urls. Emits an error message when |archive-date=
does not match the timestamp.
]]
local function archive_date_check (archive_date, archive_url_timestamp)
local good, archive_date_ts = pcall (lang_object.formatDate, lang_object, 'Ymd', archive_date); -- |archive-date= value to YYYYMMDD format
-- local archive_date_ts = lang_object:formatDate ('Ymd', archive_date); -- |archive-date= value to YYYYMMDD format
if good then
if not archive_url_timestamp:find (archive_date_ts, 1, true) then -- plain text find; begin search at position 1
set_message ('err_archive_date_url_ts_mismatch'); -- emit an error message
end
end
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return { -- return exported functions
archive_date_check = archive_date_check,
date_hyphen_to_dash = date_hyphen_to_dash,
date_name_xlate = date_name_xlate,
dates = dates,
reformat_dates = reformat_dates,
set_selected_modules = set_selected_modules,
year_date_check = year_date_check,
}
91dea3f3d4d1691cec7700aac0057c873554b8c1
Module:Citation/CS1/Whitelist
828
160
420
2023-08-12T19:19:08Z
wikipedia>Trappist the monk
0
sync from sandbox;
Scribunto
text/plain
--[[--------------------------< S U P P O R T E D P A R A M E T E R S >--------------------------------------
Because a steady-state signal conveys no useful information, whitelist.basic_arguments[] list items can have three values:
true - these parameters are valid and supported parameters
false - these parameters are deprecated but still supported
tracked - these parameters are valid and supported parameters tracked in an eponymous properties category
nil - these parameters are no longer supported. remove entirely
]]
local basic_arguments_t = {
['accessdate'] = true,
['access-date'] = true,
['agency'] = true,
['archivedate'] = true,
['archive-date'] = true,
['archive-format'] = true,
['archiveurl'] = true,
['archive-url'] = true,
['article'] = true,
['article-format'] = true,
['article-number'] = true, -- {{cite journal}}, {{cite conference}}; {{citation}} when |journal= has a value
['article-url'] = true,
['article-url-access'] = true,
['arxiv'] = true, -- cite arxiv; here because allowed in cite ... as identifier
['asin'] = true,
['ASIN'] = true,
['asin-tld'] = true,
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-given'] = true,
['author-last'] = true,
['author-surname'] = true,
['authorlink'] = true,
['author-link'] = true,
['author-mask'] = true,
['authors'] = true,
['bibcode'] = true,
['bibcode-access'] = true,
['biorxiv'] = true, -- cite biorxiv; here because allowed in cite ... as identifier
['chapter'] = true,
['chapter-format'] = true,
['chapter-url'] = true,
['chapter-url-access'] = true,
['citeseerx'] = true, -- cite citeseerx; here because allowed in cite ... as identifier
['collaboration'] = true,
['contribution'] = true,
['contribution-format'] = true,
['contribution-url'] = true,
['contribution-url-access'] = true,
['contributor'] = true,
['contributor-first'] = true,
['contributor-given'] = true,
['contributor-last'] = true,
['contributor-surname'] = true,
['contributor-link'] = true,
['contributor-mask'] = true,
['date'] = true,
['department'] = true,
['df'] = true,
['dictionary'] = true,
['display-authors'] = true,
['display-contributors'] = true,
['display-editors'] = true,
['display-interviewers'] = true,
['display-subjects'] = true,
['display-translators'] = true,
['doi'] = true,
['DOI'] = true,
['doi-access'] = true,
['doi-broken-date'] = true,
['edition'] = true,
['editor'] = true,
['editor-first'] = true,
['editor-given'] = true,
['editor-last'] = true,
['editor-surname'] = true,
['editor-link'] = true,
['editor-mask'] = true,
['eissn'] = true,
['EISSN'] = true,
['encyclopaedia'] = true,
['encyclopedia'] = true,
['entry'] = true,
['entry-format'] = true,
['entry-url'] = true,
['entry-url-access'] = true,
['eprint'] = true, -- cite arxiv; here because allowed in cite ... as identifier
['first'] = true,
['format'] = true,
['given'] = true,
['hdl'] = true,
['HDL'] = true,
['hdl-access'] = true,
['host'] = true, -- unique to certain templates?
['id'] = true,
['ID'] = true,
['institution'] = true, -- constrain to cite thesis?
['interviewer'] = true,
['interviewer-first'] = true,
['interviewer-given'] = true,
['interviewer-last'] = true,
['interviewer-surname'] = true,
['interviewer-link'] = true,
['interviewer-mask'] = true,
['isbn'] = true,
['ISBN'] = true,
['ismn'] = true,
['ISMN'] = true,
['issn'] = true,
['ISSN'] = true,
['issue'] = true,
['jfm'] = true,
['JFM'] = true,
['journal'] = true,
['jstor'] = true,
['JSTOR'] = true,
['jstor-access'] = true,
['lang'] = true,
['language'] = true,
['last'] = true,
['lccn'] = true,
['LCCN'] = true,
['location'] = true,
['magazine'] = true,
['medium'] = true,
['medrxiv'] = true, -- cite medrxiv; here because allowed in cite ... as identifier
['minutes'] = true, -- constrain to cite AV media and podcast?
['mode'] = true,
['mr'] = true,
['MR'] = true,
['name-list-style'] = true,
['newspaper'] = true,
['no-pp'] = true,
['no-tracking'] = true,
['number'] = true,
['oclc'] = true,
['OCLC'] = true,
['ol'] = true,
['OL'] = true,
['ol-access'] = true,
['orig-date'] = true,
['origyear'] = true,
['orig-year'] = true,
['osti'] = true,
['OSTI'] = true,
['osti-access'] = true,
['others'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['people'] = true,
['periodical'] = true,
['place'] = true,
['pmc'] = true,
['PMC'] = true,
['pmc-embargo-date'] = true,
['pmid'] = true,
['PMID'] = true,
['postscript'] = true,
['pp'] = true,
['publication-date'] = true,
['publication-place'] = true,
['publisher'] = true,
['quotation'] = true,
['quote'] = true,
['quote-page'] = true,
['quote-pages'] = true,
['ref'] = true,
['rfc'] = true,
['RFC'] = true,
['sbn'] = true,
['SBN'] = true,
['scale'] = true,
['script-article'] = true,
['script-chapter'] = true,
['script-contribution'] = true,
['script-entry'] = true,
['script-journal'] = true,
['script-magazine'] = true,
['script-newspaper'] = true,
['script-periodical'] = true,
['script-quote'] = true,
['script-section'] = true,
['script-title'] = true,
['script-website'] = true,
['script-work'] = true,
['section'] = true,
['section-format'] = true,
['section-url'] = true,
['section-url-access'] = true,
['series'] = true,
['ssrn'] = true, -- cite ssrn; these three here because allowed in cite ... as identifier
['SSRN'] = true,
['ssrn-access'] = true,
['subject'] = true,
['subject-first'] = true,
['subject-given'] = true,
['subject-last'] = true,
['subject-link'] = true,
['subject-mask'] = true,
['subject-surname'] = true,
['surname'] = true,
['s2cid'] = true,
['S2CID'] = true,
['s2cid-access'] = true,
['template-doc-demo'] = true,
['time'] = true, -- constrain to cite av media and podcast?
['time-caption'] = true, -- constrain to cite av media and podcast?
['title'] = true,
['title-link'] = true,
['title-note'] = true,
['translator'] = true,
['translator-first'] = true,
['translator-given'] = true,
['translator-last'] = true,
['translator-surname'] = true,
['translator-link'] = true,
['translator-mask'] = true,
['trans-article'] = true,
['trans-chapter'] = true,
['trans-contribution'] = true,
['trans-entry'] = true,
['trans-journal'] = true,
['trans-magazine'] = true,
['trans-newspaper'] = true,
['trans-periodical'] = true,
['trans-quote'] = true,
['trans-section'] = true,
['trans-title'] = true,
['trans-website'] = true,
['trans-work'] = true,
['type'] = true,
['url'] = true,
['URL'] = true,
['url-access'] = true,
['url-status'] = true,
['vauthors'] = true,
['veditors'] = true,
['version'] = true,
['via'] = true,
['volume'] = true,
['website'] = true,
['work'] = true,
['year'] = true,
['zbl'] = true,
['ZBL'] = true,
}
local numbered_arguments_t = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-given#'] = true,
['author#-given'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-surname#'] = true,
['author#-surname'] = true,
['author-link#'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author#link'] = true,
['author-mask#'] = true,
['author#-mask'] = true,
['contributor#'] = true,
['contributor-first#'] = true,
['contributor#-first'] = true,
['contributor-given#'] = true,
['contributor#-given'] = true,
['contributor-last#'] = true,
['contributor#-last'] = true,
['contributor-surname#'] = true,
['contributor#-surname'] = true,
['contributor-link#'] = true,
['contributor#-link'] = true,
['contributor-mask#'] = true,
['contributor#-mask'] = true,
['editor#'] = true,
['editor-first#'] = true,
['editor#-first'] = true,
['editor-given#'] = true,
['editor#-given'] = true,
['editor-last#'] = true,
['editor#-last'] = true,
['editor-surname#'] = true,
['editor#-surname'] = true,
['editor-link#'] = true,
['editor#-link'] = true,
['editor-mask#'] = true,
['editor#-mask'] = true,
['first#'] = true,
['given#'] = true,
['host#'] = true,
['interviewer#'] = true,
['interviewer-first#'] = true,
['interviewer#-first'] = true,
['interviewer-given#'] = true,
['interviewer#-given'] = true,
['interviewer-last#'] = true,
['interviewer#-last'] = true,
['interviewer-surname#'] = true,
['interviewer#-surname'] = true,
['interviewer-link#'] = true,
['interviewer#-link'] = true,
['interviewer-mask#'] = true,
['interviewer#-mask'] = true,
['last#'] = true,
['subject#'] = true,
['subject-first#'] = true,
['subject#-first'] = true,
['subject-given#'] = true,
['subject#-given'] = true,
['subject-last#'] = true,
['subject#-last'] = true,
['subject-link#'] = true,
['subject#-link'] = true,
['subject-mask#'] = true,
['subject#-mask'] = true,
['subject-surname#'] = true,
['subject#-surname'] = true,
['surname#'] = true,
['translator#'] = true,
['translator-first#'] = true,
['translator#-first'] = true,
['translator-given#'] = true,
['translator#-given'] = true,
['translator-last#'] = true,
['translator#-last'] = true,
['translator-surname#'] = true,
['translator#-surname'] = true,
['translator-link#'] = true,
['translator#-link'] = true,
['translator-mask#'] = true,
['translator#-mask'] = true,
}
--[[--------------------------< P R E P R I N T S U P P O R T E D P A R A M E T E R S >--------------------
Cite arXiv, cite biorxiv, cite citeseerx, cite medrxiv, and cite ssrn are preprint templates that use the limited
set of parameters defined in the limited_basic_arguments and limited_numbered_arguments tables. Those lists are
supplemented with a template-specific list of parameters that are required by the particular template and may be
exclusive to one of the preprint templates. Some of these parameters may also be available to the general cs1|2
templates.
Same conventions for true/false/tracked/nil as above.
]]
local preprint_arguments_t = {
arxiv = {
['arxiv'] = true, -- cite arxiv and arxiv identifiers
['class'] = true,
['eprint'] = true, -- cite arxiv and arxiv identifiers
},
biorxiv = {
['biorxiv'] = true,
},
citeseerx = {
['citeseerx'] = true,
},
medrxiv = {
['medrxiv'] = true,
},
ssrn = {
['ssrn'] = true,
['SSRN'] = true,
['ssrn-access'] = true,
},
}
--[[--------------------------< L I M I T E D S U P P O R T E D P A R A M E T E R S >----------------------
cite arxiv, cite biorxiv, cite citeseerx, cite medrxiv, and cite ssrn templates are preprint templates so are
allowed only a limited subset of parameters allowed to all other cs1|2 templates. The limited subset is defined
here.
This list of parameters also used by {{cite document}}
Same conventions for true/false/tracked/nil as above.
]]
local limited_basic_arguments_t = {
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-given'] = true,
['author-last'] = true,
['author-surname'] = true,
['author-link'] = true,
['authorlink'] = true,
['author-mask'] = true,
['authors'] = true,
['collaboration'] = true,
['date'] = true,
['df'] = true,
['display-authors'] = true,
['first'] = true,
['given'] = true,
['language'] = true,
['last'] = true,
['mode'] = true,
['name-list-style'] = true,
['no-tracking'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['postscript'] = true,
['pp'] = true,
['quotation'] = true,
['quote'] = true,
['ref'] = true,
['surname'] = true,
['template-doc-demo'] = true,
['title'] = true,
['trans-title'] = true,
['vauthors'] = true,
['year'] = true,
}
local limited_numbered_arguments_t = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-given#'] = true,
['author#-given'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-surname#'] = true,
['author#-surname'] = true,
['author-link#'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author#link'] = true,
['author-mask#'] = true,
['author#-mask'] = true,
['first#'] = true,
['given#'] = true,
['last#'] = true,
['surname#'] = true,
}
--[[--------------------------< U N I Q U E _ A R G U M E N T S >----------------------------------------------
Some templates have unique parameters. Those templates and their unique parameters are listed here. Keys in this
table are the template's CitationClass parameter value
Same conventions for true/false/tracked/nil as above.
]]
local unique_arguments_t = {
['audio-visual'] = {
['transcript'] = true,
['transcript-format'] = true,
['transcript-url'] = true,
},
conference = {
['book-title'] = true,
['conference'] = true,
['conference-format'] = true,
['conference-url'] = true,
['event'] = true,
},
episode = {
['airdate'] = true,
['air-date'] = true,
['credits'] = true,
['episode-link'] = true, -- alias of |title-link=
['network'] = true,
['season'] = true,
['series-link'] = true,
['series-no'] = true,
['series-number'] = true,
['station'] = true,
['transcript'] = true,
['transcript-format'] = true,
['transcript-url'] = true,
},
mailinglist = {
['mailing-list'] = true,
},
map = {
['cartography'] = true,
['inset'] = true,
['map'] = true,
['map-format'] = true,
['map-url'] = true,
['map-url-access'] = true,
['script-map'] = true,
['sections'] = true,
['sheet'] = true,
['sheets'] = true,
['trans-map'] = true,
},
newsgroup = {
['message-id'] = true,
['newsgroup'] = true,
},
report = {
['docket'] = true,
},
serial = {
['airdate'] = true,
['air-date'] = true,
['credits'] = true,
['episode'] = true, -- cite serial only TODO: make available to cite episode?
['episode-link'] = true, -- alias of |title-link=
['network'] = true,
['series-link'] = true,
['station'] = true,
},
speech = {
['conference'] = true,
['conference-format'] = true,
['conference-url'] = true,
['event'] = true,
},
thesis = {
['degree'] = true,
['docket'] = true,
},
}
--[[--------------------------< C I T E _ D O C U M E N T >----------------------------------------------------
Special case for cite document. This template takes the limited basic and limited enumerated parameters plus
others that are apply only to standalone published sources that cannot be cited any other way; no url, book,
periodical, etc parameters; limited support for name lists and named identifiers.
when validating parameters in {{cite document}} templates, the basic and
]]
local document_arguments_t = {
['bibcode'] = true,
['bibcode-access'] = true,
['doi'] = true,
['DOI'] = true,
['doi-access'] = true,
['doi-broken-date'] = true,
['hdl'] = true,
['HDL'] = true,
['hdl-access'] = true,
['id'] = true,
['ID'] = true,
['jfm'] = true,
['JFM'] = true,
['lang'] = true,
['location'] = true,
['mr'] = true,
['MR'] = true,
['no-pp'] = true,
['orig-date'] = true,
['origyear'] = true,
['orig-year'] = true,
['osti'] = true,
['OSTI'] = true,
['osti-access'] = true,
['place'] = true,
['publisher'] = true,
['quote-page'] = true,
['quote-pages'] = true,
['script-quote'] = true,
['script-title'] = true,
['title-link'] = true,
['translator'] = true,
['translator-first'] = true,
['translator-given'] = true,
['translator-last'] = true,
['translator-surname'] = true,
['translator-link'] = true,
['translator-mask'] = true,
['trans-quote'] = true,
['type'] = true,
['zbl'] = true,
['ZBL'] = true,
}
local document_numbered_arguments_t = {
['translator#'] = true,
['translator-first#'] = true,
['translator#-first'] = true,
['translator-given#'] = true,
['translator#-given'] = true,
['translator-last#'] = true,
['translator#-last'] = true,
['translator-surname#'] = true,
['translator#-surname'] = true,
['translator-link#'] = true,
['translator#-link'] = true,
['translator-mask#'] = true,
['translator#-mask'] = true,
}
--[[--------------------------< L I S T _ C O M B I N E >------------------------------------------------------
makes one table from a list of tables. <lists_t> is a sequence of tables to be combined
]]
local function list_combine (lists_t)
local out_t = {};
for _, list_t in ipairs (lists_t) do -- for each list in <lists_t>
for k, v in pairs (list_t) do -- extract each k/v pair
out_t[k] = v; -- add to <out_t>
end
end
return out_t; -- and done
end
--[[--------------------------< T E M P L A T E _ L I S T _ G E T >--------------------------------------------
gets a list of the templates from table t
]]
local function template_list_get (t)
local out_t = {}; -- a table for output
for k, _ in pairs (t) do -- spin through the table and collect the keys
table.insert (out_t, k) -- add each key to the output table
end
return out_t; -- and done
end
--[[--------------------------< E X P O R T E D T A B L E S >------------------------------------------------
]]
return {
preprint_arguments_t = preprint_arguments_t,
preprint_template_list_t = template_list_get (preprint_arguments_t), -- make a template list from preprint_arguments{} table
unique_arguments_t = unique_arguments_t,
unique_param_template_list_t = template_list_get (unique_arguments_t), -- make a template list from unique_arguments{} table
document_parameters_t = list_combine ({limited_basic_arguments_t, limited_numbered_arguments_t, document_arguments_t, document_numbered_arguments_t});
common_parameters_t = list_combine ({basic_arguments_t, numbered_arguments_t});
limited_parameters_t = list_combine ({limited_basic_arguments_t, limited_numbered_arguments_t});
};
bd347271e3380cb17f22c0e3924982798e9adc07
Module:Language/data/iana languages
828
152
404
2023-08-21T15:41:21Z
wikipedia>Trappist the monk
0
update to 2023-08-02 data;
Scribunto
text/plain
-- File-Date: 2023-08-02
local active = {
["aa"] = {"Afar"},
["ab"] = {"Abkhazian"},
["ae"] = {"Avestan"},
["af"] = {"Afrikaans"},
["ak"] = {"Akan"},
["am"] = {"Amharic"},
["an"] = {"Aragonese"},
["ar"] = {"Arabic"},
["as"] = {"Assamese"},
["av"] = {"Avaric"},
["ay"] = {"Aymara"},
["az"] = {"Azerbaijani"},
["ba"] = {"Bashkir"},
["be"] = {"Belarusian"},
["bg"] = {"Bulgarian"},
["bh"] = {"Bihari languages"},
["bi"] = {"Bislama"},
["bm"] = {"Bambara"},
["bn"] = {"Bengali", "Bangla"},
["bo"] = {"Tibetan"},
["br"] = {"Breton"},
["bs"] = {"Bosnian"},
["ca"] = {"Catalan", "Valencian"},
["ce"] = {"Chechen"},
["ch"] = {"Chamorro"},
["co"] = {"Corsican"},
["cr"] = {"Cree"},
["cs"] = {"Czech"},
["cu"] = {"Church Slavic", "Church Slavonic", "Old Bulgarian", "Old Church Slavonic", "Old Slavonic"},
["cv"] = {"Chuvash"},
["cy"] = {"Welsh"},
["da"] = {"Danish"},
["de"] = {"German"},
["dv"] = {"Dhivehi", "Divehi", "Maldivian"},
["dz"] = {"Dzongkha"},
["ee"] = {"Ewe"},
["el"] = {"Modern Greek (1453-)"},
["en"] = {"English"},
["eo"] = {"Esperanto"},
["es"] = {"Spanish", "Castilian"},
["et"] = {"Estonian"},
["eu"] = {"Basque"},
["fa"] = {"Persian"},
["ff"] = {"Fulah"},
["fi"] = {"Finnish"},
["fj"] = {"Fijian"},
["fo"] = {"Faroese"},
["fr"] = {"French"},
["fy"] = {"Western Frisian"},
["ga"] = {"Irish"},
["gd"] = {"Scottish Gaelic", "Gaelic"},
["gl"] = {"Galician"},
["gn"] = {"Guarani"},
["gu"] = {"Gujarati"},
["gv"] = {"Manx"},
["ha"] = {"Hausa"},
["he"] = {"Hebrew"},
["hi"] = {"Hindi"},
["ho"] = {"Hiri Motu"},
["hr"] = {"Croatian"},
["ht"] = {"Haitian", "Haitian Creole"},
["hu"] = {"Hungarian"},
["hy"] = {"Armenian"},
["hz"] = {"Herero"},
["ia"] = {"Interlingua (International Auxiliary Language Association)"},
["id"] = {"Indonesian"},
["ie"] = {"Interlingue", "Occidental"},
["ig"] = {"Igbo"},
["ii"] = {"Sichuan Yi", "Nuosu"},
["ik"] = {"Inupiaq"},
["io"] = {"Ido"},
["is"] = {"Icelandic"},
["it"] = {"Italian"},
["iu"] = {"Inuktitut"},
["ja"] = {"Japanese"},
["jv"] = {"Javanese"},
["ka"] = {"Georgian"},
["kg"] = {"Kongo"},
["ki"] = {"Kikuyu", "Gikuyu"},
["kj"] = {"Kuanyama", "Kwanyama"},
["kk"] = {"Kazakh"},
["kl"] = {"Kalaallisut", "Greenlandic"},
["km"] = {"Khmer", "Central Khmer"},
["kn"] = {"Kannada"},
["ko"] = {"Korean"},
["kr"] = {"Kanuri"},
["ks"] = {"Kashmiri"},
["ku"] = {"Kurdish"},
["kv"] = {"Komi"},
["kw"] = {"Cornish"},
["ky"] = {"Kirghiz", "Kyrgyz"},
["la"] = {"Latin"},
["lb"] = {"Luxembourgish", "Letzeburgesch"},
["lg"] = {"Ganda", "Luganda"},
["li"] = {"Limburgan", "Limburger", "Limburgish"},
["ln"] = {"Lingala"},
["lo"] = {"Lao"},
["lt"] = {"Lithuanian"},
["lu"] = {"Luba-Katanga"},
["lv"] = {"Latvian"},
["mg"] = {"Malagasy"},
["mh"] = {"Marshallese"},
["mi"] = {"Maori"},
["mk"] = {"Macedonian"},
["ml"] = {"Malayalam"},
["mn"] = {"Mongolian"},
["mr"] = {"Marathi"},
["ms"] = {"Malay (macrolanguage)"},
["mt"] = {"Maltese"},
["my"] = {"Burmese"},
["na"] = {"Nauru"},
["nb"] = {"Norwegian Bokmål"},
["nd"] = {"North Ndebele"},
["ne"] = {"Nepali (macrolanguage)"},
["ng"] = {"Ndonga"},
["nl"] = {"Dutch", "Flemish"},
["nn"] = {"Norwegian Nynorsk"},
["no"] = {"Norwegian"},
["nr"] = {"South Ndebele"},
["nv"] = {"Navajo", "Navaho"},
["ny"] = {"Nyanja", "Chewa", "Chichewa"},
["oc"] = {"Occitan (post 1500)"},
["oj"] = {"Ojibwa"},
["om"] = {"Oromo"},
["or"] = {"Oriya (macrolanguage)", "Odia (macrolanguage)"},
["os"] = {"Ossetian", "Ossetic"},
["pa"] = {"Panjabi", "Punjabi"},
["pi"] = {"Pali"},
["pl"] = {"Polish"},
["ps"] = {"Pushto", "Pashto"},
["pt"] = {"Portuguese"},
["qu"] = {"Quechua"},
["rm"] = {"Romansh"},
["rn"] = {"Rundi"},
["ro"] = {"Romanian", "Moldavian", "Moldovan"},
["ru"] = {"Russian"},
["rw"] = {"Kinyarwanda"},
["sa"] = {"Sanskrit"},
["sc"] = {"Sardinian"},
["sd"] = {"Sindhi"},
["se"] = {"Northern Sami"},
["sg"] = {"Sango"},
["sh"] = {"Serbo-Croatian"},
["si"] = {"Sinhala", "Sinhalese"},
["sk"] = {"Slovak"},
["sl"] = {"Slovenian"},
["sm"] = {"Samoan"},
["sn"] = {"Shona"},
["so"] = {"Somali"},
["sq"] = {"Albanian"},
["sr"] = {"Serbian"},
["ss"] = {"Swati"},
["st"] = {"Southern Sotho"},
["su"] = {"Sundanese"},
["sv"] = {"Swedish"},
["sw"] = {"Swahili (macrolanguage)"},
["ta"] = {"Tamil"},
["te"] = {"Telugu"},
["tg"] = {"Tajik"},
["th"] = {"Thai"},
["ti"] = {"Tigrinya"},
["tk"] = {"Turkmen"},
["tl"] = {"Tagalog"},
["tn"] = {"Tswana"},
["to"] = {"Tonga (Tonga Islands)"},
["tr"] = {"Turkish"},
["ts"] = {"Tsonga"},
["tt"] = {"Tatar"},
["tw"] = {"Twi"},
["ty"] = {"Tahitian"},
["ug"] = {"Uighur", "Uyghur"},
["uk"] = {"Ukrainian"},
["ur"] = {"Urdu"},
["uz"] = {"Uzbek"},
["ve"] = {"Venda"},
["vi"] = {"Vietnamese"},
["vo"] = {"Volapük"},
["wa"] = {"Walloon"},
["wo"] = {"Wolof"},
["xh"] = {"Xhosa"},
["yi"] = {"Yiddish"},
["yo"] = {"Yoruba"},
["za"] = {"Zhuang", "Chuang"},
["zh"] = {"Chinese"},
["zu"] = {"Zulu"},
["aaa"] = {"Ghotuo"},
["aab"] = {"Alumu-Tesu"},
["aac"] = {"Ari"},
["aad"] = {"Amal"},
["aae"] = {"Arbëreshë Albanian"},
["aaf"] = {"Aranadan"},
["aag"] = {"Ambrak"},
["aah"] = {"Abu' Arapesh"},
["aai"] = {"Arifama-Miniafia"},
["aak"] = {"Ankave"},
["aal"] = {"Afade"},
["aan"] = {"Anambé"},
["aao"] = {"Algerian Saharan Arabic"},
["aap"] = {"Pará Arára"},
["aaq"] = {"Eastern Abnaki"},
["aas"] = {"Aasáx"},
["aat"] = {"Arvanitika Albanian"},
["aau"] = {"Abau"},
["aav"] = {"Austro-Asiatic languages"},
["aaw"] = {"Solong"},
["aax"] = {"Mandobo Atas"},
["aaz"] = {"Amarasi"},
["aba"] = {"Abé"},
["abb"] = {"Bankon"},
["abc"] = {"Ambala Ayta"},
["abd"] = {"Manide"},
["abe"] = {"Western Abnaki"},
["abf"] = {"Abai Sungai"},
["abg"] = {"Abaga"},
["abh"] = {"Tajiki Arabic"},
["abi"] = {"Abidji"},
["abj"] = {"Aka-Bea"},
["abl"] = {"Lampung Nyo"},
["abm"] = {"Abanyom"},
["abn"] = {"Abua"},
["abo"] = {"Abon"},
["abp"] = {"Abellen Ayta"},
["abq"] = {"Abaza"},
["abr"] = {"Abron"},
["abs"] = {"Ambonese Malay"},
["abt"] = {"Ambulas"},
["abu"] = {"Abure"},
["abv"] = {"Baharna Arabic"},
["abw"] = {"Pal"},
["abx"] = {"Inabaknon"},
["aby"] = {"Aneme Wake"},
["abz"] = {"Abui"},
["aca"] = {"Achagua"},
["acb"] = {"Áncá"},
["acd"] = {"Gikyode"},
["ace"] = {"Achinese"},
["acf"] = {"Saint Lucian Creole French"},
["ach"] = {"Acoli"},
["aci"] = {"Aka-Cari"},
["ack"] = {"Aka-Kora"},
["acl"] = {"Akar-Bale"},
["acm"] = {"Mesopotamian Arabic"},
["acn"] = {"Achang"},
["acp"] = {"Eastern Acipa"},
["acq"] = {"Ta'izzi-Adeni Arabic"},
["acr"] = {"Achi"},
["acs"] = {"Acroá"},
["act"] = {"Achterhoeks"},
["acu"] = {"Achuar-Shiwiar"},
["acv"] = {"Achumawi"},
["acw"] = {"Hijazi Arabic"},
["acx"] = {"Omani Arabic"},
["acy"] = {"Cypriot Arabic"},
["acz"] = {"Acheron"},
["ada"] = {"Adangme"},
["adb"] = {"Atauran"},
["add"] = {"Lidzonka", "Dzodinka"},
["ade"] = {"Adele"},
["adf"] = {"Dhofari Arabic"},
["adg"] = {"Andegerebinha"},
["adh"] = {"Adhola"},
["adi"] = {"Adi"},
["adj"] = {"Adioukrou"},
["adl"] = {"Galo"},
["adn"] = {"Adang"},
["ado"] = {"Abu"},
["adq"] = {"Adangbe"},
["adr"] = {"Adonara"},
["ads"] = {"Adamorobe Sign Language"},
["adt"] = {"Adnyamathanha"},
["adu"] = {"Aduge"},
["adw"] = {"Amundava"},
["adx"] = {"Amdo Tibetan"},
["ady"] = {"Adyghe", "Adygei"},
["adz"] = {"Adzera"},
["aea"] = {"Areba"},
["aeb"] = {"Tunisian Arabic"},
["aec"] = {"Saidi Arabic"},
["aed"] = {"Argentine Sign Language"},
["aee"] = {"Northeast Pashai", "Northeast Pashayi"},
["aek"] = {"Haeke"},
["ael"] = {"Ambele"},
["aem"] = {"Arem"},
["aen"] = {"Armenian Sign Language"},
["aeq"] = {"Aer"},
["aer"] = {"Eastern Arrernte"},
["aes"] = {"Alsea"},
["aeu"] = {"Akeu"},
["aew"] = {"Ambakich"},
["aey"] = {"Amele"},
["aez"] = {"Aeka"},
["afa"] = {"Afro-Asiatic languages"},
["afb"] = {"Gulf Arabic"},
["afd"] = {"Andai"},
["afe"] = {"Putukwam"},
["afg"] = {"Afghan Sign Language"},
["afh"] = {"Afrihili"},
["afi"] = {"Akrukay", "Chini"},
["afk"] = {"Nanubae"},
["afn"] = {"Defaka"},
["afo"] = {"Eloyi"},
["afp"] = {"Tapei"},
["afs"] = {"Afro-Seminole Creole"},
["aft"] = {"Afitti"},
["afu"] = {"Awutu"},
["afz"] = {"Obokuitai"},
["aga"] = {"Aguano"},
["agb"] = {"Legbo"},
["agc"] = {"Agatu"},
["agd"] = {"Agarabi"},
["age"] = {"Angal"},
["agf"] = {"Arguni"},
["agg"] = {"Angor"},
["agh"] = {"Ngelima"},
["agi"] = {"Agariya"},
["agj"] = {"Argobba"},
["agk"] = {"Isarog Agta"},
["agl"] = {"Fembe"},
["agm"] = {"Angaataha"},
["agn"] = {"Agutaynen"},
["ago"] = {"Tainae"},
["agq"] = {"Aghem"},
["agr"] = {"Aguaruna"},
["ags"] = {"Esimbi"},
["agt"] = {"Central Cagayan Agta"},
["agu"] = {"Aguacateco"},
["agv"] = {"Remontado Dumagat"},
["agw"] = {"Kahua"},
["agx"] = {"Aghul"},
["agy"] = {"Southern Alta"},
["agz"] = {"Mt. Iriga Agta"},
["aha"] = {"Ahanta"},
["ahb"] = {"Axamb"},
["ahg"] = {"Qimant"},
["ahh"] = {"Aghu"},
["ahi"] = {"Tiagbamrin Aizi"},
["ahk"] = {"Akha"},
["ahl"] = {"Igo"},
["ahm"] = {"Mobumrin Aizi"},
["ahn"] = {"Àhàn"},
["aho"] = {"Ahom"},
["ahp"] = {"Aproumu Aizi"},
["ahr"] = {"Ahirani"},
["ahs"] = {"Ashe"},
["aht"] = {"Ahtena"},
["aia"] = {"Arosi"},
["aib"] = {"Ainu (China)"},
["aic"] = {"Ainbai"},
["aid"] = {"Alngith"},
["aie"] = {"Amara"},
["aif"] = {"Agi"},
["aig"] = {"Antigua and Barbuda Creole English"},
["aih"] = {"Ai-Cham"},
["aii"] = {"Assyrian Neo-Aramaic"},
["aij"] = {"Lishanid Noshan"},
["aik"] = {"Ake"},
["ail"] = {"Aimele"},
["aim"] = {"Aimol"},
["ain"] = {"Ainu (Japan)"},
["aio"] = {"Aiton"},
["aip"] = {"Burumakok"},
["aiq"] = {"Aimaq"},
["air"] = {"Airoran"},
["ait"] = {"Arikem"},
["aiw"] = {"Aari"},
["aix"] = {"Aighon"},
["aiy"] = {"Ali"},
["aja"] = {"Aja (South Sudan)"},
["ajg"] = {"Aja (Benin)"},
["aji"] = {"Ajië"},
["ajn"] = {"Andajin"},
["ajs"] = {"Algerian Jewish Sign Language"},
["aju"] = {"Judeo-Moroccan Arabic"},
["ajw"] = {"Ajawa"},
["ajz"] = {"Amri Karbi"},
["akb"] = {"Batak Angkola"},
["akc"] = {"Mpur"},
["akd"] = {"Ukpet-Ehom"},
["ake"] = {"Akawaio"},
["akf"] = {"Akpa"},
["akg"] = {"Anakalangu"},
["akh"] = {"Angal Heneng"},
["aki"] = {"Aiome"},
["akj"] = {"Aka-Jeru"},
["akk"] = {"Akkadian"},
["akl"] = {"Aklanon"},
["akm"] = {"Aka-Bo"},
["ako"] = {"Akurio"},
["akp"] = {"Siwu"},
["akq"] = {"Ak"},
["akr"] = {"Araki"},
["aks"] = {"Akaselem"},
["akt"] = {"Akolet"},
["aku"] = {"Akum"},
["akv"] = {"Akhvakh"},
["akw"] = {"Akwa"},
["akx"] = {"Aka-Kede"},
["aky"] = {"Aka-Kol"},
["akz"] = {"Alabama"},
["ala"] = {"Alago"},
["alc"] = {"Qawasqar"},
["ald"] = {"Alladian"},
["ale"] = {"Aleut"},
["alf"] = {"Alege"},
["alg"] = {"Algonquian languages"},
["alh"] = {"Alawa"},
["ali"] = {"Amaimon"},
["alj"] = {"Alangan"},
["alk"] = {"Alak"},
["all"] = {"Allar"},
["alm"] = {"Amblong"},
["aln"] = {"Gheg Albanian"},
["alo"] = {"Larike-Wakasihu"},
["alp"] = {"Alune"},
["alq"] = {"Algonquin"},
["alr"] = {"Alutor"},
["als"] = {"Tosk Albanian"},
["alt"] = {"Southern Altai"},
["alu"] = {"'Are'are"},
["alv"] = {"Atlantic-Congo languages"},
["alw"] = {"Alaba-K’abeena", "Wanbasana"},
["alx"] = {"Amol"},
["aly"] = {"Alyawarr"},
["alz"] = {"Alur"},
["ama"] = {"Amanayé"},
["amb"] = {"Ambo"},
["amc"] = {"Amahuaca"},
["ame"] = {"Yanesha'"},
["amf"] = {"Hamer-Banna"},
["amg"] = {"Amurdak"},
["ami"] = {"Amis"},
["amj"] = {"Amdang"},
["amk"] = {"Ambai"},
["aml"] = {"War-Jaintia"},
["amm"] = {"Ama (Papua New Guinea)"},
["amn"] = {"Amanab"},
["amo"] = {"Amo"},
["amp"] = {"Alamblak"},
["amq"] = {"Amahai"},
["amr"] = {"Amarakaeri"},
["ams"] = {"Southern Amami-Oshima"},
["amt"] = {"Amto"},
["amu"] = {"Guerrero Amuzgo"},
["amv"] = {"Ambelau"},
["amw"] = {"Western Neo-Aramaic"},
["amx"] = {"Anmatyerre"},
["amy"] = {"Ami"},
["amz"] = {"Atampaya"},
["ana"] = {"Andaqui"},
["anb"] = {"Andoa"},
["anc"] = {"Ngas"},
["and"] = {"Ansus"},
["ane"] = {"Xârâcùù"},
["anf"] = {"Animere"},
["ang"] = {"Old English (ca. 450-1100)"},
["anh"] = {"Nend"},
["ani"] = {"Andi"},
["anj"] = {"Anor"},
["ank"] = {"Goemai"},
["anl"] = {"Anu-Hkongso Chin"},
["anm"] = {"Anal"},
["ann"] = {"Obolo"},
["ano"] = {"Andoque"},
["anp"] = {"Angika"},
["anq"] = {"Jarawa (India)"},
["anr"] = {"Andh"},
["ans"] = {"Anserma"},
["ant"] = {"Antakarinya", "Antikarinya"},
["anu"] = {"Anuak"},
["anv"] = {"Denya"},
["anw"] = {"Anaang"},
["anx"] = {"Andra-Hus"},
["any"] = {"Anyin"},
["anz"] = {"Anem"},
["aoa"] = {"Angolar"},
["aob"] = {"Abom"},
["aoc"] = {"Pemon"},
["aod"] = {"Andarum"},
["aoe"] = {"Angal Enen"},
["aof"] = {"Bragat"},
["aog"] = {"Angoram"},
["aoi"] = {"Anindilyakwa"},
["aoj"] = {"Mufian"},
["aok"] = {"Arhö"},
["aol"] = {"Alor"},
["aom"] = {"Ömie"},
["aon"] = {"Bumbita Arapesh"},
["aor"] = {"Aore"},
["aos"] = {"Taikat"},
["aot"] = {"Atong (India)", "A'tong"},
["aou"] = {"A'ou"},
["aox"] = {"Atorada"},
["aoz"] = {"Uab Meto"},
["apa"] = {"Apache languages"},
["apb"] = {"Sa'a"},
["apc"] = {"Levantine Arabic"},
["apd"] = {"Sudanese Arabic"},
["ape"] = {"Bukiyip"},
["apf"] = {"Pahanan Agta"},
["apg"] = {"Ampanang"},
["aph"] = {"Athpariya"},
["api"] = {"Apiaká"},
["apj"] = {"Jicarilla Apache"},
["apk"] = {"Kiowa Apache"},
["apl"] = {"Lipan Apache"},
["apm"] = {"Mescalero-Chiricahua Apache"},
["apn"] = {"Apinayé"},
["apo"] = {"Ambul"},
["app"] = {"Apma"},
["apq"] = {"A-Pucikwar"},
["apr"] = {"Arop-Lokep"},
["aps"] = {"Arop-Sissano"},
["apt"] = {"Apatani"},
["apu"] = {"Apurinã"},
["apv"] = {"Alapmunte"},
["apw"] = {"Western Apache"},
["apx"] = {"Aputai"},
["apy"] = {"Apalaí"},
["apz"] = {"Safeyoka"},
["aqa"] = {"Alacalufan languages"},
["aqc"] = {"Archi"},
["aqd"] = {"Ampari Dogon"},
["aqg"] = {"Arigidi"},
["aqk"] = {"Aninka"},
["aql"] = {"Algic languages"},
["aqm"] = {"Atohwaim"},
["aqn"] = {"Northern Alta"},
["aqp"] = {"Atakapa"},
["aqr"] = {"Arhâ"},
["aqt"] = {"Angaité"},
["aqz"] = {"Akuntsu"},
["arb"] = {"Standard Arabic"},
["arc"] = {"Official Aramaic (700-300 BCE)", "Imperial Aramaic (700-300 BCE)"},
["ard"] = {"Arabana"},
["are"] = {"Western Arrarnta"},
["arh"] = {"Arhuaco"},
["ari"] = {"Arikara"},
["arj"] = {"Arapaso"},
["ark"] = {"Arikapú"},
["arl"] = {"Arabela"},
["arn"] = {"Mapudungun", "Mapuche"},
["aro"] = {"Araona"},
["arp"] = {"Arapaho"},
["arq"] = {"Algerian Arabic"},
["arr"] = {"Karo (Brazil)"},
["ars"] = {"Najdi Arabic"},
["art"] = {"Artificial languages"},
["aru"] = {"Aruá (Amazonas State)", "Arawá"},
["arv"] = {"Arbore"},
["arw"] = {"Arawak"},
["arx"] = {"Aruá (Rodonia State)"},
["ary"] = {"Moroccan Arabic"},
["arz"] = {"Egyptian Arabic"},
["asa"] = {"Asu (Tanzania)"},
["asb"] = {"Assiniboine"},
["asc"] = {"Casuarina Coast Asmat"},
["ase"] = {"American Sign Language"},
["asf"] = {"Auslan", "Australian Sign Language"},
["asg"] = {"Cishingini"},
["ash"] = {"Abishira"},
["asi"] = {"Buruwai"},
["asj"] = {"Sari"},
["ask"] = {"Ashkun"},
["asl"] = {"Asilulu"},
["asn"] = {"Xingú Asuriní"},
["aso"] = {"Dano"},
["asp"] = {"Algerian Sign Language"},
["asq"] = {"Austrian Sign Language"},
["asr"] = {"Asuri"},
["ass"] = {"Ipulo"},
["ast"] = {"Asturian", "Asturleonese", "Bable", "Leonese"},
["asu"] = {"Tocantins Asurini"},
["asv"] = {"Asoa"},
["asw"] = {"Australian Aborigines Sign Language"},
["asx"] = {"Muratayak"},
["asy"] = {"Yaosakor Asmat"},
["asz"] = {"As"},
["ata"] = {"Pele-Ata"},
["atb"] = {"Zaiwa"},
["atc"] = {"Atsahuaca"},
["atd"] = {"Ata Manobo"},
["ate"] = {"Atemble"},
["atg"] = {"Ivbie North-Okpela-Arhe"},
["ath"] = {"Athapascan languages"},
["ati"] = {"Attié"},
["atj"] = {"Atikamekw"},
["atk"] = {"Ati"},
["atl"] = {"Mt. Iraya Agta"},
["atm"] = {"Ata"},
["atn"] = {"Ashtiani"},
["ato"] = {"Atong (Cameroon)"},
["atp"] = {"Pudtol Atta"},
["atq"] = {"Aralle-Tabulahan"},
["atr"] = {"Waimiri-Atroari"},
["ats"] = {"Gros Ventre"},
["att"] = {"Pamplona Atta"},
["atu"] = {"Reel"},
["atv"] = {"Northern Altai"},
["atw"] = {"Atsugewi"},
["atx"] = {"Arutani"},
["aty"] = {"Aneityum"},
["atz"] = {"Arta"},
["aua"] = {"Asumboa"},
["aub"] = {"Alugu"},
["auc"] = {"Waorani"},
["aud"] = {"Anuta"},
["auf"] = {"Arauan languages"},
["aug"] = {"Aguna"},
["auh"] = {"Aushi"},
["aui"] = {"Anuki"},
["auj"] = {"Awjilah"},
["auk"] = {"Heyo"},
["aul"] = {"Aulua"},
["aum"] = {"Asu (Nigeria)"},
["aun"] = {"Molmo One"},
["auo"] = {"Auyokawa"},
["aup"] = {"Makayam"},
["auq"] = {"Anus", "Korur"},
["aur"] = {"Aruek"},
["aus"] = {"Australian languages"},
["aut"] = {"Austral"},
["auu"] = {"Auye"},
["auw"] = {"Awyi"},
["aux"] = {"Aurá"},
["auy"] = {"Awiyaana"},
["auz"] = {"Uzbeki Arabic"},
["avb"] = {"Avau"},
["avd"] = {"Alviri-Vidari"},
["avi"] = {"Avikam"},
["avk"] = {"Kotava"},
["avl"] = {"Eastern Egyptian Bedawi Arabic"},
["avm"] = {"Angkamuthi"},
["avn"] = {"Avatime"},
["avo"] = {"Agavotaguerra"},
["avs"] = {"Aushiri"},
["avt"] = {"Au"},
["avu"] = {"Avokaya"},
["avv"] = {"Avá-Canoeiro"},
["awa"] = {"Awadhi"},
["awb"] = {"Awa (Papua New Guinea)"},
["awc"] = {"Cicipu"},
["awd"] = {"Arawakan languages"},
["awe"] = {"Awetí"},
["awg"] = {"Anguthimri"},
["awh"] = {"Awbono"},
["awi"] = {"Aekyom"},
["awk"] = {"Awabakal"},
["awm"] = {"Arawum"},
["awn"] = {"Awngi"},
["awo"] = {"Awak"},
["awr"] = {"Awera"},
["aws"] = {"South Awyu"},
["awt"] = {"Araweté"},
["awu"] = {"Central Awyu"},
["awv"] = {"Jair Awyu"},
["aww"] = {"Awun"},
["awx"] = {"Awara"},
["awy"] = {"Edera Awyu"},
["axb"] = {"Abipon"},
["axe"] = {"Ayerrerenge"},
["axg"] = {"Mato Grosso Arára"},
["axk"] = {"Yaka (Central African Republic)"},
["axl"] = {"Lower Southern Aranda"},
["axm"] = {"Middle Armenian"},
["axx"] = {"Xârâgurè"},
["aya"] = {"Awar"},
["ayb"] = {"Ayizo Gbe"},
["ayc"] = {"Southern Aymara"},
["ayd"] = {"Ayabadhu"},
["aye"] = {"Ayere"},
["ayg"] = {"Ginyanga"},
["ayh"] = {"Hadrami Arabic"},
["ayi"] = {"Leyigha"},
["ayk"] = {"Akuku"},
["ayl"] = {"Libyan Arabic"},
["ayn"] = {"Sanaani Arabic"},
["ayo"] = {"Ayoreo"},
["ayp"] = {"North Mesopotamian Arabic"},
["ayq"] = {"Ayi (Papua New Guinea)"},
["ayr"] = {"Central Aymara"},
["ays"] = {"Sorsogon Ayta"},
["ayt"] = {"Magbukun Ayta"},
["ayu"] = {"Ayu"},
["ayz"] = {"Mai Brat"},
["aza"] = {"Azha"},
["azb"] = {"South Azerbaijani"},
["azc"] = {"Uto-Aztecan languages"},
["azd"] = {"Eastern Durango Nahuatl"},
["azg"] = {"San Pedro Amuzgos Amuzgo"},
["azj"] = {"North Azerbaijani"},
["azm"] = {"Ipalapa Amuzgo"},
["azn"] = {"Western Durango Nahuatl"},
["azo"] = {"Awing"},
["azt"] = {"Faire Atta"},
["azz"] = {"Highland Puebla Nahuatl"},
["baa"] = {"Babatana"},
["bab"] = {"Bainouk-Gunyuño"},
["bac"] = {"Badui"},
["bad"] = {"Banda languages"},
["bae"] = {"Baré"},
["baf"] = {"Nubaca"},
["bag"] = {"Tuki"},
["bah"] = {"Bahamas Creole English"},
["bai"] = {"Bamileke languages"},
["baj"] = {"Barakai"},
["bal"] = {"Baluchi"},
["ban"] = {"Balinese"},
["bao"] = {"Waimaha"},
["bap"] = {"Bantawa"},
["bar"] = {"Bavarian"},
["bas"] = {"Basa (Cameroon)"},
["bat"] = {"Baltic languages"},
["bau"] = {"Bada (Nigeria)"},
["bav"] = {"Vengo"},
["baw"] = {"Bambili-Bambui"},
["bax"] = {"Bamun"},
["bay"] = {"Batuley"},
["bba"] = {"Baatonum"},
["bbb"] = {"Barai"},
["bbc"] = {"Batak Toba"},
["bbd"] = {"Bau"},
["bbe"] = {"Bangba"},
["bbf"] = {"Baibai"},
["bbg"] = {"Barama"},
["bbh"] = {"Bugan"},
["bbi"] = {"Barombi"},
["bbj"] = {"Ghomálá'"},
["bbk"] = {"Babanki"},
["bbl"] = {"Bats"},
["bbm"] = {"Babango"},
["bbn"] = {"Uneapa"},
["bbo"] = {"Northern Bobo Madaré", "Konabéré"},
["bbp"] = {"West Central Banda"},
["bbq"] = {"Bamali"},
["bbr"] = {"Girawa"},
["bbs"] = {"Bakpinka"},
["bbt"] = {"Mburku"},
["bbu"] = {"Kulung (Nigeria)"},
["bbv"] = {"Karnai"},
["bbw"] = {"Baba"},
["bbx"] = {"Bubia"},
["bby"] = {"Befang"},
["bca"] = {"Central Bai"},
["bcb"] = {"Bainouk-Samik"},
["bcc"] = {"Southern Balochi"},
["bcd"] = {"North Babar"},
["bce"] = {"Bamenyam"},
["bcf"] = {"Bamu"},
["bcg"] = {"Baga Pokur"},
["bch"] = {"Bariai"},
["bci"] = {"Baoulé"},
["bcj"] = {"Bardi"},
["bck"] = {"Bunuba"},
["bcl"] = {"Central Bikol"},
["bcm"] = {"Bannoni"},
["bcn"] = {"Bali (Nigeria)"},
["bco"] = {"Kaluli"},
["bcp"] = {"Bali (Democratic Republic of Congo)"},
["bcq"] = {"Bench"},
["bcr"] = {"Babine"},
["bcs"] = {"Kohumono"},
["bct"] = {"Bendi"},
["bcu"] = {"Awad Bing"},
["bcv"] = {"Shoo-Minda-Nye"},
["bcw"] = {"Bana"},
["bcy"] = {"Bacama"},
["bcz"] = {"Bainouk-Gunyaamolo"},
["bda"] = {"Bayot"},
["bdb"] = {"Basap"},
["bdc"] = {"Emberá-Baudó"},
["bdd"] = {"Bunama"},
["bde"] = {"Bade"},
["bdf"] = {"Biage"},
["bdg"] = {"Bonggi"},
["bdh"] = {"Baka (South Sudan)"},
["bdi"] = {"Burun"},
["bdj"] = {"Bai (South Sudan)", "Bai"},
["bdk"] = {"Budukh"},
["bdl"] = {"Indonesian Bajau"},
["bdm"] = {"Buduma"},
["bdn"] = {"Baldemu"},
["bdo"] = {"Morom"},
["bdp"] = {"Bende"},
["bdq"] = {"Bahnar"},
["bdr"] = {"West Coast Bajau"},
["bds"] = {"Burunge"},
["bdt"] = {"Bokoto"},
["bdu"] = {"Oroko"},
["bdv"] = {"Bodo Parja"},
["bdw"] = {"Baham"},
["bdx"] = {"Budong-Budong"},
["bdy"] = {"Bandjalang"},
["bdz"] = {"Badeshi"},
["bea"] = {"Beaver"},
["beb"] = {"Bebele"},
["bec"] = {"Iceve-Maci"},
["bed"] = {"Bedoanas"},
["bee"] = {"Byangsi"},
["bef"] = {"Benabena"},
["beg"] = {"Belait"},
["beh"] = {"Biali"},
["bei"] = {"Bekati'"},
["bej"] = {"Beja", "Bedawiyet"},
["bek"] = {"Bebeli"},
["bem"] = {"Bemba (Zambia)"},
["beo"] = {"Beami"},
["bep"] = {"Besoa"},
["beq"] = {"Beembe"},
["ber"] = {"Berber languages"},
["bes"] = {"Besme"},
["bet"] = {"Guiberoua Béte"},
["beu"] = {"Blagar"},
["bev"] = {"Daloa Bété"},
["bew"] = {"Betawi"},
["bex"] = {"Jur Modo"},
["bey"] = {"Beli (Papua New Guinea)"},
["bez"] = {"Bena (Tanzania)"},
["bfa"] = {"Bari"},
["bfb"] = {"Pauri Bareli"},
["bfc"] = {"Panyi Bai", "Northern Bai"},
["bfd"] = {"Bafut"},
["bfe"] = {"Betaf", "Tena"},
["bff"] = {"Bofi"},
["bfg"] = {"Busang Kayan"},
["bfh"] = {"Blafe"},
["bfi"] = {"British Sign Language"},
["bfj"] = {"Bafanji"},
["bfk"] = {"Ban Khor Sign Language"},
["bfl"] = {"Banda-Ndélé"},
["bfm"] = {"Mmen"},
["bfn"] = {"Bunak"},
["bfo"] = {"Malba Birifor"},
["bfp"] = {"Beba"},
["bfq"] = {"Badaga"},
["bfr"] = {"Bazigar"},
["bfs"] = {"Southern Bai"},
["bft"] = {"Balti"},
["bfu"] = {"Gahri"},
["bfw"] = {"Bondo"},
["bfx"] = {"Bantayanon"},
["bfy"] = {"Bagheli"},
["bfz"] = {"Mahasu Pahari"},
["bga"] = {"Gwamhi-Wuri"},
["bgb"] = {"Bobongko"},
["bgc"] = {"Haryanvi"},
["bgd"] = {"Rathwi Bareli"},
["bge"] = {"Bauria"},
["bgf"] = {"Bangandu"},
["bgg"] = {"Bugun"},
["bgi"] = {"Giangan"},
["bgj"] = {"Bangolan"},
["bgk"] = {"Bit", "Buxinhua"},
["bgl"] = {"Bo (Laos)"},
["bgn"] = {"Western Balochi"},
["bgo"] = {"Baga Koga"},
["bgp"] = {"Eastern Balochi"},
["bgq"] = {"Bagri"},
["bgr"] = {"Bawm Chin"},
["bgs"] = {"Tagabawa"},
["bgt"] = {"Bughotu"},
["bgu"] = {"Mbongno"},
["bgv"] = {"Warkay-Bipim"},
["bgw"] = {"Bhatri"},
["bgx"] = {"Balkan Gagauz Turkish"},
["bgy"] = {"Benggoi"},
["bgz"] = {"Banggai"},
["bha"] = {"Bharia"},
["bhb"] = {"Bhili"},
["bhc"] = {"Biga"},
["bhd"] = {"Bhadrawahi"},
["bhe"] = {"Bhaya"},
["bhf"] = {"Odiai"},
["bhg"] = {"Binandere"},
["bhh"] = {"Bukharic"},
["bhi"] = {"Bhilali"},
["bhj"] = {"Bahing"},
["bhl"] = {"Bimin"},
["bhm"] = {"Bathari"},
["bhn"] = {"Bohtan Neo-Aramaic"},
["bho"] = {"Bhojpuri"},
["bhp"] = {"Bima"},
["bhq"] = {"Tukang Besi South"},
["bhr"] = {"Bara Malagasy"},
["bhs"] = {"Buwal"},
["bht"] = {"Bhattiyali"},
["bhu"] = {"Bhunjia"},
["bhv"] = {"Bahau"},
["bhw"] = {"Biak"},
["bhx"] = {"Bhalay"},
["bhy"] = {"Bhele"},
["bhz"] = {"Bada (Indonesia)"},
["bia"] = {"Badimaya"},
["bib"] = {"Bissa", "Bisa"},
["bid"] = {"Bidiyo"},
["bie"] = {"Bepour"},
["bif"] = {"Biafada"},
["big"] = {"Biangai"},
["bik"] = {"Bikol"},
["bil"] = {"Bile"},
["bim"] = {"Bimoba"},
["bin"] = {"Bini", "Edo"},
["bio"] = {"Nai"},
["bip"] = {"Bila"},
["biq"] = {"Bipi"},
["bir"] = {"Bisorio"},
["bit"] = {"Berinomo"},
["biu"] = {"Biete"},
["biv"] = {"Southern Birifor"},
["biw"] = {"Kol (Cameroon)"},
["bix"] = {"Bijori"},
["biy"] = {"Birhor"},
["biz"] = {"Baloi"},
["bja"] = {"Budza"},
["bjb"] = {"Banggarla"},
["bjc"] = {"Bariji"},
["bje"] = {"Biao-Jiao Mien"},
["bjf"] = {"Barzani Jewish Neo-Aramaic"},
["bjg"] = {"Bidyogo"},
["bjh"] = {"Bahinemo"},
["bji"] = {"Burji"},
["bjj"] = {"Kanauji"},
["bjk"] = {"Barok"},
["bjl"] = {"Bulu (Papua New Guinea)"},
["bjm"] = {"Bajelani"},
["bjn"] = {"Banjar"},
["bjo"] = {"Mid-Southern Banda"},
["bjp"] = {"Fanamaket"},
["bjr"] = {"Binumarien"},
["bjs"] = {"Bajan"},
["bjt"] = {"Balanta-Ganja"},
["bju"] = {"Busuu"},
["bjv"] = {"Bedjond"},
["bjw"] = {"Bakwé"},
["bjx"] = {"Banao Itneg"},
["bjy"] = {"Bayali"},
["bjz"] = {"Baruga"},
["bka"] = {"Kyak"},
["bkc"] = {"Baka (Cameroon)"},
["bkd"] = {"Binukid", "Talaandig"},
["bkf"] = {"Beeke"},
["bkg"] = {"Buraka"},
["bkh"] = {"Bakoko"},
["bki"] = {"Baki"},
["bkj"] = {"Pande"},
["bkk"] = {"Brokskat"},
["bkl"] = {"Berik"},
["bkm"] = {"Kom (Cameroon)"},
["bkn"] = {"Bukitan"},
["bko"] = {"Kwa'"},
["bkp"] = {"Boko (Democratic Republic of Congo)"},
["bkq"] = {"Bakairí"},
["bkr"] = {"Bakumpai"},
["bks"] = {"Northern Sorsoganon"},
["bkt"] = {"Boloki"},
["bku"] = {"Buhid"},
["bkv"] = {"Bekwarra"},
["bkw"] = {"Bekwel"},
["bkx"] = {"Baikeno"},
["bky"] = {"Bokyi"},
["bkz"] = {"Bungku"},
["bla"] = {"Siksika"},
["blb"] = {"Bilua"},
["blc"] = {"Bella Coola"},
["bld"] = {"Bolango"},
["ble"] = {"Balanta-Kentohe"},
["blf"] = {"Buol"},
["blh"] = {"Kuwaa"},
["bli"] = {"Bolia"},
["blj"] = {"Bolongan"},
["blk"] = {"Pa'o Karen", "Pa'O"},
["bll"] = {"Biloxi"},
["blm"] = {"Beli (South Sudan)"},
["bln"] = {"Southern Catanduanes Bikol"},
["blo"] = {"Anii"},
["blp"] = {"Blablanga"},
["blq"] = {"Baluan-Pam"},
["blr"] = {"Blang"},
["bls"] = {"Balaesang"},
["blt"] = {"Tai Dam"},
["blv"] = {"Kibala", "Bolo"},
["blw"] = {"Balangao"},
["blx"] = {"Mag-Indi Ayta"},
["bly"] = {"Notre"},
["blz"] = {"Balantak"},
["bma"] = {"Lame"},
["bmb"] = {"Bembe"},
["bmc"] = {"Biem"},
["bmd"] = {"Baga Manduri"},
["bme"] = {"Limassa"},
["bmf"] = {"Bom-Kim"},
["bmg"] = {"Bamwe"},
["bmh"] = {"Kein"},
["bmi"] = {"Bagirmi"},
["bmj"] = {"Bote-Majhi"},
["bmk"] = {"Ghayavi"},
["bml"] = {"Bomboli"},
["bmm"] = {"Northern Betsimisaraka Malagasy"},
["bmn"] = {"Bina (Papua New Guinea)"},
["bmo"] = {"Bambalang"},
["bmp"] = {"Bulgebi"},
["bmq"] = {"Bomu"},
["bmr"] = {"Muinane"},
["bms"] = {"Bilma Kanuri"},
["bmt"] = {"Biao Mon"},
["bmu"] = {"Somba-Siawari"},
["bmv"] = {"Bum"},
["bmw"] = {"Bomwali"},
["bmx"] = {"Baimak"},
["bmz"] = {"Baramu"},
["bna"] = {"Bonerate"},
["bnb"] = {"Bookan"},
["bnc"] = {"Bontok"},
["bnd"] = {"Banda (Indonesia)"},
["bne"] = {"Bintauna"},
["bnf"] = {"Masiwang"},
["bng"] = {"Benga"},
["bni"] = {"Bangi"},
["bnj"] = {"Eastern Tawbuid"},
["bnk"] = {"Bierebo"},
["bnl"] = {"Boon"},
["bnm"] = {"Batanga"},
["bnn"] = {"Bunun"},
["bno"] = {"Bantoanon"},
["bnp"] = {"Bola"},
["bnq"] = {"Bantik"},
["bnr"] = {"Butmas-Tur"},
["bns"] = {"Bundeli"},
["bnt"] = {"Bantu languages"},
["bnu"] = {"Bentong"},
["bnv"] = {"Bonerif", "Beneraf", "Edwas"},
["bnw"] = {"Bisis"},
["bnx"] = {"Bangubangu"},
["bny"] = {"Bintulu"},
["bnz"] = {"Beezen"},
["boa"] = {"Bora"},
["bob"] = {"Aweer"},
["boe"] = {"Mundabli"},
["bof"] = {"Bolon"},
["bog"] = {"Bamako Sign Language"},
["boh"] = {"Boma"},
["boi"] = {"Barbareño"},
["boj"] = {"Anjam"},
["bok"] = {"Bonjo"},
["bol"] = {"Bole"},
["bom"] = {"Berom"},
["bon"] = {"Bine"},
["boo"] = {"Tiemacèwè Bozo"},
["bop"] = {"Bonkiman"},
["boq"] = {"Bogaya"},
["bor"] = {"Borôro"},
["bot"] = {"Bongo"},
["bou"] = {"Bondei"},
["bov"] = {"Tuwuli"},
["bow"] = {"Rema"},
["box"] = {"Buamu"},
["boy"] = {"Bodo (Central African Republic)"},
["boz"] = {"Tiéyaxo Bozo"},
["bpa"] = {"Daakaka"},
["bpc"] = {"Mbuk"},
["bpd"] = {"Banda-Banda"},
["bpe"] = {"Bauni"},
["bpg"] = {"Bonggo"},
["bph"] = {"Botlikh"},
["bpi"] = {"Bagupi"},
["bpj"] = {"Binji"},
["bpk"] = {"Orowe", "'Ôrôê"},
["bpl"] = {"Broome Pearling Lugger Pidgin"},
["bpm"] = {"Biyom"},
["bpn"] = {"Dzao Min"},
["bpo"] = {"Anasi"},
["bpp"] = {"Kaure"},
["bpq"] = {"Banda Malay"},
["bpr"] = {"Koronadal Blaan"},
["bps"] = {"Sarangani Blaan"},
["bpt"] = {"Barrow Point"},
["bpu"] = {"Bongu"},
["bpv"] = {"Bian Marind"},
["bpw"] = {"Bo (Papua New Guinea)"},
["bpx"] = {"Palya Bareli"},
["bpy"] = {"Bishnupriya"},
["bpz"] = {"Bilba"},
["bqa"] = {"Tchumbuli"},
["bqb"] = {"Bagusa"},
["bqc"] = {"Boko (Benin)", "Boo"},
["bqd"] = {"Bung"},
["bqf"] = {"Baga Kaloum"},
["bqg"] = {"Bago-Kusuntu"},
["bqh"] = {"Baima"},
["bqi"] = {"Bakhtiari"},
["bqj"] = {"Bandial"},
["bqk"] = {"Banda-Mbrès"},
["bql"] = {"Bilakura"},
["bqm"] = {"Wumboko"},
["bqn"] = {"Bulgarian Sign Language"},
["bqo"] = {"Balo"},
["bqp"] = {"Busa"},
["bqq"] = {"Biritai"},
["bqr"] = {"Burusu"},
["bqs"] = {"Bosngun"},
["bqt"] = {"Bamukumbit"},
["bqu"] = {"Boguru"},
["bqv"] = {"Koro Wachi", "Begbere-Ejar"},
["bqw"] = {"Buru (Nigeria)"},
["bqx"] = {"Baangi"},
["bqy"] = {"Bengkala Sign Language"},
["bqz"] = {"Bakaka"},
["bra"] = {"Braj"},
["brb"] = {"Brao", "Lave"},
["brc"] = {"Berbice Creole Dutch"},
["brd"] = {"Baraamu"},
["brf"] = {"Bira"},
["brg"] = {"Baure"},
["brh"] = {"Brahui"},
["bri"] = {"Mokpwe"},
["brj"] = {"Bieria"},
["brk"] = {"Birked"},
["brl"] = {"Birwa"},
["brm"] = {"Barambu"},
["brn"] = {"Boruca"},
["bro"] = {"Brokkat"},
["brp"] = {"Barapasi"},
["brq"] = {"Breri"},
["brr"] = {"Birao"},
["brs"] = {"Baras"},
["brt"] = {"Bitare"},
["bru"] = {"Eastern Bru"},
["brv"] = {"Western Bru"},
["brw"] = {"Bellari"},
["brx"] = {"Bodo (India)"},
["bry"] = {"Burui"},
["brz"] = {"Bilbil"},
["bsa"] = {"Abinomn"},
["bsb"] = {"Brunei Bisaya"},
["bsc"] = {"Bassari", "Oniyan"},
["bse"] = {"Wushi"},
["bsf"] = {"Bauchi"},
["bsg"] = {"Bashkardi"},
["bsh"] = {"Kati"},
["bsi"] = {"Bassossi"},
["bsj"] = {"Bangwinji"},
["bsk"] = {"Burushaski"},
["bsl"] = {"Basa-Gumna"},
["bsm"] = {"Busami"},
["bsn"] = {"Barasana-Eduria"},
["bso"] = {"Buso"},
["bsp"] = {"Baga Sitemu"},
["bsq"] = {"Bassa"},
["bsr"] = {"Bassa-Kontagora"},
["bss"] = {"Akoose"},
["bst"] = {"Basketo"},
["bsu"] = {"Bahonsuai"},
["bsv"] = {"Baga Sobané"},
["bsw"] = {"Baiso"},
["bsx"] = {"Yangkam"},
["bsy"] = {"Sabah Bisaya"},
["bta"] = {"Bata"},
["btc"] = {"Bati (Cameroon)"},
["btd"] = {"Batak Dairi"},
["bte"] = {"Gamo-Ningi"},
["btf"] = {"Birgit"},
["btg"] = {"Gagnoa Bété"},
["bth"] = {"Biatah Bidayuh"},
["bti"] = {"Burate"},
["btj"] = {"Bacanese Malay"},
["btk"] = {"Batak languages"},
["btm"] = {"Batak Mandailing"},
["btn"] = {"Ratagnon"},
["bto"] = {"Rinconada Bikol"},
["btp"] = {"Budibud"},
["btq"] = {"Batek"},
["btr"] = {"Baetora"},
["bts"] = {"Batak Simalungun"},
["btt"] = {"Bete-Bendi"},
["btu"] = {"Batu"},
["btv"] = {"Bateri"},
["btw"] = {"Butuanon"},
["btx"] = {"Batak Karo"},
["bty"] = {"Bobot"},
["btz"] = {"Batak Alas-Kluet"},
["bua"] = {"Buriat"},
["bub"] = {"Bua"},
["buc"] = {"Bushi"},
["bud"] = {"Ntcham"},
["bue"] = {"Beothuk"},
["buf"] = {"Bushoong"},
["bug"] = {"Buginese"},
["buh"] = {"Younuo Bunu"},
["bui"] = {"Bongili"},
["buj"] = {"Basa-Gurmana"},
["buk"] = {"Bugawac"},
["bum"] = {"Bulu (Cameroon)"},
["bun"] = {"Sherbro"},
["buo"] = {"Terei"},
["bup"] = {"Busoa"},
["buq"] = {"Brem"},
["bus"] = {"Bokobaru"},
["but"] = {"Bungain"},
["buu"] = {"Budu"},
["buv"] = {"Bun"},
["buw"] = {"Bubi"},
["bux"] = {"Boghom"},
["buy"] = {"Bullom So"},
["buz"] = {"Bukwen"},
["bva"] = {"Barein"},
["bvb"] = {"Bube"},
["bvc"] = {"Baelelea"},
["bvd"] = {"Baeggu"},
["bve"] = {"Berau Malay"},
["bvf"] = {"Boor"},
["bvg"] = {"Bonkeng"},
["bvh"] = {"Bure"},
["bvi"] = {"Belanda Viri"},
["bvj"] = {"Baan"},
["bvk"] = {"Bukat"},
["bvl"] = {"Bolivian Sign Language"},
["bvm"] = {"Bamunka"},
["bvn"] = {"Buna"},
["bvo"] = {"Bolgo"},
["bvp"] = {"Bumang"},
["bvq"] = {"Birri"},
["bvr"] = {"Burarra"},
["bvt"] = {"Bati (Indonesia)"},
["bvu"] = {"Bukit Malay"},
["bvv"] = {"Baniva"},
["bvw"] = {"Boga"},
["bvx"] = {"Dibole"},
["bvy"] = {"Baybayanon"},
["bvz"] = {"Bauzi"},
["bwa"] = {"Bwatoo"},
["bwb"] = {"Namosi-Naitasiri-Serua"},
["bwc"] = {"Bwile"},
["bwd"] = {"Bwaidoka"},
["bwe"] = {"Bwe Karen"},
["bwf"] = {"Boselewa"},
["bwg"] = {"Barwe"},
["bwh"] = {"Bishuo"},
["bwi"] = {"Baniwa"},
["bwj"] = {"Láá Láá Bwamu"},
["bwk"] = {"Bauwaki"},
["bwl"] = {"Bwela"},
["bwm"] = {"Biwat"},
["bwn"] = {"Wunai Bunu"},
["bwo"] = {"Boro (Ethiopia)", "Borna (Ethiopia)"},
["bwp"] = {"Mandobo Bawah"},
["bwq"] = {"Southern Bobo Madaré"},
["bwr"] = {"Bura-Pabir"},
["bws"] = {"Bomboma"},
["bwt"] = {"Bafaw-Balong"},
["bwu"] = {"Buli (Ghana)"},
["bww"] = {"Bwa"},
["bwx"] = {"Bu-Nao Bunu"},
["bwy"] = {"Cwi Bwamu"},
["bwz"] = {"Bwisi"},
["bxa"] = {"Tairaha"},
["bxb"] = {"Belanda Bor"},
["bxc"] = {"Molengue"},
["bxd"] = {"Pela"},
["bxe"] = {"Birale"},
["bxf"] = {"Bilur", "Minigir"},
["bxg"] = {"Bangala"},
["bxh"] = {"Buhutu"},
["bxi"] = {"Pirlatapa"},
["bxj"] = {"Bayungu"},
["bxk"] = {"Bukusu", "Lubukusu"},
["bxl"] = {"Jalkunan"},
["bxm"] = {"Mongolia Buriat"},
["bxn"] = {"Burduna"},
["bxo"] = {"Barikanchi"},
["bxp"] = {"Bebil"},
["bxq"] = {"Beele"},
["bxr"] = {"Russia Buriat"},
["bxs"] = {"Busam"},
["bxu"] = {"China Buriat"},
["bxv"] = {"Berakou"},
["bxw"] = {"Bankagooma"},
["bxz"] = {"Binahari"},
["bya"] = {"Batak"},
["byb"] = {"Bikya"},
["byc"] = {"Ubaghara"},
["byd"] = {"Benyadu'"},
["bye"] = {"Pouye"},
["byf"] = {"Bete"},
["byg"] = {"Baygo"},
["byh"] = {"Bhujel"},
["byi"] = {"Buyu"},
["byj"] = {"Bina (Nigeria)"},
["byk"] = {"Biao"},
["byl"] = {"Bayono"},
["bym"] = {"Bidjara"},
["byn"] = {"Bilin", "Blin"},
["byo"] = {"Biyo"},
["byp"] = {"Bumaji"},
["byq"] = {"Basay"},
["byr"] = {"Baruya", "Yipma"},
["bys"] = {"Burak"},
["byt"] = {"Berti"},
["byv"] = {"Medumba"},
["byw"] = {"Belhariya"},
["byx"] = {"Qaqet"},
["byz"] = {"Banaro"},
["bza"] = {"Bandi"},
["bzb"] = {"Andio"},
["bzc"] = {"Southern Betsimisaraka Malagasy"},
["bzd"] = {"Bribri"},
["bze"] = {"Jenaama Bozo"},
["bzf"] = {"Boikin"},
["bzg"] = {"Babuza"},
["bzh"] = {"Mapos Buang"},
["bzi"] = {"Bisu"},
["bzj"] = {"Belize Kriol English"},
["bzk"] = {"Nicaragua Creole English"},
["bzl"] = {"Boano (Sulawesi)"},
["bzm"] = {"Bolondo"},
["bzn"] = {"Boano (Maluku)"},
["bzo"] = {"Bozaba"},
["bzp"] = {"Kemberano"},
["bzq"] = {"Buli (Indonesia)"},
["bzr"] = {"Biri"},
["bzs"] = {"Brazilian Sign Language"},
["bzt"] = {"Brithenig"},
["bzu"] = {"Burmeso"},
["bzv"] = {"Naami"},
["bzw"] = {"Basa (Nigeria)"},
["bzx"] = {"Kɛlɛngaxo Bozo"},
["bzy"] = {"Obanliku"},
["bzz"] = {"Evant"},
["caa"] = {"Chortí"},
["cab"] = {"Garifuna"},
["cac"] = {"Chuj"},
["cad"] = {"Caddo"},
["cae"] = {"Lehar", "Laalaa"},
["caf"] = {"Southern Carrier"},
["cag"] = {"Nivaclé"},
["cah"] = {"Cahuarano"},
["cai"] = {"Central American Indian languages"},
["caj"] = {"Chané"},
["cak"] = {"Kaqchikel", "Cakchiquel"},
["cal"] = {"Carolinian"},
["cam"] = {"Cemuhî"},
["can"] = {"Chambri"},
["cao"] = {"Chácobo"},
["cap"] = {"Chipaya"},
["caq"] = {"Car Nicobarese"},
["car"] = {"Galibi Carib"},
["cas"] = {"Tsimané"},
["cau"] = {"Caucasian languages"},
["cav"] = {"Cavineña"},
["caw"] = {"Callawalla"},
["cax"] = {"Chiquitano"},
["cay"] = {"Cayuga"},
["caz"] = {"Canichana"},
["cba"] = {"Chibchan languages"},
["cbb"] = {"Cabiyarí"},
["cbc"] = {"Carapana"},
["cbd"] = {"Carijona"},
["cbg"] = {"Chimila"},
["cbi"] = {"Chachi"},
["cbj"] = {"Ede Cabe"},
["cbk"] = {"Chavacano"},
["cbl"] = {"Bualkhaw Chin"},
["cbn"] = {"Nyahkur"},
["cbo"] = {"Izora"},
["cbq"] = {"Tsucuba", "Cuba"},
["cbr"] = {"Cashibo-Cacataibo"},
["cbs"] = {"Cashinahua"},
["cbt"] = {"Chayahuita"},
["cbu"] = {"Candoshi-Shapra"},
["cbv"] = {"Cacua"},
["cbw"] = {"Kinabalian"},
["cby"] = {"Carabayo"},
["ccc"] = {"Chamicuro"},
["ccd"] = {"Cafundo Creole"},
["cce"] = {"Chopi"},
["ccg"] = {"Samba Daka"},
["cch"] = {"Atsam"},
["ccj"] = {"Kasanga"},
["ccl"] = {"Cutchi-Swahili"},
["ccm"] = {"Malaccan Creole Malay"},
["ccn"] = {"North Caucasian languages"},
["cco"] = {"Comaltepec Chinantec"},
["ccp"] = {"Chakma"},
["ccr"] = {"Cacaopera"},
["ccs"] = {"South Caucasian languages"},
["cda"] = {"Choni"},
["cdc"] = {"Chadic languages"},
["cdd"] = {"Caddoan languages"},
["cde"] = {"Chenchu"},
["cdf"] = {"Chiru"},
["cdh"] = {"Chambeali"},
["cdi"] = {"Chodri"},
["cdj"] = {"Churahi"},
["cdm"] = {"Chepang"},
["cdn"] = {"Chaudangsi"},
["cdo"] = {"Min Dong Chinese"},
["cdr"] = {"Cinda-Regi-Tiyal"},
["cds"] = {"Chadian Sign Language"},
["cdy"] = {"Chadong"},
["cdz"] = {"Koda"},
["cea"] = {"Lower Chehalis"},
["ceb"] = {"Cebuano"},
["ceg"] = {"Chamacoco"},
["cek"] = {"Eastern Khumi Chin"},
["cel"] = {"Celtic languages"},
["cen"] = {"Cen"},
["cet"] = {"Centúúm"},
["cey"] = {"Ekai Chin"},
["cfa"] = {"Dijim-Bwilim"},
["cfd"] = {"Cara"},
["cfg"] = {"Como Karim"},
["cfm"] = {"Falam Chin"},
["cga"] = {"Changriwa"},
["cgc"] = {"Kagayanen"},
["cgg"] = {"Chiga"},
["cgk"] = {"Chocangacakha"},
["chb"] = {"Chibcha"},
["chc"] = {"Catawba"},
["chd"] = {"Highland Oaxaca Chontal"},
["chf"] = {"Tabasco Chontal"},
["chg"] = {"Chagatai"},
["chh"] = {"Chinook"},
["chj"] = {"Ojitlán Chinantec"},
["chk"] = {"Chuukese"},
["chl"] = {"Cahuilla"},
["chm"] = {"Mari (Russia)"},
["chn"] = {"Chinook jargon"},
["cho"] = {"Choctaw"},
["chp"] = {"Chipewyan", "Dene Suline"},
["chq"] = {"Quiotepec Chinantec"},
["chr"] = {"Cherokee"},
["cht"] = {"Cholón"},
["chw"] = {"Chuwabu"},
["chx"] = {"Chantyal"},
["chy"] = {"Cheyenne"},
["chz"] = {"Ozumacín Chinantec"},
["cia"] = {"Cia-Cia"},
["cib"] = {"Ci Gbe"},
["cic"] = {"Chickasaw"},
["cid"] = {"Chimariko"},
["cie"] = {"Cineni"},
["cih"] = {"Chinali"},
["cik"] = {"Chitkuli Kinnauri"},
["cim"] = {"Cimbrian"},
["cin"] = {"Cinta Larga"},
["cip"] = {"Chiapanec"},
["cir"] = {"Tiri", "Haméa", "Méa"},
["ciw"] = {"Chippewa"},
["ciy"] = {"Chaima"},
["cja"] = {"Western Cham"},
["cje"] = {"Chru"},
["cjh"] = {"Upper Chehalis"},
["cji"] = {"Chamalal"},
["cjk"] = {"Chokwe"},
["cjm"] = {"Eastern Cham"},
["cjn"] = {"Chenapian"},
["cjo"] = {"Ashéninka Pajonal"},
["cjp"] = {"Cabécar"},
["cjs"] = {"Shor"},
["cjv"] = {"Chuave"},
["cjy"] = {"Jinyu Chinese"},
["ckb"] = {"Central Kurdish"},
["ckh"] = {"Chak"},
["ckl"] = {"Cibak"},
["ckm"] = {"Chakavian"},
["ckn"] = {"Kaang Chin"},
["cko"] = {"Anufo"},
["ckq"] = {"Kajakse"},
["ckr"] = {"Kairak"},
["cks"] = {"Tayo"},
["ckt"] = {"Chukot"},
["cku"] = {"Koasati"},
["ckv"] = {"Kavalan"},
["ckx"] = {"Caka"},
["cky"] = {"Cakfem-Mushere"},
["ckz"] = {"Cakchiquel-Quiché Mixed Language"},
["cla"] = {"Ron"},
["clc"] = {"Chilcotin"},
["cld"] = {"Chaldean Neo-Aramaic"},
["cle"] = {"Lealao Chinantec"},
["clh"] = {"Chilisso"},
["cli"] = {"Chakali"},
["clj"] = {"Laitu Chin"},
["clk"] = {"Idu-Mishmi"},
["cll"] = {"Chala"},
["clm"] = {"Clallam"},
["clo"] = {"Lowland Oaxaca Chontal"},
["clt"] = {"Lautu Chin"},
["clu"] = {"Caluyanun"},
["clw"] = {"Chulym"},
["cly"] = {"Eastern Highland Chatino"},
["cma"] = {"Maa"},
["cmc"] = {"Chamic languages"},
["cme"] = {"Cerma"},
["cmg"] = {"Classical Mongolian"},
["cmi"] = {"Emberá-Chamí"},
["cml"] = {"Campalagian"},
["cmm"] = {"Michigamea"},
["cmn"] = {"Mandarin Chinese"},
["cmo"] = {"Central Mnong"},
["cmr"] = {"Mro-Khimi Chin"},
["cms"] = {"Messapic"},
["cmt"] = {"Camtho"},
["cna"] = {"Changthang"},
["cnb"] = {"Chinbon Chin"},
["cnc"] = {"Côông"},
["cng"] = {"Northern Qiang"},
["cnh"] = {"Hakha Chin", "Haka Chin"},
["cni"] = {"Asháninka"},
["cnk"] = {"Khumi Chin"},
["cnl"] = {"Lalana Chinantec"},
["cno"] = {"Con"},
["cnp"] = {"Northern Ping Chinese", "Northern Pinghua"},
["cnq"] = {"Chung"},
["cnr"] = {"Montenegrin"},
["cns"] = {"Central Asmat"},
["cnt"] = {"Tepetotutla Chinantec"},
["cnu"] = {"Chenoua"},
["cnw"] = {"Ngawn Chin"},
["cnx"] = {"Middle Cornish"},
["coa"] = {"Cocos Islands Malay"},
["cob"] = {"Chicomuceltec"},
["coc"] = {"Cocopa"},
["cod"] = {"Cocama-Cocamilla"},
["coe"] = {"Koreguaje"},
["cof"] = {"Colorado"},
["cog"] = {"Chong"},
["coh"] = {"Chonyi-Dzihana-Kauma", "Chichonyi-Chidzihana-Chikauma"},
["coj"] = {"Cochimi"},
["cok"] = {"Santa Teresa Cora"},
["col"] = {"Columbia-Wenatchi"},
["com"] = {"Comanche"},
["con"] = {"Cofán"},
["coo"] = {"Comox"},
["cop"] = {"Coptic"},
["coq"] = {"Coquille"},
["cot"] = {"Caquinte"},
["cou"] = {"Wamey"},
["cov"] = {"Cao Miao"},
["cow"] = {"Cowlitz"},
["cox"] = {"Nanti"},
["coz"] = {"Chochotec"},
["cpa"] = {"Palantla Chinantec"},
["cpb"] = {"Ucayali-Yurúa Ashéninka"},
["cpc"] = {"Ajyíninka Apurucayali"},
["cpe"] = {"English-based creoles and pidgins"},
["cpf"] = {"French-based creoles and pidgins"},
["cpg"] = {"Cappadocian Greek"},
["cpi"] = {"Chinese Pidgin English"},
["cpn"] = {"Cherepon"},
["cpo"] = {"Kpeego"},
["cpp"] = {"Portuguese-based creoles and pidgins"},
["cps"] = {"Capiznon"},
["cpu"] = {"Pichis Ashéninka"},
["cpx"] = {"Pu-Xian Chinese"},
["cpy"] = {"South Ucayali Ashéninka"},
["cqd"] = {"Chuanqiandian Cluster Miao"},
["cra"] = {"Chara"},
["crb"] = {"Island Carib"},
["crc"] = {"Lonwolwol"},
["crd"] = {"Coeur d'Alene"},
["crf"] = {"Caramanta"},
["crg"] = {"Michif"},
["crh"] = {"Crimean Tatar", "Crimean Turkish"},
["cri"] = {"Sãotomense"},
["crj"] = {"Southern East Cree"},
["crk"] = {"Plains Cree"},
["crl"] = {"Northern East Cree"},
["crm"] = {"Moose Cree"},
["crn"] = {"El Nayar Cora"},
["cro"] = {"Crow"},
["crp"] = {"Creoles and pidgins"},
["crq"] = {"Iyo'wujwa Chorote"},
["crr"] = {"Carolina Algonquian"},
["crs"] = {"Seselwa Creole French"},
["crt"] = {"Iyojwa'ja Chorote"},
["crv"] = {"Chaura"},
["crw"] = {"Chrau"},
["crx"] = {"Carrier"},
["cry"] = {"Cori"},
["crz"] = {"Cruzeño"},
["csa"] = {"Chiltepec Chinantec"},
["csb"] = {"Kashubian"},
["csc"] = {"Catalan Sign Language", "Lengua de señas catalana", "Llengua de Signes Catalana"},
["csd"] = {"Chiangmai Sign Language"},
["cse"] = {"Czech Sign Language"},
["csf"] = {"Cuba Sign Language"},
["csg"] = {"Chilean Sign Language"},
["csh"] = {"Asho Chin"},
["csi"] = {"Coast Miwok"},
["csj"] = {"Songlai Chin"},
["csk"] = {"Jola-Kasa"},
["csl"] = {"Chinese Sign Language"},
["csm"] = {"Central Sierra Miwok"},
["csn"] = {"Colombian Sign Language"},
["cso"] = {"Sochiapam Chinantec", "Sochiapan Chinantec"},
["csp"] = {"Southern Ping Chinese", "Southern Pinghua"},
["csq"] = {"Croatia Sign Language"},
["csr"] = {"Costa Rican Sign Language"},
["css"] = {"Southern Ohlone"},
["cst"] = {"Northern Ohlone"},
["csu"] = {"Central Sudanic languages"},
["csv"] = {"Sumtu Chin"},
["csw"] = {"Swampy Cree"},
["csx"] = {"Cambodian Sign Language"},
["csy"] = {"Siyin Chin"},
["csz"] = {"Coos"},
["cta"] = {"Tataltepec Chatino"},
["ctc"] = {"Chetco"},
["ctd"] = {"Tedim Chin"},
["cte"] = {"Tepinapa Chinantec"},
["ctg"] = {"Chittagonian"},
["cth"] = {"Thaiphum Chin"},
["ctl"] = {"Tlacoatzintepec Chinantec"},
["ctm"] = {"Chitimacha"},
["ctn"] = {"Chhintange"},
["cto"] = {"Emberá-Catío"},
["ctp"] = {"Western Highland Chatino"},
["cts"] = {"Northern Catanduanes Bikol"},
["ctt"] = {"Wayanad Chetti"},
["ctu"] = {"Chol"},
["cty"] = {"Moundadan Chetty"},
["ctz"] = {"Zacatepec Chatino"},
["cua"] = {"Cua"},
["cub"] = {"Cubeo"},
["cuc"] = {"Usila Chinantec"},
["cuh"] = {"Chuka", "Gichuka"},
["cui"] = {"Cuiba"},
["cuj"] = {"Mashco Piro"},
["cuk"] = {"San Blas Kuna"},
["cul"] = {"Culina", "Kulina"},
["cuo"] = {"Cumanagoto"},
["cup"] = {"Cupeño"},
["cuq"] = {"Cun"},
["cur"] = {"Chhulung"},
["cus"] = {"Cushitic languages"},
["cut"] = {"Teutila Cuicatec"},
["cuu"] = {"Tai Ya"},
["cuv"] = {"Cuvok"},
["cuw"] = {"Chukwa"},
["cux"] = {"Tepeuxila Cuicatec"},
["cuy"] = {"Cuitlatec"},
["cvg"] = {"Chug"},
["cvn"] = {"Valle Nacional Chinantec"},
["cwa"] = {"Kabwa"},
["cwb"] = {"Maindo"},
["cwd"] = {"Woods Cree"},
["cwe"] = {"Kwere"},
["cwg"] = {"Chewong", "Cheq Wong"},
["cwt"] = {"Kuwaataay"},
["cxh"] = {"Cha'ari"},
["cya"] = {"Nopala Chatino"},
["cyb"] = {"Cayubaba"},
["cyo"] = {"Cuyonon"},
["czh"] = {"Huizhou Chinese"},
["czk"] = {"Knaanic"},
["czn"] = {"Zenzontepec Chatino"},
["czo"] = {"Min Zhong Chinese"},
["czt"] = {"Zotung Chin"},
["daa"] = {"Dangaléat"},
["dac"] = {"Dambi"},
["dad"] = {"Marik"},
["dae"] = {"Duupa"},
["dag"] = {"Dagbani"},
["dah"] = {"Gwahatike"},
["dai"] = {"Day"},
["daj"] = {"Dar Fur Daju"},
["dak"] = {"Dakota"},
["dal"] = {"Dahalo"},
["dam"] = {"Damakawa"},
["dao"] = {"Daai Chin"},
["daq"] = {"Dandami Maria"},
["dar"] = {"Dargwa"},
["das"] = {"Daho-Doo"},
["dau"] = {"Dar Sila Daju"},
["dav"] = {"Taita", "Dawida"},
["daw"] = {"Davawenyo"},
["dax"] = {"Dayi"},
["day"] = {"Land Dayak languages"},
["daz"] = {"Dao"},
["dba"] = {"Bangime"},
["dbb"] = {"Deno"},
["dbd"] = {"Dadiya"},
["dbe"] = {"Dabe"},
["dbf"] = {"Edopi"},
["dbg"] = {"Dogul Dom Dogon"},
["dbi"] = {"Doka"},
["dbj"] = {"Ida'an"},
["dbl"] = {"Dyirbal"},
["dbm"] = {"Duguri"},
["dbn"] = {"Duriankere"},
["dbo"] = {"Dulbu"},
["dbp"] = {"Duwai"},
["dbq"] = {"Daba"},
["dbr"] = {"Dabarre"},
["dbt"] = {"Ben Tey Dogon"},
["dbu"] = {"Bondum Dom Dogon"},
["dbv"] = {"Dungu"},
["dbw"] = {"Bankan Tey Dogon"},
["dby"] = {"Dibiyaso"},
["dcc"] = {"Deccan"},
["dcr"] = {"Negerhollands"},
["dda"] = {"Dadi Dadi"},
["ddd"] = {"Dongotono"},
["dde"] = {"Doondo"},
["ddg"] = {"Fataluku"},
["ddi"] = {"West Goodenough"},
["ddj"] = {"Jaru"},
["ddn"] = {"Dendi (Benin)"},
["ddo"] = {"Dido"},
["ddr"] = {"Dhudhuroa"},
["dds"] = {"Donno So Dogon"},
["ddw"] = {"Dawera-Daweloor"},
["dec"] = {"Dagik"},
["ded"] = {"Dedua"},
["dee"] = {"Dewoin"},
["def"] = {"Dezfuli"},
["deg"] = {"Degema"},
["deh"] = {"Dehwari"},
["dei"] = {"Demisa"},
["dek"] = {"Dek"},
["del"] = {"Delaware"},
["dem"] = {"Dem"},
["den"] = {"Slave (Athapascan)"},
["dep"] = {"Pidgin Delaware"},
["deq"] = {"Dendi (Central African Republic)"},
["der"] = {"Deori"},
["des"] = {"Desano"},
["dev"] = {"Domung"},
["dez"] = {"Dengese"},
["dga"] = {"Southern Dagaare"},
["dgb"] = {"Bunoge Dogon"},
["dgc"] = {"Casiguran Dumagat Agta"},
["dgd"] = {"Dagaari Dioula"},
["dge"] = {"Degenan"},
["dgg"] = {"Doga"},
["dgh"] = {"Dghwede"},
["dgi"] = {"Northern Dagara"},
["dgk"] = {"Dagba"},
["dgl"] = {"Andaandi", "Dongolawi"},
["dgn"] = {"Dagoman"},
["dgo"] = {"Dogri (individual language)"},
["dgr"] = {"Dogrib", "Tłı̨chǫ"},
["dgs"] = {"Dogoso"},
["dgt"] = {"Ndra'ngith"},
["dgw"] = {"Daungwurrung"},
["dgx"] = {"Doghoro"},
["dgz"] = {"Daga"},
["dhd"] = {"Dhundari"},
["dhg"] = {"Dhangu-Djangu", "Dhangu", "Djangu"},
["dhi"] = {"Dhimal"},
["dhl"] = {"Dhalandji"},
["dhm"] = {"Zemba"},
["dhn"] = {"Dhanki"},
["dho"] = {"Dhodia"},
["dhr"] = {"Dhargari"},
["dhs"] = {"Dhaiso"},
["dhu"] = {"Dhurga"},
["dhv"] = {"Dehu", "Drehu"},
["dhw"] = {"Dhanwar (Nepal)"},
["dhx"] = {"Dhungaloo"},
["dia"] = {"Dia"},
["dib"] = {"South Central Dinka"},
["dic"] = {"Lakota Dida"},
["did"] = {"Didinga"},
["dif"] = {"Dieri", "Diyari"},
["dig"] = {"Digo", "Chidigo"},
["dih"] = {"Kumiai"},
["dii"] = {"Dimbong"},
["dij"] = {"Dai"},
["dik"] = {"Southwestern Dinka"},
["dil"] = {"Dilling"},
["dim"] = {"Dime"},
["din"] = {"Dinka"},
["dio"] = {"Dibo"},
["dip"] = {"Northeastern Dinka"},
["diq"] = {"Dimli (individual language)"},
["dir"] = {"Dirim"},
["dis"] = {"Dimasa"},
["diu"] = {"Diriku"},
["diw"] = {"Northwestern Dinka"},
["dix"] = {"Dixon Reef"},
["diy"] = {"Diuwe"},
["diz"] = {"Ding"},
["dja"] = {"Djadjawurrung"},
["djb"] = {"Djinba"},
["djc"] = {"Dar Daju Daju"},
["djd"] = {"Djamindjung", "Ngaliwurru"},
["dje"] = {"Zarma"},
["djf"] = {"Djangun"},
["dji"] = {"Djinang"},
["djj"] = {"Djeebbana"},
["djk"] = {"Eastern Maroon Creole", "Businenge Tongo", "Nenge"},
["djm"] = {"Jamsay Dogon"},
["djn"] = {"Jawoyn", "Djauan"},
["djo"] = {"Jangkang"},
["djr"] = {"Djambarrpuyngu"},
["dju"] = {"Kapriman"},
["djw"] = {"Djawi"},
["dka"] = {"Dakpakha"},
["dkg"] = {"Kadung"},
["dkk"] = {"Dakka"},
["dkr"] = {"Kuijau"},
["dks"] = {"Southeastern Dinka"},
["dkx"] = {"Mazagway"},
["dlg"] = {"Dolgan"},
["dlk"] = {"Dahalik"},
["dlm"] = {"Dalmatian"},
["dln"] = {"Darlong"},
["dma"] = {"Duma"},
["dmb"] = {"Mombo Dogon"},
["dmc"] = {"Gavak"},
["dmd"] = {"Madhi Madhi"},
["dme"] = {"Dugwor"},
["dmf"] = {"Medefaidrin"},
["dmg"] = {"Upper Kinabatangan"},
["dmk"] = {"Domaaki"},
["dml"] = {"Dameli"},
["dmm"] = {"Dama"},
["dmn"] = {"Mande languages"},
["dmo"] = {"Kemedzung"},
["dmr"] = {"East Damar"},
["dms"] = {"Dampelas"},
["dmu"] = {"Dubu", "Tebi"},
["dmv"] = {"Dumpas"},
["dmw"] = {"Mudburra"},
["dmx"] = {"Dema"},
["dmy"] = {"Demta", "Sowari"},
["dna"] = {"Upper Grand Valley Dani"},
["dnd"] = {"Daonda"},
["dne"] = {"Ndendeule"},
["dng"] = {"Dungan"},
["dni"] = {"Lower Grand Valley Dani"},
["dnj"] = {"Dan"},
["dnk"] = {"Dengka"},
["dnn"] = {"Dzùùngoo"},
["dno"] = {"Ndrulo", "Northern Lendu"},
["dnr"] = {"Danaru"},
["dnt"] = {"Mid Grand Valley Dani"},
["dnu"] = {"Danau"},
["dnv"] = {"Danu"},
["dnw"] = {"Western Dani"},
["dny"] = {"Dení"},
["doa"] = {"Dom"},
["dob"] = {"Dobu"},
["doc"] = {"Northern Dong"},
["doe"] = {"Doe"},
["dof"] = {"Domu"},
["doh"] = {"Dong"},
["doi"] = {"Dogri (macrolanguage)"},
["dok"] = {"Dondo"},
["dol"] = {"Doso"},
["don"] = {"Toura (Papua New Guinea)"},
["doo"] = {"Dongo"},
["dop"] = {"Lukpa"},
["doq"] = {"Dominican Sign Language"},
["dor"] = {"Dori'o"},
["dos"] = {"Dogosé"},
["dot"] = {"Dass"},
["dov"] = {"Dombe"},
["dow"] = {"Doyayo"},
["dox"] = {"Bussa"},
["doy"] = {"Dompo"},
["doz"] = {"Dorze"},
["dpp"] = {"Papar"},
["dra"] = {"Dravidian languages"},
["drb"] = {"Dair"},
["drc"] = {"Minderico"},
["drd"] = {"Darmiya"},
["dre"] = {"Dolpo"},
["drg"] = {"Rungus"},
["dri"] = {"C'Lela"},
["drl"] = {"Paakantyi"},
["drn"] = {"West Damar"},
["dro"] = {"Daro-Matu Melanau"},
["drq"] = {"Dura"},
["drs"] = {"Gedeo"},
["drt"] = {"Drents"},
["dru"] = {"Rukai"},
["dry"] = {"Darai"},
["dsb"] = {"Lower Sorbian"},
["dse"] = {"Dutch Sign Language"},
["dsh"] = {"Daasanach"},
["dsi"] = {"Disa"},
["dsk"] = {"Dokshi"},
["dsl"] = {"Danish Sign Language"},
["dsn"] = {"Dusner"},
["dso"] = {"Desiya"},
["dsq"] = {"Tadaksahak"},
["dsz"] = {"Mardin Sign Language"},
["dta"] = {"Daur"},
["dtb"] = {"Labuk-Kinabatangan Kadazan"},
["dtd"] = {"Ditidaht"},
["dth"] = {"Adithinngithigh"},
["dti"] = {"Ana Tinga Dogon"},
["dtk"] = {"Tene Kan Dogon"},
["dtm"] = {"Tomo Kan Dogon"},
["dtn"] = {"Daatsʼíin"},
["dto"] = {"Tommo So Dogon"},
["dtp"] = {"Kadazan Dusun", "Central Dusun"},
["dtr"] = {"Lotud"},
["dts"] = {"Toro So Dogon"},
["dtt"] = {"Toro Tegu Dogon"},
["dtu"] = {"Tebul Ure Dogon"},
["dty"] = {"Dotyali"},
["dua"] = {"Duala"},
["dub"] = {"Dubli"},
["duc"] = {"Duna"},
["due"] = {"Umiray Dumaget Agta"},
["duf"] = {"Dumbea", "Drubea"},
["dug"] = {"Duruma", "Chiduruma"},
["duh"] = {"Dungra Bhil"},
["dui"] = {"Dumun"},
["duk"] = {"Uyajitaya"},
["dul"] = {"Alabat Island Agta"},
["dum"] = {"Middle Dutch (ca. 1050-1350)"},
["dun"] = {"Dusun Deyah"},
["duo"] = {"Dupaninan Agta"},
["dup"] = {"Duano"},
["duq"] = {"Dusun Malang"},
["dur"] = {"Dii"},
["dus"] = {"Dumi"},
["duu"] = {"Drung"},
["duv"] = {"Duvle"},
["duw"] = {"Dusun Witu"},
["dux"] = {"Duungooma"},
["duy"] = {"Dicamay Agta"},
["duz"] = {"Duli-Gey"},
["dva"] = {"Duau"},
["dwa"] = {"Diri"},
["dwk"] = {"Dawik Kui"},
["dwr"] = {"Dawro"},
["dws"] = {"Dutton World Speedwords"},
["dwu"] = {"Dhuwal"},
["dww"] = {"Dawawa"},
["dwy"] = {"Dhuwaya"},
["dwz"] = {"Dewas Rai"},
["dya"] = {"Dyan"},
["dyb"] = {"Dyaberdyaber"},
["dyd"] = {"Dyugun"},
["dyg"] = {"Villa Viciosa Agta"},
["dyi"] = {"Djimini Senoufo"},
["dym"] = {"Yanda Dom Dogon"},
["dyn"] = {"Dyangadi", "Dhanggatti"},
["dyo"] = {"Jola-Fonyi"},
["dyr"] = {"Dyarim"},
["dyu"] = {"Dyula"},
["dyy"] = {"Djabugay", "Dyaabugay"},
["dza"] = {"Tunzu"},
["dzd"] = {"Daza"},
["dze"] = {"Djiwarli"},
["dzg"] = {"Dazaga"},
["dzl"] = {"Dzalakha"},
["dzn"] = {"Dzando"},
["eaa"] = {"Karenggapa"},
["ebc"] = {"Beginci"},
["ebg"] = {"Ebughu"},
["ebk"] = {"Eastern Bontok"},
["ebo"] = {"Teke-Ebo"},
["ebr"] = {"Ebrié"},
["ebu"] = {"Embu", "Kiembu"},
["ecr"] = {"Eteocretan"},
["ecs"] = {"Ecuadorian Sign Language"},
["ecy"] = {"Eteocypriot"},
["eee"] = {"E"},
["efa"] = {"Efai"},
["efe"] = {"Efe"},
["efi"] = {"Efik"},
["ega"] = {"Ega"},
["egl"] = {"Emilian"},
["egm"] = {"Benamanga"},
["ego"] = {"Eggon"},
["egx"] = {"Egyptian languages"},
["egy"] = {"Egyptian (Ancient)"},
["ehs"] = {"Miyakubo Sign Language"},
["ehu"] = {"Ehueun"},
["eip"] = {"Eipomek"},
["eit"] = {"Eitiep"},
["eiv"] = {"Askopan"},
["eja"] = {"Ejamat"},
["eka"] = {"Ekajuk"},
["eke"] = {"Ekit"},
["ekg"] = {"Ekari"},
["eki"] = {"Eki"},
["ekk"] = {"Standard Estonian"},
["ekl"] = {"Kol (Bangladesh)", "Kol"},
["ekm"] = {"Elip"},
["eko"] = {"Koti"},
["ekp"] = {"Ekpeye"},
["ekr"] = {"Yace"},
["eky"] = {"Eastern Kayah"},
["ele"] = {"Elepi"},
["elh"] = {"El Hugeirat"},
["eli"] = {"Nding"},
["elk"] = {"Elkei"},
["elm"] = {"Eleme"},
["elo"] = {"El Molo"},
["elu"] = {"Elu"},
["elx"] = {"Elamite"},
["ema"] = {"Emai-Iuleha-Ora"},
["emb"] = {"Embaloh"},
["eme"] = {"Emerillon"},
["emg"] = {"Eastern Meohang"},
["emi"] = {"Mussau-Emira"},
["emk"] = {"Eastern Maninkakan"},
["emm"] = {"Mamulique"},
["emn"] = {"Eman"},
["emp"] = {"Northern Emberá"},
["emq"] = {"Eastern Minyag"},
["ems"] = {"Pacific Gulf Yupik"},
["emu"] = {"Eastern Muria"},
["emw"] = {"Emplawas"},
["emx"] = {"Erromintxela"},
["emy"] = {"Epigraphic Mayan"},
["emz"] = {"Mbessa"},
["ena"] = {"Apali"},
["enb"] = {"Markweeta"},
["enc"] = {"En"},
["end"] = {"Ende"},
["enf"] = {"Forest Enets"},
["enh"] = {"Tundra Enets"},
["enl"] = {"Enlhet"},
["enm"] = {"Middle English (1100-1500)"},
["enn"] = {"Engenni"},
["eno"] = {"Enggano"},
["enq"] = {"Enga"},
["enr"] = {"Emumu", "Emem"},
["enu"] = {"Enu"},
["env"] = {"Enwan (Edo State)"},
["enw"] = {"Enwan (Akwa Ibom State)"},
["enx"] = {"Enxet"},
["eot"] = {"Beti (Côte d'Ivoire)"},
["epi"] = {"Epie"},
["era"] = {"Eravallan"},
["erg"] = {"Sie"},
["erh"] = {"Eruwa"},
["eri"] = {"Ogea"},
["erk"] = {"South Efate"},
["ero"] = {"Horpa"},
["err"] = {"Erre"},
["ers"] = {"Ersu"},
["ert"] = {"Eritai"},
["erw"] = {"Erokwanas"},
["ese"] = {"Ese Ejja"},
["esg"] = {"Aheri Gondi"},
["esh"] = {"Eshtehardi"},
["esi"] = {"North Alaskan Inupiatun"},
["esk"] = {"Northwest Alaska Inupiatun"},
["esl"] = {"Egypt Sign Language"},
["esm"] = {"Esuma"},
["esn"] = {"Salvadoran Sign Language"},
["eso"] = {"Estonian Sign Language"},
["esq"] = {"Esselen"},
["ess"] = {"Central Siberian Yupik"},
["esu"] = {"Central Yupik"},
["esx"] = {"Eskimo-Aleut languages"},
["esy"] = {"Eskayan"},
["etb"] = {"Etebi"},
["etc"] = {"Etchemin"},
["eth"] = {"Ethiopian Sign Language"},
["etn"] = {"Eton (Vanuatu)"},
["eto"] = {"Eton (Cameroon)"},
["etr"] = {"Edolo"},
["ets"] = {"Yekhee"},
["ett"] = {"Etruscan"},
["etu"] = {"Ejagham"},
["etx"] = {"Eten"},
["etz"] = {"Semimi"},
["eud"] = {"Eudeve"},
["euq"] = {"Basque (family)"},
["eve"] = {"Even"},
["evh"] = {"Uvbie"},
["evn"] = {"Evenki"},
["ewo"] = {"Ewondo"},
["ext"] = {"Extremaduran"},
["eya"] = {"Eyak"},
["eyo"] = {"Keiyo"},
["eza"] = {"Ezaa"},
["eze"] = {"Uzekwe"},
["faa"] = {"Fasu"},
["fab"] = {"Fa d'Ambu"},
["fad"] = {"Wagi"},
["faf"] = {"Fagani"},
["fag"] = {"Finongan"},
["fah"] = {"Baissa Fali"},
["fai"] = {"Faiwol"},
["faj"] = {"Faita"},
["fak"] = {"Fang (Cameroon)"},
["fal"] = {"South Fali"},
["fam"] = {"Fam"},
["fan"] = {"Fang (Equatorial Guinea)"},
["fap"] = {"Paloor"},
["far"] = {"Fataleka"},
["fat"] = {"Fanti"},
["fau"] = {"Fayu"},
["fax"] = {"Fala"},
["fay"] = {"Southwestern Fars"},
["faz"] = {"Northwestern Fars"},
["fbl"] = {"West Albay Bikol"},
["fcs"] = {"Quebec Sign Language"},
["fer"] = {"Feroge"},
["ffi"] = {"Foia Foia"},
["ffm"] = {"Maasina Fulfulde"},
["fgr"] = {"Fongoro"},
["fia"] = {"Nobiin"},
["fie"] = {"Fyer"},
["fif"] = {"Faifi"},
["fil"] = {"Filipino", "Pilipino"},
["fip"] = {"Fipa"},
["fir"] = {"Firan"},
["fit"] = {"Tornedalen Finnish", "Meänkieli"},
["fiu"] = {"Finno-Ugrian languages"},
["fiw"] = {"Fiwaga"},
["fkk"] = {"Kirya-Konzəl"},
["fkv"] = {"Kven Finnish"},
["fla"] = {"Kalispel-Pend d'Oreille"},
["flh"] = {"Foau"},
["fli"] = {"Fali"},
["fll"] = {"North Fali"},
["fln"] = {"Flinders Island"},
["flr"] = {"Fuliiru"},
["fly"] = {"Flaaitaal", "Tsotsitaal"},
["fmp"] = {"Fe'fe'"},
["fmu"] = {"Far Western Muria"},
["fnb"] = {"Fanbak"},
["fng"] = {"Fanagalo"},
["fni"] = {"Fania"},
["fod"] = {"Foodo"},
["foi"] = {"Foi"},
["fom"] = {"Foma"},
["fon"] = {"Fon"},
["for"] = {"Fore"},
["fos"] = {"Siraya"},
["fox"] = {"Formosan languages"},
["fpe"] = {"Fernando Po Creole English"},
["fqs"] = {"Fas"},
["frc"] = {"Cajun French"},
["frd"] = {"Fordata"},
["frk"] = {"Frankish"},
["frm"] = {"Middle French (ca. 1400-1600)"},
["fro"] = {"Old French (842-ca. 1400)"},
["frp"] = {"Arpitan", "Francoprovençal"},
["frq"] = {"Forak"},
["frr"] = {"Northern Frisian"},
["frs"] = {"Eastern Frisian"},
["frt"] = {"Fortsenal"},
["fse"] = {"Finnish Sign Language"},
["fsl"] = {"French Sign Language"},
["fss"] = {"Finland-Swedish Sign Language", "finlandssvenskt teckenspråk", "suomenruotsalainen viittomakieli"},
["fub"] = {"Adamawa Fulfulde"},
["fuc"] = {"Pulaar"},
["fud"] = {"East Futuna"},
["fue"] = {"Borgu Fulfulde"},
["fuf"] = {"Pular"},
["fuh"] = {"Western Niger Fulfulde"},
["fui"] = {"Bagirmi Fulfulde"},
["fuj"] = {"Ko"},
["fum"] = {"Fum"},
["fun"] = {"Fulniô"},
["fuq"] = {"Central-Eastern Niger Fulfulde"},
["fur"] = {"Friulian"},
["fut"] = {"Futuna-Aniwa"},
["fuu"] = {"Furu"},
["fuv"] = {"Nigerian Fulfulde"},
["fuy"] = {"Fuyug"},
["fvr"] = {"Fur"},
["fwa"] = {"Fwâi"},
["fwe"] = {"Fwe"},
["gaa"] = {"Ga"},
["gab"] = {"Gabri"},
["gac"] = {"Mixed Great Andamanese"},
["gad"] = {"Gaddang"},
["gae"] = {"Guarequena"},
["gaf"] = {"Gende"},
["gag"] = {"Gagauz"},
["gah"] = {"Alekano"},
["gai"] = {"Borei"},
["gaj"] = {"Gadsup"},
["gak"] = {"Gamkonora"},
["gal"] = {"Galolen"},
["gam"] = {"Kandawo"},
["gan"] = {"Gan Chinese"},
["gao"] = {"Gants"},
["gap"] = {"Gal"},
["gaq"] = {"Gata'"},
["gar"] = {"Galeya"},
["gas"] = {"Adiwasi Garasia"},
["gat"] = {"Kenati"},
["gau"] = {"Mudhili Gadaba"},
["gaw"] = {"Nobonob"},
["gax"] = {"Borana-Arsi-Guji Oromo"},
["gay"] = {"Gayo"},
["gaz"] = {"West Central Oromo"},
["gba"] = {"Gbaya (Central African Republic)"},
["gbb"] = {"Kaytetye"},
["gbd"] = {"Karajarri"},
["gbe"] = {"Niksek"},
["gbf"] = {"Gaikundi"},
["gbg"] = {"Gbanziri"},
["gbh"] = {"Defi Gbe"},
["gbi"] = {"Galela"},
["gbj"] = {"Bodo Gadaba"},
["gbk"] = {"Gaddi"},
["gbl"] = {"Gamit"},
["gbm"] = {"Garhwali"},
["gbn"] = {"Mo'da"},
["gbo"] = {"Northern Grebo"},
["gbp"] = {"Gbaya-Bossangoa"},
["gbq"] = {"Gbaya-Bozoum"},
["gbr"] = {"Gbagyi"},
["gbs"] = {"Gbesi Gbe"},
["gbu"] = {"Gagadu"},
["gbv"] = {"Gbanu"},
["gbw"] = {"Gabi-Gabi"},
["gbx"] = {"Eastern Xwla Gbe"},
["gby"] = {"Gbari"},
["gbz"] = {"Zoroastrian Dari"},
["gcc"] = {"Mali"},
["gcd"] = {"Ganggalida"},
["gce"] = {"Galice"},
["gcf"] = {"Guadeloupean Creole French"},
["gcl"] = {"Grenadian Creole English"},
["gcn"] = {"Gaina"},
["gcr"] = {"Guianese Creole French"},
["gct"] = {"Colonia Tovar German"},
["gda"] = {"Gade Lohar"},
["gdb"] = {"Pottangi Ollar Gadaba"},
["gdc"] = {"Gugu Badhun"},
["gdd"] = {"Gedaged"},
["gde"] = {"Gude"},
["gdf"] = {"Guduf-Gava"},
["gdg"] = {"Ga'dang"},
["gdh"] = {"Gadjerawang", "Gajirrabeng"},
["gdi"] = {"Gundi"},
["gdj"] = {"Gurdjar"},
["gdk"] = {"Gadang"},
["gdl"] = {"Dirasha"},
["gdm"] = {"Laal"},
["gdn"] = {"Umanakaina"},
["gdo"] = {"Ghodoberi"},
["gdq"] = {"Mehri"},
["gdr"] = {"Wipi"},
["gds"] = {"Ghandruk Sign Language"},
["gdt"] = {"Kungardutyi"},
["gdu"] = {"Gudu"},
["gdx"] = {"Godwari"},
["gea"] = {"Geruma"},
["geb"] = {"Kire"},
["gec"] = {"Gboloo Grebo"},
["ged"] = {"Gade"},
["gef"] = {"Gerai"},
["geg"] = {"Gengle"},
["geh"] = {"Hutterite German", "Hutterisch"},
["gei"] = {"Gebe"},
["gej"] = {"Gen"},
["gek"] = {"Ywom"},
["gel"] = {"ut-Ma'in"},
["gem"] = {"Germanic languages"},
["geq"] = {"Geme"},
["ges"] = {"Geser-Gorom"},
["gev"] = {"Eviya"},
["gew"] = {"Gera"},
["gex"] = {"Garre"},
["gey"] = {"Enya"},
["gez"] = {"Geez"},
["gfk"] = {"Patpatar"},
["gft"] = {"Gafat"},
["gga"] = {"Gao"},
["ggb"] = {"Gbii"},
["ggd"] = {"Gugadj"},
["gge"] = {"Gurr-goni"},
["ggg"] = {"Gurgula"},
["ggk"] = {"Kungarakany"},
["ggl"] = {"Ganglau"},
["ggt"] = {"Gitua"},
["ggu"] = {"Gagu", "Gban"},
["ggw"] = {"Gogodala"},
["gha"] = {"Ghadamès"},
["ghc"] = {"Hiberno-Scottish Gaelic"},
["ghe"] = {"Southern Ghale"},
["ghh"] = {"Northern Ghale"},
["ghk"] = {"Geko Karen"},
["ghl"] = {"Ghulfan"},
["ghn"] = {"Ghanongga"},
["gho"] = {"Ghomara"},
["ghr"] = {"Ghera"},
["ghs"] = {"Guhu-Samane"},
["ght"] = {"Kuke", "Kutang Ghale"},
["gia"] = {"Kija"},
["gib"] = {"Gibanawa"},
["gic"] = {"Gail"},
["gid"] = {"Gidar"},
["gie"] = {"Gaɓogbo", "Guébie"},
["gig"] = {"Goaria"},
["gih"] = {"Githabul"},
["gii"] = {"Girirra"},
["gil"] = {"Gilbertese"},
["gim"] = {"Gimi (Eastern Highlands)"},
["gin"] = {"Hinukh"},
["gip"] = {"Gimi (West New Britain)"},
["giq"] = {"Green Gelao"},
["gir"] = {"Red Gelao"},
["gis"] = {"North Giziga"},
["git"] = {"Gitxsan"},
["giu"] = {"Mulao"},
["giw"] = {"White Gelao"},
["gix"] = {"Gilima"},
["giy"] = {"Giyug"},
["giz"] = {"South Giziga"},
["gjk"] = {"Kachi Koli"},
["gjm"] = {"Gunditjmara"},
["gjn"] = {"Gonja"},
["gjr"] = {"Gurindji Kriol"},
["gju"] = {"Gujari"},
["gka"] = {"Guya"},
["gkd"] = {"Magɨ (Madang Province)"},
["gke"] = {"Ndai"},
["gkn"] = {"Gokana"},
["gko"] = {"Kok-Nar"},
["gkp"] = {"Guinea Kpelle"},
["gku"] = {"ǂUngkue"},
["glb"] = {"Belning"},
["glc"] = {"Bon Gula"},
["gld"] = {"Nanai"},
["glh"] = {"Northwest Pashai", "Northwest Pashayi"},
["glj"] = {"Gula Iro"},
["glk"] = {"Gilaki"},
["gll"] = {"Garlali"},
["glo"] = {"Galambu"},
["glr"] = {"Glaro-Twabo"},
["glu"] = {"Gula (Chad)"},
["glw"] = {"Glavda"},
["gly"] = {"Gule"},
["gma"] = {"Gambera"},
["gmb"] = {"Gula'alaa"},
["gmd"] = {"Mághdì"},
["gme"] = {"East Germanic languages"},
["gmg"] = {"Magɨyi"},
["gmh"] = {"Middle High German (ca. 1050-1500)"},
["gml"] = {"Middle Low German"},
["gmm"] = {"Gbaya-Mbodomo"},
["gmn"] = {"Gimnime"},
["gmq"] = {"North Germanic languages"},
["gmr"] = {"Mirning", "Mirniny"},
["gmu"] = {"Gumalu"},
["gmv"] = {"Gamo"},
["gmw"] = {"West Germanic languages"},
["gmx"] = {"Magoma"},
["gmy"] = {"Mycenaean Greek"},
["gmz"] = {"Mgbolizhia"},
["gna"] = {"Kaansa"},
["gnb"] = {"Gangte"},
["gnc"] = {"Guanche"},
["gnd"] = {"Zulgo-Gemzek"},
["gne"] = {"Ganang"},
["gng"] = {"Ngangam"},
["gnh"] = {"Lere"},
["gni"] = {"Gooniyandi"},
["gnj"] = {"Ngen"},
["gnk"] = {"ǁGana"},
["gnl"] = {"Gangulu"},
["gnm"] = {"Ginuman"},
["gnn"] = {"Gumatj"},
["gno"] = {"Northern Gondi"},
["gnq"] = {"Gana"},
["gnr"] = {"Gureng Gureng"},
["gnt"] = {"Guntai"},
["gnu"] = {"Gnau"},
["gnw"] = {"Western Bolivian Guaraní"},
["gnz"] = {"Ganzi"},
["goa"] = {"Guro"},
["gob"] = {"Playero"},
["goc"] = {"Gorakor"},
["god"] = {"Godié"},
["goe"] = {"Gongduk"},
["gof"] = {"Gofa"},
["gog"] = {"Gogo"},
["goh"] = {"Old High German (ca. 750-1050)"},
["goi"] = {"Gobasi"},
["goj"] = {"Gowlan"},
["gok"] = {"Gowli"},
["gol"] = {"Gola"},
["gom"] = {"Goan Konkani"},
["gon"] = {"Gondi"},
["goo"] = {"Gone Dau"},
["gop"] = {"Yeretuar"},
["goq"] = {"Gorap"},
["gor"] = {"Gorontalo"},
["gos"] = {"Gronings"},
["got"] = {"Gothic"},
["gou"] = {"Gavar"},
["gov"] = {"Goo"},
["gow"] = {"Gorowa"},
["gox"] = {"Gobu"},
["goy"] = {"Goundo"},
["goz"] = {"Gozarkhani"},
["gpa"] = {"Gupa-Abawa"},
["gpe"] = {"Ghanaian Pidgin English"},
["gpn"] = {"Taiap"},
["gqa"] = {"Ga'anda"},
["gqi"] = {"Guiqiong"},
["gqn"] = {"Guana (Brazil)"},
["gqr"] = {"Gor"},
["gqu"] = {"Qau"},
["gra"] = {"Rajput Garasia"},
["grb"] = {"Grebo"},
["grc"] = {"Ancient Greek (to 1453)"},
["grd"] = {"Guruntum-Mbaaru"},
["grg"] = {"Madi"},
["grh"] = {"Gbiri-Niragu"},
["gri"] = {"Ghari"},
["grj"] = {"Southern Grebo"},
["grk"] = {"Greek languages"},
["grm"] = {"Kota Marudu Talantang"},
["gro"] = {"Groma"},
["grq"] = {"Gorovu"},
["grr"] = {"Taznatit"},
["grs"] = {"Gresi"},
["grt"] = {"Garo"},
["gru"] = {"Kistane"},
["grv"] = {"Central Grebo"},
["grw"] = {"Gweda"},
["grx"] = {"Guriaso"},
["gry"] = {"Barclayville Grebo"},
["grz"] = {"Guramalum"},
["gse"] = {"Ghanaian Sign Language"},
["gsg"] = {"German Sign Language"},
["gsl"] = {"Gusilay"},
["gsm"] = {"Guatemalan Sign Language"},
["gsn"] = {"Nema", "Gusan"},
["gso"] = {"Southwest Gbaya"},
["gsp"] = {"Wasembo"},
["gss"] = {"Greek Sign Language"},
["gsw"] = {"Swiss German", "Alemannic", "Alsatian"},
["gta"] = {"Guató"},
["gtu"] = {"Aghu-Tharnggala"},
["gua"] = {"Shiki"},
["gub"] = {"Guajajára"},
["guc"] = {"Wayuu"},
["gud"] = {"Yocoboué Dida"},
["gue"] = {"Gurindji"},
["guf"] = {"Gupapuyngu"},
["gug"] = {"Paraguayan Guaraní"},
["guh"] = {"Guahibo"},
["gui"] = {"Eastern Bolivian Guaraní"},
["guk"] = {"Gumuz"},
["gul"] = {"Sea Island Creole English"},
["gum"] = {"Guambiano"},
["gun"] = {"Mbyá Guaraní"},
["guo"] = {"Guayabero"},
["gup"] = {"Gunwinggu"},
["guq"] = {"Aché"},
["gur"] = {"Farefare"},
["gus"] = {"Guinean Sign Language"},
["gut"] = {"Maléku Jaíka"},
["guu"] = {"Yanomamö"},
["guw"] = {"Gun"},
["gux"] = {"Gourmanchéma"},
["guz"] = {"Gusii", "Ekegusii"},
["gva"] = {"Guana (Paraguay)"},
["gvc"] = {"Guanano"},
["gve"] = {"Duwet"},
["gvf"] = {"Golin"},
["gvj"] = {"Guajá"},
["gvl"] = {"Gulay"},
["gvm"] = {"Gurmana"},
["gvn"] = {"Kuku-Yalanji"},
["gvo"] = {"Gavião Do Jiparaná"},
["gvp"] = {"Pará Gavião"},
["gvr"] = {"Gurung"},
["gvs"] = {"Gumawana"},
["gvy"] = {"Guyani"},
["gwa"] = {"Mbato"},
["gwb"] = {"Gwa"},
["gwc"] = {"Gawri", "Kalami"},
["gwd"] = {"Gawwada"},
["gwe"] = {"Gweno"},
["gwf"] = {"Gowro"},
["gwg"] = {"Moo"},
["gwi"] = {"Gwichʼin"},
["gwj"] = {"ǀGwi"},
["gwm"] = {"Awngthim"},
["gwn"] = {"Gwandara"},
["gwr"] = {"Gwere"},
["gwt"] = {"Gawar-Bati"},
["gwu"] = {"Guwamu"},
["gww"] = {"Kwini"},
["gwx"] = {"Gua"},
["gxx"] = {"Wè Southern"},
["gya"] = {"Northwest Gbaya"},
["gyb"] = {"Garus"},
["gyd"] = {"Kayardild"},
["gye"] = {"Gyem"},
["gyf"] = {"Gungabula"},
["gyg"] = {"Gbayi"},
["gyi"] = {"Gyele"},
["gyl"] = {"Gayil"},
["gym"] = {"Ngäbere"},
["gyn"] = {"Guyanese Creole English"},
["gyo"] = {"Gyalsumdo"},
["gyr"] = {"Guarayu"},
["gyy"] = {"Gunya"},
["gyz"] = {"Geji", "Gyaazi"},
["gza"] = {"Ganza"},
["gzi"] = {"Gazi"},
["gzn"] = {"Gane"},
["haa"] = {"Han"},
["hab"] = {"Hanoi Sign Language"},
["hac"] = {"Gurani"},
["had"] = {"Hatam"},
["hae"] = {"Eastern Oromo"},
["haf"] = {"Haiphong Sign Language"},
["hag"] = {"Hanga"},
["hah"] = {"Hahon"},
["hai"] = {"Haida"},
["haj"] = {"Hajong"},
["hak"] = {"Hakka Chinese"},
["hal"] = {"Halang"},
["ham"] = {"Hewa"},
["han"] = {"Hangaza"},
["hao"] = {"Hakö"},
["hap"] = {"Hupla"},
["haq"] = {"Ha"},
["har"] = {"Harari"},
["has"] = {"Haisla"},
["hav"] = {"Havu"},
["haw"] = {"Hawaiian"},
["hax"] = {"Southern Haida"},
["hay"] = {"Haya"},
["haz"] = {"Hazaragi"},
["hba"] = {"Hamba"},
["hbb"] = {"Huba"},
["hbn"] = {"Heiban"},
["hbo"] = {"Ancient Hebrew"},
["hbu"] = {"Habu"},
["hca"] = {"Andaman Creole Hindi"},
["hch"] = {"Huichol"},
["hdn"] = {"Northern Haida"},
["hds"] = {"Honduras Sign Language"},
["hdy"] = {"Hadiyya"},
["hea"] = {"Northern Qiandong Miao"},
["hed"] = {"Herdé"},
["heg"] = {"Helong"},
["heh"] = {"Hehe"},
["hei"] = {"Heiltsuk"},
["hem"] = {"Hemba"},
["hgm"] = {"Haiǁom"},
["hgw"] = {"Haigwai"},
["hhi"] = {"Hoia Hoia"},
["hhr"] = {"Kerak"},
["hhy"] = {"Hoyahoya"},
["hia"] = {"Lamang"},
["hib"] = {"Hibito"},
["hid"] = {"Hidatsa"},
["hif"] = {"Fiji Hindi"},
["hig"] = {"Kamwe"},
["hih"] = {"Pamosu"},
["hii"] = {"Hinduri"},
["hij"] = {"Hijuk"},
["hik"] = {"Seit-Kaitetu"},
["hil"] = {"Hiligaynon"},
["him"] = {"Himachali languages", "Western Pahari languages"},
["hio"] = {"Tsoa"},
["hir"] = {"Himarimã"},
["hit"] = {"Hittite"},
["hiw"] = {"Hiw"},
["hix"] = {"Hixkaryána"},
["hji"] = {"Haji"},
["hka"] = {"Kahe"},
["hke"] = {"Hunde"},
["hkh"] = {"Khah", "Poguli"},
["hkk"] = {"Hunjara-Kaina Ke"},
["hkn"] = {"Mel-Khaonh"},
["hks"] = {"Hong Kong Sign Language", "Heung Kong Sau Yue"},
["hla"] = {"Halia"},
["hlb"] = {"Halbi"},
["hld"] = {"Halang Doan"},
["hle"] = {"Hlersu"},
["hlt"] = {"Matu Chin"},
["hlu"] = {"Hieroglyphic Luwian"},
["hma"] = {"Southern Mashan Hmong", "Southern Mashan Miao"},
["hmb"] = {"Humburi Senni Songhay"},
["hmc"] = {"Central Huishui Hmong", "Central Huishui Miao"},
["hmd"] = {"Large Flowery Miao", "A-hmaos", "Da-Hua Miao"},
["hme"] = {"Eastern Huishui Hmong", "Eastern Huishui Miao"},
["hmf"] = {"Hmong Don"},
["hmg"] = {"Southwestern Guiyang Hmong"},
["hmh"] = {"Southwestern Huishui Hmong", "Southwestern Huishui Miao"},
["hmi"] = {"Northern Huishui Hmong", "Northern Huishui Miao"},
["hmj"] = {"Ge", "Gejia"},
["hmk"] = {"Maek"},
["hml"] = {"Luopohe Hmong", "Luopohe Miao"},
["hmm"] = {"Central Mashan Hmong", "Central Mashan Miao"},
["hmn"] = {"Hmong", "Mong"},
["hmp"] = {"Northern Mashan Hmong", "Northern Mashan Miao"},
["hmq"] = {"Eastern Qiandong Miao"},
["hmr"] = {"Hmar"},
["hms"] = {"Southern Qiandong Miao"},
["hmt"] = {"Hamtai"},
["hmu"] = {"Hamap"},
["hmv"] = {"Hmong Dô"},
["hmw"] = {"Western Mashan Hmong", "Western Mashan Miao"},
["hmx"] = {"Hmong-Mien languages"},
["hmy"] = {"Southern Guiyang Hmong", "Southern Guiyang Miao"},
["hmz"] = {"Hmong Shua", "Sinicized Miao"},
["hna"] = {"Mina (Cameroon)"},
["hnd"] = {"Southern Hindko"},
["hne"] = {"Chhattisgarhi"},
["hng"] = {"Hungu"},
["hnh"] = {"ǁAni"},
["hni"] = {"Hani"},
["hnj"] = {"Hmong Njua", "Mong Leng", "Mong Njua"},
["hnn"] = {"Hanunoo"},
["hno"] = {"Northern Hindko"},
["hns"] = {"Caribbean Hindustani"},
["hnu"] = {"Hung"},
["hoa"] = {"Hoava"},
["hob"] = {"Mari (Madang Province)"},
["hoc"] = {"Ho"},
["hod"] = {"Holma"},
["hoe"] = {"Horom"},
["hoh"] = {"Hobyót"},
["hoi"] = {"Holikachuk"},
["hoj"] = {"Hadothi", "Haroti"},
["hok"] = {"Hokan languages"},
["hol"] = {"Holu"},
["hom"] = {"Homa"},
["hoo"] = {"Holoholo"},
["hop"] = {"Hopi"},
["hor"] = {"Horo"},
["hos"] = {"Ho Chi Minh City Sign Language"},
["hot"] = {"Hote", "Malê"},
["hov"] = {"Hovongan"},
["how"] = {"Honi"},
["hoy"] = {"Holiya"},
["hoz"] = {"Hozo"},
["hpo"] = {"Hpon"},
["hps"] = {"Hawai'i Sign Language (HSL)", "Hawai'i Pidgin Sign Language"},
["hra"] = {"Hrangkhol"},
["hrc"] = {"Niwer Mil"},
["hre"] = {"Hre"},
["hrk"] = {"Haruku"},
["hrm"] = {"Horned Miao"},
["hro"] = {"Haroi"},
["hrp"] = {"Nhirrpi"},
["hrt"] = {"Hértevin"},
["hru"] = {"Hruso"},
["hrw"] = {"Warwar Feni"},
["hrx"] = {"Hunsrik"},
["hrz"] = {"Harzani"},
["hsb"] = {"Upper Sorbian"},
["hsh"] = {"Hungarian Sign Language"},
["hsl"] = {"Hausa Sign Language"},
["hsn"] = {"Xiang Chinese"},
["hss"] = {"Harsusi"},
["hti"] = {"Hoti"},
["hto"] = {"Minica Huitoto"},
["hts"] = {"Hadza"},
["htu"] = {"Hitu"},
["htx"] = {"Middle Hittite"},
["hub"] = {"Huambisa"},
["huc"] = {"ǂHua", "ǂʼAmkhoe"},
["hud"] = {"Huaulu"},
["hue"] = {"San Francisco Del Mar Huave"},
["huf"] = {"Humene"},
["hug"] = {"Huachipaeri"},
["huh"] = {"Huilliche"},
["hui"] = {"Huli"},
["huj"] = {"Northern Guiyang Hmong", "Northern Guiyang Miao"},
["huk"] = {"Hulung"},
["hul"] = {"Hula"},
["hum"] = {"Hungana"},
["huo"] = {"Hu"},
["hup"] = {"Hupa"},
["huq"] = {"Tsat"},
["hur"] = {"Halkomelem"},
["hus"] = {"Huastec"},
["hut"] = {"Humla"},
["huu"] = {"Murui Huitoto"},
["huv"] = {"San Mateo Del Mar Huave"},
["huw"] = {"Hukumina"},
["hux"] = {"Nüpode Huitoto"},
["huy"] = {"Hulaulá"},
["huz"] = {"Hunzib"},
["hvc"] = {"Haitian Vodoun Culture Language"},
["hve"] = {"San Dionisio Del Mar Huave"},
["hvk"] = {"Haveke"},
["hvn"] = {"Sabu"},
["hvv"] = {"Santa María Del Mar Huave"},
["hwa"] = {"Wané"},
["hwc"] = {"Hawai'i Creole English", "Hawai'i Pidgin"},
["hwo"] = {"Hwana"},
["hya"] = {"Hya"},
["hyw"] = {"Western Armenian"},
["hyx"] = {"Armenian (family)"},
["iai"] = {"Iaai"},
["ian"] = {"Iatmul"},
["iar"] = {"Purari"},
["iba"] = {"Iban"},
["ibb"] = {"Ibibio"},
["ibd"] = {"Iwaidja"},
["ibe"] = {"Akpes"},
["ibg"] = {"Ibanag"},
["ibh"] = {"Bih"},
["ibl"] = {"Ibaloi"},
["ibm"] = {"Agoi"},
["ibn"] = {"Ibino"},
["ibr"] = {"Ibuoro"},
["ibu"] = {"Ibu"},
["iby"] = {"Ibani"},
["ica"] = {"Ede Ica"},
["ich"] = {"Etkywan"},
["icl"] = {"Icelandic Sign Language"},
["icr"] = {"Islander Creole English"},
["ida"] = {"Idakho-Isukha-Tiriki", "Luidakho-Luisukha-Lutirichi"},
["idb"] = {"Indo-Portuguese"},
["idc"] = {"Idon", "Ajiya"},
["idd"] = {"Ede Idaca"},
["ide"] = {"Idere"},
["idi"] = {"Idi"},
["idr"] = {"Indri"},
["ids"] = {"Idesa"},
["idt"] = {"Idaté"},
["idu"] = {"Idoma"},
["ifa"] = {"Amganad Ifugao"},
["ifb"] = {"Batad Ifugao", "Ayangan Ifugao"},
["ife"] = {"Ifè"},
["iff"] = {"Ifo"},
["ifk"] = {"Tuwali Ifugao"},
["ifm"] = {"Teke-Fuumu"},
["ifu"] = {"Mayoyao Ifugao"},
["ify"] = {"Keley-I Kallahan"},
["igb"] = {"Ebira"},
["ige"] = {"Igede"},
["igg"] = {"Igana"},
["igl"] = {"Igala"},
["igm"] = {"Kanggape"},
["ign"] = {"Ignaciano"},
["igo"] = {"Isebe"},
["igs"] = {"Interglossa"},
["igw"] = {"Igwe"},
["ihb"] = {"Iha Based Pidgin"},
["ihi"] = {"Ihievbe"},
["ihp"] = {"Iha"},
["ihw"] = {"Bidhawal"},
["iin"] = {"Thiin"},
["iir"] = {"Indo-Iranian languages"},
["ijc"] = {"Izon"},
["ije"] = {"Biseni"},
["ijj"] = {"Ede Ije"},
["ijn"] = {"Kalabari"},
["ijo"] = {"Ijo languages"},
["ijs"] = {"Southeast Ijo"},
["ike"] = {"Eastern Canadian Inuktitut"},
["ikh"] = {"Ikhin-Arokho"},
["iki"] = {"Iko"},
["ikk"] = {"Ika"},
["ikl"] = {"Ikulu"},
["iko"] = {"Olulumo-Ikom"},
["ikp"] = {"Ikpeshi"},
["ikr"] = {"Ikaranggal"},
["iks"] = {"Inuit Sign Language"},
["ikt"] = {"Inuinnaqtun", "Western Canadian Inuktitut"},
["ikv"] = {"Iku-Gora-Ankwa"},
["ikw"] = {"Ikwere"},
["ikx"] = {"Ik"},
["ikz"] = {"Ikizu"},
["ila"] = {"Ile Ape"},
["ilb"] = {"Ila"},
["ilg"] = {"Garig-Ilgar"},
["ili"] = {"Ili Turki"},
["ilk"] = {"Ilongot"},
["ilm"] = {"Iranun (Malaysia)"},
["ilo"] = {"Iloko"},
["ilp"] = {"Iranun (Philippines)"},
["ils"] = {"International Sign"},
["ilu"] = {"Ili'uun"},
["ilv"] = {"Ilue"},
["ima"] = {"Mala Malasar"},
["imi"] = {"Anamgura"},
["iml"] = {"Miluk"},
["imn"] = {"Imonda"},
["imo"] = {"Imbongu"},
["imr"] = {"Imroing"},
["ims"] = {"Marsian"},
["imt"] = {"Imotong"},
["imy"] = {"Milyan"},
["inb"] = {"Inga"},
["inc"] = {"Indic languages"},
["ine"] = {"Indo-European languages"},
["ing"] = {"Degexit'an"},
["inh"] = {"Ingush"},
["inj"] = {"Jungle Inga"},
["inl"] = {"Indonesian Sign Language"},
["inm"] = {"Minaean"},
["inn"] = {"Isinai"},
["ino"] = {"Inoke-Yate"},
["inp"] = {"Iñapari"},
["ins"] = {"Indian Sign Language"},
["int"] = {"Intha"},
["inz"] = {"Ineseño"},
["ior"] = {"Inor"},
["iou"] = {"Tuma-Irumu"},
["iow"] = {"Iowa-Oto"},
["ipi"] = {"Ipili"},
["ipo"] = {"Ipiko"},
["iqu"] = {"Iquito"},
["iqw"] = {"Ikwo"},
["ira"] = {"Iranian languages"},
["ire"] = {"Iresim"},
["irh"] = {"Irarutu"},
["iri"] = {"Rigwe", "Irigwe"},
["irk"] = {"Iraqw"},
["irn"] = {"Irántxe"},
["iro"] = {"Iroquoian languages"},
["irr"] = {"Ir"},
["iru"] = {"Irula"},
["irx"] = {"Kamberau"},
["iry"] = {"Iraya"},
["isa"] = {"Isabi"},
["isc"] = {"Isconahua"},
["isd"] = {"Isnag"},
["ise"] = {"Italian Sign Language"},
["isg"] = {"Irish Sign Language"},
["ish"] = {"Esan"},
["isi"] = {"Nkem-Nkum"},
["isk"] = {"Ishkashimi"},
["ism"] = {"Masimasi"},
["isn"] = {"Isanzu"},
["iso"] = {"Isoko"},
["isr"] = {"Israeli Sign Language"},
["ist"] = {"Istriot"},
["isu"] = {"Isu (Menchum Division)"},
["itb"] = {"Binongan Itneg"},
["itc"] = {"Italic languages"},
["itd"] = {"Southern Tidung"},
["ite"] = {"Itene"},
["iti"] = {"Inlaod Itneg"},
["itk"] = {"Judeo-Italian"},
["itl"] = {"Itelmen"},
["itm"] = {"Itu Mbon Uzo"},
["ito"] = {"Itonama"},
["itr"] = {"Iteri"},
["its"] = {"Isekiri"},
["itt"] = {"Maeng Itneg"},
["itv"] = {"Itawit"},
["itw"] = {"Ito"},
["itx"] = {"Itik"},
["ity"] = {"Moyadan Itneg"},
["itz"] = {"Itzá"},
["ium"] = {"Iu Mien"},
["ivb"] = {"Ibatan"},
["ivv"] = {"Ivatan"},
["iwk"] = {"I-Wak"},
["iwm"] = {"Iwam"},
["iwo"] = {"Iwur"},
["iws"] = {"Sepik Iwam"},
["ixc"] = {"Ixcatec"},
["ixl"] = {"Ixil"},
["iya"] = {"Iyayu"},
["iyo"] = {"Mesaka"},
["iyx"] = {"Yaka (Congo)"},
["izh"] = {"Ingrian"},
["izm"] = {"Kizamani"},
["izr"] = {"Izere"},
["izz"] = {"Izii"},
["jaa"] = {"Jamamadí"},
["jab"] = {"Hyam"},
["jac"] = {"Popti'", "Jakalteko"},
["jad"] = {"Jahanka"},
["jae"] = {"Yabem"},
["jaf"] = {"Jara"},
["jah"] = {"Jah Hut"},
["jaj"] = {"Zazao"},
["jak"] = {"Jakun"},
["jal"] = {"Yalahatan"},
["jam"] = {"Jamaican Creole English"},
["jan"] = {"Jandai"},
["jao"] = {"Yanyuwa"},
["jaq"] = {"Yaqay"},
["jas"] = {"New Caledonian Javanese"},
["jat"] = {"Jakati"},
["jau"] = {"Yaur"},
["jax"] = {"Jambi Malay"},
["jay"] = {"Yan-nhangu", "Nhangu"},
["jaz"] = {"Jawe"},
["jbe"] = {"Judeo-Berber"},
["jbi"] = {"Badjiri"},
["jbj"] = {"Arandai"},
["jbk"] = {"Barikewa"},
["jbm"] = {"Bijim"},
["jbn"] = {"Nafusi"},
["jbo"] = {"Lojban"},
["jbr"] = {"Jofotek-Bromnya"},
["jbt"] = {"Jabutí"},
["jbu"] = {"Jukun Takum"},
["jbw"] = {"Yawijibaya"},
["jcs"] = {"Jamaican Country Sign Language"},
["jct"] = {"Krymchak"},
["jda"] = {"Jad"},
["jdg"] = {"Jadgali"},
["jdt"] = {"Judeo-Tat"},
["jeb"] = {"Jebero"},
["jee"] = {"Jerung"},
["jeh"] = {"Jeh"},
["jei"] = {"Yei"},
["jek"] = {"Jeri Kuo"},
["jel"] = {"Yelmek"},
["jen"] = {"Dza"},
["jer"] = {"Jere"},
["jet"] = {"Manem"},
["jeu"] = {"Jonkor Bourmataguil"},
["jgb"] = {"Ngbee"},
["jge"] = {"Judeo-Georgian"},
["jgk"] = {"Gwak"},
["jgo"] = {"Ngomba"},
["jhi"] = {"Jehai"},
["jhs"] = {"Jhankot Sign Language"},
["jia"] = {"Jina"},
["jib"] = {"Jibu"},
["jic"] = {"Tol"},
["jid"] = {"Bu (Kaduna State)"},
["jie"] = {"Jilbe"},
["jig"] = {"Jingulu", "Djingili"},
["jih"] = {"sTodsde", "Shangzhai"},
["jii"] = {"Jiiddu"},
["jil"] = {"Jilim"},
["jim"] = {"Jimi (Cameroon)"},
["jio"] = {"Jiamao"},
["jiq"] = {"Guanyinqiao", "Lavrung"},
["jit"] = {"Jita"},
["jiu"] = {"Youle Jinuo"},
["jiv"] = {"Shuar"},
["jiy"] = {"Buyuan Jinuo"},
["jje"] = {"Jejueo"},
["jjr"] = {"Bankal"},
["jka"] = {"Kaera"},
["jkm"] = {"Mobwa Karen"},
["jko"] = {"Kubo"},
["jkp"] = {"Paku Karen"},
["jkr"] = {"Koro (India)"},
["jks"] = {"Amami Koniya Sign Language"},
["jku"] = {"Labir"},
["jle"] = {"Ngile"},
["jls"] = {"Jamaican Sign Language"},
["jma"] = {"Dima"},
["jmb"] = {"Zumbun"},
["jmc"] = {"Machame"},
["jmd"] = {"Yamdena"},
["jmi"] = {"Jimi (Nigeria)"},
["jml"] = {"Jumli"},
["jmn"] = {"Makuri Naga"},
["jmr"] = {"Kamara"},
["jms"] = {"Mashi (Nigeria)"},
["jmw"] = {"Mouwase"},
["jmx"] = {"Western Juxtlahuaca Mixtec"},
["jna"] = {"Jangshung"},
["jnd"] = {"Jandavra"},
["jng"] = {"Yangman"},
["jni"] = {"Janji"},
["jnj"] = {"Yemsa"},
["jnl"] = {"Rawat"},
["jns"] = {"Jaunsari"},
["job"] = {"Joba"},
["jod"] = {"Wojenaka"},
["jog"] = {"Jogi"},
["jor"] = {"Jorá"},
["jos"] = {"Jordanian Sign Language"},
["jow"] = {"Jowulu"},
["jpa"] = {"Jewish Palestinian Aramaic"},
["jpr"] = {"Judeo-Persian"},
["jpx"] = {"Japanese (family)"},
["jqr"] = {"Jaqaru"},
["jra"] = {"Jarai"},
["jrb"] = {"Judeo-Arabic"},
["jrr"] = {"Jiru"},
["jrt"] = {"Jakattoe"},
["jru"] = {"Japrería"},
["jsl"] = {"Japanese Sign Language"},
["jua"] = {"Júma"},
["jub"] = {"Wannu"},
["juc"] = {"Jurchen"},
["jud"] = {"Worodougou"},
["juh"] = {"Hõne"},
["jui"] = {"Ngadjuri"},
["juk"] = {"Wapan"},
["jul"] = {"Jirel"},
["jum"] = {"Jumjum"},
["jun"] = {"Juang"},
["juo"] = {"Jiba"},
["jup"] = {"Hupdë"},
["jur"] = {"Jurúna"},
["jus"] = {"Jumla Sign Language"},
["jut"] = {"Jutish"},
["juu"] = {"Ju"},
["juw"] = {"Wãpha"},
["juy"] = {"Juray"},
["jvd"] = {"Javindo"},
["jvn"] = {"Caribbean Javanese"},
["jwi"] = {"Jwira-Pepesa"},
["jya"] = {"Jiarong"},
["jye"] = {"Judeo-Yemeni Arabic"},
["jyy"] = {"Jaya"},
["kaa"] = {"Kara-Kalpak", "Karakalpak"},
["kab"] = {"Kabyle"},
["kac"] = {"Kachin", "Jingpho"},
["kad"] = {"Adara"},
["kae"] = {"Ketangalan"},
["kaf"] = {"Katso"},
["kag"] = {"Kajaman"},
["kah"] = {"Kara (Central African Republic)"},
["kai"] = {"Karekare"},
["kaj"] = {"Jju"},
["kak"] = {"Kalanguya", "Kayapa Kallahan"},
["kam"] = {"Kamba (Kenya)"},
["kao"] = {"Xaasongaxango"},
["kap"] = {"Bezhta"},
["kaq"] = {"Capanahua"},
["kar"] = {"Karen languages"},
["kav"] = {"Katukína"},
["kaw"] = {"Kawi"},
["kax"] = {"Kao"},
["kay"] = {"Kamayurá"},
["kba"] = {"Kalarko"},
["kbb"] = {"Kaxuiâna"},
["kbc"] = {"Kadiwéu"},
["kbd"] = {"Kabardian"},
["kbe"] = {"Kanju"},
["kbg"] = {"Khamba"},
["kbh"] = {"Camsá"},
["kbi"] = {"Kaptiau"},
["kbj"] = {"Kari"},
["kbk"] = {"Grass Koiari"},
["kbl"] = {"Kanembu"},
["kbm"] = {"Iwal"},
["kbn"] = {"Kare (Central African Republic)"},
["kbo"] = {"Keliko"},
["kbp"] = {"Kabiyè"},
["kbq"] = {"Kamano"},
["kbr"] = {"Kafa"},
["kbs"] = {"Kande"},
["kbt"] = {"Abadi"},
["kbu"] = {"Kabutra"},
["kbv"] = {"Dera (Indonesia)"},
["kbw"] = {"Kaiep"},
["kbx"] = {"Ap Ma"},
["kby"] = {"Manga Kanuri"},
["kbz"] = {"Duhwa"},
["kca"] = {"Khanty"},
["kcb"] = {"Kawacha"},
["kcc"] = {"Lubila"},
["kcd"] = {"Ngkâlmpw Kanum"},
["kce"] = {"Kaivi"},
["kcf"] = {"Ukaan"},
["kcg"] = {"Tyap"},
["kch"] = {"Vono"},
["kci"] = {"Kamantan"},
["kcj"] = {"Kobiana"},
["kck"] = {"Kalanga"},
["kcl"] = {"Kela (Papua New Guinea)", "Kala"},
["kcm"] = {"Gula (Central African Republic)"},
["kcn"] = {"Nubi"},
["kco"] = {"Kinalakna"},
["kcp"] = {"Kanga"},
["kcq"] = {"Kamo"},
["kcr"] = {"Katla"},
["kcs"] = {"Koenoem"},
["kct"] = {"Kaian"},
["kcu"] = {"Kami (Tanzania)"},
["kcv"] = {"Kete"},
["kcw"] = {"Kabwari"},
["kcx"] = {"Kachama-Ganjule"},
["kcy"] = {"Korandje"},
["kcz"] = {"Konongo"},
["kda"] = {"Worimi"},
["kdc"] = {"Kutu"},
["kdd"] = {"Yankunytjatjara"},
["kde"] = {"Makonde"},
["kdf"] = {"Mamusi"},
["kdg"] = {"Seba"},
["kdh"] = {"Tem"},
["kdi"] = {"Kumam"},
["kdj"] = {"Karamojong"},
["kdk"] = {"Numèè", "Kwényi"},
["kdl"] = {"Tsikimba"},
["kdm"] = {"Kagoma"},
["kdn"] = {"Kunda"},
["kdo"] = {"Kordofanian languages"},
["kdp"] = {"Kaningdon-Nindem"},
["kdq"] = {"Koch"},
["kdr"] = {"Karaim"},
["kdt"] = {"Kuy"},
["kdu"] = {"Kadaru"},
["kdw"] = {"Koneraw"},
["kdx"] = {"Kam"},
["kdy"] = {"Keder", "Keijar"},
["kdz"] = {"Kwaja"},
["kea"] = {"Kabuverdianu"},
["keb"] = {"Kélé"},
["kec"] = {"Keiga"},
["ked"] = {"Kerewe"},
["kee"] = {"Eastern Keres"},
["kef"] = {"Kpessi"},
["keg"] = {"Tese"},
["keh"] = {"Keak"},
["kei"] = {"Kei"},
["kej"] = {"Kadar"},
["kek"] = {"Kekchí"},
["kel"] = {"Kela (Democratic Republic of Congo)"},
["kem"] = {"Kemak"},
["ken"] = {"Kenyang"},
["keo"] = {"Kakwa"},
["kep"] = {"Kaikadi"},
["keq"] = {"Kamar"},
["ker"] = {"Kera"},
["kes"] = {"Kugbo"},
["ket"] = {"Ket"},
["keu"] = {"Akebu"},
["kev"] = {"Kanikkaran"},
["kew"] = {"West Kewa"},
["kex"] = {"Kukna"},
["key"] = {"Kupia"},
["kez"] = {"Kukele"},
["kfa"] = {"Kodava"},
["kfb"] = {"Northwestern Kolami"},
["kfc"] = {"Konda-Dora"},
["kfd"] = {"Korra Koraga"},
["kfe"] = {"Kota (India)"},
["kff"] = {"Koya"},
["kfg"] = {"Kudiya"},
["kfh"] = {"Kurichiya"},
["kfi"] = {"Kannada Kurumba"},
["kfj"] = {"Kemiehua"},
["kfk"] = {"Kinnauri"},
["kfl"] = {"Kung"},
["kfm"] = {"Khunsari"},
["kfn"] = {"Kuk"},
["kfo"] = {"Koro (Côte d'Ivoire)"},
["kfp"] = {"Korwa"},
["kfq"] = {"Korku"},
["kfr"] = {"Kachhi", "Kutchi"},
["kfs"] = {"Bilaspuri"},
["kft"] = {"Kanjari"},
["kfu"] = {"Katkari"},
["kfv"] = {"Kurmukar"},
["kfw"] = {"Kharam Naga"},
["kfx"] = {"Kullu Pahari"},
["kfy"] = {"Kumaoni"},
["kfz"] = {"Koromfé"},
["kga"] = {"Koyaga"},
["kgb"] = {"Kawe"},
["kge"] = {"Komering"},
["kgf"] = {"Kube"},
["kgg"] = {"Kusunda"},
["kgi"] = {"Selangor Sign Language"},
["kgj"] = {"Gamale Kham"},
["kgk"] = {"Kaiwá"},
["kgl"] = {"Kunggari"},
["kgn"] = {"Karingani"},
["kgo"] = {"Krongo"},
["kgp"] = {"Kaingang"},
["kgq"] = {"Kamoro"},
["kgr"] = {"Abun"},
["kgs"] = {"Kumbainggar"},
["kgt"] = {"Somyev"},
["kgu"] = {"Kobol"},
["kgv"] = {"Karas"},
["kgw"] = {"Karon Dori"},
["kgx"] = {"Kamaru"},
["kgy"] = {"Kyerung"},
["kha"] = {"Khasi"},
["khb"] = {"Lü"},
["khc"] = {"Tukang Besi North"},
["khd"] = {"Bädi Kanum"},
["khe"] = {"Korowai"},
["khf"] = {"Khuen"},
["khg"] = {"Khams Tibetan"},
["khh"] = {"Kehu"},
["khi"] = {"Khoisan languages"},
["khj"] = {"Kuturmi"},
["khk"] = {"Halh Mongolian"},
["khl"] = {"Lusi"},
["khn"] = {"Khandesi"},
["kho"] = {"Khotanese", "Sakan"},
["khp"] = {"Kapori", "Kapauri"},
["khq"] = {"Koyra Chiini Songhay"},
["khr"] = {"Kharia"},
["khs"] = {"Kasua"},
["kht"] = {"Khamti"},
["khu"] = {"Nkhumbi"},
["khv"] = {"Khvarshi"},
["khw"] = {"Khowar"},
["khx"] = {"Kanu"},
["khy"] = {"Kele (Democratic Republic of Congo)"},
["khz"] = {"Keapara"},
["kia"] = {"Kim"},
["kib"] = {"Koalib"},
["kic"] = {"Kickapoo"},
["kid"] = {"Koshin"},
["kie"] = {"Kibet"},
["kif"] = {"Eastern Parbate Kham"},
["kig"] = {"Kimaama", "Kimaghima"},
["kih"] = {"Kilmeri"},
["kii"] = {"Kitsai"},
["kij"] = {"Kilivila"},
["kil"] = {"Kariya"},
["kim"] = {"Karagas"},
["kio"] = {"Kiowa"},
["kip"] = {"Sheshi Kham"},
["kiq"] = {"Kosadle", "Kosare"},
["kis"] = {"Kis"},
["kit"] = {"Agob"},
["kiu"] = {"Kirmanjki (individual language)"},
["kiv"] = {"Kimbu"},
["kiw"] = {"Northeast Kiwai"},
["kix"] = {"Khiamniungan Naga"},
["kiy"] = {"Kirikiri"},
["kiz"] = {"Kisi"},
["kja"] = {"Mlap"},
["kjb"] = {"Q'anjob'al", "Kanjobal"},
["kjc"] = {"Coastal Konjo"},
["kjd"] = {"Southern Kiwai"},
["kje"] = {"Kisar"},
["kjg"] = {"Khmu"},
["kjh"] = {"Khakas"},
["kji"] = {"Zabana"},
["kjj"] = {"Khinalugh"},
["kjk"] = {"Highland Konjo"},
["kjl"] = {"Western Parbate Kham"},
["kjm"] = {"Kháng"},
["kjn"] = {"Kunjen"},
["kjo"] = {"Harijan Kinnauri"},
["kjp"] = {"Pwo Eastern Karen"},
["kjq"] = {"Western Keres"},
["kjr"] = {"Kurudu"},
["kjs"] = {"East Kewa"},
["kjt"] = {"Phrae Pwo Karen"},
["kju"] = {"Kashaya"},
["kjv"] = {"Kaikavian Literary Language"},
["kjx"] = {"Ramopa"},
["kjy"] = {"Erave"},
["kjz"] = {"Bumthangkha"},
["kka"] = {"Kakanda"},
["kkb"] = {"Kwerisa"},
["kkc"] = {"Odoodee"},
["kkd"] = {"Kinuku"},
["kke"] = {"Kakabe"},
["kkf"] = {"Kalaktang Monpa"},
["kkg"] = {"Mabaka Valley Kalinga"},
["kkh"] = {"Khün"},
["kki"] = {"Kagulu"},
["kkj"] = {"Kako"},
["kkk"] = {"Kokota"},
["kkl"] = {"Kosarek Yale"},
["kkm"] = {"Kiong"},
["kkn"] = {"Kon Keu"},
["kko"] = {"Karko"},
["kkp"] = {"Gugubera", "Koko-Bera"},
["kkq"] = {"Kaeku"},
["kkr"] = {"Kir-Balar"},
["kks"] = {"Giiwo"},
["kkt"] = {"Koi"},
["kku"] = {"Tumi"},
["kkv"] = {"Kangean"},
["kkw"] = {"Teke-Kukuya"},
["kkx"] = {"Kohin"},
["kky"] = {"Guugu Yimidhirr", "Guguyimidjir"},
["kkz"] = {"Kaska"},
["kla"] = {"Klamath-Modoc"},
["klb"] = {"Kiliwa"},
["klc"] = {"Kolbila"},
["kld"] = {"Gamilaraay"},
["kle"] = {"Kulung (Nepal)"},
["klf"] = {"Kendeje"},
["klg"] = {"Tagakaulo"},
["klh"] = {"Weliki"},
["kli"] = {"Kalumpang"},
["klj"] = {"Khalaj"},
["klk"] = {"Kono (Nigeria)"},
["kll"] = {"Kagan Kalagan"},
["klm"] = {"Migum"},
["kln"] = {"Kalenjin"},
["klo"] = {"Kapya"},
["klp"] = {"Kamasa"},
["klq"] = {"Rumu"},
["klr"] = {"Khaling"},
["kls"] = {"Kalasha"},
["klt"] = {"Nukna"},
["klu"] = {"Klao"},
["klv"] = {"Maskelynes"},
["klw"] = {"Tado", "Lindu"},
["klx"] = {"Koluwawa"},
["kly"] = {"Kalao"},
["klz"] = {"Kabola"},
["kma"] = {"Konni"},
["kmb"] = {"Kimbundu"},
["kmc"] = {"Southern Dong"},
["kmd"] = {"Majukayang Kalinga"},
["kme"] = {"Bakole"},
["kmf"] = {"Kare (Papua New Guinea)"},
["kmg"] = {"Kâte"},
["kmh"] = {"Kalam"},
["kmi"] = {"Kami (Nigeria)"},
["kmj"] = {"Kumarbhag Paharia"},
["kmk"] = {"Limos Kalinga"},
["kml"] = {"Tanudan Kalinga"},
["kmm"] = {"Kom (India)"},
["kmn"] = {"Awtuw"},
["kmo"] = {"Kwoma"},
["kmp"] = {"Gimme"},
["kmq"] = {"Kwama"},
["kmr"] = {"Northern Kurdish"},
["kms"] = {"Kamasau"},
["kmt"] = {"Kemtuik"},
["kmu"] = {"Kanite"},
["kmv"] = {"Karipúna Creole French"},
["kmw"] = {"Komo (Democratic Republic of Congo)"},
["kmx"] = {"Waboda"},
["kmy"] = {"Koma"},
["kmz"] = {"Khorasani Turkish"},
["kna"] = {"Dera (Nigeria)"},
["knb"] = {"Lubuagan Kalinga"},
["knc"] = {"Central Kanuri"},
["knd"] = {"Konda"},
["kne"] = {"Kankanaey"},
["knf"] = {"Mankanya"},
["kng"] = {"Koongo"},
["kni"] = {"Kanufi"},
["knj"] = {"Western Kanjobal"},
["knk"] = {"Kuranko"},
["knl"] = {"Keninjal"},
["knm"] = {"Kanamarí"},
["knn"] = {"Konkani (individual language)"},
["kno"] = {"Kono (Sierra Leone)"},
["knp"] = {"Kwanja"},
["knq"] = {"Kintaq"},
["knr"] = {"Kaningra"},
["kns"] = {"Kensiu"},
["knt"] = {"Panoan Katukína"},
["knu"] = {"Kono (Guinea)"},
["knv"] = {"Tabo"},
["knw"] = {"Kung-Ekoka"},
["knx"] = {"Kendayan", "Salako"},
["kny"] = {"Kanyok"},
["knz"] = {"Kalamsé"},
["koa"] = {"Konomala"},
["koc"] = {"Kpati"},
["kod"] = {"Kodi"},
["koe"] = {"Kacipo-Bale Suri"},
["kof"] = {"Kubi"},
["kog"] = {"Cogui", "Kogi"},
["koh"] = {"Koyo"},
["koi"] = {"Komi-Permyak"},
["kok"] = {"Konkani (macrolanguage)"},
["kol"] = {"Kol (Papua New Guinea)"},
["koo"] = {"Konzo"},
["kop"] = {"Waube"},
["koq"] = {"Kota (Gabon)"},
["kos"] = {"Kosraean"},
["kot"] = {"Lagwan"},
["kou"] = {"Koke"},
["kov"] = {"Kudu-Camo"},
["kow"] = {"Kugama"},
["koy"] = {"Koyukon"},
["koz"] = {"Korak"},
["kpa"] = {"Kutto"},
["kpb"] = {"Mullu Kurumba"},
["kpc"] = {"Curripaco"},
["kpd"] = {"Koba"},
["kpe"] = {"Kpelle"},
["kpf"] = {"Komba"},
["kpg"] = {"Kapingamarangi"},
["kph"] = {"Kplang"},
["kpi"] = {"Kofei"},
["kpj"] = {"Karajá"},
["kpk"] = {"Kpan"},
["kpl"] = {"Kpala"},
["kpm"] = {"Koho"},
["kpn"] = {"Kepkiriwát"},
["kpo"] = {"Ikposo"},
["kpq"] = {"Korupun-Sela"},
["kpr"] = {"Korafe-Yegha"},
["kps"] = {"Tehit"},
["kpt"] = {"Karata"},
["kpu"] = {"Kafoa"},
["kpv"] = {"Komi-Zyrian"},
["kpw"] = {"Kobon"},
["kpx"] = {"Mountain Koiali"},
["kpy"] = {"Koryak"},
["kpz"] = {"Kupsabiny"},
["kqa"] = {"Mum"},
["kqb"] = {"Kovai"},
["kqc"] = {"Doromu-Koki"},
["kqd"] = {"Koy Sanjaq Surat"},
["kqe"] = {"Kalagan"},
["kqf"] = {"Kakabai"},
["kqg"] = {"Khe"},
["kqh"] = {"Kisankasa"},
["kqi"] = {"Koitabu"},
["kqj"] = {"Koromira"},
["kqk"] = {"Kotafon Gbe"},
["kql"] = {"Kyenele"},
["kqm"] = {"Khisa"},
["kqn"] = {"Kaonde"},
["kqo"] = {"Eastern Krahn"},
["kqp"] = {"Kimré"},
["kqq"] = {"Krenak"},
["kqr"] = {"Kimaragang"},
["kqs"] = {"Northern Kissi"},
["kqt"] = {"Klias River Kadazan"},
["kqu"] = {"Seroa"},
["kqv"] = {"Okolod"},
["kqw"] = {"Kandas"},
["kqx"] = {"Mser"},
["kqy"] = {"Koorete"},
["kqz"] = {"Korana"},
["kra"] = {"Kumhali"},
["krb"] = {"Karkin"},
["krc"] = {"Karachay-Balkar"},
["krd"] = {"Kairui-Midiki"},
["kre"] = {"Panará"},
["krf"] = {"Koro (Vanuatu)"},
["krh"] = {"Kurama"},
["kri"] = {"Krio"},
["krj"] = {"Kinaray-A"},
["krk"] = {"Kerek"},
["krl"] = {"Karelian"},
["krn"] = {"Sapo"},
["kro"] = {"Kru languages"},
["krp"] = {"Durop"},
["krr"] = {"Krung"},
["krs"] = {"Gbaya (Sudan)"},
["krt"] = {"Tumari Kanuri"},
["kru"] = {"Kurukh"},
["krv"] = {"Kavet"},
["krw"] = {"Western Krahn"},
["krx"] = {"Karon"},
["kry"] = {"Kryts"},
["krz"] = {"Sota Kanum"},
["ksb"] = {"Shambala"},
["ksc"] = {"Southern Kalinga"},
["ksd"] = {"Kuanua"},
["kse"] = {"Kuni"},
["ksf"] = {"Bafia"},
["ksg"] = {"Kusaghe"},
["ksh"] = {"Kölsch"},
["ksi"] = {"Krisa", "I'saka"},
["ksj"] = {"Uare"},
["ksk"] = {"Kansa"},
["ksl"] = {"Kumalu"},
["ksm"] = {"Kumba"},
["ksn"] = {"Kasiguranin"},
["kso"] = {"Kofa"},
["ksp"] = {"Kaba"},
["ksq"] = {"Kwaami"},
["ksr"] = {"Borong"},
["kss"] = {"Southern Kisi"},
["kst"] = {"Winyé"},
["ksu"] = {"Khamyang"},
["ksv"] = {"Kusu"},
["ksw"] = {"S'gaw Karen"},
["ksx"] = {"Kedang"},
["ksy"] = {"Kharia Thar"},
["ksz"] = {"Kodaku"},
["kta"] = {"Katua"},
["ktb"] = {"Kambaata"},
["ktc"] = {"Kholok"},
["ktd"] = {"Kokata", "Kukatha"},
["kte"] = {"Nubri"},
["ktf"] = {"Kwami"},
["ktg"] = {"Kalkutung"},
["kth"] = {"Karanga"},
["kti"] = {"North Muyu"},
["ktj"] = {"Plapo Krumen"},
["ktk"] = {"Kaniet"},
["ktl"] = {"Koroshi"},
["ktm"] = {"Kurti"},
["ktn"] = {"Karitiâna"},
["kto"] = {"Kuot"},
["ktp"] = {"Kaduo"},
["ktq"] = {"Katabaga"},
["kts"] = {"South Muyu"},
["ktt"] = {"Ketum"},
["ktu"] = {"Kituba (Democratic Republic of Congo)"},
["ktv"] = {"Eastern Katu"},
["ktw"] = {"Kato"},
["ktx"] = {"Kaxararí"},
["kty"] = {"Kango (Bas-Uélé District)"},
["ktz"] = {"Juǀʼhoan", "Juǀʼhoansi"},
["kub"] = {"Kutep"},
["kuc"] = {"Kwinsu"},
["kud"] = {"'Auhelawa"},
["kue"] = {"Kuman (Papua New Guinea)"},
["kuf"] = {"Western Katu"},
["kug"] = {"Kupa"},
["kuh"] = {"Kushi"},
["kui"] = {"Kuikúro-Kalapálo", "Kalapalo"},
["kuj"] = {"Kuria"},
["kuk"] = {"Kepo'"},
["kul"] = {"Kulere"},
["kum"] = {"Kumyk"},
["kun"] = {"Kunama"},
["kuo"] = {"Kumukio"},
["kup"] = {"Kunimaipa"},
["kuq"] = {"Karipuna"},
["kus"] = {"Kusaal"},
["kut"] = {"Kutenai"},
["kuu"] = {"Upper Kuskokwim"},
["kuv"] = {"Kur"},
["kuw"] = {"Kpagua"},
["kux"] = {"Kukatja"},
["kuy"] = {"Kuuku-Ya'u"},
["kuz"] = {"Kunza"},
["kva"] = {"Bagvalal"},
["kvb"] = {"Kubu"},
["kvc"] = {"Kove"},
["kvd"] = {"Kui (Indonesia)"},
["kve"] = {"Kalabakan"},
["kvf"] = {"Kabalai"},
["kvg"] = {"Kuni-Boazi"},
["kvh"] = {"Komodo"},
["kvi"] = {"Kwang"},
["kvj"] = {"Psikye"},
["kvk"] = {"Korean Sign Language"},
["kvl"] = {"Kayaw"},
["kvm"] = {"Kendem"},
["kvn"] = {"Border Kuna"},
["kvo"] = {"Dobel"},
["kvp"] = {"Kompane"},
["kvq"] = {"Geba Karen"},
["kvr"] = {"Kerinci"},
["kvt"] = {"Lahta Karen", "Lahta"},
["kvu"] = {"Yinbaw Karen"},
["kvv"] = {"Kola"},
["kvw"] = {"Wersing"},
["kvx"] = {"Parkari Koli"},
["kvy"] = {"Yintale Karen", "Yintale"},
["kvz"] = {"Tsakwambo", "Tsaukambo"},
["kwa"] = {"Dâw"},
["kwb"] = {"Kwa"},
["kwc"] = {"Likwala"},
["kwd"] = {"Kwaio"},
["kwe"] = {"Kwerba"},
["kwf"] = {"Kwara'ae"},
["kwg"] = {"Sara Kaba Deme"},
["kwh"] = {"Kowiai"},
["kwi"] = {"Awa-Cuaiquer"},
["kwj"] = {"Kwanga"},
["kwk"] = {"Kwakiutl"},
["kwl"] = {"Kofyar"},
["kwm"] = {"Kwambi"},
["kwn"] = {"Kwangali"},
["kwo"] = {"Kwomtari"},
["kwp"] = {"Kodia"},
["kwr"] = {"Kwer"},
["kws"] = {"Kwese"},
["kwt"] = {"Kwesten"},
["kwu"] = {"Kwakum"},
["kwv"] = {"Sara Kaba Náà"},
["kww"] = {"Kwinti"},
["kwx"] = {"Khirwar"},
["kwy"] = {"San Salvador Kongo"},
["kwz"] = {"Kwadi"},
["kxa"] = {"Kairiru"},
["kxb"] = {"Krobu"},
["kxc"] = {"Konso", "Khonso"},
["kxd"] = {"Brunei"},
["kxf"] = {"Manumanaw Karen", "Manumanaw"},
["kxh"] = {"Karo (Ethiopia)"},
["kxi"] = {"Keningau Murut"},
["kxj"] = {"Kulfa"},
["kxk"] = {"Zayein Karen"},
["kxm"] = {"Northern Khmer"},
["kxn"] = {"Kanowit-Tanjong Melanau"},
["kxo"] = {"Kanoé"},
["kxp"] = {"Wadiyara Koli"},
["kxq"] = {"Smärky Kanum"},
["kxr"] = {"Koro (Papua New Guinea)"},
["kxs"] = {"Kangjia"},
["kxt"] = {"Koiwat"},
["kxv"] = {"Kuvi"},
["kxw"] = {"Konai"},
["kxx"] = {"Likuba"},
["kxy"] = {"Kayong"},
["kxz"] = {"Kerewo"},
["kya"] = {"Kwaya"},
["kyb"] = {"Butbut Kalinga"},
["kyc"] = {"Kyaka"},
["kyd"] = {"Karey"},
["kye"] = {"Krache"},
["kyf"] = {"Kouya"},
["kyg"] = {"Keyagana"},
["kyh"] = {"Karok"},
["kyi"] = {"Kiput"},
["kyj"] = {"Karao"},
["kyk"] = {"Kamayo"},
["kyl"] = {"Kalapuya"},
["kym"] = {"Kpatili"},
["kyn"] = {"Northern Binukidnon"},
["kyo"] = {"Kelon"},
["kyp"] = {"Kang"},
["kyq"] = {"Kenga"},
["kyr"] = {"Kuruáya"},
["kys"] = {"Baram Kayan"},
["kyt"] = {"Kayagar"},
["kyu"] = {"Western Kayah"},
["kyv"] = {"Kayort"},
["kyw"] = {"Kudmali"},
["kyx"] = {"Rapoisi"},
["kyy"] = {"Kambaira"},
["kyz"] = {"Kayabí"},
["kza"] = {"Western Karaboro"},
["kzb"] = {"Kaibobo"},
["kzc"] = {"Bondoukou Kulango"},
["kzd"] = {"Kadai"},
["kze"] = {"Kosena"},
["kzf"] = {"Da'a Kaili"},
["kzg"] = {"Kikai"},
["kzi"] = {"Kelabit"},
["kzk"] = {"Kazukuru"},
["kzl"] = {"Kayeli"},
["kzm"] = {"Kais"},
["kzn"] = {"Kokola"},
["kzo"] = {"Kaningi"},
["kzp"] = {"Kaidipang"},
["kzq"] = {"Kaike"},
["kzr"] = {"Karang"},
["kzs"] = {"Sugut Dusun"},
["kzu"] = {"Kayupulau"},
["kzv"] = {"Komyandaret"},
["kzw"] = {"Karirí-Xocó"},
["kzx"] = {"Kamarian"},
["kzy"] = {"Kango (Tshopo District)"},
["kzz"] = {"Kalabra"},
["laa"] = {"Southern Subanen"},
["lab"] = {"Linear A"},
["lac"] = {"Lacandon"},
["lad"] = {"Ladino"},
["lae"] = {"Pattani"},
["laf"] = {"Lafofa"},
["lag"] = {"Rangi"},
["lah"] = {"Lahnda"},
["lai"] = {"Lambya"},
["laj"] = {"Lango (Uganda)"},
["lal"] = {"Lalia"},
["lam"] = {"Lamba"},
["lan"] = {"Laru"},
["lap"] = {"Laka (Chad)"},
["laq"] = {"Qabiao"},
["lar"] = {"Larteh"},
["las"] = {"Lama (Togo)"},
["lau"] = {"Laba"},
["law"] = {"Lauje"},
["lax"] = {"Tiwa"},
["lay"] = {"Lama Bai"},
["laz"] = {"Aribwatsa"},
["lbb"] = {"Label"},
["lbc"] = {"Lakkia"},
["lbe"] = {"Lak"},
["lbf"] = {"Tinani"},
["lbg"] = {"Laopang"},
["lbi"] = {"La'bi"},
["lbj"] = {"Ladakhi"},
["lbk"] = {"Central Bontok"},
["lbl"] = {"Libon Bikol"},
["lbm"] = {"Lodhi"},
["lbn"] = {"Rmeet"},
["lbo"] = {"Laven"},
["lbq"] = {"Wampar"},
["lbr"] = {"Lohorung"},
["lbs"] = {"Libyan Sign Language"},
["lbt"] = {"Lachi"},
["lbu"] = {"Labu"},
["lbv"] = {"Lavatbura-Lamusong"},
["lbw"] = {"Tolaki"},
["lbx"] = {"Lawangan"},
["lby"] = {"Lamalama", "Lamu-Lamu"},
["lbz"] = {"Lardil"},
["lcc"] = {"Legenyem"},
["lcd"] = {"Lola"},
["lce"] = {"Loncong", "Sekak"},
["lcf"] = {"Lubu"},
["lch"] = {"Luchazi"},
["lcl"] = {"Lisela"},
["lcm"] = {"Tungag"},
["lcp"] = {"Western Lawa"},
["lcq"] = {"Luhu"},
["lcs"] = {"Lisabata-Nuniali"},
["lda"] = {"Kla-Dan"},
["ldb"] = {"Dũya"},
["ldd"] = {"Luri"},
["ldg"] = {"Lenyima"},
["ldh"] = {"Lamja-Dengsa-Tola"},
["ldi"] = {"Laari"},
["ldj"] = {"Lemoro"},
["ldk"] = {"Leelau"},
["ldl"] = {"Kaan"},
["ldm"] = {"Landoma"},
["ldn"] = {"Láadan"},
["ldo"] = {"Loo"},
["ldp"] = {"Tso"},
["ldq"] = {"Lufu"},
["lea"] = {"Lega-Shabunda"},
["leb"] = {"Lala-Bisa"},
["lec"] = {"Leco"},
["led"] = {"Lendu"},
["lee"] = {"Lyélé"},
["lef"] = {"Lelemi"},
["leh"] = {"Lenje"},
["lei"] = {"Lemio"},
["lej"] = {"Lengola"},
["lek"] = {"Leipon"},
["lel"] = {"Lele (Democratic Republic of Congo)"},
["lem"] = {"Nomaande"},
["len"] = {"Lenca"},
["leo"] = {"Leti (Cameroon)"},
["lep"] = {"Lepcha"},
["leq"] = {"Lembena"},
["ler"] = {"Lenkau"},
["les"] = {"Lese"},
["let"] = {"Lesing-Gelimi", "Amio-Gelimi"},
["leu"] = {"Kara (Papua New Guinea)"},
["lev"] = {"Lamma"},
["lew"] = {"Ledo Kaili"},
["lex"] = {"Luang"},
["ley"] = {"Lemolang"},
["lez"] = {"Lezghian"},
["lfa"] = {"Lefa"},
["lfn"] = {"Lingua Franca Nova"},
["lga"] = {"Lungga"},
["lgb"] = {"Laghu"},
["lgg"] = {"Lugbara"},
["lgh"] = {"Laghuu"},
["lgi"] = {"Lengilu"},
["lgk"] = {"Lingarak", "Neverver"},
["lgl"] = {"Wala"},
["lgm"] = {"Lega-Mwenga"},
["lgn"] = {"T'apo", "Opuuo"},
["lgo"] = {"Lango (South Sudan)"},
["lgq"] = {"Logba"},
["lgr"] = {"Lengo"},
["lgs"] = {"Guinea-Bissau Sign Language", "Língua Gestual Guineense"},
["lgt"] = {"Pahi"},
["lgu"] = {"Longgu"},
["lgz"] = {"Ligenza"},
["lha"] = {"Laha (Viet Nam)"},
["lhh"] = {"Laha (Indonesia)"},
["lhi"] = {"Lahu Shi"},
["lhl"] = {"Lahul Lohar"},
["lhm"] = {"Lhomi"},
["lhn"] = {"Lahanan"},
["lhp"] = {"Lhokpu"},
["lhs"] = {"Mlahsö"},
["lht"] = {"Lo-Toga"},
["lhu"] = {"Lahu"},
["lia"] = {"West-Central Limba"},
["lib"] = {"Likum"},
["lic"] = {"Hlai"},
["lid"] = {"Nyindrou"},
["lie"] = {"Likila"},
["lif"] = {"Limbu"},
["lig"] = {"Ligbi"},
["lih"] = {"Lihir"},
["lij"] = {"Ligurian"},
["lik"] = {"Lika"},
["lil"] = {"Lillooet"},
["lio"] = {"Liki"},
["lip"] = {"Sekpele"},
["liq"] = {"Libido"},
["lir"] = {"Liberian English"},
["lis"] = {"Lisu"},
["liu"] = {"Logorik"},
["liv"] = {"Liv"},
["liw"] = {"Col"},
["lix"] = {"Liabuku"},
["liy"] = {"Banda-Bambari"},
["liz"] = {"Libinza"},
["lja"] = {"Golpa"},
["lje"] = {"Rampi"},
["lji"] = {"Laiyolo"},
["ljl"] = {"Li'o"},
["ljp"] = {"Lampung Api"},
["ljw"] = {"Yirandali"},
["ljx"] = {"Yuru"},
["lka"] = {"Lakalei"},
["lkb"] = {"Kabras", "Lukabaras"},
["lkc"] = {"Kucong"},
["lkd"] = {"Lakondê"},
["lke"] = {"Kenyi"},
["lkh"] = {"Lakha"},
["lki"] = {"Laki"},
["lkj"] = {"Remun"},
["lkl"] = {"Laeko-Libuat"},
["lkm"] = {"Kalaamaya"},
["lkn"] = {"Lakon", "Vure"},
["lko"] = {"Khayo", "Olukhayo"},
["lkr"] = {"Päri"},
["lks"] = {"Kisa", "Olushisa"},
["lkt"] = {"Lakota"},
["lku"] = {"Kungkari"},
["lky"] = {"Lokoya"},
["lla"] = {"Lala-Roba"},
["llb"] = {"Lolo"},
["llc"] = {"Lele (Guinea)"},
["lld"] = {"Ladin"},
["lle"] = {"Lele (Papua New Guinea)"},
["llf"] = {"Hermit"},
["llg"] = {"Lole"},
["llh"] = {"Lamu"},
["lli"] = {"Teke-Laali"},
["llj"] = {"Ladji Ladji"},
["llk"] = {"Lelak"},
["lll"] = {"Lilau"},
["llm"] = {"Lasalimu"},
["lln"] = {"Lele (Chad)"},
["llp"] = {"North Efate"},
["llq"] = {"Lolak"},
["lls"] = {"Lithuanian Sign Language"},
["llu"] = {"Lau"},
["llx"] = {"Lauan"},
["lma"] = {"East Limba"},
["lmb"] = {"Merei"},
["lmc"] = {"Limilngan"},
["lmd"] = {"Lumun"},
["lme"] = {"Pévé"},
["lmf"] = {"South Lembata"},
["lmg"] = {"Lamogai"},
["lmh"] = {"Lambichhong"},
["lmi"] = {"Lombi"},
["lmj"] = {"West Lembata"},
["lmk"] = {"Lamkang"},
["lml"] = {"Hano"},
["lmn"] = {"Lambadi"},
["lmo"] = {"Lombard"},
["lmp"] = {"Limbum"},
["lmq"] = {"Lamatuka"},
["lmr"] = {"Lamalera"},
["lmu"] = {"Lamenu"},
["lmv"] = {"Lomaiviti"},
["lmw"] = {"Lake Miwok"},
["lmx"] = {"Laimbue"},
["lmy"] = {"Lamboya"},
["lna"] = {"Langbashe"},
["lnb"] = {"Mbalanhu"},
["lnd"] = {"Lundayeh", "Lun Bawang"},
["lng"] = {"Langobardic"},
["lnh"] = {"Lanoh"},
["lni"] = {"Daantanai'"},
["lnj"] = {"Leningitij"},
["lnl"] = {"South Central Banda"},
["lnm"] = {"Langam"},
["lnn"] = {"Lorediakarkar"},
["lns"] = {"Lamnso'"},
["lnu"] = {"Longuda"},
["lnw"] = {"Lanima"},
["lnz"] = {"Lonzo"},
["loa"] = {"Loloda"},
["lob"] = {"Lobi"},
["loc"] = {"Inonhan"},
["loe"] = {"Saluan"},
["lof"] = {"Logol"},
["log"] = {"Logo"},
["loh"] = {"Laarim", "Narim"},
["loi"] = {"Loma (Côte d'Ivoire)"},
["loj"] = {"Lou"},
["lok"] = {"Loko"},
["lol"] = {"Mongo"},
["lom"] = {"Loma (Liberia)"},
["lon"] = {"Malawi Lomwe"},
["loo"] = {"Lombo"},
["lop"] = {"Lopa"},
["loq"] = {"Lobala"},
["lor"] = {"Téén"},
["los"] = {"Loniu"},
["lot"] = {"Otuho"},
["lou"] = {"Louisiana Creole"},
["lov"] = {"Lopi"},
["low"] = {"Tampias Lobu"},
["lox"] = {"Loun"},
["loy"] = {"Loke"},
["loz"] = {"Lozi"},
["lpa"] = {"Lelepa"},
["lpe"] = {"Lepki"},
["lpn"] = {"Long Phuri Naga"},
["lpo"] = {"Lipo"},
["lpx"] = {"Lopit"},
["lqr"] = {"Logir"},
["lra"] = {"Rara Bakati'"},
["lrc"] = {"Northern Luri"},
["lre"] = {"Laurentian"},
["lrg"] = {"Laragia"},
["lri"] = {"Marachi", "Olumarachi"},
["lrk"] = {"Loarki"},
["lrl"] = {"Lari"},
["lrm"] = {"Marama", "Olumarama"},
["lrn"] = {"Lorang"},
["lro"] = {"Laro"},
["lrr"] = {"Southern Yamphu"},
["lrt"] = {"Larantuka Malay"},
["lrv"] = {"Larevat"},
["lrz"] = {"Lemerig"},
["lsa"] = {"Lasgerdi"},
["lsb"] = {"Burundian Sign Language", "Langue des Signes Burundaise"},
["lsc"] = {"Albarradas Sign Language", "Lengua de señas Albarradas"},
["lsd"] = {"Lishana Deni"},
["lse"] = {"Lusengo"},
["lsh"] = {"Lish"},
["lsi"] = {"Lashi"},
["lsl"] = {"Latvian Sign Language"},
["lsm"] = {"Saamia", "Olusamia"},
["lsn"] = {"Tibetan Sign Language"},
["lso"] = {"Laos Sign Language"},
["lsp"] = {"Panamanian Sign Language", "Lengua de Señas Panameñas"},
["lsr"] = {"Aruop"},
["lss"] = {"Lasi"},
["lst"] = {"Trinidad and Tobago Sign Language"},
["lsv"] = {"Sivia Sign Language"},
["lsw"] = {"Seychelles Sign Language", "Lalang Siny Seselwa", "Langue des Signes Seychelloise"},
["lsy"] = {"Mauritian Sign Language"},
["ltc"] = {"Late Middle Chinese"},
["ltg"] = {"Latgalian"},
["lth"] = {"Thur"},
["lti"] = {"Leti (Indonesia)"},
["ltn"] = {"Latundê"},
["lto"] = {"Tsotso", "Olutsotso"},
["lts"] = {"Tachoni", "Lutachoni"},
["ltu"] = {"Latu"},
["lua"] = {"Luba-Lulua"},
["luc"] = {"Aringa"},
["lud"] = {"Ludian"},
["lue"] = {"Luvale"},
["luf"] = {"Laua"},
["lui"] = {"Luiseno"},
["luj"] = {"Luna"},
["luk"] = {"Lunanakha"},
["lul"] = {"Olu'bo"},
["lum"] = {"Luimbi"},
["lun"] = {"Lunda"},
["luo"] = {"Luo (Kenya and Tanzania)", "Dholuo"},
["lup"] = {"Lumbu"},
["luq"] = {"Lucumi"},
["lur"] = {"Laura"},
["lus"] = {"Lushai"},
["lut"] = {"Lushootseed"},
["luu"] = {"Lumba-Yakkha"},
["luv"] = {"Luwati"},
["luw"] = {"Luo (Cameroon)"},
["luy"] = {"Luyia", "Oluluyia"},
["luz"] = {"Southern Luri"},
["lva"] = {"Maku'a"},
["lvi"] = {"Lavi"},
["lvk"] = {"Lavukaleve"},
["lvl"] = {"Lwel"},
["lvs"] = {"Standard Latvian"},
["lvu"] = {"Levuka"},
["lwa"] = {"Lwalu"},
["lwe"] = {"Lewo Eleng"},
["lwg"] = {"Wanga", "Oluwanga"},
["lwh"] = {"White Lachi"},
["lwl"] = {"Eastern Lawa"},
["lwm"] = {"Laomian"},
["lwo"] = {"Luwo"},
["lws"] = {"Malawian Sign Language"},
["lwt"] = {"Lewotobi"},
["lwu"] = {"Lawu"},
["lww"] = {"Lewo"},
["lxm"] = {"Lakurumau"},
["lya"] = {"Layakha"},
["lyg"] = {"Lyngngam"},
["lyn"] = {"Luyana"},
["lzh"] = {"Literary Chinese"},
["lzl"] = {"Litzlitz"},
["lzn"] = {"Leinong Naga"},
["lzz"] = {"Laz"},
["maa"] = {"San Jerónimo Tecóatl Mazatec"},
["mab"] = {"Yutanduchi Mixtec"},
["mad"] = {"Madurese"},
["mae"] = {"Bo-Rukul"},
["maf"] = {"Mafa"},
["mag"] = {"Magahi"},
["mai"] = {"Maithili"},
["maj"] = {"Jalapa De Díaz Mazatec"},
["mak"] = {"Makasar"},
["mam"] = {"Mam"},
["man"] = {"Mandingo", "Manding"},
["map"] = {"Austronesian languages"},
["maq"] = {"Chiquihuitlán Mazatec"},
["mas"] = {"Masai"},
["mat"] = {"San Francisco Matlatzinca"},
["mau"] = {"Huautla Mazatec"},
["mav"] = {"Sateré-Mawé"},
["maw"] = {"Mampruli"},
["max"] = {"North Moluccan Malay"},
["maz"] = {"Central Mazahua"},
["mba"] = {"Higaonon"},
["mbb"] = {"Western Bukidnon Manobo"},
["mbc"] = {"Macushi"},
["mbd"] = {"Dibabawon Manobo"},
["mbe"] = {"Molale"},
["mbf"] = {"Baba Malay"},
["mbh"] = {"Mangseng"},
["mbi"] = {"Ilianen Manobo"},
["mbj"] = {"Nadëb"},
["mbk"] = {"Malol"},
["mbl"] = {"Maxakalí"},
["mbm"] = {"Ombamba"},
["mbn"] = {"Macaguán"},
["mbo"] = {"Mbo (Cameroon)"},
["mbp"] = {"Malayo"},
["mbq"] = {"Maisin"},
["mbr"] = {"Nukak Makú"},
["mbs"] = {"Sarangani Manobo"},
["mbt"] = {"Matigsalug Manobo"},
["mbu"] = {"Mbula-Bwazza"},
["mbv"] = {"Mbulungish"},
["mbw"] = {"Maring"},
["mbx"] = {"Mari (East Sepik Province)"},
["mby"] = {"Memoni"},
["mbz"] = {"Amoltepec Mixtec"},
["mca"] = {"Maca"},
["mcb"] = {"Machiguenga"},
["mcc"] = {"Bitur"},
["mcd"] = {"Sharanahua"},
["mce"] = {"Itundujia Mixtec"},
["mcf"] = {"Matsés"},
["mcg"] = {"Mapoyo"},
["mch"] = {"Maquiritari"},
["mci"] = {"Mese"},
["mcj"] = {"Mvanip"},
["mck"] = {"Mbunda"},
["mcl"] = {"Macaguaje"},
["mcm"] = {"Malaccan Creole Portuguese"},
["mcn"] = {"Masana"},
["mco"] = {"Coatlán Mixe"},
["mcp"] = {"Makaa"},
["mcq"] = {"Ese"},
["mcr"] = {"Menya"},
["mcs"] = {"Mambai"},
["mct"] = {"Mengisa"},
["mcu"] = {"Cameroon Mambila"},
["mcv"] = {"Minanibai"},
["mcw"] = {"Mawa (Chad)"},
["mcx"] = {"Mpiemo"},
["mcy"] = {"South Watut"},
["mcz"] = {"Mawan"},
["mda"] = {"Mada (Nigeria)"},
["mdb"] = {"Morigi"},
["mdc"] = {"Male (Papua New Guinea)"},
["mdd"] = {"Mbum"},
["mde"] = {"Maba (Chad)"},
["mdf"] = {"Moksha"},
["mdg"] = {"Massalat"},
["mdh"] = {"Maguindanaon"},
["mdi"] = {"Mamvu"},
["mdj"] = {"Mangbetu"},
["mdk"] = {"Mangbutu"},
["mdl"] = {"Maltese Sign Language"},
["mdm"] = {"Mayogo"},
["mdn"] = {"Mbati"},
["mdp"] = {"Mbala"},
["mdq"] = {"Mbole"},
["mdr"] = {"Mandar"},
["mds"] = {"Maria (Papua New Guinea)"},
["mdt"] = {"Mbere"},
["mdu"] = {"Mboko"},
["mdv"] = {"Santa Lucía Monteverde Mixtec"},
["mdw"] = {"Mbosi"},
["mdx"] = {"Dizin"},
["mdy"] = {"Male (Ethiopia)"},
["mdz"] = {"Suruí Do Pará"},
["mea"] = {"Menka"},
["meb"] = {"Ikobi"},
["mec"] = {"Marra"},
["med"] = {"Melpa"},
["mee"] = {"Mengen"},
["mef"] = {"Megam"},
["meh"] = {"Southwestern Tlaxiaco Mixtec"},
["mei"] = {"Midob"},
["mej"] = {"Meyah"},
["mek"] = {"Mekeo"},
["mel"] = {"Central Melanau"},
["mem"] = {"Mangala"},
["men"] = {"Mende (Sierra Leone)"},
["meo"] = {"Kedah Malay"},
["mep"] = {"Miriwoong"},
["meq"] = {"Merey"},
["mer"] = {"Meru"},
["mes"] = {"Masmaje"},
["met"] = {"Mato"},
["meu"] = {"Motu"},
["mev"] = {"Mano"},
["mew"] = {"Maaka"},
["mey"] = {"Hassaniyya"},
["mez"] = {"Menominee"},
["mfa"] = {"Pattani Malay"},
["mfb"] = {"Bangka"},
["mfc"] = {"Mba"},
["mfd"] = {"Mendankwe-Nkwen"},
["mfe"] = {"Morisyen"},
["mff"] = {"Naki"},
["mfg"] = {"Mogofin"},
["mfh"] = {"Matal"},
["mfi"] = {"Wandala"},
["mfj"] = {"Mefele"},
["mfk"] = {"North Mofu"},
["mfl"] = {"Putai"},
["mfm"] = {"Marghi South"},
["mfn"] = {"Cross River Mbembe"},
["mfo"] = {"Mbe"},
["mfp"] = {"Makassar Malay"},
["mfq"] = {"Moba"},
["mfr"] = {"Marrithiyel"},
["mfs"] = {"Mexican Sign Language"},
["mft"] = {"Mokerang"},
["mfu"] = {"Mbwela"},
["mfv"] = {"Mandjak"},
["mfw"] = {"Mulaha"},
["mfx"] = {"Melo"},
["mfy"] = {"Mayo"},
["mfz"] = {"Mabaan"},
["mga"] = {"Middle Irish (900-1200)"},
["mgb"] = {"Mararit"},
["mgc"] = {"Morokodo"},
["mgd"] = {"Moru"},
["mge"] = {"Mango"},
["mgf"] = {"Maklew"},
["mgg"] = {"Mpumpong"},
["mgh"] = {"Makhuwa-Meetto"},
["mgi"] = {"Lijili"},
["mgj"] = {"Abureni"},
["mgk"] = {"Mawes"},
["mgl"] = {"Maleu-Kilenge"},
["mgm"] = {"Mambae"},
["mgn"] = {"Mbangi"},
["mgo"] = {"Meta'"},
["mgp"] = {"Eastern Magar"},
["mgq"] = {"Malila"},
["mgr"] = {"Mambwe-Lungu"},
["mgs"] = {"Manda (Tanzania)"},
["mgt"] = {"Mongol"},
["mgu"] = {"Mailu"},
["mgv"] = {"Matengo"},
["mgw"] = {"Matumbi"},
["mgy"] = {"Mbunga"},
["mgz"] = {"Mbugwe"},
["mha"] = {"Manda (India)"},
["mhb"] = {"Mahongwe"},
["mhc"] = {"Mocho"},
["mhd"] = {"Mbugu"},
["mhe"] = {"Besisi", "Mah Meri"},
["mhf"] = {"Mamaa"},
["mhg"] = {"Margu"},
["mhi"] = {"Ma'di"},
["mhj"] = {"Mogholi"},
["mhk"] = {"Mungaka"},
["mhl"] = {"Mauwake"},
["mhm"] = {"Makhuwa-Moniga"},
["mhn"] = {"Mócheno"},
["mho"] = {"Mashi (Zambia)"},
["mhp"] = {"Balinese Malay"},
["mhq"] = {"Mandan"},
["mhr"] = {"Eastern Mari"},
["mhs"] = {"Buru (Indonesia)"},
["mht"] = {"Mandahuaca"},
["mhu"] = {"Digaro-Mishmi", "Darang Deng"},
["mhw"] = {"Mbukushu"},
["mhx"] = {"Maru", "Lhaovo"},
["mhy"] = {"Ma'anyan"},
["mhz"] = {"Mor (Mor Islands)"},
["mia"] = {"Miami"},
["mib"] = {"Atatláhuca Mixtec"},
["mic"] = {"Mi'kmaq", "Micmac"},
["mid"] = {"Mandaic"},
["mie"] = {"Ocotepec Mixtec"},
["mif"] = {"Mofu-Gudur"},
["mig"] = {"San Miguel El Grande Mixtec"},
["mih"] = {"Chayuco Mixtec"},
["mii"] = {"Chigmecatitlán Mixtec"},
["mij"] = {"Abar", "Mungbam"},
["mik"] = {"Mikasuki"},
["mil"] = {"Peñoles Mixtec"},
["mim"] = {"Alacatlatzala Mixtec"},
["min"] = {"Minangkabau"},
["mio"] = {"Pinotepa Nacional Mixtec"},
["mip"] = {"Apasco-Apoala Mixtec"},
["miq"] = {"Mískito"},
["mir"] = {"Isthmus Mixe"},
["mis"] = {"Uncoded languages"},
["mit"] = {"Southern Puebla Mixtec"},
["miu"] = {"Cacaloxtepec Mixtec"},
["miw"] = {"Akoye"},
["mix"] = {"Mixtepec Mixtec"},
["miy"] = {"Ayutla Mixtec"},
["miz"] = {"Coatzospan Mixtec"},
["mjb"] = {"Makalero"},
["mjc"] = {"San Juan Colorado Mixtec"},
["mjd"] = {"Northwest Maidu"},
["mje"] = {"Muskum"},
["mjg"] = {"Tu"},
["mjh"] = {"Mwera (Nyasa)"},
["mji"] = {"Kim Mun"},
["mjj"] = {"Mawak"},
["mjk"] = {"Matukar"},
["mjl"] = {"Mandeali"},
["mjm"] = {"Medebur"},
["mjn"] = {"Ma (Papua New Guinea)"},
["mjo"] = {"Malankuravan"},
["mjp"] = {"Malapandaram"},
["mjq"] = {"Malaryan"},
["mjr"] = {"Malavedan"},
["mjs"] = {"Miship"},
["mjt"] = {"Sauria Paharia"},
["mju"] = {"Manna-Dora"},
["mjv"] = {"Mannan"},
["mjw"] = {"Karbi"},
["mjx"] = {"Mahali"},
["mjy"] = {"Mahican"},
["mjz"] = {"Majhi"},
["mka"] = {"Mbre"},
["mkb"] = {"Mal Paharia"},
["mkc"] = {"Siliput"},
["mke"] = {"Mawchi"},
["mkf"] = {"Miya"},
["mkg"] = {"Mak (China)"},
["mkh"] = {"Mon-Khmer languages"},
["mki"] = {"Dhatki"},
["mkj"] = {"Mokilese"},
["mkk"] = {"Byep"},
["mkl"] = {"Mokole"},
["mkm"] = {"Moklen"},
["mkn"] = {"Kupang Malay"},
["mko"] = {"Mingang Doso"},
["mkp"] = {"Moikodi"},
["mkq"] = {"Bay Miwok"},
["mkr"] = {"Malas"},
["mks"] = {"Silacayoapan Mixtec"},
["mkt"] = {"Vamale"},
["mku"] = {"Konyanka Maninka"},
["mkv"] = {"Mafea"},
["mkw"] = {"Kituba (Congo)"},
["mkx"] = {"Kinamiging Manobo"},
["mky"] = {"East Makian"},
["mkz"] = {"Makasae"},
["mla"] = {"Malo"},
["mlb"] = {"Mbule"},
["mlc"] = {"Cao Lan"},
["mle"] = {"Manambu"},
["mlf"] = {"Mal"},
["mlh"] = {"Mape"},
["mli"] = {"Malimpung"},
["mlj"] = {"Miltu"},
["mlk"] = {"Ilwana", "Kiwilwana"},
["mll"] = {"Malua Bay"},
["mlm"] = {"Mulam"},
["mln"] = {"Malango"},
["mlo"] = {"Mlomp"},
["mlp"] = {"Bargam"},
["mlq"] = {"Western Maninkakan"},
["mlr"] = {"Vame"},
["mls"] = {"Masalit"},
["mlu"] = {"To'abaita"},
["mlv"] = {"Motlav", "Mwotlap"},
["mlw"] = {"Moloko"},
["mlx"] = {"Malfaxal", "Naha'ai"},
["mlz"] = {"Malaynon"},
["mma"] = {"Mama"},
["mmb"] = {"Momina"},
["mmc"] = {"Michoacán Mazahua"},
["mmd"] = {"Maonan"},
["mme"] = {"Mae"},
["mmf"] = {"Mundat"},
["mmg"] = {"North Ambrym"},
["mmh"] = {"Mehináku"},
["mmi"] = {"Musar"},
["mmj"] = {"Majhwar"},
["mmk"] = {"Mukha-Dora"},
["mml"] = {"Man Met"},
["mmm"] = {"Maii"},
["mmn"] = {"Mamanwa"},
["mmo"] = {"Mangga Buang"},
["mmp"] = {"Siawi"},
["mmq"] = {"Musak"},
["mmr"] = {"Western Xiangxi Miao"},
["mmt"] = {"Malalamai"},
["mmu"] = {"Mmaala"},
["mmv"] = {"Miriti"},
["mmw"] = {"Emae"},
["mmx"] = {"Madak"},
["mmy"] = {"Migaama"},
["mmz"] = {"Mabaale"},
["mna"] = {"Mbula"},
["mnb"] = {"Muna"},
["mnc"] = {"Manchu"},
["mnd"] = {"Mondé"},
["mne"] = {"Naba"},
["mnf"] = {"Mundani"},
["mng"] = {"Eastern Mnong"},
["mnh"] = {"Mono (Democratic Republic of Congo)"},
["mni"] = {"Manipuri"},
["mnj"] = {"Munji"},
["mnk"] = {"Mandinka"},
["mnl"] = {"Tiale"},
["mnm"] = {"Mapena"},
["mnn"] = {"Southern Mnong"},
["mno"] = {"Manobo languages"},
["mnp"] = {"Min Bei Chinese"},
["mnq"] = {"Minriq"},
["mnr"] = {"Mono (USA)"},
["mns"] = {"Mansi"},
["mnu"] = {"Mer"},
["mnv"] = {"Rennell-Bellona"},
["mnw"] = {"Mon"},
["mnx"] = {"Manikion"},
["mny"] = {"Manyawa"},
["mnz"] = {"Moni"},
["moa"] = {"Mwan"},
["moc"] = {"Mocoví"},
["mod"] = {"Mobilian"},
["moe"] = {"Innu", "Montagnais"},
["mog"] = {"Mongondow"},
["moh"] = {"Mohawk"},
["moi"] = {"Mboi"},
["moj"] = {"Monzombo"},
["mok"] = {"Morori"},
["mom"] = {"Mangue"},
["moo"] = {"Monom"},
["mop"] = {"Mopán Maya"},
["moq"] = {"Mor (Bomberai Peninsula)"},
["mor"] = {"Moro"},
["mos"] = {"Mossi"},
["mot"] = {"Barí"},
["mou"] = {"Mogum"},
["mov"] = {"Mohave"},
["mow"] = {"Moi (Congo)"},
["mox"] = {"Molima"},
["moy"] = {"Shekkacho"},
["moz"] = {"Mukulu", "Gergiko"},
["mpa"] = {"Mpoto"},
["mpb"] = {"Malak Malak", "Mullukmulluk"},
["mpc"] = {"Mangarrayi"},
["mpd"] = {"Machinere"},
["mpe"] = {"Majang"},
["mpg"] = {"Marba"},
["mph"] = {"Maung"},
["mpi"] = {"Mpade"},
["mpj"] = {"Martu Wangka", "Wangkajunga"},
["mpk"] = {"Mbara (Chad)"},
["mpl"] = {"Middle Watut"},
["mpm"] = {"Yosondúa Mixtec"},
["mpn"] = {"Mindiri"},
["mpo"] = {"Miu"},
["mpp"] = {"Migabac"},
["mpq"] = {"Matís"},
["mpr"] = {"Vangunu"},
["mps"] = {"Dadibi"},
["mpt"] = {"Mian"},
["mpu"] = {"Makuráp"},
["mpv"] = {"Mungkip"},
["mpw"] = {"Mapidian"},
["mpx"] = {"Misima-Panaeati"},
["mpy"] = {"Mapia"},
["mpz"] = {"Mpi"},
["mqa"] = {"Maba (Indonesia)"},
["mqb"] = {"Mbuko"},
["mqc"] = {"Mangole"},
["mqe"] = {"Matepi"},
["mqf"] = {"Momuna"},
["mqg"] = {"Kota Bangun Kutai Malay"},
["mqh"] = {"Tlazoyaltepec Mixtec"},
["mqi"] = {"Mariri"},
["mqj"] = {"Mamasa"},
["mqk"] = {"Rajah Kabunsuwan Manobo"},
["mql"] = {"Mbelime"},
["mqm"] = {"South Marquesan"},
["mqn"] = {"Moronene"},
["mqo"] = {"Modole"},
["mqp"] = {"Manipa"},
["mqq"] = {"Minokok"},
["mqr"] = {"Mander"},
["mqs"] = {"West Makian"},
["mqt"] = {"Mok"},
["mqu"] = {"Mandari"},
["mqv"] = {"Mosimo"},
["mqw"] = {"Murupi"},
["mqx"] = {"Mamuju"},
["mqy"] = {"Manggarai"},
["mqz"] = {"Pano"},
["mra"] = {"Mlabri"},
["mrb"] = {"Marino"},
["mrc"] = {"Maricopa"},
["mrd"] = {"Western Magar"},
["mre"] = {"Martha's Vineyard Sign Language"},
["mrf"] = {"Elseng"},
["mrg"] = {"Mising"},
["mrh"] = {"Mara Chin"},
["mrj"] = {"Western Mari"},
["mrk"] = {"Hmwaveke"},
["mrl"] = {"Mortlockese"},
["mrm"] = {"Merlav", "Mwerlap"},
["mrn"] = {"Cheke Holo"},
["mro"] = {"Mru"},
["mrp"] = {"Morouas"},
["mrq"] = {"North Marquesan"},
["mrr"] = {"Maria (India)"},
["mrs"] = {"Maragus"},
["mrt"] = {"Marghi Central"},
["mru"] = {"Mono (Cameroon)"},
["mrv"] = {"Mangareva"},
["mrw"] = {"Maranao"},
["mrx"] = {"Maremgi", "Dineor"},
["mry"] = {"Mandaya"},
["mrz"] = {"Marind"},
["msb"] = {"Masbatenyo"},
["msc"] = {"Sankaran Maninka"},
["msd"] = {"Yucatec Maya Sign Language"},
["mse"] = {"Musey"},
["msf"] = {"Mekwei"},
["msg"] = {"Moraid"},
["msh"] = {"Masikoro Malagasy"},
["msi"] = {"Sabah Malay"},
["msj"] = {"Ma (Democratic Republic of Congo)"},
["msk"] = {"Mansaka"},
["msl"] = {"Molof", "Poule"},
["msm"] = {"Agusan Manobo"},
["msn"] = {"Vurës"},
["mso"] = {"Mombum"},
["msp"] = {"Maritsauá"},
["msq"] = {"Caac"},
["msr"] = {"Mongolian Sign Language"},
["mss"] = {"West Masela"},
["msu"] = {"Musom"},
["msv"] = {"Maslam"},
["msw"] = {"Mansoanka"},
["msx"] = {"Moresada"},
["msy"] = {"Aruamu"},
["msz"] = {"Momare"},
["mta"] = {"Cotabato Manobo"},
["mtb"] = {"Anyin Morofo"},
["mtc"] = {"Munit"},
["mtd"] = {"Mualang"},
["mte"] = {"Mono (Solomon Islands)"},
["mtf"] = {"Murik (Papua New Guinea)"},
["mtg"] = {"Una"},
["mth"] = {"Munggui"},
["mti"] = {"Maiwa (Papua New Guinea)"},
["mtj"] = {"Moskona"},
["mtk"] = {"Mbe'"},
["mtl"] = {"Montol"},
["mtm"] = {"Mator"},
["mtn"] = {"Matagalpa"},
["mto"] = {"Totontepec Mixe"},
["mtp"] = {"Wichí Lhamtés Nocten"},
["mtq"] = {"Muong"},
["mtr"] = {"Mewari"},
["mts"] = {"Yora"},
["mtt"] = {"Mota"},
["mtu"] = {"Tututepec Mixtec"},
["mtv"] = {"Asaro'o"},
["mtw"] = {"Southern Binukidnon"},
["mtx"] = {"Tidaá Mixtec"},
["mty"] = {"Nabi"},
["mua"] = {"Mundang"},
["mub"] = {"Mubi"},
["muc"] = {"Ajumbu"},
["mud"] = {"Mednyj Aleut"},
["mue"] = {"Media Lengua"},
["mug"] = {"Musgu"},
["muh"] = {"Mündü"},
["mui"] = {"Musi"},
["muj"] = {"Mabire"},
["muk"] = {"Mugom"},
["mul"] = {"Multiple languages"},
["mum"] = {"Maiwala"},
["mun"] = {"Munda languages"},
["muo"] = {"Nyong"},
["mup"] = {"Malvi"},
["muq"] = {"Eastern Xiangxi Miao"},
["mur"] = {"Murle"},
["mus"] = {"Creek"},
["mut"] = {"Western Muria"},
["muu"] = {"Yaaku"},
["muv"] = {"Muthuvan"},
["mux"] = {"Bo-Ung"},
["muy"] = {"Muyang"},
["muz"] = {"Mursi"},
["mva"] = {"Manam"},
["mvb"] = {"Mattole"},
["mvd"] = {"Mamboru"},
["mve"] = {"Marwari (Pakistan)"},
["mvf"] = {"Peripheral Mongolian"},
["mvg"] = {"Yucuañe Mixtec"},
["mvh"] = {"Mulgi"},
["mvi"] = {"Miyako"},
["mvk"] = {"Mekmek"},
["mvl"] = {"Mbara (Australia)"},
["mvn"] = {"Minaveha"},
["mvo"] = {"Marovo"},
["mvp"] = {"Duri"},
["mvq"] = {"Moere"},
["mvr"] = {"Marau"},
["mvs"] = {"Massep"},
["mvt"] = {"Mpotovoro"},
["mvu"] = {"Marfa"},
["mvv"] = {"Tagal Murut"},
["mvw"] = {"Machinga"},
["mvx"] = {"Meoswar"},
["mvy"] = {"Indus Kohistani"},
["mvz"] = {"Mesqan"},
["mwa"] = {"Mwatebu"},
["mwb"] = {"Juwal"},
["mwc"] = {"Are"},
["mwe"] = {"Mwera (Chimwera)"},
["mwf"] = {"Murrinh-Patha"},
["mwg"] = {"Aiklep"},
["mwh"] = {"Mouk-Aria"},
["mwi"] = {"Labo", "Ninde"},
["mwk"] = {"Kita Maninkakan"},
["mwl"] = {"Mirandese"},
["mwm"] = {"Sar"},
["mwn"] = {"Nyamwanga"},
["mwo"] = {"Central Maewo"},
["mwp"] = {"Kala Lagaw Ya"},
["mwq"] = {"Mün Chin"},
["mwr"] = {"Marwari"},
["mws"] = {"Mwimbi-Muthambi"},
["mwt"] = {"Moken"},
["mwu"] = {"Mittu"},
["mwv"] = {"Mentawai"},
["mww"] = {"Hmong Daw"},
["mwz"] = {"Moingi"},
["mxa"] = {"Northwest Oaxaca Mixtec"},
["mxb"] = {"Tezoatlán Mixtec"},
["mxc"] = {"Manyika"},
["mxd"] = {"Modang"},
["mxe"] = {"Mele-Fila"},
["mxf"] = {"Malgbe"},
["mxg"] = {"Mbangala"},
["mxh"] = {"Mvuba"},
["mxi"] = {"Mozarabic"},
["mxj"] = {"Miju-Mishmi", "Geman Deng"},
["mxk"] = {"Monumbo"},
["mxl"] = {"Maxi Gbe"},
["mxm"] = {"Meramera"},
["mxn"] = {"Moi (Indonesia)"},
["mxo"] = {"Mbowe"},
["mxp"] = {"Tlahuitoltepec Mixe"},
["mxq"] = {"Juquila Mixe"},
["mxr"] = {"Murik (Malaysia)"},
["mxs"] = {"Huitepec Mixtec"},
["mxt"] = {"Jamiltepec Mixtec"},
["mxu"] = {"Mada (Cameroon)"},
["mxv"] = {"Metlatónoc Mixtec"},
["mxw"] = {"Namo"},
["mxx"] = {"Mahou", "Mawukakan"},
["mxy"] = {"Southeastern Nochixtlán Mixtec"},
["mxz"] = {"Central Masela"},
["myb"] = {"Mbay"},
["myc"] = {"Mayeka"},
["mye"] = {"Myene"},
["myf"] = {"Bambassi"},
["myg"] = {"Manta"},
["myh"] = {"Makah"},
["myj"] = {"Mangayat"},
["myk"] = {"Mamara Senoufo"},
["myl"] = {"Moma"},
["mym"] = {"Me'en"},
["myn"] = {"Mayan languages"},
["myo"] = {"Anfillo"},
["myp"] = {"Pirahã"},
["myr"] = {"Muniche"},
["mys"] = {"Mesmes"},
["myu"] = {"Mundurukú"},
["myv"] = {"Erzya"},
["myw"] = {"Muyuw"},
["myx"] = {"Masaaba"},
["myy"] = {"Macuna"},
["myz"] = {"Classical Mandaic"},
["mza"] = {"Santa María Zacatepec Mixtec"},
["mzb"] = {"Tumzabt"},
["mzc"] = {"Madagascar Sign Language"},
["mzd"] = {"Malimba"},
["mze"] = {"Morawa"},
["mzg"] = {"Monastic Sign Language"},
["mzh"] = {"Wichí Lhamtés Güisnay"},
["mzi"] = {"Ixcatlán Mazatec"},
["mzj"] = {"Manya"},
["mzk"] = {"Nigeria Mambila"},
["mzl"] = {"Mazatlán Mixe"},
["mzm"] = {"Mumuye"},
["mzn"] = {"Mazanderani"},
["mzo"] = {"Matipuhy"},
["mzp"] = {"Movima"},
["mzq"] = {"Mori Atas"},
["mzr"] = {"Marúbo"},
["mzs"] = {"Macanese"},
["mzt"] = {"Mintil"},
["mzu"] = {"Inapang"},
["mzv"] = {"Manza"},
["mzw"] = {"Deg"},
["mzx"] = {"Mawayana"},
["mzy"] = {"Mozambican Sign Language"},
["mzz"] = {"Maiadomu"},
["naa"] = {"Namla"},
["nab"] = {"Southern Nambikuára"},
["nac"] = {"Narak"},
["nae"] = {"Naka'ela"},
["naf"] = {"Nabak"},
["nag"] = {"Naga Pidgin"},
["nah"] = {"Nahuatl languages"},
["nai"] = {"North American Indian languages"},
["naj"] = {"Nalu"},
["nak"] = {"Nakanai"},
["nal"] = {"Nalik"},
["nam"] = {"Ngan'gityemerri"},
["nan"] = {"Min Nan Chinese"},
["nao"] = {"Naaba"},
["nap"] = {"Neapolitan"},
["naq"] = {"Khoekhoe", "Nama (Namibia)"},
["nar"] = {"Iguta"},
["nas"] = {"Naasioi"},
["nat"] = {"Ca̱hungwa̱rya̱", "Hungworo"},
["naw"] = {"Nawuri"},
["nax"] = {"Nakwi"},
["nay"] = {"Ngarrindjeri"},
["naz"] = {"Coatepec Nahuatl"},
["nba"] = {"Nyemba"},
["nbb"] = {"Ndoe"},
["nbc"] = {"Chang Naga"},
["nbd"] = {"Ngbinda"},
["nbe"] = {"Konyak Naga"},
["nbg"] = {"Nagarchal"},
["nbh"] = {"Ngamo"},
["nbi"] = {"Mao Naga"},
["nbj"] = {"Ngarinyman"},
["nbk"] = {"Nake"},
["nbm"] = {"Ngbaka Ma'bo"},
["nbn"] = {"Kuri"},
["nbo"] = {"Nkukoli"},
["nbp"] = {"Nnam"},
["nbq"] = {"Nggem"},
["nbr"] = {"Numana"},
["nbs"] = {"Namibian Sign Language"},
["nbt"] = {"Na"},
["nbu"] = {"Rongmei Naga"},
["nbv"] = {"Ngamambo"},
["nbw"] = {"Southern Ngbandi"},
["nby"] = {"Ningera"},
["nca"] = {"Iyo"},
["ncb"] = {"Central Nicobarese"},
["ncc"] = {"Ponam"},
["ncd"] = {"Nachering"},
["nce"] = {"Yale"},
["ncf"] = {"Notsi"},
["ncg"] = {"Nisga'a"},
["nch"] = {"Central Huasteca Nahuatl"},
["nci"] = {"Classical Nahuatl"},
["ncj"] = {"Northern Puebla Nahuatl"},
["nck"] = {"Na-kara"},
["ncl"] = {"Michoacán Nahuatl"},
["ncm"] = {"Nambo"},
["ncn"] = {"Nauna"},
["nco"] = {"Sibe"},
["ncq"] = {"Northern Katang"},
["ncr"] = {"Ncane"},
["ncs"] = {"Nicaraguan Sign Language"},
["nct"] = {"Chothe Naga"},
["ncu"] = {"Chumburung"},
["ncx"] = {"Central Puebla Nahuatl"},
["ncz"] = {"Natchez"},
["nda"] = {"Ndasa"},
["ndb"] = {"Kenswei Nsei"},
["ndc"] = {"Ndau"},
["ndd"] = {"Nde-Nsele-Nta"},
["ndf"] = {"Nadruvian"},
["ndg"] = {"Ndengereko"},
["ndh"] = {"Ndali"},
["ndi"] = {"Samba Leko"},
["ndj"] = {"Ndamba"},
["ndk"] = {"Ndaka"},
["ndl"] = {"Ndolo"},
["ndm"] = {"Ndam"},
["ndn"] = {"Ngundi"},
["ndp"] = {"Ndo"},
["ndq"] = {"Ndombe"},
["ndr"] = {"Ndoola"},
["nds"] = {"Low German", "Low Saxon"},
["ndt"] = {"Ndunga"},
["ndu"] = {"Dugun"},
["ndv"] = {"Ndut"},
["ndw"] = {"Ndobo"},
["ndx"] = {"Nduga"},
["ndy"] = {"Lutos"},
["ndz"] = {"Ndogo"},
["nea"] = {"Eastern Ngad'a"},
["neb"] = {"Toura (Côte d'Ivoire)"},
["nec"] = {"Nedebang"},
["ned"] = {"Nde-Gbite"},
["nee"] = {"Nêlêmwa-Nixumwak"},
["nef"] = {"Nefamese"},
["neg"] = {"Negidal"},
["neh"] = {"Nyenkha"},
["nei"] = {"Neo-Hittite"},
["nej"] = {"Neko"},
["nek"] = {"Neku"},
["nem"] = {"Nemi"},
["nen"] = {"Nengone"},
["neo"] = {"Ná-Meo"},
["neq"] = {"North Central Mixe"},
["ner"] = {"Yahadian"},
["nes"] = {"Bhoti Kinnauri"},
["net"] = {"Nete"},
["neu"] = {"Neo"},
["nev"] = {"Nyaheun"},
["new"] = {"Newari", "Nepal Bhasa"},
["nex"] = {"Neme"},
["ney"] = {"Neyo"},
["nez"] = {"Nez Perce"},
["nfa"] = {"Dhao"},
["nfd"] = {"Ahwai"},
["nfl"] = {"Ayiwo", "Äiwoo"},
["nfr"] = {"Nafaanra"},
["nfu"] = {"Mfumte"},
["nga"] = {"Ngbaka"},
["ngb"] = {"Northern Ngbandi"},
["ngc"] = {"Ngombe (Democratic Republic of Congo)"},
["ngd"] = {"Ngando (Central African Republic)"},
["nge"] = {"Ngemba"},
["ngf"] = {"Trans-New Guinea languages"},
["ngg"] = {"Ngbaka Manza"},
["ngh"] = {"Nǁng"},
["ngi"] = {"Ngizim"},
["ngj"] = {"Ngie"},
["ngk"] = {"Dalabon"},
["ngl"] = {"Lomwe"},
["ngm"] = {"Ngatik Men's Creole"},
["ngn"] = {"Ngwo"},
["ngp"] = {"Ngulu"},
["ngq"] = {"Ngurimi", "Ngoreme"},
["ngr"] = {"Engdewu"},
["ngs"] = {"Gvoko"},
["ngt"] = {"Kriang", "Ngeq"},
["ngu"] = {"Guerrero Nahuatl"},
["ngv"] = {"Nagumi"},
["ngw"] = {"Ngwaba"},
["ngx"] = {"Nggwahyi"},
["ngy"] = {"Tibea"},
["ngz"] = {"Ngungwel"},
["nha"] = {"Nhanda"},
["nhb"] = {"Beng"},
["nhc"] = {"Tabasco Nahuatl"},
["nhd"] = {"Chiripá", "Ava Guaraní"},
["nhe"] = {"Eastern Huasteca Nahuatl"},
["nhf"] = {"Nhuwala"},
["nhg"] = {"Tetelcingo Nahuatl"},
["nhh"] = {"Nahari"},
["nhi"] = {"Zacatlán-Ahuacatlán-Tepetzintla Nahuatl"},
["nhk"] = {"Isthmus-Cosoleacaque Nahuatl"},
["nhm"] = {"Morelos Nahuatl"},
["nhn"] = {"Central Nahuatl"},
["nho"] = {"Takuu"},
["nhp"] = {"Isthmus-Pajapan Nahuatl"},
["nhq"] = {"Huaxcaleca Nahuatl"},
["nhr"] = {"Naro"},
["nht"] = {"Ometepec Nahuatl"},
["nhu"] = {"Noone"},
["nhv"] = {"Temascaltepec Nahuatl"},
["nhw"] = {"Western Huasteca Nahuatl"},
["nhx"] = {"Isthmus-Mecayapan Nahuatl"},
["nhy"] = {"Northern Oaxaca Nahuatl"},
["nhz"] = {"Santa María La Alta Nahuatl"},
["nia"] = {"Nias"},
["nib"] = {"Nakame"},
["nic"] = {"Niger-Kordofanian languages"},
["nid"] = {"Ngandi"},
["nie"] = {"Niellim"},
["nif"] = {"Nek"},
["nig"] = {"Ngalakgan"},
["nih"] = {"Nyiha (Tanzania)"},
["nii"] = {"Nii"},
["nij"] = {"Ngaju"},
["nik"] = {"Southern Nicobarese"},
["nil"] = {"Nila"},
["nim"] = {"Nilamba"},
["nin"] = {"Ninzo"},
["nio"] = {"Nganasan"},
["niq"] = {"Nandi"},
["nir"] = {"Nimboran"},
["nis"] = {"Nimi"},
["nit"] = {"Southeastern Kolami"},
["niu"] = {"Niuean"},
["niv"] = {"Gilyak"},
["niw"] = {"Nimo"},
["nix"] = {"Hema"},
["niy"] = {"Ngiti"},
["niz"] = {"Ningil"},
["nja"] = {"Nzanyi"},
["njb"] = {"Nocte Naga"},
["njd"] = {"Ndonde Hamba"},
["njh"] = {"Lotha Naga"},
["nji"] = {"Gudanji"},
["njj"] = {"Njen"},
["njl"] = {"Njalgulgule"},
["njm"] = {"Angami Naga"},
["njn"] = {"Liangmai Naga"},
["njo"] = {"Ao Naga"},
["njr"] = {"Njerep"},
["njs"] = {"Nisa"},
["njt"] = {"Ndyuka-Trio Pidgin"},
["nju"] = {"Ngadjunmaya"},
["njx"] = {"Kunyi"},
["njy"] = {"Njyem"},
["njz"] = {"Nyishi"},
["nka"] = {"Nkoya"},
["nkb"] = {"Khoibu Naga"},
["nkc"] = {"Nkongho"},
["nkd"] = {"Koireng"},
["nke"] = {"Duke"},
["nkf"] = {"Inpui Naga"},
["nkg"] = {"Nekgini"},
["nkh"] = {"Khezha Naga"},
["nki"] = {"Thangal Naga"},
["nkj"] = {"Nakai"},
["nkk"] = {"Nokuku"},
["nkm"] = {"Namat"},
["nkn"] = {"Nkangala"},
["nko"] = {"Nkonya"},
["nkp"] = {"Niuatoputapu"},
["nkq"] = {"Nkami"},
["nkr"] = {"Nukuoro"},
["nks"] = {"North Asmat"},
["nkt"] = {"Nyika (Tanzania)"},
["nku"] = {"Bouna Kulango"},
["nkv"] = {"Nyika (Malawi and Zambia)"},
["nkw"] = {"Nkutu"},
["nkx"] = {"Nkoroo"},
["nkz"] = {"Nkari"},
["nla"] = {"Ngombale"},
["nlc"] = {"Nalca"},
["nle"] = {"East Nyala"},
["nlg"] = {"Gela"},
["nli"] = {"Grangali"},
["nlj"] = {"Nyali"},
["nlk"] = {"Ninia Yali"},
["nll"] = {"Nihali"},
["nlm"] = {"Mankiyali"},
["nlo"] = {"Ngul"},
["nlq"] = {"Lao Naga"},
["nlu"] = {"Nchumbulu"},
["nlv"] = {"Orizaba Nahuatl"},
["nlw"] = {"Walangama"},
["nlx"] = {"Nahali"},
["nly"] = {"Nyamal"},
["nlz"] = {"Nalögo"},
["nma"] = {"Maram Naga"},
["nmb"] = {"Big Nambas", "V'ënen Taut"},
["nmc"] = {"Ngam"},
["nmd"] = {"Ndumu"},
["nme"] = {"Mzieme Naga"},
["nmf"] = {"Tangkhul Naga (India)"},
["nmg"] = {"Kwasio"},
["nmh"] = {"Monsang Naga"},
["nmi"] = {"Nyam"},
["nmj"] = {"Ngombe (Central African Republic)"},
["nmk"] = {"Namakura"},
["nml"] = {"Ndemli"},
["nmm"] = {"Manangba"},
["nmn"] = {"ǃXóõ"},
["nmo"] = {"Moyon Naga"},
["nmp"] = {"Nimanbur"},
["nmq"] = {"Nambya"},
["nmr"] = {"Nimbari"},
["nms"] = {"Letemboi"},
["nmt"] = {"Namonuito"},
["nmu"] = {"Northeast Maidu"},
["nmv"] = {"Ngamini"},
["nmw"] = {"Nimoa", "Rifao"},
["nmx"] = {"Nama (Papua New Guinea)"},
["nmy"] = {"Namuyi"},
["nmz"] = {"Nawdm"},
["nna"] = {"Nyangumarta"},
["nnb"] = {"Nande"},
["nnc"] = {"Nancere"},
["nnd"] = {"West Ambae"},
["nne"] = {"Ngandyera"},
["nnf"] = {"Ngaing"},
["nng"] = {"Maring Naga"},
["nnh"] = {"Ngiemboon"},
["nni"] = {"North Nuaulu"},
["nnj"] = {"Nyangatom"},
["nnk"] = {"Nankina"},
["nnl"] = {"Northern Rengma Naga"},
["nnm"] = {"Namia"},
["nnn"] = {"Ngete"},
["nnp"] = {"Wancho Naga"},
["nnq"] = {"Ngindo"},
["nnr"] = {"Narungga"},
["nnt"] = {"Nanticoke"},
["nnu"] = {"Dwang"},
["nnv"] = {"Nugunu (Australia)"},
["nnw"] = {"Southern Nuni"},
["nny"] = {"Nyangga"},
["nnz"] = {"Nda'nda'"},
["noa"] = {"Woun Meu"},
["noc"] = {"Nuk"},
["nod"] = {"Northern Thai"},
["noe"] = {"Nimadi"},
["nof"] = {"Nomane"},
["nog"] = {"Nogai"},
["noh"] = {"Nomu"},
["noi"] = {"Noiri"},
["noj"] = {"Nonuya"},
["nok"] = {"Nooksack"},
["nol"] = {"Nomlaki"},
["non"] = {"Old Norse"},
["nop"] = {"Numanggang"},
["noq"] = {"Ngongo"},
["nos"] = {"Eastern Nisu"},
["not"] = {"Nomatsiguenga"},
["nou"] = {"Ewage-Notu"},
["nov"] = {"Novial"},
["now"] = {"Nyambo"},
["noy"] = {"Noy"},
["noz"] = {"Nayi"},
["npa"] = {"Nar Phu"},
["npb"] = {"Nupbikha"},
["npg"] = {"Ponyo-Gongwang Naga"},
["nph"] = {"Phom Naga"},
["npi"] = {"Nepali (individual language)"},
["npl"] = {"Southeastern Puebla Nahuatl"},
["npn"] = {"Mondropolon"},
["npo"] = {"Pochuri Naga"},
["nps"] = {"Nipsan"},
["npu"] = {"Puimei Naga"},
["npx"] = {"Noipx"},
["npy"] = {"Napu"},
["nqg"] = {"Southern Nago"},
["nqk"] = {"Kura Ede Nago"},
["nql"] = {"Ngendelengo"},
["nqm"] = {"Ndom"},
["nqn"] = {"Nen"},
["nqo"] = {"N'Ko", "N’Ko"},
["nqq"] = {"Kyan-Karyaw Naga"},
["nqt"] = {"Nteng"},
["nqy"] = {"Akyaung Ari Naga"},
["nra"] = {"Ngom"},
["nrb"] = {"Nara"},
["nrc"] = {"Noric"},
["nre"] = {"Southern Rengma Naga"},
["nrf"] = {"Jèrriais", "Guernésiais", "Sercquiais"},
["nrg"] = {"Narango"},
["nri"] = {"Chokri Naga"},
["nrk"] = {"Ngarla"},
["nrl"] = {"Ngarluma"},
["nrm"] = {"Narom"},
["nrn"] = {"Norn"},
["nrp"] = {"North Picene"},
["nrr"] = {"Norra", "Nora"},
["nrt"] = {"Northern Kalapuya"},
["nru"] = {"Narua"},
["nrx"] = {"Ngurmbur"},
["nrz"] = {"Lala"},
["nsa"] = {"Sangtam Naga"},
["nsb"] = {"Lower Nossob"},
["nsc"] = {"Nshi"},
["nsd"] = {"Southern Nisu"},
["nse"] = {"Nsenga"},
["nsf"] = {"Northwestern Nisu"},
["nsg"] = {"Ngasa"},
["nsh"] = {"Ngoshie"},
["nsi"] = {"Nigerian Sign Language"},
["nsk"] = {"Naskapi"},
["nsl"] = {"Norwegian Sign Language"},
["nsm"] = {"Sumi Naga"},
["nsn"] = {"Nehan"},
["nso"] = {"Pedi", "Northern Sotho", "Sepedi"},
["nsp"] = {"Nepalese Sign Language"},
["nsq"] = {"Northern Sierra Miwok"},
["nsr"] = {"Maritime Sign Language"},
["nss"] = {"Nali"},
["nst"] = {"Tase Naga"},
["nsu"] = {"Sierra Negra Nahuatl"},
["nsv"] = {"Southwestern Nisu"},
["nsw"] = {"Navut"},
["nsx"] = {"Nsongo"},
["nsy"] = {"Nasal"},
["nsz"] = {"Nisenan"},
["ntd"] = {"Northern Tidung"},
["nte"] = {"Nathembo"},
["ntg"] = {"Ngantangarra"},
["nti"] = {"Natioro"},
["ntj"] = {"Ngaanyatjarra"},
["ntk"] = {"Ikoma-Nata-Isenye"},
["ntm"] = {"Nateni"},
["nto"] = {"Ntomba"},
["ntp"] = {"Northern Tepehuan"},
["ntr"] = {"Delo"},
["ntu"] = {"Natügu"},
["ntw"] = {"Nottoway"},
["ntx"] = {"Tangkhul Naga (Myanmar)"},
["nty"] = {"Mantsi"},
["ntz"] = {"Natanzi"},
["nua"] = {"Yuanga"},
["nub"] = {"Nubian languages"},
["nuc"] = {"Nukuini"},
["nud"] = {"Ngala"},
["nue"] = {"Ngundu"},
["nuf"] = {"Nusu"},
["nug"] = {"Nungali"},
["nuh"] = {"Ndunda"},
["nui"] = {"Ngumbi"},
["nuj"] = {"Nyole"},
["nuk"] = {"Nuu-chah-nulth", "Nuuchahnulth"},
["nul"] = {"Nusa Laut"},
["num"] = {"Niuafo'ou"},
["nun"] = {"Anong"},
["nuo"] = {"Nguôn"},
["nup"] = {"Nupe-Nupe-Tako"},
["nuq"] = {"Nukumanu"},
["nur"] = {"Nukuria"},
["nus"] = {"Nuer"},
["nut"] = {"Nung (Viet Nam)"},
["nuu"] = {"Ngbundu"},
["nuv"] = {"Northern Nuni"},
["nuw"] = {"Nguluwan"},
["nux"] = {"Mehek"},
["nuy"] = {"Nunggubuyu"},
["nuz"] = {"Tlamacazapa Nahuatl"},
["nvh"] = {"Nasarian"},
["nvm"] = {"Namiae"},
["nvo"] = {"Nyokon"},
["nwa"] = {"Nawathinehena"},
["nwb"] = {"Nyabwa"},
["nwc"] = {"Classical Newari", "Classical Nepal Bhasa", "Old Newari"},
["nwe"] = {"Ngwe"},
["nwg"] = {"Ngayawung"},
["nwi"] = {"Southwest Tanna"},
["nwm"] = {"Nyamusa-Molo"},
["nwo"] = {"Nauo"},
["nwr"] = {"Nawaru"},
["nww"] = {"Ndwewe"},
["nwx"] = {"Middle Newar"},
["nwy"] = {"Nottoway-Meherrin"},
["nxa"] = {"Nauete"},
["nxd"] = {"Ngando (Democratic Republic of Congo)"},
["nxe"] = {"Nage"},
["nxg"] = {"Ngad'a"},
["nxi"] = {"Nindi"},
["nxk"] = {"Koki Naga"},
["nxl"] = {"South Nuaulu"},
["nxm"] = {"Numidian"},
["nxn"] = {"Ngawun"},
["nxo"] = {"Ndambomo"},
["nxq"] = {"Naxi"},
["nxr"] = {"Ninggerum"},
["nxx"] = {"Nafri"},
["nyb"] = {"Nyangbo"},
["nyc"] = {"Nyanga-li"},
["nyd"] = {"Nyore", "Olunyole"},
["nye"] = {"Nyengo"},
["nyf"] = {"Giryama", "Kigiryama"},
["nyg"] = {"Nyindu"},
["nyh"] = {"Nyikina"},
["nyi"] = {"Ama (Sudan)"},
["nyj"] = {"Nyanga"},
["nyk"] = {"Nyaneka"},
["nyl"] = {"Nyeu"},
["nym"] = {"Nyamwezi"},
["nyn"] = {"Nyankole"},
["nyo"] = {"Nyoro"},
["nyp"] = {"Nyang'i"},
["nyq"] = {"Nayini"},
["nyr"] = {"Nyiha (Malawi)"},
["nys"] = {"Nyungar"},
["nyt"] = {"Nyawaygi"},
["nyu"] = {"Nyungwe"},
["nyv"] = {"Nyulnyul"},
["nyw"] = {"Nyaw"},
["nyx"] = {"Nganyaywana"},
["nyy"] = {"Nyakyusa-Ngonde"},
["nza"] = {"Tigon Mbembe"},
["nzb"] = {"Njebi"},
["nzd"] = {"Nzadi"},
["nzi"] = {"Nzima"},
["nzk"] = {"Nzakara"},
["nzm"] = {"Zeme Naga"},
["nzr"] = {"Dir-Nyamzak-Mbarimi"},
["nzs"] = {"New Zealand Sign Language"},
["nzu"] = {"Teke-Nzikou"},
["nzy"] = {"Nzakambay"},
["nzz"] = {"Nanga Dama Dogon"},
["oaa"] = {"Orok"},
["oac"] = {"Oroch"},
["oar"] = {"Old Aramaic (up to 700 BCE)", "Ancient Aramaic (up to 700 BCE)"},
["oav"] = {"Old Avar"},
["obi"] = {"Obispeño"},
["obk"] = {"Southern Bontok"},
["obl"] = {"Oblo"},
["obm"] = {"Moabite"},
["obo"] = {"Obo Manobo"},
["obr"] = {"Old Burmese"},
["obt"] = {"Old Breton"},
["obu"] = {"Obulom"},
["oca"] = {"Ocaina"},
["och"] = {"Old Chinese"},
["ocm"] = {"Old Cham"},
["oco"] = {"Old Cornish"},
["ocu"] = {"Atzingo Matlatzinca"},
["oda"] = {"Odut"},
["odk"] = {"Od"},
["odt"] = {"Old Dutch"},
["odu"] = {"Odual"},
["ofo"] = {"Ofo"},
["ofs"] = {"Old Frisian"},
["ofu"] = {"Efutop"},
["ogb"] = {"Ogbia"},
["ogc"] = {"Ogbah"},
["oge"] = {"Old Georgian"},
["ogg"] = {"Ogbogolo"},
["ogo"] = {"Khana"},
["ogu"] = {"Ogbronuagum"},
["oht"] = {"Old Hittite"},
["ohu"] = {"Old Hungarian"},
["oia"] = {"Oirata"},
["oie"] = {"Okolie"},
["oin"] = {"Inebu One"},
["ojb"] = {"Northwestern Ojibwa"},
["ojc"] = {"Central Ojibwa"},
["ojg"] = {"Eastern Ojibwa"},
["ojp"] = {"Old Japanese"},
["ojs"] = {"Severn Ojibwa"},
["ojv"] = {"Ontong Java"},
["ojw"] = {"Western Ojibwa"},
["oka"] = {"Okanagan"},
["okb"] = {"Okobo"},
["okc"] = {"Kobo"},
["okd"] = {"Okodia"},
["oke"] = {"Okpe (Southwestern Edo)"},
["okg"] = {"Koko Babangk"},
["okh"] = {"Koresh-e Rostam"},
["oki"] = {"Okiek"},
["okj"] = {"Oko-Juwoi"},
["okk"] = {"Kwamtim One"},
["okl"] = {"Old Kentish Sign Language"},
["okm"] = {"Middle Korean (10th-16th cent.)"},
["okn"] = {"Oki-No-Erabu"},
["oko"] = {"Old Korean (3rd-9th cent.)"},
["okr"] = {"Kirike"},
["oks"] = {"Oko-Eni-Osayen"},
["oku"] = {"Oku"},
["okv"] = {"Orokaiva"},
["okx"] = {"Okpe (Northwestern Edo)"},
["okz"] = {"Old Khmer"},
["ola"] = {"Walungge"},
["old"] = {"Mochi"},
["ole"] = {"Olekha"},
["olk"] = {"Olkol"},
["olm"] = {"Oloma"},
["olo"] = {"Livvi"},
["olr"] = {"Olrat"},
["olt"] = {"Old Lithuanian"},
["olu"] = {"Kuvale"},
["oma"] = {"Omaha-Ponca"},
["omb"] = {"East Ambae"},
["omc"] = {"Mochica"},
["omg"] = {"Omagua"},
["omi"] = {"Omi"},
["omk"] = {"Omok"},
["oml"] = {"Ombo"},
["omn"] = {"Minoan"},
["omo"] = {"Utarmbung"},
["omp"] = {"Old Manipuri"},
["omq"] = {"Oto-Manguean languages"},
["omr"] = {"Old Marathi"},
["omt"] = {"Omotik"},
["omu"] = {"Omurano"},
["omv"] = {"Omotic languages"},
["omw"] = {"South Tairora"},
["omx"] = {"Old Mon"},
["omy"] = {"Old Malay"},
["ona"] = {"Ona"},
["onb"] = {"Lingao"},
["one"] = {"Oneida"},
["ong"] = {"Olo"},
["oni"] = {"Onin"},
["onj"] = {"Onjob"},
["onk"] = {"Kabore One"},
["onn"] = {"Onobasulu"},
["ono"] = {"Onondaga"},
["onp"] = {"Sartang"},
["onr"] = {"Northern One"},
["ons"] = {"Ono"},
["ont"] = {"Ontenu"},
["onu"] = {"Unua"},
["onw"] = {"Old Nubian"},
["onx"] = {"Onin Based Pidgin"},
["ood"] = {"Tohono O'odham"},
["oog"] = {"Ong"},
["oon"] = {"Önge"},
["oor"] = {"Oorlams"},
["oos"] = {"Old Ossetic"},
["opa"] = {"Okpamheri"},
["opk"] = {"Kopkaka"},
["opm"] = {"Oksapmin"},
["opo"] = {"Opao"},
["opt"] = {"Opata"},
["opy"] = {"Ofayé"},
["ora"] = {"Oroha"},
["orc"] = {"Orma"},
["ore"] = {"Orejón"},
["org"] = {"Oring"},
["orh"] = {"Oroqen"},
["orn"] = {"Orang Kanaq"},
["oro"] = {"Orokolo"},
["orr"] = {"Oruma"},
["ors"] = {"Orang Seletar"},
["ort"] = {"Adivasi Oriya"},
["oru"] = {"Ormuri"},
["orv"] = {"Old Russian"},
["orw"] = {"Oro Win"},
["orx"] = {"Oro"},
["ory"] = {"Odia (individual language)", "Oriya (individual language)"},
["orz"] = {"Ormu"},
["osa"] = {"Osage"},
["osc"] = {"Oscan"},
["osi"] = {"Osing"},
["osn"] = {"Old Sundanese"},
["oso"] = {"Ososo"},
["osp"] = {"Old Spanish"},
["ost"] = {"Osatu"},
["osu"] = {"Southern One"},
["osx"] = {"Old Saxon"},
["ota"] = {"Ottoman Turkish (1500-1928)"},
["otb"] = {"Old Tibetan"},
["otd"] = {"Ot Danum"},
["ote"] = {"Mezquital Otomi"},
["oti"] = {"Oti"},
["otk"] = {"Old Turkish"},
["otl"] = {"Tilapa Otomi"},
["otm"] = {"Eastern Highland Otomi"},
["otn"] = {"Tenango Otomi"},
["oto"] = {"Otomian languages"},
["otq"] = {"Querétaro Otomi"},
["otr"] = {"Otoro"},
["ots"] = {"Estado de México Otomi"},
["ott"] = {"Temoaya Otomi"},
["otu"] = {"Otuke"},
["otw"] = {"Ottawa"},
["otx"] = {"Texcatepec Otomi"},
["oty"] = {"Old Tamil"},
["otz"] = {"Ixtenco Otomi"},
["oua"] = {"Tagargrent"},
["oub"] = {"Glio-Oubi"},
["oue"] = {"Oune"},
["oui"] = {"Old Uighur"},
["oum"] = {"Ouma"},
["ovd"] = {"Elfdalian", "Övdalian"},
["owi"] = {"Owiniga"},
["owl"] = {"Old Welsh"},
["oyb"] = {"Oy"},
["oyd"] = {"Oyda"},
["oym"] = {"Wayampi"},
["oyy"] = {"Oya'oya"},
["ozm"] = {"Koonzime"},
["paa"] = {"Papuan languages"},
["pab"] = {"Parecís"},
["pac"] = {"Pacoh"},
["pad"] = {"Paumarí"},
["pae"] = {"Pagibete"},
["paf"] = {"Paranawát"},
["pag"] = {"Pangasinan"},
["pah"] = {"Tenharim"},
["pai"] = {"Pe"},
["pak"] = {"Parakanã"},
["pal"] = {"Pahlavi"},
["pam"] = {"Pampanga", "Kapampangan"},
["pao"] = {"Northern Paiute"},
["pap"] = {"Papiamento"},
["paq"] = {"Parya"},
["par"] = {"Panamint", "Timbisha"},
["pas"] = {"Papasena"},
["pau"] = {"Palauan"},
["pav"] = {"Pakaásnovos"},
["paw"] = {"Pawnee"},
["pax"] = {"Pankararé"},
["pay"] = {"Pech"},
["paz"] = {"Pankararú"},
["pbb"] = {"Páez"},
["pbc"] = {"Patamona"},
["pbe"] = {"Mezontla Popoloca"},
["pbf"] = {"Coyotepec Popoloca"},
["pbg"] = {"Paraujano"},
["pbh"] = {"E'ñapa Woromaipu"},
["pbi"] = {"Parkwa"},
["pbl"] = {"Mak (Nigeria)"},
["pbm"] = {"Puebla Mazatec"},
["pbn"] = {"Kpasam"},
["pbo"] = {"Papel"},
["pbp"] = {"Badyara"},
["pbr"] = {"Pangwa"},
["pbs"] = {"Central Pame"},
["pbt"] = {"Southern Pashto"},
["pbu"] = {"Northern Pashto"},
["pbv"] = {"Pnar"},
["pby"] = {"Pyu (Papua New Guinea)"},
["pca"] = {"Santa Inés Ahuatempan Popoloca"},
["pcb"] = {"Pear"},
["pcc"] = {"Bouyei"},
["pcd"] = {"Picard"},
["pce"] = {"Ruching Palaung"},
["pcf"] = {"Paliyan"},
["pcg"] = {"Paniya"},
["pch"] = {"Pardhan"},
["pci"] = {"Duruwa"},
["pcj"] = {"Parenga"},
["pck"] = {"Paite Chin"},
["pcl"] = {"Pardhi"},
["pcm"] = {"Nigerian Pidgin"},
["pcn"] = {"Piti"},
["pcp"] = {"Pacahuara"},
["pcw"] = {"Pyapun"},
["pda"] = {"Anam"},
["pdc"] = {"Pennsylvania German"},
["pdi"] = {"Pa Di"},
["pdn"] = {"Podena", "Fedan"},
["pdo"] = {"Padoe"},
["pdt"] = {"Plautdietsch"},
["pdu"] = {"Kayan"},
["pea"] = {"Peranakan Indonesian"},
["peb"] = {"Eastern Pomo"},
["ped"] = {"Mala (Papua New Guinea)"},
["pee"] = {"Taje"},
["pef"] = {"Northeastern Pomo"},
["peg"] = {"Pengo"},
["peh"] = {"Bonan"},
["pei"] = {"Chichimeca-Jonaz"},
["pej"] = {"Northern Pomo"},
["pek"] = {"Penchal"},
["pel"] = {"Pekal"},
["pem"] = {"Phende"},
["peo"] = {"Old Persian (ca. 600-400 B.C.)"},
["pep"] = {"Kunja"},
["peq"] = {"Southern Pomo"},
["pes"] = {"Iranian Persian"},
["pev"] = {"Pémono"},
["pex"] = {"Petats"},
["pey"] = {"Petjo"},
["pez"] = {"Eastern Penan"},
["pfa"] = {"Pááfang"},
["pfe"] = {"Pere"},
["pfl"] = {"Pfaelzisch"},
["pga"] = {"Sudanese Creole Arabic"},
["pgd"] = {"Gāndhārī"},
["pgg"] = {"Pangwali"},
["pgi"] = {"Pagi"},
["pgk"] = {"Rerep"},
["pgl"] = {"Primitive Irish"},
["pgn"] = {"Paelignian"},
["pgs"] = {"Pangseng"},
["pgu"] = {"Pagu"},
["pgz"] = {"Papua New Guinean Sign Language"},
["pha"] = {"Pa-Hng"},
["phd"] = {"Phudagi"},
["phg"] = {"Phuong"},
["phh"] = {"Phukha"},
["phi"] = {"Philippine languages"},
["phj"] = {"Pahari"},
["phk"] = {"Phake"},
["phl"] = {"Phalura", "Palula"},
["phm"] = {"Phimbi"},
["phn"] = {"Phoenician"},
["pho"] = {"Phunoi"},
["phq"] = {"Phana'"},
["phr"] = {"Pahari-Potwari"},
["pht"] = {"Phu Thai"},
["phu"] = {"Phuan"},
["phv"] = {"Pahlavani"},
["phw"] = {"Phangduwali"},
["pia"] = {"Pima Bajo"},
["pib"] = {"Yine"},
["pic"] = {"Pinji"},
["pid"] = {"Piaroa"},
["pie"] = {"Piro"},
["pif"] = {"Pingelapese"},
["pig"] = {"Pisabo"},
["pih"] = {"Pitcairn-Norfolk"},
["pij"] = {"Pijao"},
["pil"] = {"Yom"},
["pim"] = {"Powhatan"},
["pin"] = {"Piame"},
["pio"] = {"Piapoco"},
["pip"] = {"Pero"},
["pir"] = {"Piratapuyo"},
["pis"] = {"Pijin"},
["pit"] = {"Pitta Pitta"},
["piu"] = {"Pintupi-Luritja"},
["piv"] = {"Pileni", "Vaeakau-Taumako"},
["piw"] = {"Pimbwe"},
["pix"] = {"Piu"},
["piy"] = {"Piya-Kwonci"},
["piz"] = {"Pije"},
["pjt"] = {"Pitjantjatjara"},
["pka"] = {"Ardhamāgadhī Prākrit"},
["pkb"] = {"Pokomo", "Kipfokomo"},
["pkc"] = {"Paekche"},
["pkg"] = {"Pak-Tong"},
["pkh"] = {"Pankhu"},
["pkn"] = {"Pakanha"},
["pko"] = {"Pökoot"},
["pkp"] = {"Pukapuka"},
["pkr"] = {"Attapady Kurumba"},
["pks"] = {"Pakistan Sign Language"},
["pkt"] = {"Maleng"},
["pku"] = {"Paku"},
["pla"] = {"Miani"},
["plb"] = {"Polonombauk"},
["plc"] = {"Central Palawano"},
["pld"] = {"Polari"},
["ple"] = {"Palu'e"},
["plf"] = {"Central Malayo-Polynesian languages"},
["plg"] = {"Pilagá"},
["plh"] = {"Paulohi"},
["plk"] = {"Kohistani Shina"},
["pll"] = {"Shwe Palaung"},
["pln"] = {"Palenquero"},
["plo"] = {"Oluta Popoluca"},
["plq"] = {"Palaic"},
["plr"] = {"Palaka Senoufo"},
["pls"] = {"San Marcos Tlacoyalco Popoloca", "San Marcos Tlalcoyalco Popoloca"},
["plt"] = {"Plateau Malagasy"},
["plu"] = {"Palikúr"},
["plv"] = {"Southwest Palawano"},
["plw"] = {"Brooke's Point Palawano"},
["ply"] = {"Bolyu"},
["plz"] = {"Paluan"},
["pma"] = {"Paama"},
["pmb"] = {"Pambia"},
["pmd"] = {"Pallanganmiddang"},
["pme"] = {"Pwaamei"},
["pmf"] = {"Pamona"},
["pmh"] = {"Māhārāṣṭri Prākrit"},
["pmi"] = {"Northern Pumi"},
["pmj"] = {"Southern Pumi"},
["pml"] = {"Lingua Franca"},
["pmm"] = {"Pomo"},
["pmn"] = {"Pam"},
["pmo"] = {"Pom"},
["pmq"] = {"Northern Pame"},
["pmr"] = {"Paynamar"},
["pms"] = {"Piemontese"},
["pmt"] = {"Tuamotuan"},
["pmw"] = {"Plains Miwok"},
["pmx"] = {"Poumei Naga"},
["pmy"] = {"Papuan Malay"},
["pmz"] = {"Southern Pame"},
["pna"] = {"Punan Bah-Biau"},
["pnb"] = {"Western Panjabi"},
["pnc"] = {"Pannei"},
["pnd"] = {"Mpinda"},
["pne"] = {"Western Penan"},
["png"] = {"Pangu", "Pongu"},
["pnh"] = {"Penrhyn"},
["pni"] = {"Aoheng"},
["pnj"] = {"Pinjarup"},
["pnk"] = {"Paunaka"},
["pnl"] = {"Paleni"},
["pnm"] = {"Punan Batu 1"},
["pnn"] = {"Pinai-Hagahai"},
["pno"] = {"Panobo"},
["pnp"] = {"Pancana"},
["pnq"] = {"Pana (Burkina Faso)"},
["pnr"] = {"Panim"},
["pns"] = {"Ponosakan"},
["pnt"] = {"Pontic"},
["pnu"] = {"Jiongnai Bunu"},
["pnv"] = {"Pinigura"},
["pnw"] = {"Banyjima", "Panytyima"},
["pnx"] = {"Phong-Kniang"},
["pny"] = {"Pinyin"},
["pnz"] = {"Pana (Central African Republic)"},
["poc"] = {"Poqomam"},
["poe"] = {"San Juan Atzingo Popoloca"},
["pof"] = {"Poke"},
["pog"] = {"Potiguára"},
["poh"] = {"Poqomchi'"},
["poi"] = {"Highland Popoluca"},
["pok"] = {"Pokangá"},
["pom"] = {"Southeastern Pomo"},
["pon"] = {"Pohnpeian"},
["poo"] = {"Central Pomo"},
["pop"] = {"Pwapwâ"},
["poq"] = {"Texistepec Popoluca"},
["pos"] = {"Sayula Popoluca"},
["pot"] = {"Potawatomi"},
["pov"] = {"Upper Guinea Crioulo"},
["pow"] = {"San Felipe Otlaltepec Popoloca"},
["pox"] = {"Polabian"},
["poy"] = {"Pogolo"},
["poz"] = {"Malayo-Polynesian languages"},
["ppe"] = {"Papi"},
["ppi"] = {"Paipai"},
["ppk"] = {"Uma"},
["ppl"] = {"Pipil", "Nicarao"},
["ppm"] = {"Papuma"},
["ppn"] = {"Papapana"},
["ppo"] = {"Folopa"},
["ppp"] = {"Pelende"},
["ppq"] = {"Pei"},
["pps"] = {"San Luís Temalacayuca Popoloca"},
["ppt"] = {"Pare"},
["ppu"] = {"Papora"},
["pqa"] = {"Pa'a"},
["pqe"] = {"Eastern Malayo-Polynesian languages"},
["pqm"] = {"Malecite-Passamaquoddy"},
["pqw"] = {"Western Malayo-Polynesian languages"},
["pra"] = {"Prakrit languages"},
["prc"] = {"Parachi"},
["prd"] = {"Parsi-Dari"},
["pre"] = {"Principense"},
["prf"] = {"Paranan"},
["prg"] = {"Prussian"},
["prh"] = {"Porohanon"},
["pri"] = {"Paicî"},
["prk"] = {"Parauk"},
["prl"] = {"Peruvian Sign Language"},
["prm"] = {"Kibiri"},
["prn"] = {"Prasuni"},
["pro"] = {"Old Provençal (to 1500)", "Old Occitan (to 1500)"},
["prq"] = {"Ashéninka Perené"},
["prr"] = {"Puri"},
["prs"] = {"Dari", "Afghan Persian"},
["prt"] = {"Phai"},
["pru"] = {"Puragi"},
["prw"] = {"Parawen"},
["prx"] = {"Purik"},
["prz"] = {"Providencia Sign Language"},
["psa"] = {"Asue Awyu"},
["psc"] = {"Iranian Sign Language", "Persian Sign Language"},
["psd"] = {"Plains Indian Sign Language"},
["pse"] = {"Central Malay"},
["psg"] = {"Penang Sign Language"},
["psh"] = {"Southwest Pashai", "Southwest Pashayi"},
["psi"] = {"Southeast Pashai", "Southeast Pashayi"},
["psl"] = {"Puerto Rican Sign Language"},
["psm"] = {"Pauserna"},
["psn"] = {"Panasuan"},
["pso"] = {"Polish Sign Language"},
["psp"] = {"Philippine Sign Language"},
["psq"] = {"Pasi"},
["psr"] = {"Portuguese Sign Language"},
["pss"] = {"Kaulong"},
["pst"] = {"Central Pashto"},
["psu"] = {"Sauraseni Prākrit"},
["psw"] = {"Port Sandwich"},
["psy"] = {"Piscataway"},
["pta"] = {"Pai Tavytera"},
["pth"] = {"Pataxó Hã-Ha-Hãe"},
["pti"] = {"Pindiini", "Wangkatha"},
["ptn"] = {"Patani"},
["pto"] = {"Zo'é"},
["ptp"] = {"Patep"},
["ptq"] = {"Pattapu"},
["ptr"] = {"Piamatsina"},
["ptt"] = {"Enrekang"},
["ptu"] = {"Bambam"},
["ptv"] = {"Port Vato"},
["ptw"] = {"Pentlatch"},
["pty"] = {"Pathiya"},
["pua"] = {"Western Highland Purepecha"},
["pub"] = {"Purum"},
["puc"] = {"Punan Merap"},
["pud"] = {"Punan Aput"},
["pue"] = {"Puelche"},
["puf"] = {"Punan Merah"},
["pug"] = {"Phuie"},
["pui"] = {"Puinave"},
["puj"] = {"Punan Tubu"},
["pum"] = {"Puma"},
["puo"] = {"Puoc"},
["pup"] = {"Pulabu"},
["puq"] = {"Puquina"},
["pur"] = {"Puruborá"},
["put"] = {"Putoh"},
["puu"] = {"Punu"},
["puw"] = {"Puluwatese"},
["pux"] = {"Puare"},
["puy"] = {"Purisimeño"},
["pwa"] = {"Pawaia"},
["pwb"] = {"Panawa"},
["pwg"] = {"Gapapaiwa"},
["pwi"] = {"Patwin"},
["pwm"] = {"Molbog"},
["pwn"] = {"Paiwan"},
["pwo"] = {"Pwo Western Karen"},
["pwr"] = {"Powari"},
["pww"] = {"Pwo Northern Karen"},
["pxm"] = {"Quetzaltepec Mixe"},
["pye"] = {"Pye Krumen"},
["pym"] = {"Fyam"},
["pyn"] = {"Poyanáwa"},
["pys"] = {"Paraguayan Sign Language", "Lengua de Señas del Paraguay"},
["pyu"] = {"Puyuma"},
["pyx"] = {"Pyu (Myanmar)"},
["pyy"] = {"Pyen"},
["pze"] = {"Pesse"},
["pzh"] = {"Pazeh"},
["pzn"] = {"Jejara Naga", "Para Naga"},
["qua"] = {"Quapaw"},
["qub"] = {"Huallaga Huánuco Quechua"},
["quc"] = {"K'iche'", "Quiché"},
["qud"] = {"Calderón Highland Quichua"},
["quf"] = {"Lambayeque Quechua"},
["qug"] = {"Chimborazo Highland Quichua"},
["quh"] = {"South Bolivian Quechua"},
["qui"] = {"Quileute"},
["quk"] = {"Chachapoyas Quechua"},
["qul"] = {"North Bolivian Quechua"},
["qum"] = {"Sipacapense"},
["qun"] = {"Quinault"},
["qup"] = {"Southern Pastaza Quechua"},
["quq"] = {"Quinqui"},
["qur"] = {"Yanahuanca Pasco Quechua"},
["qus"] = {"Santiago del Estero Quichua"},
["quv"] = {"Sacapulteco"},
["quw"] = {"Tena Lowland Quichua"},
["qux"] = {"Yauyos Quechua"},
["quy"] = {"Ayacucho Quechua"},
["quz"] = {"Cusco Quechua"},
["qva"] = {"Ambo-Pasco Quechua"},
["qvc"] = {"Cajamarca Quechua"},
["qve"] = {"Eastern Apurímac Quechua"},
["qvh"] = {"Huamalíes-Dos de Mayo Huánuco Quechua"},
["qvi"] = {"Imbabura Highland Quichua"},
["qvj"] = {"Loja Highland Quichua"},
["qvl"] = {"Cajatambo North Lima Quechua"},
["qvm"] = {"Margos-Yarowilca-Lauricocha Quechua"},
["qvn"] = {"North Junín Quechua"},
["qvo"] = {"Napo Lowland Quechua"},
["qvp"] = {"Pacaraos Quechua"},
["qvs"] = {"San Martín Quechua"},
["qvw"] = {"Huaylla Wanca Quechua"},
["qvy"] = {"Queyu"},
["qvz"] = {"Northern Pastaza Quichua"},
["qwa"] = {"Corongo Ancash Quechua"},
["qwc"] = {"Classical Quechua"},
["qwe"] = {"Quechuan (family)"},
["qwh"] = {"Huaylas Ancash Quechua"},
["qwm"] = {"Kuman (Russia)"},
["qws"] = {"Sihuas Ancash Quechua"},
["qwt"] = {"Kwalhioqua-Tlatskanai"},
["qxa"] = {"Chiquián Ancash Quechua"},
["qxc"] = {"Chincha Quechua"},
["qxh"] = {"Panao Huánuco Quechua"},
["qxl"] = {"Salasaca Highland Quichua"},
["qxn"] = {"Northern Conchucos Ancash Quechua"},
["qxo"] = {"Southern Conchucos Ancash Quechua"},
["qxp"] = {"Puno Quechua"},
["qxq"] = {"Qashqa'i"},
["qxr"] = {"Cañar Highland Quichua"},
["qxs"] = {"Southern Qiang"},
["qxt"] = {"Santa Ana de Tusi Pasco Quechua"},
["qxu"] = {"Arequipa-La Unión Quechua"},
["qxw"] = {"Jauja Wanca Quechua"},
["qya"] = {"Quenya"},
["qyp"] = {"Quiripi"},
["raa"] = {"Dungmali"},
["rab"] = {"Camling"},
["rac"] = {"Rasawa"},
["rad"] = {"Rade"},
["raf"] = {"Western Meohang"},
["rag"] = {"Logooli", "Lulogooli"},
["rah"] = {"Rabha"},
["rai"] = {"Ramoaaina"},
["raj"] = {"Rajasthani"},
["rak"] = {"Tulu-Bohuai"},
["ral"] = {"Ralte"},
["ram"] = {"Canela"},
["ran"] = {"Riantana"},
["rao"] = {"Rao"},
["rap"] = {"Rapanui"},
["raq"] = {"Saam"},
["rar"] = {"Rarotongan", "Cook Islands Maori"},
["ras"] = {"Tegali"},
["rat"] = {"Razajerdi"},
["rau"] = {"Raute"},
["rav"] = {"Sampang"},
["raw"] = {"Rawang"},
["rax"] = {"Rang"},
["ray"] = {"Rapa"},
["raz"] = {"Rahambuu"},
["rbb"] = {"Rumai Palaung"},
["rbk"] = {"Northern Bontok"},
["rbl"] = {"Miraya Bikol"},
["rbp"] = {"Barababaraba"},
["rcf"] = {"Réunion Creole French"},
["rdb"] = {"Rudbari"},
["rea"] = {"Rerau"},
["reb"] = {"Rembong"},
["ree"] = {"Rejang Kayan"},
["reg"] = {"Kara (Tanzania)"},
["rei"] = {"Reli"},
["rej"] = {"Rejang"},
["rel"] = {"Rendille"},
["rem"] = {"Remo"},
["ren"] = {"Rengao"},
["rer"] = {"Rer Bare"},
["res"] = {"Reshe"},
["ret"] = {"Retta"},
["rey"] = {"Reyesano"},
["rga"] = {"Roria"},
["rge"] = {"Romano-Greek"},
["rgk"] = {"Rangkas"},
["rgn"] = {"Romagnol"},
["rgr"] = {"Resígaro"},
["rgs"] = {"Southern Roglai"},
["rgu"] = {"Ringgou"},
["rhg"] = {"Rohingya"},
["rhp"] = {"Yahang"},
["ria"] = {"Riang (India)"},
["rib"] = {"Bribri Sign Language"},
["rif"] = {"Tarifit"},
["ril"] = {"Riang Lang", "Riang (Myanmar)"},
["rim"] = {"Nyaturu"},
["rin"] = {"Nungu"},
["rir"] = {"Ribun"},
["rit"] = {"Ritharrngu"},
["riu"] = {"Riung"},
["rjg"] = {"Rajong"},
["rji"] = {"Raji"},
["rjs"] = {"Rajbanshi"},
["rka"] = {"Kraol"},
["rkb"] = {"Rikbaktsa"},
["rkh"] = {"Rakahanga-Manihiki"},
["rki"] = {"Rakhine"},
["rkm"] = {"Marka"},
["rkt"] = {"Rangpuri", "Kamta"},
["rkw"] = {"Arakwal"},
["rma"] = {"Rama"},
["rmb"] = {"Rembarrnga"},
["rmc"] = {"Carpathian Romani"},
["rmd"] = {"Traveller Danish"},
["rme"] = {"Angloromani"},
["rmf"] = {"Kalo Finnish Romani"},
["rmg"] = {"Traveller Norwegian"},
["rmh"] = {"Murkim"},
["rmi"] = {"Lomavren"},
["rmk"] = {"Romkun"},
["rml"] = {"Baltic Romani"},
["rmm"] = {"Roma"},
["rmn"] = {"Balkan Romani"},
["rmo"] = {"Sinte Romani"},
["rmp"] = {"Rempi"},
["rmq"] = {"Caló"},
["rms"] = {"Romanian Sign Language"},
["rmt"] = {"Domari"},
["rmu"] = {"Tavringer Romani"},
["rmv"] = {"Romanova"},
["rmw"] = {"Welsh Romani"},
["rmx"] = {"Romam"},
["rmy"] = {"Vlax Romani"},
["rmz"] = {"Marma"},
["rnb"] = {"Brunca Sign Language"},
["rnd"] = {"Ruund"},
["rng"] = {"Ronga"},
["rnl"] = {"Ranglong"},
["rnn"] = {"Roon"},
["rnp"] = {"Rongpo"},
["rnr"] = {"Nari Nari"},
["rnw"] = {"Rungwa"},
["roa"] = {"Romance languages"},
["rob"] = {"Tae'"},
["roc"] = {"Cacgia Roglai"},
["rod"] = {"Rogo"},
["roe"] = {"Ronji"},
["rof"] = {"Rombo"},
["rog"] = {"Northern Roglai"},
["rol"] = {"Romblomanon"},
["rom"] = {"Romany"},
["roo"] = {"Rotokas"},
["rop"] = {"Kriol"},
["ror"] = {"Rongga"},
["rou"] = {"Runga"},
["row"] = {"Dela-Oenale"},
["rpn"] = {"Repanbitip"},
["rpt"] = {"Rapting"},
["rri"] = {"Ririo"},
["rro"] = {"Waima"},
["rrt"] = {"Arritinngithigh"},
["rsb"] = {"Romano-Serbian"},
["rsk"] = {"Ruthenian", "Rusnak"},
["rsl"] = {"Russian Sign Language"},
["rsm"] = {"Miriwoong Sign Language"},
["rsn"] = {"Rwandan Sign Language"},
["rsw"] = {"Rishiwa"},
["rtc"] = {"Rungtu Chin"},
["rth"] = {"Ratahan"},
["rtm"] = {"Rotuman"},
["rts"] = {"Yurats"},
["rtw"] = {"Rathawi"},
["rub"] = {"Gungu"},
["ruc"] = {"Ruuli"},
["rue"] = {"Rusyn"},
["ruf"] = {"Luguru"},
["rug"] = {"Roviana"},
["ruh"] = {"Ruga"},
["rui"] = {"Rufiji"},
["ruk"] = {"Che"},
["ruo"] = {"Istro Romanian"},
["rup"] = {"Macedo-Romanian", "Aromanian", "Arumanian"},
["ruq"] = {"Megleno Romanian"},
["rut"] = {"Rutul"},
["ruu"] = {"Lanas Lobu"},
["ruy"] = {"Mala (Nigeria)"},
["ruz"] = {"Ruma"},
["rwa"] = {"Rawo"},
["rwk"] = {"Rwa"},
["rwl"] = {"Ruwila"},
["rwm"] = {"Amba (Uganda)"},
["rwo"] = {"Rawa"},
["rwr"] = {"Marwari (India)"},
["rxd"] = {"Ngardi"},
["rxw"] = {"Karuwali", "Garuwali"},
["ryn"] = {"Northern Amami-Oshima"},
["rys"] = {"Yaeyama"},
["ryu"] = {"Central Okinawan"},
["rzh"] = {"Rāziḥī"},
["saa"] = {"Saba"},
["sab"] = {"Buglere"},
["sac"] = {"Meskwaki"},
["sad"] = {"Sandawe"},
["sae"] = {"Sabanê"},
["saf"] = {"Safaliba"},
["sah"] = {"Yakut"},
["sai"] = {"South American Indian languages"},
["saj"] = {"Sahu"},
["sak"] = {"Sake"},
["sal"] = {"Salishan languages"},
["sam"] = {"Samaritan Aramaic"},
["sao"] = {"Sause"},
["saq"] = {"Samburu"},
["sar"] = {"Saraveca"},
["sas"] = {"Sasak"},
["sat"] = {"Santali"},
["sau"] = {"Saleman"},
["sav"] = {"Saafi-Saafi"},
["saw"] = {"Sawi"},
["sax"] = {"Sa"},
["say"] = {"Saya"},
["saz"] = {"Saurashtra"},
["sba"] = {"Ngambay"},
["sbb"] = {"Simbo"},
["sbc"] = {"Kele (Papua New Guinea)"},
["sbd"] = {"Southern Samo"},
["sbe"] = {"Saliba"},
["sbf"] = {"Chabu", "Shabo"},
["sbg"] = {"Seget"},
["sbh"] = {"Sori-Harengan"},
["sbi"] = {"Seti"},
["sbj"] = {"Surbakhal"},
["sbk"] = {"Safwa"},
["sbl"] = {"Botolan Sambal"},
["sbm"] = {"Sagala"},
["sbn"] = {"Sindhi Bhil"},
["sbo"] = {"Sabüm"},
["sbp"] = {"Sangu (Tanzania)"},
["sbq"] = {"Sileibi"},
["sbr"] = {"Sembakung Murut"},
["sbs"] = {"Subiya"},
["sbt"] = {"Kimki"},
["sbu"] = {"Stod Bhoti"},
["sbv"] = {"Sabine"},
["sbw"] = {"Simba"},
["sbx"] = {"Seberuang"},
["sby"] = {"Soli"},
["sbz"] = {"Sara Kaba"},
["scb"] = {"Chut"},
["sce"] = {"Dongxiang"},
["scf"] = {"San Miguel Creole French"},
["scg"] = {"Sanggau"},
["sch"] = {"Sakachep"},
["sci"] = {"Sri Lankan Creole Malay"},
["sck"] = {"Sadri"},
["scl"] = {"Shina"},
["scn"] = {"Sicilian"},
["sco"] = {"Scots"},
["scp"] = {"Hyolmo", "Helambu Sherpa"},
["scq"] = {"Sa'och"},
["scs"] = {"North Slavey"},
["sct"] = {"Southern Katang"},
["scu"] = {"Shumcho"},
["scv"] = {"Sheni"},
["scw"] = {"Sha"},
["scx"] = {"Sicel"},
["sda"] = {"Toraja-Sa'dan"},
["sdb"] = {"Shabak"},
["sdc"] = {"Sassarese Sardinian"},
["sde"] = {"Surubu"},
["sdf"] = {"Sarli"},
["sdg"] = {"Savi"},
["sdh"] = {"Southern Kurdish"},
["sdj"] = {"Suundi"},
["sdk"] = {"Sos Kundi"},
["sdl"] = {"Saudi Arabian Sign Language"},
["sdn"] = {"Gallurese Sardinian"},
["sdo"] = {"Bukar-Sadung Bidayuh"},
["sdp"] = {"Sherdukpen"},
["sdq"] = {"Semandang"},
["sdr"] = {"Oraon Sadri"},
["sds"] = {"Sened"},
["sdt"] = {"Shuadit"},
["sdu"] = {"Sarudu"},
["sdv"] = {"Eastern Sudanic languages"},
["sdx"] = {"Sibu Melanau"},
["sdz"] = {"Sallands"},
["sea"] = {"Semai"},
["seb"] = {"Shempire Senoufo"},
["sec"] = {"Sechelt"},
["sed"] = {"Sedang"},
["see"] = {"Seneca"},
["sef"] = {"Cebaara Senoufo"},
["seg"] = {"Segeju"},
["seh"] = {"Sena"},
["sei"] = {"Seri"},
["sej"] = {"Sene"},
["sek"] = {"Sekani"},
["sel"] = {"Selkup"},
["sem"] = {"Semitic languages"},
["sen"] = {"Nanerigé Sénoufo"},
["seo"] = {"Suarmin"},
["sep"] = {"Sìcìté Sénoufo"},
["seq"] = {"Senara Sénoufo"},
["ser"] = {"Serrano"},
["ses"] = {"Koyraboro Senni Songhai"},
["set"] = {"Sentani"},
["seu"] = {"Serui-Laut"},
["sev"] = {"Nyarafolo Senoufo"},
["sew"] = {"Sewa Bay"},
["sey"] = {"Secoya"},
["sez"] = {"Senthang Chin"},
["sfb"] = {"Langue des signes de Belgique Francophone", "French Belgian Sign Language"},
["sfe"] = {"Eastern Subanen"},
["sfm"] = {"Small Flowery Miao"},
["sfs"] = {"South African Sign Language"},
["sfw"] = {"Sehwi"},
["sga"] = {"Old Irish (to 900)"},
["sgb"] = {"Mag-antsi Ayta"},
["sgc"] = {"Kipsigis"},
["sgd"] = {"Surigaonon"},
["sge"] = {"Segai"},
["sgg"] = {"Swiss-German Sign Language"},
["sgh"] = {"Shughni"},
["sgi"] = {"Suga"},
["sgj"] = {"Surgujia"},
["sgk"] = {"Sangkong"},
["sgm"] = {"Singa"},
["sgn"] = {"Sign languages"},
["sgp"] = {"Singpho"},
["sgr"] = {"Sangisari"},
["sgs"] = {"Samogitian"},
["sgt"] = {"Brokpake"},
["sgu"] = {"Salas"},
["sgw"] = {"Sebat Bet Gurage"},
["sgx"] = {"Sierra Leone Sign Language"},
["sgy"] = {"Sanglechi"},
["sgz"] = {"Sursurunga"},
["sha"] = {"Shall-Zwall"},
["shb"] = {"Ninam"},
["shc"] = {"Sonde"},
["shd"] = {"Kundal Shahi"},
["she"] = {"Sheko"},
["shg"] = {"Shua"},
["shh"] = {"Shoshoni"},
["shi"] = {"Tachelhit"},
["shj"] = {"Shatt"},
["shk"] = {"Shilluk"},
["shl"] = {"Shendu"},
["shm"] = {"Shahrudi"},
["shn"] = {"Shan"},
["sho"] = {"Shanga"},
["shp"] = {"Shipibo-Conibo"},
["shq"] = {"Sala"},
["shr"] = {"Shi"},
["shs"] = {"Shuswap"},
["sht"] = {"Shasta"},
["shu"] = {"Chadian Arabic"},
["shv"] = {"Shehri"},
["shw"] = {"Shwai"},
["shx"] = {"She"},
["shy"] = {"Tachawit"},
["shz"] = {"Syenara Senoufo"},
["sia"] = {"Akkala Sami"},
["sib"] = {"Sebop"},
["sid"] = {"Sidamo"},
["sie"] = {"Simaa"},
["sif"] = {"Siamou"},
["sig"] = {"Paasaal"},
["sih"] = {"Zire", "Sîshëë"},
["sii"] = {"Shom Peng"},
["sij"] = {"Numbami"},
["sik"] = {"Sikiana"},
["sil"] = {"Tumulung Sisaala"},
["sim"] = {"Mende (Papua New Guinea)"},
["sio"] = {"Siouan languages"},
["sip"] = {"Sikkimese"},
["siq"] = {"Sonia"},
["sir"] = {"Siri"},
["sis"] = {"Siuslaw"},
["sit"] = {"Sino-Tibetan languages"},
["siu"] = {"Sinagen"},
["siv"] = {"Sumariup"},
["siw"] = {"Siwai"},
["six"] = {"Sumau"},
["siy"] = {"Sivandi"},
["siz"] = {"Siwi"},
["sja"] = {"Epena"},
["sjb"] = {"Sajau Basap"},
["sjd"] = {"Kildin Sami"},
["sje"] = {"Pite Sami"},
["sjg"] = {"Assangori"},
["sjk"] = {"Kemi Sami"},
["sjl"] = {"Sajalong", "Miji"},
["sjm"] = {"Mapun"},
["sjn"] = {"Sindarin"},
["sjo"] = {"Xibe"},
["sjp"] = {"Surjapuri"},
["sjr"] = {"Siar-Lak"},
["sjs"] = {"Senhaja De Srair"},
["sjt"] = {"Ter Sami"},
["sju"] = {"Ume Sami"},
["sjw"] = {"Shawnee"},
["ska"] = {"Skagit"},
["skb"] = {"Saek"},
["skc"] = {"Ma Manda"},
["skd"] = {"Southern Sierra Miwok"},
["ske"] = {"Seke (Vanuatu)"},
["skf"] = {"Sakirabiá"},
["skg"] = {"Sakalava Malagasy"},
["skh"] = {"Sikule"},
["ski"] = {"Sika"},
["skj"] = {"Seke (Nepal)"},
["skm"] = {"Kutong"},
["skn"] = {"Kolibugan Subanon"},
["sko"] = {"Seko Tengah"},
["skp"] = {"Sekapan"},
["skq"] = {"Sininkere"},
["skr"] = {"Saraiki", "Seraiki"},
["sks"] = {"Maia"},
["skt"] = {"Sakata"},
["sku"] = {"Sakao"},
["skv"] = {"Skou"},
["skw"] = {"Skepi Creole Dutch"},
["skx"] = {"Seko Padang"},
["sky"] = {"Sikaiana"},
["skz"] = {"Sekar"},
["sla"] = {"Slavic languages"},
["slc"] = {"Sáliba"},
["sld"] = {"Sissala"},
["sle"] = {"Sholaga"},
["slf"] = {"Swiss-Italian Sign Language"},
["slg"] = {"Selungai Murut"},
["slh"] = {"Southern Puget Sound Salish"},
["sli"] = {"Lower Silesian"},
["slj"] = {"Salumá"},
["sll"] = {"Salt-Yui"},
["slm"] = {"Pangutaran Sama"},
["sln"] = {"Salinan"},
["slp"] = {"Lamaholot"},
["slr"] = {"Salar"},
["sls"] = {"Singapore Sign Language"},
["slt"] = {"Sila"},
["slu"] = {"Selaru"},
["slw"] = {"Sialum"},
["slx"] = {"Salampasu"},
["sly"] = {"Selayar"},
["slz"] = {"Ma'ya"},
["sma"] = {"Southern Sami"},
["smb"] = {"Simbari"},
["smc"] = {"Som"},
["smf"] = {"Auwe"},
["smg"] = {"Simbali"},
["smh"] = {"Samei"},
["smi"] = {"Sami languages"},
["smj"] = {"Lule Sami"},
["smk"] = {"Bolinao"},
["sml"] = {"Central Sama"},
["smm"] = {"Musasa"},
["smn"] = {"Inari Sami"},
["smp"] = {"Samaritan"},
["smq"] = {"Samo"},
["smr"] = {"Simeulue"},
["sms"] = {"Skolt Sami"},
["smt"] = {"Simte"},
["smu"] = {"Somray"},
["smv"] = {"Samvedi"},
["smw"] = {"Sumbawa"},
["smx"] = {"Samba"},
["smy"] = {"Semnani"},
["smz"] = {"Simeku"},
["snc"] = {"Sinaugoro"},
["sne"] = {"Bau Bidayuh"},
["snf"] = {"Noon"},
["sng"] = {"Sanga (Democratic Republic of Congo)"},
["sni"] = {"Sensi"},
["snj"] = {"Riverain Sango"},
["snk"] = {"Soninke"},
["snl"] = {"Sangil"},
["snm"] = {"Southern Ma'di"},
["snn"] = {"Siona"},
["sno"] = {"Snohomish"},
["snp"] = {"Siane"},
["snq"] = {"Sangu (Gabon)"},
["snr"] = {"Sihan"},
["sns"] = {"South West Bay", "Nahavaq"},
["snu"] = {"Senggi", "Viid"},
["snv"] = {"Sa'ban"},
["snw"] = {"Selee"},
["snx"] = {"Sam"},
["sny"] = {"Saniyo-Hiyewe"},
["snz"] = {"Kou"},
["soa"] = {"Thai Song"},
["sob"] = {"Sobei"},
["soc"] = {"So (Democratic Republic of Congo)"},
["sod"] = {"Songoora"},
["soe"] = {"Songomeno"},
["sog"] = {"Sogdian"},
["soh"] = {"Aka"},
["soi"] = {"Sonha"},
["soj"] = {"Soi"},
["sok"] = {"Sokoro"},
["sol"] = {"Solos"},
["son"] = {"Songhai languages"},
["soo"] = {"Songo"},
["sop"] = {"Songe"},
["soq"] = {"Kanasi"},
["sor"] = {"Somrai"},
["sos"] = {"Seeku"},
["sou"] = {"Southern Thai"},
["sov"] = {"Sonsorol"},
["sow"] = {"Sowanda"},
["sox"] = {"Swo"},
["soy"] = {"Miyobe"},
["soz"] = {"Temi"},
["spb"] = {"Sepa (Indonesia)"},
["spc"] = {"Sapé"},
["spd"] = {"Saep"},
["spe"] = {"Sepa (Papua New Guinea)"},
["spg"] = {"Sian"},
["spi"] = {"Saponi"},
["spk"] = {"Sengo"},
["spl"] = {"Selepet"},
["spm"] = {"Akukem"},
["spn"] = {"Sanapaná"},
["spo"] = {"Spokane"},
["spp"] = {"Supyire Senoufo"},
["spq"] = {"Loreto-Ucayali Spanish"},
["spr"] = {"Saparua"},
["sps"] = {"Saposa"},
["spt"] = {"Spiti Bhoti"},
["spu"] = {"Sapuan"},
["spv"] = {"Sambalpuri", "Kosli"},
["spx"] = {"South Picene"},
["spy"] = {"Sabaot"},
["sqa"] = {"Shama-Sambuga"},
["sqh"] = {"Shau"},
["sqj"] = {"Albanian languages"},
["sqk"] = {"Albanian Sign Language"},
["sqm"] = {"Suma"},
["sqn"] = {"Susquehannock"},
["sqo"] = {"Sorkhei"},
["sqq"] = {"Sou"},
["sqr"] = {"Siculo Arabic"},
["sqs"] = {"Sri Lankan Sign Language"},
["sqt"] = {"Soqotri"},
["squ"] = {"Squamish"},
["sqx"] = {"Kufr Qassem Sign Language (KQSL)"},
["sra"] = {"Saruga"},
["srb"] = {"Sora"},
["src"] = {"Logudorese Sardinian"},
["sre"] = {"Sara"},
["srf"] = {"Nafi"},
["srg"] = {"Sulod"},
["srh"] = {"Sarikoli"},
["sri"] = {"Siriano"},
["srk"] = {"Serudung Murut"},
["srl"] = {"Isirawa"},
["srm"] = {"Saramaccan"},
["srn"] = {"Sranan Tongo"},
["sro"] = {"Campidanese Sardinian"},
["srq"] = {"Sirionó"},
["srr"] = {"Serer"},
["srs"] = {"Sarsi"},
["srt"] = {"Sauri"},
["sru"] = {"Suruí"},
["srv"] = {"Southern Sorsoganon"},
["srw"] = {"Serua"},
["srx"] = {"Sirmauri"},
["sry"] = {"Sera"},
["srz"] = {"Shahmirzadi"},
["ssa"] = {"Nilo-Saharan languages"},
["ssb"] = {"Southern Sama"},
["ssc"] = {"Suba-Simbiti"},
["ssd"] = {"Siroi"},
["sse"] = {"Balangingi", "Bangingih Sama"},
["ssf"] = {"Thao"},
["ssg"] = {"Seimat"},
["ssh"] = {"Shihhi Arabic"},
["ssi"] = {"Sansi"},
["ssj"] = {"Sausi"},
["ssk"] = {"Sunam"},
["ssl"] = {"Western Sisaala"},
["ssm"] = {"Semnam"},
["ssn"] = {"Waata"},
["sso"] = {"Sissano"},
["ssp"] = {"Spanish Sign Language"},
["ssq"] = {"So'a"},
["ssr"] = {"Swiss-French Sign Language"},
["sss"] = {"Sô"},
["sst"] = {"Sinasina"},
["ssu"] = {"Susuami"},
["ssv"] = {"Shark Bay"},
["ssx"] = {"Samberigi"},
["ssy"] = {"Saho"},
["ssz"] = {"Sengseng"},
["sta"] = {"Settla"},
["stb"] = {"Northern Subanen"},
["std"] = {"Sentinel"},
["ste"] = {"Liana-Seti"},
["stf"] = {"Seta"},
["stg"] = {"Trieng"},
["sth"] = {"Shelta"},
["sti"] = {"Bulo Stieng"},
["stj"] = {"Matya Samo"},
["stk"] = {"Arammba"},
["stl"] = {"Stellingwerfs"},
["stm"] = {"Setaman"},
["stn"] = {"Owa"},
["sto"] = {"Stoney"},
["stp"] = {"Southeastern Tepehuan"},
["stq"] = {"Saterfriesisch"},
["str"] = {"Straits Salish"},
["sts"] = {"Shumashti"},
["stt"] = {"Budeh Stieng"},
["stu"] = {"Samtao"},
["stv"] = {"Silt'e"},
["stw"] = {"Satawalese"},
["sty"] = {"Siberian Tatar"},
["sua"] = {"Sulka"},
["sub"] = {"Suku"},
["suc"] = {"Western Subanon"},
["sue"] = {"Suena"},
["sug"] = {"Suganga"},
["sui"] = {"Suki"},
["suj"] = {"Shubi"},
["suk"] = {"Sukuma"},
["suo"] = {"Bouni"},
["suq"] = {"Tirmaga-Chai Suri", "Suri"},
["sur"] = {"Mwaghavul"},
["sus"] = {"Susu"},
["sut"] = {"Subtiaba"},
["suv"] = {"Puroik"},
["suw"] = {"Sumbwa"},
["sux"] = {"Sumerian"},
["suy"] = {"Suyá"},
["suz"] = {"Sunwar"},
["sva"] = {"Svan"},
["svb"] = {"Ulau-Suain"},
["svc"] = {"Vincentian Creole English"},
["sve"] = {"Serili"},
["svk"] = {"Slovakian Sign Language"},
["svm"] = {"Slavomolisano"},
["svs"] = {"Savosavo"},
["svx"] = {"Skalvian"},
["swb"] = {"Maore Comorian"},
["swc"] = {"Congo Swahili"},
["swf"] = {"Sere"},
["swg"] = {"Swabian"},
["swh"] = {"Swahili (individual language)", "Kiswahili"},
["swi"] = {"Sui"},
["swj"] = {"Sira"},
["swk"] = {"Malawi Sena"},
["swl"] = {"Swedish Sign Language"},
["swm"] = {"Samosa"},
["swn"] = {"Sawknah"},
["swo"] = {"Shanenawa"},
["swp"] = {"Suau"},
["swq"] = {"Sharwa"},
["swr"] = {"Saweru"},
["sws"] = {"Seluwasan"},
["swt"] = {"Sawila"},
["swu"] = {"Suwawa"},
["swv"] = {"Shekhawati"},
["sww"] = {"Sowa"},
["swx"] = {"Suruahá"},
["swy"] = {"Sarua"},
["sxb"] = {"Suba"},
["sxc"] = {"Sicanian"},
["sxe"] = {"Sighu"},
["sxg"] = {"Shuhi", "Shixing"},
["sxk"] = {"Southern Kalapuya"},
["sxl"] = {"Selian"},
["sxm"] = {"Samre"},
["sxn"] = {"Sangir"},
["sxo"] = {"Sorothaptic"},
["sxr"] = {"Saaroa"},
["sxs"] = {"Sasaru"},
["sxu"] = {"Upper Saxon"},
["sxw"] = {"Saxwe Gbe"},
["sya"] = {"Siang"},
["syb"] = {"Central Subanen"},
["syc"] = {"Classical Syriac"},
["syd"] = {"Samoyedic languages"},
["syi"] = {"Seki"},
["syk"] = {"Sukur"},
["syl"] = {"Sylheti"},
["sym"] = {"Maya Samo"},
["syn"] = {"Senaya"},
["syo"] = {"Suoy"},
["syr"] = {"Syriac"},
["sys"] = {"Sinyar"},
["syw"] = {"Kagate"},
["syx"] = {"Samay"},
["syy"] = {"Al-Sayyid Bedouin Sign Language"},
["sza"] = {"Semelai"},
["szb"] = {"Ngalum"},
["szc"] = {"Semaq Beri"},
["sze"] = {"Seze"},
["szg"] = {"Sengele"},
["szl"] = {"Silesian"},
["szn"] = {"Sula"},
["szp"] = {"Suabo"},
["szs"] = {"Solomon Islands Sign Language"},
["szv"] = {"Isu (Fako Division)"},
["szw"] = {"Sawai"},
["szy"] = {"Sakizaya"},
["taa"] = {"Lower Tanana"},
["tab"] = {"Tabassaran"},
["tac"] = {"Lowland Tarahumara"},
["tad"] = {"Tause"},
["tae"] = {"Tariana"},
["taf"] = {"Tapirapé"},
["tag"] = {"Tagoi"},
["tai"] = {"Tai languages"},
["taj"] = {"Eastern Tamang"},
["tak"] = {"Tala"},
["tal"] = {"Tal"},
["tan"] = {"Tangale"},
["tao"] = {"Yami"},
["tap"] = {"Taabwa"},
["taq"] = {"Tamasheq"},
["tar"] = {"Central Tarahumara"},
["tas"] = {"Tay Boi"},
["tau"] = {"Upper Tanana"},
["tav"] = {"Tatuyo"},
["taw"] = {"Tai"},
["tax"] = {"Tamki"},
["tay"] = {"Atayal"},
["taz"] = {"Tocho"},
["tba"] = {"Aikanã"},
["tbc"] = {"Takia"},
["tbd"] = {"Kaki Ae"},
["tbe"] = {"Tanimbili"},
["tbf"] = {"Mandara"},
["tbg"] = {"North Tairora"},
["tbh"] = {"Dharawal", "Thurawal"},
["tbi"] = {"Gaam"},
["tbj"] = {"Tiang"},
["tbk"] = {"Calamian Tagbanwa"},
["tbl"] = {"Tboli"},
["tbm"] = {"Tagbu"},
["tbn"] = {"Barro Negro Tunebo"},
["tbo"] = {"Tawala"},
["tbp"] = {"Taworta", "Diebroud"},
["tbq"] = {"Tibeto-Burman languages"},
["tbr"] = {"Tumtum"},
["tbs"] = {"Tanguat"},
["tbt"] = {"Tembo (Kitembo)"},
["tbu"] = {"Tubar"},
["tbv"] = {"Tobo"},
["tbw"] = {"Tagbanwa"},
["tbx"] = {"Kapin"},
["tby"] = {"Tabaru"},
["tbz"] = {"Ditammari"},
["tca"] = {"Ticuna"},
["tcb"] = {"Tanacross"},
["tcc"] = {"Datooga"},
["tcd"] = {"Tafi"},
["tce"] = {"Southern Tutchone"},
["tcf"] = {"Malinaltepec Me'phaa", "Malinaltepec Tlapanec"},
["tcg"] = {"Tamagario"},
["tch"] = {"Turks And Caicos Creole English"},
["tci"] = {"Wára"},
["tck"] = {"Tchitchege"},
["tcl"] = {"Taman (Myanmar)"},
["tcm"] = {"Tanahmerah"},
["tcn"] = {"Tichurong"},
["tco"] = {"Taungyo"},
["tcp"] = {"Tawr Chin"},
["tcq"] = {"Kaiy"},
["tcs"] = {"Torres Strait Creole", "Yumplatok"},
["tct"] = {"T'en"},
["tcu"] = {"Southeastern Tarahumara"},
["tcw"] = {"Tecpatlán Totonac"},
["tcx"] = {"Toda"},
["tcy"] = {"Tulu"},
["tcz"] = {"Thado Chin"},
["tda"] = {"Tagdal"},
["tdb"] = {"Panchpargania"},
["tdc"] = {"Emberá-Tadó"},
["tdd"] = {"Tai Nüa"},
["tde"] = {"Tiranige Diga Dogon"},
["tdf"] = {"Talieng"},
["tdg"] = {"Western Tamang"},
["tdh"] = {"Thulung"},
["tdi"] = {"Tomadino"},
["tdj"] = {"Tajio"},
["tdk"] = {"Tambas"},
["tdl"] = {"Sur"},
["tdm"] = {"Taruma"},
["tdn"] = {"Tondano"},
["tdo"] = {"Teme"},
["tdq"] = {"Tita"},
["tdr"] = {"Todrah"},
["tds"] = {"Doutai"},
["tdt"] = {"Tetun Dili"},
["tdv"] = {"Toro"},
["tdx"] = {"Tandroy-Mahafaly Malagasy"},
["tdy"] = {"Tadyawan"},
["tea"] = {"Temiar"},
["teb"] = {"Tetete"},
["tec"] = {"Terik"},
["ted"] = {"Tepo Krumen"},
["tee"] = {"Huehuetla Tepehua"},
["tef"] = {"Teressa"},
["teg"] = {"Teke-Tege"},
["teh"] = {"Tehuelche"},
["tei"] = {"Torricelli"},
["tek"] = {"Ibali Teke"},
["tem"] = {"Timne"},
["ten"] = {"Tama (Colombia)"},
["teo"] = {"Teso"},
["tep"] = {"Tepecano"},
["teq"] = {"Temein"},
["ter"] = {"Tereno"},
["tes"] = {"Tengger"},
["tet"] = {"Tetum"},
["teu"] = {"Soo"},
["tev"] = {"Teor"},
["tew"] = {"Tewa (USA)"},
["tex"] = {"Tennet"},
["tey"] = {"Tulishi"},
["tez"] = {"Tetserret"},
["tfi"] = {"Tofin Gbe"},
["tfn"] = {"Tanaina"},
["tfo"] = {"Tefaro"},
["tfr"] = {"Teribe"},
["tft"] = {"Ternate"},
["tga"] = {"Sagalla"},
["tgb"] = {"Tobilung"},
["tgc"] = {"Tigak"},
["tgd"] = {"Ciwogai"},
["tge"] = {"Eastern Gorkha Tamang"},
["tgf"] = {"Chalikha"},
["tgh"] = {"Tobagonian Creole English"},
["tgi"] = {"Lawunuia"},
["tgj"] = {"Tagin"},
["tgn"] = {"Tandaganon"},
["tgo"] = {"Sudest"},
["tgp"] = {"Tangoa"},
["tgq"] = {"Tring"},
["tgr"] = {"Tareng"},
["tgs"] = {"Nume"},
["tgt"] = {"Central Tagbanwa"},
["tgu"] = {"Tanggu"},
["tgv"] = {"Tingui-Boto"},
["tgw"] = {"Tagwana Senoufo"},
["tgx"] = {"Tagish"},
["tgy"] = {"Togoyo"},
["tgz"] = {"Tagalaka"},
["thd"] = {"Kuuk Thaayorre", "Thayore"},
["the"] = {"Chitwania Tharu"},
["thf"] = {"Thangmi"},
["thh"] = {"Northern Tarahumara"},
["thi"] = {"Tai Long"},
["thk"] = {"Tharaka", "Kitharaka"},
["thl"] = {"Dangaura Tharu"},
["thm"] = {"Aheu"},
["thn"] = {"Thachanadan"},
["thp"] = {"Thompson"},
["thq"] = {"Kochila Tharu"},
["thr"] = {"Rana Tharu"},
["ths"] = {"Thakali"},
["tht"] = {"Tahltan"},
["thu"] = {"Thuri"},
["thv"] = {"Tahaggart Tamahaq"},
["thy"] = {"Tha"},
["thz"] = {"Tayart Tamajeq"},
["tia"] = {"Tidikelt Tamazight"},
["tic"] = {"Tira"},
["tif"] = {"Tifal"},
["tig"] = {"Tigre"},
["tih"] = {"Timugon Murut"},
["tii"] = {"Tiene"},
["tij"] = {"Tilung"},
["tik"] = {"Tikar"},
["til"] = {"Tillamook"},
["tim"] = {"Timbe"},
["tin"] = {"Tindi"},
["tio"] = {"Teop"},
["tip"] = {"Trimuris"},
["tiq"] = {"Tiéfo"},
["tis"] = {"Masadiit Itneg"},
["tit"] = {"Tinigua"},
["tiu"] = {"Adasen"},
["tiv"] = {"Tiv"},
["tiw"] = {"Tiwi"},
["tix"] = {"Southern Tiwa"},
["tiy"] = {"Tiruray"},
["tiz"] = {"Tai Hongjin"},
["tja"] = {"Tajuasohn"},
["tjg"] = {"Tunjung"},
["tji"] = {"Northern Tujia"},
["tjj"] = {"Tjungundji"},
["tjl"] = {"Tai Laing"},
["tjm"] = {"Timucua"},
["tjn"] = {"Tonjon"},
["tjo"] = {"Temacine Tamazight"},
["tjp"] = {"Tjupany"},
["tjs"] = {"Southern Tujia"},
["tju"] = {"Tjurruru"},
["tjw"] = {"Djabwurrung"},
["tka"] = {"Truká"},
["tkb"] = {"Buksa"},
["tkd"] = {"Tukudede"},
["tke"] = {"Takwane"},
["tkf"] = {"Tukumanféd"},
["tkg"] = {"Tesaka Malagasy"},
["tkl"] = {"Tokelau"},
["tkm"] = {"Takelma"},
["tkn"] = {"Toku-No-Shima"},
["tkp"] = {"Tikopia"},
["tkq"] = {"Tee"},
["tkr"] = {"Tsakhur"},
["tks"] = {"Takestani"},
["tkt"] = {"Kathoriya Tharu"},
["tku"] = {"Upper Necaxa Totonac"},
["tkv"] = {"Mur Pano"},
["tkw"] = {"Teanu"},
["tkx"] = {"Tangko"},
["tkz"] = {"Takua"},
["tla"] = {"Southwestern Tepehuan"},
["tlb"] = {"Tobelo"},
["tlc"] = {"Yecuatla Totonac"},
["tld"] = {"Talaud"},
["tlf"] = {"Telefol"},
["tlg"] = {"Tofanma"},
["tlh"] = {"Klingon", "tlhIngan Hol"},
["tli"] = {"Tlingit"},
["tlj"] = {"Talinga-Bwisi"},
["tlk"] = {"Taloki"},
["tll"] = {"Tetela"},
["tlm"] = {"Tolomako"},
["tln"] = {"Talondo'"},
["tlo"] = {"Talodi"},
["tlp"] = {"Filomena Mata-Coahuitlán Totonac"},
["tlq"] = {"Tai Loi"},
["tlr"] = {"Talise"},
["tls"] = {"Tambotalo"},
["tlt"] = {"Sou Nama", "Teluti"},
["tlu"] = {"Tulehu"},
["tlv"] = {"Taliabu"},
["tlx"] = {"Khehek"},
["tly"] = {"Talysh"},
["tma"] = {"Tama (Chad)"},
["tmb"] = {"Katbol", "Avava"},
["tmc"] = {"Tumak"},
["tmd"] = {"Haruai"},
["tme"] = {"Tremembé"},
["tmf"] = {"Toba-Maskoy"},
["tmg"] = {"Ternateño"},
["tmh"] = {"Tamashek"},
["tmi"] = {"Tutuba"},
["tmj"] = {"Samarokena"},
["tml"] = {"Tamnim Citak"},
["tmm"] = {"Tai Thanh"},
["tmn"] = {"Taman (Indonesia)"},
["tmo"] = {"Temoq"},
["tmq"] = {"Tumleo"},
["tmr"] = {"Jewish Babylonian Aramaic (ca. 200-1200 CE)"},
["tms"] = {"Tima"},
["tmt"] = {"Tasmate"},
["tmu"] = {"Iau"},
["tmv"] = {"Tembo (Motembo)"},
["tmw"] = {"Temuan"},
["tmy"] = {"Tami"},
["tmz"] = {"Tamanaku"},
["tna"] = {"Tacana"},
["tnb"] = {"Western Tunebo"},
["tnc"] = {"Tanimuca-Retuarã"},
["tnd"] = {"Angosturas Tunebo"},
["tng"] = {"Tobanga"},
["tnh"] = {"Maiani"},
["tni"] = {"Tandia"},
["tnk"] = {"Kwamera"},
["tnl"] = {"Lenakel"},
["tnm"] = {"Tabla"},
["tnn"] = {"North Tanna"},
["tno"] = {"Toromono"},
["tnp"] = {"Whitesands"},
["tnq"] = {"Taino"},
["tnr"] = {"Ménik"},
["tns"] = {"Tenis"},
["tnt"] = {"Tontemboan"},
["tnu"] = {"Tay Khang"},
["tnv"] = {"Tangchangya"},
["tnw"] = {"Tonsawang"},
["tnx"] = {"Tanema"},
["tny"] = {"Tongwe"},
["tnz"] = {"Ten'edn"},
["tob"] = {"Toba"},
["toc"] = {"Coyutla Totonac"},
["tod"] = {"Toma"},
["tof"] = {"Gizrra"},
["tog"] = {"Tonga (Nyasa)"},
["toh"] = {"Gitonga"},
["toi"] = {"Tonga (Zambia)"},
["toj"] = {"Tojolabal"},
["tok"] = {"Toki Pona"},
["tol"] = {"Tolowa"},
["tom"] = {"Tombulu"},
["too"] = {"Xicotepec De Juárez Totonac"},
["top"] = {"Papantla Totonac"},
["toq"] = {"Toposa"},
["tor"] = {"Togbo-Vara Banda"},
["tos"] = {"Highland Totonac"},
["tou"] = {"Tho"},
["tov"] = {"Upper Taromi"},
["tow"] = {"Jemez"},
["tox"] = {"Tobian"},
["toy"] = {"Topoiyo"},
["toz"] = {"To"},
["tpa"] = {"Taupota"},
["tpc"] = {"Azoyú Me'phaa", "Azoyú Tlapanec"},
["tpe"] = {"Tippera"},
["tpf"] = {"Tarpia"},
["tpg"] = {"Kula"},
["tpi"] = {"Tok Pisin"},
["tpj"] = {"Tapieté"},
["tpk"] = {"Tupinikin"},
["tpl"] = {"Tlacoapa Me'phaa", "Tlacoapa Tlapanec"},
["tpm"] = {"Tampulma"},
["tpn"] = {"Tupinambá"},
["tpo"] = {"Tai Pao"},
["tpp"] = {"Pisaflores Tepehua"},
["tpq"] = {"Tukpa"},
["tpr"] = {"Tuparí"},
["tpt"] = {"Tlachichilco Tepehua"},
["tpu"] = {"Tampuan"},
["tpv"] = {"Tanapag"},
["tpx"] = {"Acatepec Me'phaa", "Acatepec Tlapanec"},
["tpy"] = {"Trumai"},
["tpz"] = {"Tinputz"},
["tqb"] = {"Tembé"},
["tql"] = {"Lehali"},
["tqm"] = {"Turumsa"},
["tqn"] = {"Tenino"},
["tqo"] = {"Toaripi"},
["tqp"] = {"Tomoip"},
["tqq"] = {"Tunni"},
["tqr"] = {"Torona"},
["tqt"] = {"Western Totonac"},
["tqu"] = {"Touo"},
["tqw"] = {"Tonkawa"},
["tra"] = {"Tirahi"},
["trb"] = {"Terebu"},
["trc"] = {"Copala Triqui"},
["trd"] = {"Turi"},
["tre"] = {"East Tarangan"},
["trf"] = {"Trinidadian Creole English"},
["trg"] = {"Lishán Didán"},
["trh"] = {"Turaka"},
["tri"] = {"Trió"},
["trj"] = {"Toram"},
["trk"] = {"Turkic languages"},
["trl"] = {"Traveller Scottish"},
["trm"] = {"Tregami"},
["trn"] = {"Trinitario"},
["tro"] = {"Tarao Naga"},
["trp"] = {"Kok Borok"},
["trq"] = {"San Martín Itunyoso Triqui"},
["trr"] = {"Taushiro"},
["trs"] = {"Chicahuaxtla Triqui"},
["trt"] = {"Tunggare"},
["tru"] = {"Turoyo", "Surayt"},
["trv"] = {"Sediq", "Seediq", "Taroko"},
["trw"] = {"Torwali"},
["trx"] = {"Tringgus-Sembaan Bidayuh"},
["try"] = {"Turung"},
["trz"] = {"Torá"},
["tsa"] = {"Tsaangi"},
["tsb"] = {"Tsamai"},
["tsc"] = {"Tswa"},
["tsd"] = {"Tsakonian"},
["tse"] = {"Tunisian Sign Language"},
["tsg"] = {"Tausug"},
["tsh"] = {"Tsuvan"},
["tsi"] = {"Tsimshian"},
["tsj"] = {"Tshangla"},
["tsk"] = {"Tseku"},
["tsl"] = {"Ts'ün-Lao"},
["tsm"] = {"Turkish Sign Language", "Türk İşaret Dili"},
["tsp"] = {"Northern Toussian"},
["tsq"] = {"Thai Sign Language"},
["tsr"] = {"Akei"},
["tss"] = {"Taiwan Sign Language"},
["tst"] = {"Tondi Songway Kiini"},
["tsu"] = {"Tsou"},
["tsv"] = {"Tsogo"},
["tsw"] = {"Tsishingini"},
["tsx"] = {"Mubami"},
["tsy"] = {"Tebul Sign Language"},
["tsz"] = {"Purepecha"},
["tta"] = {"Tutelo"},
["ttb"] = {"Gaa"},
["ttc"] = {"Tektiteko"},
["ttd"] = {"Tauade"},
["tte"] = {"Bwanabwana"},
["ttf"] = {"Tuotomb"},
["ttg"] = {"Tutong"},
["tth"] = {"Upper Ta'oih"},
["tti"] = {"Tobati"},
["ttj"] = {"Tooro"},
["ttk"] = {"Totoro"},
["ttl"] = {"Totela"},
["ttm"] = {"Northern Tutchone"},
["ttn"] = {"Towei"},
["tto"] = {"Lower Ta'oih"},
["ttp"] = {"Tombelala"},
["ttq"] = {"Tawallammat Tamajaq"},
["ttr"] = {"Tera"},
["tts"] = {"Northeastern Thai"},
["ttt"] = {"Muslim Tat"},
["ttu"] = {"Torau"},
["ttv"] = {"Titan"},
["ttw"] = {"Long Wat"},
["tty"] = {"Sikaritai"},
["ttz"] = {"Tsum"},
["tua"] = {"Wiarumus"},
["tub"] = {"Tübatulabal"},
["tuc"] = {"Mutu"},
["tud"] = {"Tuxá"},
["tue"] = {"Tuyuca"},
["tuf"] = {"Central Tunebo"},
["tug"] = {"Tunia"},
["tuh"] = {"Taulil"},
["tui"] = {"Tupuri"},
["tuj"] = {"Tugutil"},
["tul"] = {"Tula"},
["tum"] = {"Tumbuka"},
["tun"] = {"Tunica"},
["tuo"] = {"Tucano"},
["tup"] = {"Tupi languages"},
["tuq"] = {"Tedaga"},
["tus"] = {"Tuscarora"},
["tut"] = {"Altaic languages"},
["tuu"] = {"Tututni"},
["tuv"] = {"Turkana"},
["tuw"] = {"Tungus languages"},
["tux"] = {"Tuxináwa"},
["tuy"] = {"Tugen"},
["tuz"] = {"Turka"},
["tva"] = {"Vaghua"},
["tvd"] = {"Tsuvadi"},
["tve"] = {"Te'un"},
["tvi"] = {"Tulai"},
["tvk"] = {"Southeast Ambrym"},
["tvl"] = {"Tuvalu"},
["tvm"] = {"Tela-Masbuar"},
["tvn"] = {"Tavoyan"},
["tvo"] = {"Tidore"},
["tvs"] = {"Taveta"},
["tvt"] = {"Tutsa Naga"},
["tvu"] = {"Tunen"},
["tvw"] = {"Sedoa"},
["tvx"] = {"Taivoan"},
["tvy"] = {"Timor Pidgin"},
["twa"] = {"Twana"},
["twb"] = {"Western Tawbuid"},
["twc"] = {"Teshenawa"},
["twd"] = {"Twents"},
["twe"] = {"Tewa (Indonesia)"},
["twf"] = {"Northern Tiwa"},
["twg"] = {"Tereweng"},
["twh"] = {"Tai Dón"},
["twl"] = {"Tawara"},
["twm"] = {"Tawang Monpa"},
["twn"] = {"Twendi"},
["two"] = {"Tswapong"},
["twp"] = {"Ere"},
["twq"] = {"Tasawaq"},
["twr"] = {"Southwestern Tarahumara"},
["twt"] = {"Turiwára"},
["twu"] = {"Termanu"},
["tww"] = {"Tuwari"},
["twx"] = {"Tewe"},
["twy"] = {"Tawoyan"},
["txa"] = {"Tombonuo"},
["txb"] = {"Tokharian B"},
["txc"] = {"Tsetsaut"},
["txe"] = {"Totoli"},
["txg"] = {"Tangut"},
["txh"] = {"Thracian"},
["txi"] = {"Ikpeng"},
["txj"] = {"Tarjumo"},
["txm"] = {"Tomini"},
["txn"] = {"West Tarangan"},
["txo"] = {"Toto"},
["txq"] = {"Tii"},
["txr"] = {"Tartessian"},
["txs"] = {"Tonsea"},
["txt"] = {"Citak"},
["txu"] = {"Kayapó"},
["txx"] = {"Tatana"},
["txy"] = {"Tanosy Malagasy"},
["tya"] = {"Tauya"},
["tye"] = {"Kyanga"},
["tyh"] = {"O'du"},
["tyi"] = {"Teke-Tsaayi"},
["tyj"] = {"Tai Do", "Tai Yo"},
["tyl"] = {"Thu Lao"},
["tyn"] = {"Kombai"},
["typ"] = {"Thaypan"},
["tyr"] = {"Tai Daeng"},
["tys"] = {"Tày Sa Pa"},
["tyt"] = {"Tày Tac"},
["tyu"] = {"Kua"},
["tyv"] = {"Tuvinian"},
["tyx"] = {"Teke-Tyee"},
["tyy"] = {"Tiyaa"},
["tyz"] = {"Tày"},
["tza"] = {"Tanzanian Sign Language"},
["tzh"] = {"Tzeltal"},
["tzj"] = {"Tz'utujil"},
["tzl"] = {"Talossan"},
["tzm"] = {"Central Atlas Tamazight"},
["tzn"] = {"Tugun"},
["tzo"] = {"Tzotzil"},
["tzx"] = {"Tabriak"},
["uam"] = {"Uamué"},
["uan"] = {"Kuan"},
["uar"] = {"Tairuma"},
["uba"] = {"Ubang"},
["ubi"] = {"Ubi"},
["ubl"] = {"Buhi'non Bikol"},
["ubr"] = {"Ubir"},
["ubu"] = {"Umbu-Ungu"},
["uby"] = {"Ubykh"},
["uda"] = {"Uda"},
["ude"] = {"Udihe"},
["udg"] = {"Muduga"},
["udi"] = {"Udi"},
["udj"] = {"Ujir"},
["udl"] = {"Wuzlam"},
["udm"] = {"Udmurt"},
["udu"] = {"Uduk"},
["ues"] = {"Kioko"},
["ufi"] = {"Ufim"},
["uga"] = {"Ugaritic"},
["ugb"] = {"Kuku-Ugbanh"},
["uge"] = {"Ughele"},
["ugh"] = {"Kubachi"},
["ugn"] = {"Ugandan Sign Language"},
["ugo"] = {"Ugong"},
["ugy"] = {"Uruguayan Sign Language"},
["uha"] = {"Uhami"},
["uhn"] = {"Damal"},
["uis"] = {"Uisai"},
["uiv"] = {"Iyive"},
["uji"] = {"Tanjijili"},
["uka"] = {"Kaburi"},
["ukg"] = {"Ukuriguma"},
["ukh"] = {"Ukhwejo"},
["uki"] = {"Kui (India)"},
["ukk"] = {"Muak Sa-aak"},
["ukl"] = {"Ukrainian Sign Language"},
["ukp"] = {"Ukpe-Bayobiri"},
["ukq"] = {"Ukwa"},
["uks"] = {"Urubú-Kaapor Sign Language", "Kaapor Sign Language"},
["uku"] = {"Ukue"},
["ukv"] = {"Kuku"},
["ukw"] = {"Ukwuani-Aboh-Ndoni"},
["uky"] = {"Kuuk-Yak"},
["ula"] = {"Fungwa"},
["ulb"] = {"Ulukwumi"},
["ulc"] = {"Ulch"},
["ule"] = {"Lule"},
["ulf"] = {"Usku", "Afra"},
["uli"] = {"Ulithian"},
["ulk"] = {"Meriam Mir"},
["ull"] = {"Ullatan"},
["ulm"] = {"Ulumanda'"},
["uln"] = {"Unserdeutsch"},
["ulu"] = {"Uma' Lung"},
["ulw"] = {"Ulwa"},
["uly"] = {"Buli"},
["uma"] = {"Umatilla"},
["umb"] = {"Umbundu"},
["umc"] = {"Marrucinian"},
["umd"] = {"Umbindhamu"},
["umg"] = {"Morrobalama", "Umbuygamu"},
["umi"] = {"Ukit"},
["umm"] = {"Umon"},
["umn"] = {"Makyan Naga"},
["umo"] = {"Umotína"},
["ump"] = {"Umpila"},
["umr"] = {"Umbugarla"},
["ums"] = {"Pendau"},
["umu"] = {"Munsee"},
["una"] = {"North Watut"},
["und"] = {"Undetermined"},
["une"] = {"Uneme"},
["ung"] = {"Ngarinyin"},
["uni"] = {"Uni"},
["unk"] = {"Enawené-Nawé"},
["unm"] = {"Unami"},
["unn"] = {"Kurnai"},
["unr"] = {"Mundari"},
["unu"] = {"Unubahe"},
["unx"] = {"Munda"},
["unz"] = {"Unde Kaili"},
["uon"] = {"Kulon"},
["upi"] = {"Umeda"},
["upv"] = {"Uripiv-Wala-Rano-Atchin"},
["ura"] = {"Urarina"},
["urb"] = {"Urubú-Kaapor", "Kaapor"},
["urc"] = {"Urningangg"},
["ure"] = {"Uru"},
["urf"] = {"Uradhi"},
["urg"] = {"Urigina"},
["urh"] = {"Urhobo"},
["uri"] = {"Urim"},
["urj"] = {"Uralic languages"},
["urk"] = {"Urak Lawoi'"},
["url"] = {"Urali"},
["urm"] = {"Urapmin"},
["urn"] = {"Uruangnirin"},
["uro"] = {"Ura (Papua New Guinea)"},
["urp"] = {"Uru-Pa-In"},
["urr"] = {"Lehalurup", "Löyöp"},
["urt"] = {"Urat"},
["uru"] = {"Urumi"},
["urv"] = {"Uruava"},
["urw"] = {"Sop"},
["urx"] = {"Urimo"},
["ury"] = {"Orya"},
["urz"] = {"Uru-Eu-Wau-Wau"},
["usa"] = {"Usarufa"},
["ush"] = {"Ushojo"},
["usi"] = {"Usui"},
["usk"] = {"Usaghade"},
["usp"] = {"Uspanteco"},
["uss"] = {"us-Saare"},
["usu"] = {"Uya"},
["uta"] = {"Otank"},
["ute"] = {"Ute-Southern Paiute"},
["uth"] = {"ut-Hun"},
["utp"] = {"Amba (Solomon Islands)"},
["utr"] = {"Etulo"},
["utu"] = {"Utu"},
["uum"] = {"Urum"},
["uur"] = {"Ura (Vanuatu)"},
["uuu"] = {"U"},
["uve"] = {"West Uvean", "Fagauvea"},
["uvh"] = {"Uri"},
["uvl"] = {"Lote"},
["uwa"] = {"Kuku-Uwanh"},
["uya"] = {"Doko-Uyanga"},
["uzn"] = {"Northern Uzbek"},
["uzs"] = {"Southern Uzbek"},
["vaa"] = {"Vaagri Booli"},
["vae"] = {"Vale"},
["vaf"] = {"Vafsi"},
["vag"] = {"Vagla"},
["vah"] = {"Varhadi-Nagpuri"},
["vai"] = {"Vai"},
["vaj"] = {"Sekele", "Northwestern ǃKung", "Vasekele"},
["val"] = {"Vehes"},
["vam"] = {"Vanimo"},
["van"] = {"Valman"},
["vao"] = {"Vao"},
["vap"] = {"Vaiphei"},
["var"] = {"Huarijio"},
["vas"] = {"Vasavi"},
["vau"] = {"Vanuma"},
["vav"] = {"Varli"},
["vay"] = {"Wayu"},
["vbb"] = {"Southeast Babar"},
["vbk"] = {"Southwestern Bontok"},
["vec"] = {"Venetian"},
["ved"] = {"Veddah"},
["vel"] = {"Veluws"},
["vem"] = {"Vemgo-Mabas"},
["veo"] = {"Ventureño"},
["vep"] = {"Veps"},
["ver"] = {"Mom Jango"},
["vgr"] = {"Vaghri"},
["vgt"] = {"Vlaamse Gebarentaal", "Flemish Sign Language"},
["vic"] = {"Virgin Islands Creole English"},
["vid"] = {"Vidunda"},
["vif"] = {"Vili"},
["vig"] = {"Viemo"},
["vil"] = {"Vilela"},
["vin"] = {"Vinza"},
["vis"] = {"Vishavan"},
["vit"] = {"Viti"},
["viv"] = {"Iduna"},
["vjk"] = {"Bajjika"},
["vka"] = {"Kariyarra"},
["vkj"] = {"Kujarge"},
["vkk"] = {"Kaur"},
["vkl"] = {"Kulisusu"},
["vkm"] = {"Kamakan"},
["vkn"] = {"Koro Nulu"},
["vko"] = {"Kodeoha"},
["vkp"] = {"Korlai Creole Portuguese"},
["vkt"] = {"Tenggarong Kutai Malay"},
["vku"] = {"Kurrama"},
["vkz"] = {"Koro Zuba"},
["vlp"] = {"Valpei"},
["vls"] = {"Vlaams"},
["vma"] = {"Martuyhunira"},
["vmb"] = {"Barbaram"},
["vmc"] = {"Juxtlahuaca Mixtec"},
["vmd"] = {"Mudu Koraga"},
["vme"] = {"East Masela"},
["vmf"] = {"Mainfränkisch"},
["vmg"] = {"Lungalunga"},
["vmh"] = {"Maraghei"},
["vmi"] = {"Miwa"},
["vmj"] = {"Ixtayutla Mixtec"},
["vmk"] = {"Makhuwa-Shirima"},
["vml"] = {"Malgana"},
["vmm"] = {"Mitlatongo Mixtec"},
["vmp"] = {"Soyaltepec Mazatec"},
["vmq"] = {"Soyaltepec Mixtec"},
["vmr"] = {"Marenje"},
["vms"] = {"Moksela"},
["vmu"] = {"Muluridyi"},
["vmv"] = {"Valley Maidu"},
["vmw"] = {"Makhuwa"},
["vmx"] = {"Tamazola Mixtec"},
["vmy"] = {"Ayautla Mazatec"},
["vmz"] = {"Mazatlán Mazatec"},
["vnk"] = {"Vano", "Lovono"},
["vnm"] = {"Vinmavis", "Neve'ei"},
["vnp"] = {"Vunapu"},
["vor"] = {"Voro"},
["vot"] = {"Votic"},
["vra"] = {"Vera'a"},
["vro"] = {"Võro"},
["vrs"] = {"Varisi"},
["vrt"] = {"Burmbar", "Banam Bay"},
["vsi"] = {"Moldova Sign Language"},
["vsl"] = {"Venezuelan Sign Language"},
["vsv"] = {"Valencian Sign Language", "Llengua de signes valenciana"},
["vto"] = {"Vitou"},
["vum"] = {"Vumbu"},
["vun"] = {"Vunjo"},
["vut"] = {"Vute"},
["vwa"] = {"Awa (China)"},
["waa"] = {"Walla Walla"},
["wab"] = {"Wab"},
["wac"] = {"Wasco-Wishram"},
["wad"] = {"Wamesa", "Wondama"},
["wae"] = {"Walser"},
["waf"] = {"Wakoná"},
["wag"] = {"Wa'ema"},
["wah"] = {"Watubela"},
["wai"] = {"Wares"},
["waj"] = {"Waffa"},
["wak"] = {"Wakashan languages"},
["wal"] = {"Wolaytta", "Wolaitta"},
["wam"] = {"Wampanoag"},
["wan"] = {"Wan"},
["wao"] = {"Wappo"},
["wap"] = {"Wapishana"},
["waq"] = {"Wagiman"},
["war"] = {"Waray (Philippines)"},
["was"] = {"Washo"},
["wat"] = {"Kaninuwa"},
["wau"] = {"Waurá"},
["wav"] = {"Waka"},
["waw"] = {"Waiwai"},
["wax"] = {"Watam", "Marangis"},
["way"] = {"Wayana"},
["waz"] = {"Wampur"},
["wba"] = {"Warao"},
["wbb"] = {"Wabo"},
["wbe"] = {"Waritai"},
["wbf"] = {"Wara"},
["wbh"] = {"Wanda"},
["wbi"] = {"Vwanji"},
["wbj"] = {"Alagwa"},
["wbk"] = {"Waigali"},
["wbl"] = {"Wakhi"},
["wbm"] = {"Wa"},
["wbp"] = {"Warlpiri"},
["wbq"] = {"Waddar"},
["wbr"] = {"Wagdi"},
["wbs"] = {"West Bengal Sign Language"},
["wbt"] = {"Warnman"},
["wbv"] = {"Wajarri"},
["wbw"] = {"Woi"},
["wca"] = {"Yanomámi"},
["wci"] = {"Waci Gbe"},
["wdd"] = {"Wandji"},
["wdg"] = {"Wadaginam"},
["wdj"] = {"Wadjiginy"},
["wdk"] = {"Wadikali"},
["wdt"] = {"Wendat"},
["wdu"] = {"Wadjigu"},
["wdy"] = {"Wadjabangayi"},
["wea"] = {"Wewaw"},
["wec"] = {"Wè Western"},
["wed"] = {"Wedau"},
["weg"] = {"Wergaia"},
["weh"] = {"Weh"},
["wei"] = {"Kiunum"},
["wem"] = {"Weme Gbe"},
["wen"] = {"Sorbian languages"},
["weo"] = {"Wemale"},
["wep"] = {"Westphalien"},
["wer"] = {"Weri"},
["wes"] = {"Cameroon Pidgin"},
["wet"] = {"Perai"},
["weu"] = {"Rawngtu Chin"},
["wew"] = {"Wejewa"},
["wfg"] = {"Yafi", "Zorop"},
["wga"] = {"Wagaya"},
["wgb"] = {"Wagawaga"},
["wgg"] = {"Wangkangurru", "Wangganguru"},
["wgi"] = {"Wahgi"},
["wgo"] = {"Waigeo"},
["wgu"] = {"Wirangu"},
["wgy"] = {"Warrgamay"},
["wha"] = {"Sou Upaa", "Manusela"},
["whg"] = {"North Wahgi"},
["whk"] = {"Wahau Kenyah"},
["whu"] = {"Wahau Kayan"},
["wib"] = {"Southern Toussian"},
["wic"] = {"Wichita"},
["wie"] = {"Wik-Epa"},
["wif"] = {"Wik-Keyangan"},
["wig"] = {"Wik Ngathan"},
["wih"] = {"Wik-Me'anha"},
["wii"] = {"Minidien"},
["wij"] = {"Wik-Iiyanh"},
["wik"] = {"Wikalkan"},
["wil"] = {"Wilawila"},
["wim"] = {"Wik-Mungkan"},
["win"] = {"Ho-Chunk"},
["wir"] = {"Wiraféd"},
["wiu"] = {"Wiru"},
["wiv"] = {"Vitu"},
["wiy"] = {"Wiyot"},
["wja"] = {"Waja"},
["wji"] = {"Warji"},
["wka"] = {"Kw'adza"},
["wkb"] = {"Kumbaran"},
["wkd"] = {"Wakde", "Mo"},
["wkl"] = {"Kalanadi"},
["wkr"] = {"Keerray-Woorroong"},
["wku"] = {"Kunduvadi"},
["wkw"] = {"Wakawaka"},
["wky"] = {"Wangkayutyuru"},
["wla"] = {"Walio"},
["wlc"] = {"Mwali Comorian"},
["wle"] = {"Wolane"},
["wlg"] = {"Kunbarlang"},
["wlh"] = {"Welaun"},
["wli"] = {"Waioli"},
["wlk"] = {"Wailaki"},
["wll"] = {"Wali (Sudan)"},
["wlm"] = {"Middle Welsh"},
["wlo"] = {"Wolio"},
["wlr"] = {"Wailapa"},
["wls"] = {"Wallisian"},
["wlu"] = {"Wuliwuli"},
["wlv"] = {"Wichí Lhamtés Vejoz"},
["wlw"] = {"Walak"},
["wlx"] = {"Wali (Ghana)"},
["wly"] = {"Waling"},
["wma"] = {"Mawa (Nigeria)"},
["wmb"] = {"Wambaya"},
["wmc"] = {"Wamas"},
["wmd"] = {"Mamaindé"},
["wme"] = {"Wambule"},
["wmg"] = {"Western Minyag"},
["wmh"] = {"Waima'a"},
["wmi"] = {"Wamin"},
["wmm"] = {"Maiwa (Indonesia)"},
["wmn"] = {"Waamwang"},
["wmo"] = {"Wom (Papua New Guinea)"},
["wms"] = {"Wambon"},
["wmt"] = {"Walmajarri"},
["wmw"] = {"Mwani"},
["wmx"] = {"Womo"},
["wnb"] = {"Mokati"},
["wnc"] = {"Wantoat"},
["wnd"] = {"Wandarang"},
["wne"] = {"Waneci"},
["wng"] = {"Wanggom"},
["wni"] = {"Ndzwani Comorian"},
["wnk"] = {"Wanukaka"},
["wnm"] = {"Wanggamala"},
["wnn"] = {"Wunumara"},
["wno"] = {"Wano"},
["wnp"] = {"Wanap"},
["wnu"] = {"Usan"},
["wnw"] = {"Wintu"},
["wny"] = {"Wanyi", "Waanyi"},
["woa"] = {"Kuwema", "Tyaraity"},
["wob"] = {"Wè Northern"},
["woc"] = {"Wogeo"},
["wod"] = {"Wolani"},
["woe"] = {"Woleaian"},
["wof"] = {"Gambian Wolof"},
["wog"] = {"Wogamusin"},
["woi"] = {"Kamang"},
["wok"] = {"Longto"},
["wom"] = {"Wom (Nigeria)"},
["won"] = {"Wongo"},
["woo"] = {"Manombai"},
["wor"] = {"Woria"},
["wos"] = {"Hanga Hundi"},
["wow"] = {"Wawonii"},
["woy"] = {"Weyto"},
["wpc"] = {"Maco"},
["wrb"] = {"Waluwarra", "Warluwara"},
["wrg"] = {"Warungu", "Gudjal"},
["wrh"] = {"Wiradjuri"},
["wri"] = {"Wariyangga"},
["wrk"] = {"Garrwa"},
["wrl"] = {"Warlmanpa"},
["wrm"] = {"Warumungu"},
["wrn"] = {"Warnang"},
["wro"] = {"Worrorra"},
["wrp"] = {"Waropen"},
["wrr"] = {"Wardaman"},
["wrs"] = {"Waris"},
["wru"] = {"Waru"},
["wrv"] = {"Waruna"},
["wrw"] = {"Gugu Warra"},
["wrx"] = {"Wae Rana"},
["wry"] = {"Merwari"},
["wrz"] = {"Waray (Australia)"},
["wsa"] = {"Warembori"},
["wsg"] = {"Adilabad Gondi"},
["wsi"] = {"Wusi"},
["wsk"] = {"Waskia"},
["wsr"] = {"Owenia"},
["wss"] = {"Wasa"},
["wsu"] = {"Wasu"},
["wsv"] = {"Wotapuri-Katarqalai"},
["wtb"] = {"Matambwe"},
["wtf"] = {"Watiwa"},
["wth"] = {"Wathawurrung"},
["wti"] = {"Berta"},
["wtk"] = {"Watakataui"},
["wtm"] = {"Mewati"},
["wtw"] = {"Wotu"},
["wua"] = {"Wikngenchera"},
["wub"] = {"Wunambal"},
["wud"] = {"Wudu"},
["wuh"] = {"Wutunhua"},
["wul"] = {"Silimo"},
["wum"] = {"Wumbvu"},
["wun"] = {"Bungu"},
["wur"] = {"Wurrugu"},
["wut"] = {"Wutung"},
["wuu"] = {"Wu Chinese"},
["wuv"] = {"Wuvulu-Aua"},
["wux"] = {"Wulna"},
["wuy"] = {"Wauyai"},
["wwa"] = {"Waama"},
["wwb"] = {"Wakabunga"},
["wwo"] = {"Wetamut", "Dorig"},
["wwr"] = {"Warrwa"},
["www"] = {"Wawa"},
["wxa"] = {"Waxianghua"},
["wxw"] = {"Wardandi"},
["wyb"] = {"Wangaaybuwan-Ngiyambaa"},
["wyi"] = {"Woiwurrung"},
["wym"] = {"Wymysorys"},
["wyn"] = {"Wyandot"},
["wyr"] = {"Wayoró"},
["wyy"] = {"Western Fijian"},
["xaa"] = {"Andalusian Arabic"},
["xab"] = {"Sambe"},
["xac"] = {"Kachari"},
["xad"] = {"Adai"},
["xae"] = {"Aequian"},
["xag"] = {"Aghwan"},
["xai"] = {"Kaimbé"},
["xaj"] = {"Ararandewára"},
["xak"] = {"Máku"},
["xal"] = {"Kalmyk", "Oirat"},
["xam"] = {"ǀXam"},
["xan"] = {"Xamtanga"},
["xao"] = {"Khao"},
["xap"] = {"Apalachee"},
["xaq"] = {"Aquitanian"},
["xar"] = {"Karami"},
["xas"] = {"Kamas"},
["xat"] = {"Katawixi"},
["xau"] = {"Kauwera"},
["xav"] = {"Xavánte"},
["xaw"] = {"Kawaiisu"},
["xay"] = {"Kayan Mahakam"},
["xbb"] = {"Lower Burdekin"},
["xbc"] = {"Bactrian"},
["xbd"] = {"Bindal"},
["xbe"] = {"Bigambal"},
["xbg"] = {"Bunganditj"},
["xbi"] = {"Kombio"},
["xbj"] = {"Birrpayi"},
["xbm"] = {"Middle Breton"},
["xbn"] = {"Kenaboi"},
["xbo"] = {"Bolgarian"},
["xbp"] = {"Bibbulman"},
["xbr"] = {"Kambera"},
["xbw"] = {"Kambiwá"},
["xby"] = {"Batjala", "Batyala"},
["xcb"] = {"Cumbric"},
["xcc"] = {"Camunic"},
["xce"] = {"Celtiberian"},
["xcg"] = {"Cisalpine Gaulish"},
["xch"] = {"Chemakum", "Chimakum"},
["xcl"] = {"Classical Armenian"},
["xcm"] = {"Comecrudo"},
["xcn"] = {"Cotoname"},
["xco"] = {"Chorasmian"},
["xcr"] = {"Carian"},
["xct"] = {"Classical Tibetan"},
["xcu"] = {"Curonian"},
["xcv"] = {"Chuvantsy"},
["xcw"] = {"Coahuilteco"},
["xcy"] = {"Cayuse"},
["xda"] = {"Darkinyung"},
["xdc"] = {"Dacian"},
["xdk"] = {"Dharuk"},
["xdm"] = {"Edomite"},
["xdo"] = {"Kwandu"},
["xdq"] = {"Kaitag"},
["xdy"] = {"Malayic Dayak"},
["xeb"] = {"Eblan"},
["xed"] = {"Hdi"},
["xeg"] = {"ǁXegwi"},
["xel"] = {"Kelo"},
["xem"] = {"Kembayan"},
["xep"] = {"Epi-Olmec"},
["xer"] = {"Xerénte"},
["xes"] = {"Kesawai"},
["xet"] = {"Xetá"},
["xeu"] = {"Keoru-Ahia"},
["xfa"] = {"Faliscan"},
["xga"] = {"Galatian"},
["xgb"] = {"Gbin"},
["xgd"] = {"Gudang"},
["xgf"] = {"Gabrielino-Fernandeño"},
["xgg"] = {"Goreng"},
["xgi"] = {"Garingbal"},
["xgl"] = {"Galindan"},
["xgm"] = {"Dharumbal", "Guwinmal"},
["xgn"] = {"Mongolian languages"},
["xgr"] = {"Garza"},
["xgu"] = {"Unggumi"},
["xgw"] = {"Guwa"},
["xha"] = {"Harami"},
["xhc"] = {"Hunnic"},
["xhd"] = {"Hadrami"},
["xhe"] = {"Khetrani"},
["xhm"] = {"Middle Khmer (1400 to 1850 CE)"},
["xhr"] = {"Hernican"},
["xht"] = {"Hattic"},
["xhu"] = {"Hurrian"},
["xhv"] = {"Khua"},
["xib"] = {"Iberian"},
["xii"] = {"Xiri"},
["xil"] = {"Illyrian"},
["xin"] = {"Xinca"},
["xir"] = {"Xiriâna"},
["xis"] = {"Kisan"},
["xiv"] = {"Indus Valley Language"},
["xiy"] = {"Xipaya"},
["xjb"] = {"Minjungbal"},
["xjt"] = {"Jaitmatang"},
["xka"] = {"Kalkoti"},
["xkb"] = {"Northern Nago"},
["xkc"] = {"Kho'ini"},
["xkd"] = {"Mendalam Kayan"},
["xke"] = {"Kereho"},
["xkf"] = {"Khengkha"},
["xkg"] = {"Kagoro"},
["xki"] = {"Kenyan Sign Language"},
["xkj"] = {"Kajali"},
["xkk"] = {"Kachok", "Kaco'"},
["xkl"] = {"Mainstream Kenyah"},
["xkn"] = {"Kayan River Kayan"},
["xko"] = {"Kiorr"},
["xkp"] = {"Kabatei"},
["xkq"] = {"Koroni"},
["xkr"] = {"Xakriabá"},
["xks"] = {"Kumbewaha"},
["xkt"] = {"Kantosi"},
["xku"] = {"Kaamba"},
["xkv"] = {"Kgalagadi"},
["xkw"] = {"Kembra"},
["xkx"] = {"Karore"},
["xky"] = {"Uma' Lasan"},
["xkz"] = {"Kurtokha"},
["xla"] = {"Kamula"},
["xlb"] = {"Loup B"},
["xlc"] = {"Lycian"},
["xld"] = {"Lydian"},
["xle"] = {"Lemnian"},
["xlg"] = {"Ligurian (Ancient)"},
["xli"] = {"Liburnian"},
["xln"] = {"Alanic"},
["xlo"] = {"Loup A"},
["xlp"] = {"Lepontic"},
["xls"] = {"Lusitanian"},
["xlu"] = {"Cuneiform Luwian"},
["xly"] = {"Elymian"},
["xma"] = {"Mushungulu"},
["xmb"] = {"Mbonga"},
["xmc"] = {"Makhuwa-Marrevone"},
["xmd"] = {"Mbudum"},
["xme"] = {"Median"},
["xmf"] = {"Mingrelian"},
["xmg"] = {"Mengaka"},
["xmh"] = {"Kugu-Muminh"},
["xmj"] = {"Majera"},
["xmk"] = {"Ancient Macedonian"},
["xml"] = {"Malaysian Sign Language"},
["xmm"] = {"Manado Malay"},
["xmn"] = {"Manichaean Middle Persian"},
["xmo"] = {"Morerebi"},
["xmp"] = {"Kuku-Mu'inh"},
["xmq"] = {"Kuku-Mangk"},
["xmr"] = {"Meroitic"},
["xms"] = {"Moroccan Sign Language"},
["xmt"] = {"Matbat"},
["xmu"] = {"Kamu"},
["xmv"] = {"Antankarana Malagasy", "Tankarana Malagasy"},
["xmw"] = {"Tsimihety Malagasy"},
["xmx"] = {"Salawati", "Maden"},
["xmy"] = {"Mayaguduna"},
["xmz"] = {"Mori Bawah"},
["xna"] = {"Ancient North Arabian"},
["xnb"] = {"Kanakanabu"},
["xnd"] = {"Na-Dene languages"},
["xng"] = {"Middle Mongolian"},
["xnh"] = {"Kuanhua"},
["xni"] = {"Ngarigu"},
["xnj"] = {"Ngoni (Tanzania)"},
["xnk"] = {"Nganakarti"},
["xnm"] = {"Ngumbarl"},
["xnn"] = {"Northern Kankanay"},
["xno"] = {"Anglo-Norman"},
["xnq"] = {"Ngoni (Mozambique)"},
["xnr"] = {"Kangri"},
["xns"] = {"Kanashi"},
["xnt"] = {"Narragansett"},
["xnu"] = {"Nukunul"},
["xny"] = {"Nyiyaparli"},
["xnz"] = {"Kenzi", "Mattoki"},
["xoc"] = {"O'chi'chi'"},
["xod"] = {"Kokoda"},
["xog"] = {"Soga"},
["xoi"] = {"Kominimung"},
["xok"] = {"Xokleng"},
["xom"] = {"Komo (Sudan)"},
["xon"] = {"Konkomba"},
["xoo"] = {"Xukurú"},
["xop"] = {"Kopar"},
["xor"] = {"Korubo"},
["xow"] = {"Kowaki"},
["xpa"] = {"Pirriya"},
["xpb"] = {"Northeastern Tasmanian", "Pyemmairrener"},
["xpc"] = {"Pecheneg"},
["xpd"] = {"Oyster Bay Tasmanian"},
["xpe"] = {"Liberia Kpelle"},
["xpf"] = {"Southeast Tasmanian", "Nuenonne"},
["xpg"] = {"Phrygian"},
["xph"] = {"North Midlands Tasmanian", "Tyerrenoterpanner"},
["xpi"] = {"Pictish"},
["xpj"] = {"Mpalitjanh"},
["xpk"] = {"Kulina Pano"},
["xpl"] = {"Port Sorell Tasmanian"},
["xpm"] = {"Pumpokol"},
["xpn"] = {"Kapinawá"},
["xpo"] = {"Pochutec"},
["xpp"] = {"Puyo-Paekche"},
["xpq"] = {"Mohegan-Pequot"},
["xpr"] = {"Parthian"},
["xps"] = {"Pisidian"},
["xpt"] = {"Punthamara"},
["xpu"] = {"Punic"},
["xpv"] = {"Northern Tasmanian", "Tommeginne"},
["xpw"] = {"Northwestern Tasmanian", "Peerapper"},
["xpx"] = {"Southwestern Tasmanian", "Toogee"},
["xpy"] = {"Puyo"},
["xpz"] = {"Bruny Island Tasmanian"},
["xqa"] = {"Karakhanid"},
["xqt"] = {"Qatabanian"},
["xra"] = {"Krahô"},
["xrb"] = {"Eastern Karaboro"},
["xrd"] = {"Gundungurra"},
["xre"] = {"Kreye"},
["xrg"] = {"Minang"},
["xri"] = {"Krikati-Timbira"},
["xrm"] = {"Armazic"},
["xrn"] = {"Arin"},
["xrr"] = {"Raetic"},
["xrt"] = {"Aranama-Tamique"},
["xru"] = {"Marriammu"},
["xrw"] = {"Karawa"},
["xsa"] = {"Sabaean"},
["xsb"] = {"Sambal"},
["xsc"] = {"Scythian"},
["xsd"] = {"Sidetic"},
["xse"] = {"Sempan"},
["xsh"] = {"Shamang"},
["xsi"] = {"Sio"},
["xsj"] = {"Subi"},
["xsl"] = {"South Slavey"},
["xsm"] = {"Kasem"},
["xsn"] = {"Sanga (Nigeria)"},
["xso"] = {"Solano"},
["xsp"] = {"Silopi"},
["xsq"] = {"Makhuwa-Saka"},
["xsr"] = {"Sherpa"},
["xsu"] = {"Sanumá"},
["xsv"] = {"Sudovian"},
["xsy"] = {"Saisiyat"},
["xta"] = {"Alcozauca Mixtec"},
["xtb"] = {"Chazumba Mixtec"},
["xtc"] = {"Katcha-Kadugli-Miri"},
["xtd"] = {"Diuxi-Tilantongo Mixtec"},
["xte"] = {"Ketengban"},
["xtg"] = {"Transalpine Gaulish"},
["xth"] = {"Yitha Yitha"},
["xti"] = {"Sinicahua Mixtec"},
["xtj"] = {"San Juan Teita Mixtec"},
["xtl"] = {"Tijaltepec Mixtec"},
["xtm"] = {"Magdalena Peñasco Mixtec"},
["xtn"] = {"Northern Tlaxiaco Mixtec"},
["xto"] = {"Tokharian A"},
["xtp"] = {"San Miguel Piedras Mixtec"},
["xtq"] = {"Tumshuqese"},
["xtr"] = {"Early Tripuri"},
["xts"] = {"Sindihui Mixtec"},
["xtt"] = {"Tacahua Mixtec"},
["xtu"] = {"Cuyamecalco Mixtec"},
["xtv"] = {"Thawa"},
["xtw"] = {"Tawandê"},
["xty"] = {"Yoloxochitl Mixtec"},
["xua"] = {"Alu Kurumba"},
["xub"] = {"Betta Kurumba"},
["xud"] = {"Umiida"},
["xug"] = {"Kunigami"},
["xuj"] = {"Jennu Kurumba"},
["xul"] = {"Ngunawal", "Nunukul"},
["xum"] = {"Umbrian"},
["xun"] = {"Unggaranggu"},
["xuo"] = {"Kuo"},
["xup"] = {"Upper Umpqua"},
["xur"] = {"Urartian"},
["xut"] = {"Kuthant"},
["xuu"] = {"Kxoe", "Khwedam"},
["xve"] = {"Venetic"},
["xvi"] = {"Kamviri"},
["xvn"] = {"Vandalic"},
["xvo"] = {"Volscian"},
["xvs"] = {"Vestinian"},
["xwa"] = {"Kwaza"},
["xwc"] = {"Woccon"},
["xwd"] = {"Wadi Wadi"},
["xwe"] = {"Xwela Gbe"},
["xwg"] = {"Kwegu"},
["xwj"] = {"Wajuk"},
["xwk"] = {"Wangkumara"},
["xwl"] = {"Western Xwla Gbe"},
["xwo"] = {"Written Oirat"},
["xwr"] = {"Kwerba Mamberamo"},
["xwt"] = {"Wotjobaluk"},
["xww"] = {"Wemba Wemba"},
["xxb"] = {"Boro (Ghana)"},
["xxk"] = {"Ke'o"},
["xxm"] = {"Minkin"},
["xxr"] = {"Koropó"},
["xxt"] = {"Tambora"},
["xya"] = {"Yaygir"},
["xyb"] = {"Yandjibara"},
["xyj"] = {"Mayi-Yapi"},
["xyk"] = {"Mayi-Kulan"},
["xyl"] = {"Yalakalore"},
["xyt"] = {"Mayi-Thakurti"},
["xyy"] = {"Yorta Yorta"},
["xzh"] = {"Zhang-Zhung"},
["xzm"] = {"Zemgalian"},
["xzp"] = {"Ancient Zapotec"},
["yaa"] = {"Yaminahua"},
["yab"] = {"Yuhup"},
["yac"] = {"Pass Valley Yali"},
["yad"] = {"Yagua"},
["yae"] = {"Pumé"},
["yaf"] = {"Yaka (Democratic Republic of Congo)"},
["yag"] = {"Yámana"},
["yah"] = {"Yazgulyam"},
["yai"] = {"Yagnobi"},
["yaj"] = {"Banda-Yangere"},
["yak"] = {"Yakama"},
["yal"] = {"Yalunka"},
["yam"] = {"Yamba"},
["yan"] = {"Mayangna"},
["yao"] = {"Yao"},
["yap"] = {"Yapese"},
["yaq"] = {"Yaqui"},
["yar"] = {"Yabarana"},
["yas"] = {"Nugunu (Cameroon)"},
["yat"] = {"Yambeta"},
["yau"] = {"Yuwana"},
["yav"] = {"Yangben"},
["yaw"] = {"Yawalapití"},
["yax"] = {"Yauma"},
["yay"] = {"Agwagwune"},
["yaz"] = {"Lokaa"},
["yba"] = {"Yala"},
["ybb"] = {"Yemba"},
["ybe"] = {"West Yugur"},
["ybh"] = {"Yakha"},
["ybi"] = {"Yamphu"},
["ybj"] = {"Hasha"},
["ybk"] = {"Bokha"},
["ybl"] = {"Yukuben"},
["ybm"] = {"Yaben"},
["ybn"] = {"Yabaâna"},
["ybo"] = {"Yabong"},
["ybx"] = {"Yawiyo"},
["yby"] = {"Yaweyuha"},
["ych"] = {"Chesu"},
["ycl"] = {"Lolopo"},
["ycn"] = {"Yucuna"},
["ycp"] = {"Chepya"},
["ycr"] = {"Yilan Creole"},
["yda"] = {"Yanda"},
["ydd"] = {"Eastern Yiddish"},
["yde"] = {"Yangum Dey"},
["ydg"] = {"Yidgha"},
["ydk"] = {"Yoidik"},
["yea"] = {"Ravula"},
["yec"] = {"Yeniche"},
["yee"] = {"Yimas"},
["yei"] = {"Yeni"},
["yej"] = {"Yevanic"},
["yel"] = {"Yela"},
["yer"] = {"Tarok"},
["yes"] = {"Nyankpa"},
["yet"] = {"Yetfa"},
["yeu"] = {"Yerukula"},
["yev"] = {"Yapunda"},
["yey"] = {"Yeyi"},
["yga"] = {"Malyangapa"},
["ygi"] = {"Yiningayi"},
["ygl"] = {"Yangum Gel"},
["ygm"] = {"Yagomi"},
["ygp"] = {"Gepo"},
["ygr"] = {"Yagaria"},
["ygs"] = {"Yolŋu Sign Language"},
["ygu"] = {"Yugul"},
["ygw"] = {"Yagwoia"},
["yha"] = {"Baha Buyang"},
["yhd"] = {"Judeo-Iraqi Arabic"},
["yhl"] = {"Hlepho Phowa"},
["yhs"] = {"Yan-nhaŋu Sign Language"},
["yia"] = {"Yinggarda"},
["yif"] = {"Ache"},
["yig"] = {"Wusa Nasu"},
["yih"] = {"Western Yiddish"},
["yii"] = {"Yidiny"},
["yij"] = {"Yindjibarndi"},
["yik"] = {"Dongshanba Lalo"},
["yil"] = {"Yindjilandji"},
["yim"] = {"Yimchungru Naga"},
["yin"] = {"Riang Lai", "Yinchia"},
["yip"] = {"Pholo"},
["yiq"] = {"Miqie"},
["yir"] = {"North Awyu"},
["yis"] = {"Yis"},
["yit"] = {"Eastern Lalu"},
["yiu"] = {"Awu"},
["yiv"] = {"Northern Nisu"},
["yix"] = {"Axi Yi"},
["yiz"] = {"Azhe"},
["yka"] = {"Yakan"},
["ykg"] = {"Northern Yukaghir"},
["ykh"] = {"Khamnigan Mongol"},
["yki"] = {"Yoke"},
["ykk"] = {"Yakaikeke"},
["ykl"] = {"Khlula"},
["ykm"] = {"Kap"},
["ykn"] = {"Kua-nsi"},
["yko"] = {"Yasa"},
["ykr"] = {"Yekora"},
["ykt"] = {"Kathu"},
["yku"] = {"Kuamasi"},
["yky"] = {"Yakoma"},
["yla"] = {"Yaul"},
["ylb"] = {"Yaleba"},
["yle"] = {"Yele"},
["ylg"] = {"Yelogu"},
["yli"] = {"Angguruk Yali"},
["yll"] = {"Yil"},
["ylm"] = {"Limi"},
["yln"] = {"Langnian Buyang"},
["ylo"] = {"Naluo Yi"},
["ylr"] = {"Yalarnnga"},
["ylu"] = {"Aribwaung"},
["yly"] = {"Nyâlayu", "Nyelâyu"},
["ymb"] = {"Yambes"},
["ymc"] = {"Southern Muji"},
["ymd"] = {"Muda"},
["yme"] = {"Yameo"},
["ymg"] = {"Yamongeri"},
["ymh"] = {"Mili"},
["ymi"] = {"Moji"},
["ymk"] = {"Makwe"},
["yml"] = {"Iamalele"},
["ymm"] = {"Maay"},
["ymn"] = {"Yamna", "Sunum"},
["ymo"] = {"Yangum Mon"},
["ymp"] = {"Yamap"},
["ymq"] = {"Qila Muji"},
["ymr"] = {"Malasar"},
["yms"] = {"Mysian"},
["ymx"] = {"Northern Muji"},
["ymz"] = {"Muzi"},
["yna"] = {"Aluo"},
["ynd"] = {"Yandruwandha"},
["yne"] = {"Lang'e"},
["yng"] = {"Yango"},
["ynk"] = {"Naukan Yupik"},
["ynl"] = {"Yangulam"},
["ynn"] = {"Yana"},
["yno"] = {"Yong"},
["ynq"] = {"Yendang"},
["yns"] = {"Yansi"},
["ynu"] = {"Yahuna"},
["yob"] = {"Yoba"},
["yog"] = {"Yogad"},
["yoi"] = {"Yonaguni"},
["yok"] = {"Yokuts"},
["yol"] = {"Yola"},
["yom"] = {"Yombe"},
["yon"] = {"Yongkom"},
["yot"] = {"Yotti"},
["yox"] = {"Yoron"},
["yoy"] = {"Yoy"},
["ypa"] = {"Phala"},
["ypb"] = {"Labo Phowa"},
["ypg"] = {"Phola"},
["yph"] = {"Phupha"},
["ypk"] = {"Yupik languages"},
["ypm"] = {"Phuma"},
["ypn"] = {"Ani Phowa"},
["ypo"] = {"Alo Phola"},
["ypp"] = {"Phupa"},
["ypz"] = {"Phuza"},
["yra"] = {"Yerakai"},
["yrb"] = {"Yareba"},
["yre"] = {"Yaouré"},
["yrk"] = {"Nenets"},
["yrl"] = {"Nhengatu"},
["yrm"] = {"Yirrk-Mel"},
["yrn"] = {"Yerong"},
["yro"] = {"Yaroamë"},
["yrs"] = {"Yarsun"},
["yrw"] = {"Yarawata"},
["yry"] = {"Yarluyandi"},
["ysc"] = {"Yassic"},
["ysd"] = {"Samatao"},
["ysg"] = {"Sonaga"},
["ysl"] = {"Yugoslavian Sign Language"},
["ysm"] = {"Myanmar Sign Language"},
["ysn"] = {"Sani"},
["yso"] = {"Nisi (China)"},
["ysp"] = {"Southern Lolopo"},
["ysr"] = {"Sirenik Yupik"},
["yss"] = {"Yessan-Mayo"},
["ysy"] = {"Sanie"},
["yta"] = {"Talu"},
["ytl"] = {"Tanglang"},
["ytp"] = {"Thopho"},
["ytw"] = {"Yout Wam"},
["yty"] = {"Yatay"},
["yua"] = {"Yucateco", "Yucatec Maya"},
["yub"] = {"Yugambal"},
["yuc"] = {"Yuchi"},
["yud"] = {"Judeo-Tripolitanian Arabic"},
["yue"] = {"Yue Chinese", "Cantonese"},
["yuf"] = {"Havasupai-Walapai-Yavapai"},
["yug"] = {"Yug"},
["yui"] = {"Yurutí"},
["yuj"] = {"Karkar-Yuri"},
["yuk"] = {"Yuki"},
["yul"] = {"Yulu"},
["yum"] = {"Quechan"},
["yun"] = {"Bena (Nigeria)"},
["yup"] = {"Yukpa"},
["yuq"] = {"Yuqui"},
["yur"] = {"Yurok"},
["yut"] = {"Yopno"},
["yuw"] = {"Yau (Morobe Province)"},
["yux"] = {"Southern Yukaghir"},
["yuy"] = {"East Yugur"},
["yuz"] = {"Yuracare"},
["yva"] = {"Yawa"},
["yvt"] = {"Yavitero"},
["ywa"] = {"Kalou"},
["ywg"] = {"Yinhawangka"},
["ywl"] = {"Western Lalu"},
["ywn"] = {"Yawanawa"},
["ywq"] = {"Wuding-Luquan Yi"},
["ywr"] = {"Yawuru"},
["ywt"] = {"Xishanba Lalo", "Central Lalo"},
["ywu"] = {"Wumeng Nasu"},
["yww"] = {"Yawarawarga"},
["yxa"] = {"Mayawali"},
["yxg"] = {"Yagara"},
["yxl"] = {"Yardliyawarra"},
["yxm"] = {"Yinwum"},
["yxu"] = {"Yuyu"},
["yxy"] = {"Yabula Yabula"},
["yyr"] = {"Yir Yoront"},
["yyu"] = {"Yau (Sandaun Province)"},
["yyz"] = {"Ayizi"},
["yzg"] = {"E'ma Buyang"},
["yzk"] = {"Zokhuo"},
["zaa"] = {"Sierra de Juárez Zapotec"},
["zab"] = {"Western Tlacolula Valley Zapotec", "San Juan Guelavía Zapotec"},
["zac"] = {"Ocotlán Zapotec"},
["zad"] = {"Cajonos Zapotec"},
["zae"] = {"Yareni Zapotec"},
["zaf"] = {"Ayoquesco Zapotec"},
["zag"] = {"Zaghawa"},
["zah"] = {"Zangwal"},
["zai"] = {"Isthmus Zapotec"},
["zaj"] = {"Zaramo"},
["zak"] = {"Zanaki"},
["zal"] = {"Zauzou"},
["zam"] = {"Miahuatlán Zapotec"},
["zao"] = {"Ozolotepec Zapotec"},
["zap"] = {"Zapotec"},
["zaq"] = {"Aloápam Zapotec"},
["zar"] = {"Rincón Zapotec"},
["zas"] = {"Santo Domingo Albarradas Zapotec"},
["zat"] = {"Tabaa Zapotec"},
["zau"] = {"Zangskari"},
["zav"] = {"Yatzachi Zapotec"},
["zaw"] = {"Mitla Zapotec"},
["zax"] = {"Xadani Zapotec"},
["zay"] = {"Zayse-Zergulla", "Zaysete"},
["zaz"] = {"Zari"},
["zba"] = {"Balaibalan"},
["zbc"] = {"Central Berawan"},
["zbe"] = {"East Berawan"},
["zbl"] = {"Blissymbols", "Bliss", "Blissymbolics"},
["zbt"] = {"Batui"},
["zbu"] = {"Bu (Bauchi State)"},
["zbw"] = {"West Berawan"},
["zca"] = {"Coatecas Altas Zapotec"},
["zcd"] = {"Las Delicias Zapotec"},
["zch"] = {"Central Hongshuihe Zhuang"},
["zdj"] = {"Ngazidja Comorian"},
["zea"] = {"Zeeuws"},
["zeg"] = {"Zenag"},
["zeh"] = {"Eastern Hongshuihe Zhuang"},
["zem"] = {"Zeem"},
["zen"] = {"Zenaga"},
["zga"] = {"Kinga"},
["zgb"] = {"Guibei Zhuang"},
["zgh"] = {"Standard Moroccan Tamazight"},
["zgm"] = {"Minz Zhuang"},
["zgn"] = {"Guibian Zhuang"},
["zgr"] = {"Magori"},
["zhb"] = {"Zhaba"},
["zhd"] = {"Dai Zhuang"},
["zhi"] = {"Zhire"},
["zhn"] = {"Nong Zhuang"},
["zhw"] = {"Zhoa"},
["zhx"] = {"Chinese (family)"},
["zia"] = {"Zia"},
["zib"] = {"Zimbabwe Sign Language"},
["zik"] = {"Zimakani"},
["zil"] = {"Zialo"},
["zim"] = {"Mesme"},
["zin"] = {"Zinza"},
["ziw"] = {"Zigula"},
["ziz"] = {"Zizilivakan"},
["zka"] = {"Kaimbulawa"},
["zkd"] = {"Kadu"},
["zkg"] = {"Koguryo"},
["zkh"] = {"Khorezmian"},
["zkk"] = {"Karankawa"},
["zkn"] = {"Kanan"},
["zko"] = {"Kott"},
["zkp"] = {"São Paulo Kaingáng"},
["zkr"] = {"Zakhring"},
["zkt"] = {"Kitan"},
["zku"] = {"Kaurna"},
["zkv"] = {"Krevinian"},
["zkz"] = {"Khazar"},
["zla"] = {"Zula"},
["zle"] = {"East Slavic languages"},
["zlj"] = {"Liujiang Zhuang"},
["zlm"] = {"Malay (individual language)"},
["zln"] = {"Lianshan Zhuang"},
["zlq"] = {"Liuqian Zhuang"},
["zls"] = {"South Slavic languages"},
["zlu"] = {"Zul"},
["zlw"] = {"West Slavic languages"},
["zma"] = {"Manda (Australia)"},
["zmb"] = {"Zimba"},
["zmc"] = {"Margany"},
["zmd"] = {"Maridan"},
["zme"] = {"Mangerr"},
["zmf"] = {"Mfinu"},
["zmg"] = {"Marti Ke"},
["zmh"] = {"Makolkol"},
["zmi"] = {"Negeri Sembilan Malay"},
["zmj"] = {"Maridjabin"},
["zmk"] = {"Mandandanyi"},
["zml"] = {"Matngala"},
["zmm"] = {"Marimanindji", "Marramaninyshi"},
["zmn"] = {"Mbangwe"},
["zmo"] = {"Molo"},
["zmp"] = {"Mpuono"},
["zmq"] = {"Mituku"},
["zmr"] = {"Maranunggu"},
["zms"] = {"Mbesa"},
["zmt"] = {"Maringarr"},
["zmu"] = {"Muruwari"},
["zmv"] = {"Mbariman-Gudhinma"},
["zmw"] = {"Mbo (Democratic Republic of Congo)"},
["zmx"] = {"Bomitaba"},
["zmy"] = {"Mariyedi"},
["zmz"] = {"Mbandja"},
["zna"] = {"Zan Gula"},
["znd"] = {"Zande languages"},
["zne"] = {"Zande (individual language)"},
["zng"] = {"Mang"},
["znk"] = {"Manangkari"},
["zns"] = {"Mangas"},
["zoc"] = {"Copainalá Zoque"},
["zoh"] = {"Chimalapa Zoque"},
["zom"] = {"Zou"},
["zoo"] = {"Asunción Mixtepec Zapotec"},
["zoq"] = {"Tabasco Zoque"},
["zor"] = {"Rayón Zoque"},
["zos"] = {"Francisco León Zoque"},
["zpa"] = {"Lachiguiri Zapotec"},
["zpb"] = {"Yautepec Zapotec"},
["zpc"] = {"Choapan Zapotec"},
["zpd"] = {"Southeastern Ixtlán Zapotec"},
["zpe"] = {"Petapa Zapotec"},
["zpf"] = {"San Pedro Quiatoni Zapotec"},
["zpg"] = {"Guevea De Humboldt Zapotec"},
["zph"] = {"Totomachapan Zapotec"},
["zpi"] = {"Santa María Quiegolani Zapotec"},
["zpj"] = {"Quiavicuzas Zapotec"},
["zpk"] = {"Tlacolulita Zapotec"},
["zpl"] = {"Lachixío Zapotec"},
["zpm"] = {"Mixtepec Zapotec"},
["zpn"] = {"Santa Inés Yatzechi Zapotec"},
["zpo"] = {"Amatlán Zapotec"},
["zpp"] = {"El Alto Zapotec"},
["zpq"] = {"Zoogocho Zapotec"},
["zpr"] = {"Santiago Xanica Zapotec"},
["zps"] = {"Coatlán Zapotec"},
["zpt"] = {"San Vicente Coatlán Zapotec"},
["zpu"] = {"Yalálag Zapotec"},
["zpv"] = {"Chichicapan Zapotec"},
["zpw"] = {"Zaniza Zapotec"},
["zpx"] = {"San Baltazar Loxicha Zapotec"},
["zpy"] = {"Mazaltepec Zapotec"},
["zpz"] = {"Texmelucan Zapotec"},
["zqe"] = {"Qiubei Zhuang"},
["zra"] = {"Kara (Korea)"},
["zrg"] = {"Mirgan"},
["zrn"] = {"Zerenkel"},
["zro"] = {"Záparo"},
["zrp"] = {"Zarphatic"},
["zrs"] = {"Mairasi"},
["zsa"] = {"Sarasira"},
["zsk"] = {"Kaskean"},
["zsl"] = {"Zambian Sign Language"},
["zsm"] = {"Standard Malay"},
["zsr"] = {"Southern Rincon Zapotec"},
["zsu"] = {"Sukurum"},
["zte"] = {"Elotepec Zapotec"},
["ztg"] = {"Xanaguía Zapotec"},
["ztl"] = {"Lapaguía-Guivini Zapotec"},
["ztm"] = {"San Agustín Mixtepec Zapotec"},
["ztn"] = {"Santa Catarina Albarradas Zapotec"},
["ztp"] = {"Loxicha Zapotec"},
["ztq"] = {"Quioquitani-Quierí Zapotec"},
["zts"] = {"Tilquiapan Zapotec"},
["ztt"] = {"Tejalapan Zapotec"},
["ztu"] = {"Güilá Zapotec"},
["ztx"] = {"Zaachila Zapotec"},
["zty"] = {"Yatee Zapotec"},
["zuh"] = {"Tokano"},
["zum"] = {"Kumzari"},
["zun"] = {"Zuni"},
["zuy"] = {"Zumaya"},
["zwa"] = {"Zay"},
["zxx"] = {"No linguistic content", "Not applicable"},
["zyb"] = {"Yongbei Zhuang"},
["zyg"] = {"Yang Zhuang"},
["zyj"] = {"Youjiang Zhuang"},
["zyn"] = {"Yongnan Zhuang"},
["zyp"] = {"Zyphe Chin"},
["zza"] = {"Zaza", "Dimili", "Dimli (macrolanguage)", "Kirdki", "Kirmanjki (macrolanguage)", "Zazaki"},
["zzj"] = {"Zuojiang Zhuang"}
}
local deprecated = {
["in"] = {"Indonesian"},
["iw"] = {"Hebrew"},
["ji"] = {"Yiddish"},
["jw"] = {"Javanese"},
["mo"] = {"Moldavian", "Moldovan"},
["aam"] = {"Aramanik"},
["adp"] = {"Adap"},
["agp"] = {"Paranan"},
["ais"] = {"Nataoran Amis"},
["ajp"] = {"South Levantine Arabic"},
["ajt"] = {"Judeo-Tunisian Arabic"},
["aoh"] = {"Arma"},
["asd"] = {"Asas"},
["aue"] = {"ǂKxʼauǁʼein"},
["ayx"] = {"Ayi (China)"},
["ayy"] = {"Tayabas Ayta"},
["baz"] = {"Tunen"},
["bbz"] = {"Babalia Creole Arabic"},
["bgm"] = {"Baga Mboteni"},
["bhk"] = {"Albay Bicolano"},
["bic"] = {"Bikaru"},
["bij"] = {"Vaghat-Ya-Bijim-Legeri"},
["bjd"] = {"Bandjigali"},
["bjq"] = {"Southern Betsimisaraka Malagasy"},
["bkb"] = {"Finallig"},
["blg"] = {"Balau"},
["bmy"] = {"Bemba (Democratic Republic of Congo)"},
["bpb"] = {"Barbacoas"},
["btb"] = {"Beti (Cameroon)"},
["btl"] = {"Bhatola"},
["bxx"] = {"Borna (Democratic Republic of Congo)"},
["byy"] = {"Buya"},
["cbe"] = {"Chipiajes"},
["cbh"] = {"Cagua"},
["cca"] = {"Cauca"},
["ccq"] = {"Chaungtha"},
["cdg"] = {"Chamari"},
["cjr"] = {"Chorotega"},
["cka"] = {"Khumi Awa Chin"},
["cmk"] = {"Chimakum"},
["coy"] = {"Coyaima"},
["cqu"] = {"Chilean Quechua"},
["cug"] = {"Chungmboko", "Cung"},
["cum"] = {"Cumeral"},
["daf"] = {"Dan"},
["dap"] = {"Nisi (India)"},
["dgu"] = {"Degaru"},
["dha"] = {"Dhanwar (India)"},
["dit"] = {"Dirari"},
["djl"] = {"Djiwarli"},
["dkl"] = {"Kolum So Dogon"},
["drh"] = {"Darkhat"},
["drr"] = {"Dororo"},
["drw"] = {"Darwazi"},
["dud"] = {"Hun-Saare"},
["duj"] = {"Dhuwal"},
["dwl"] = {"Walo Kumbe Dogon"},
["ekc"] = {"Eastern Karnic"},
["elp"] = {"Elpaputih"},
["emo"] = {"Emok"},
["gav"] = {"Gabutamon"},
["gbc"] = {"Garawa"},
["gfx"] = {"Mangetti Dune ǃXung"},
["ggn"] = {"Eastern Gurung"},
["ggo"] = {"Southern Gondi"},
["ggr"] = {"Aghu Tharnggalu"},
["gio"] = {"Gelao"},
["gji"] = {"Geji"},
["gli"] = {"Guliguli"},
["gti"] = {"Gbati-ri"},
["guv"] = {"Gey"},
["hrr"] = {"Horuru"},
["iap"] = {"Iapama"},
["ibi"] = {"Ibilo"},
["ill"] = {"Iranun"},
["ilw"] = {"Talur"},
["ime"] = {"Imeraguen"},
["izi"] = {"Izi-Ezaa-Ikwo-Mgbo"},
["jar"] = {"Jarawa (Nigeria)"},
["jeg"] = {"Jeng"},
["kbf"] = {"Kakauhua"},
["kdv"] = {"Kado"},
["kgc"] = {"Kasseng"},
["kgd"] = {"Kataang"},
["kgh"] = {"Upper Tanudan Kalinga"},
["kgm"] = {"Karipúna"},
["kjf"] = {"Khalaj [Indo-Iranian]"},
["koj"] = {"Sara Dunjo"},
["kox"] = {"Coxima"},
["kpp"] = {"Paku Karen"},
["krm"] = {"Krim"},
["ksa"] = {"Shuwa-Zamani"},
["ktr"] = {"Kota Marudu Tinagas"},
["kvs"] = {"Kunggara"},
["kwq"] = {"Kwak"},
["kxe"] = {"Kakihum"},
["kxl"] = {"Nepali Kurux"},
["kxu"] = {"Kui (India)"},
["kzh"] = {"Kenuzi-Dongola"},
["kzj"] = {"Coastal Kadazan"},
["kzt"] = {"Tambunan Dusun"},
["lak"] = {"Laka (Nigeria)"},
["lba"] = {"Lui"},
["leg"] = {"Lengua"},
["lii"] = {"Lingkhim"},
["llo"] = {"Khlor"},
["lmm"] = {"Lamam"},
["lmz"] = {"Lumbee"},
["lno"] = {"Lango (South Sudan)"},
["lsg"] = {"Lyons Sign Language"},
["meg"] = {"Mea"},
["mgx"] = {"Omati"},
["mhh"] = {"Maskoy Pidgin"},
["mja"] = {"Mahei"},
["mld"] = {"Malakhel"},
["mnt"] = {"Maykulan"},
["mof"] = {"Mohegan-Montauk-Narragansett"},
["mst"] = {"Cataelano Mandaya"},
["mvm"] = {"Muya"},
["mwd"] = {"Mudbura"},
["mwj"] = {"Maligo"},
["mwx"] = {"Mediak"},
["mwy"] = {"Mosiro"},
["myd"] = {"Maramba"},
["myi"] = {"Mina (India)"},
["myq"] = {"Forest Maninka"},
["myt"] = {"Sangab Mandaya"},
["nad"] = {"Nijadali"},
["nbf"] = {"Naxi"},
["nbx"] = {"Ngura"},
["ncp"] = {"Ndaktup"},
["ngo"] = {"Ngoni"},
["nln"] = {"Durango Nahuatl"},
["nlr"] = {"Ngarla"},
["nns"] = {"Ningye"},
["nnx"] = {"Ngong"},
["nom"] = {"Nocamán"},
["noo"] = {"Nootka"},
["nts"] = {"Natagaimas"},
["nxu"] = {"Narau"},
["ome"] = {"Omejes"},
["oun"] = {"ǃOǃung"},
["pat"] = {"Papitalai"},
["pbz"] = {"Palu"},
["pcr"] = {"Panang"},
["pgy"] = {"Pongyong"},
["pii"] = {"Pini"},
["plj"] = {"Polci"},
["plp"] = {"Palpa"},
["pmc"] = {"Palumata"},
["pmk"] = {"Pamlico"},
["pmu"] = {"Mirpur Panjabi"},
["pod"] = {"Ponares"},
["ppa"] = {"Pao"},
["ppr"] = {"Piru"},
["prb"] = {"Lua'"},
["prp"] = {"Parsi"},
["pry"] = {"Pray 3"},
["puk"] = {"Pu Ko"},
["puz"] = {"Purum Naga"},
["rie"] = {"Rien"},
["rmr"] = {"Caló"},
["rna"] = {"Runa"},
["rsi"] = {"Rennellese Sign Language"},
["sap"] = {"Sanapaná"},
["sca"] = {"Sansu"},
["sdm"] = {"Semandang"},
["sgl"] = {"Sanglechi-Ishkashimi"},
["sgo"] = {"Songa"},
["skk"] = {"Sok"},
["slq"] = {"Salchuq"},
["smd"] = {"Sama"},
["snb"] = {"Sebuyau"},
["snh"] = {"Shinabo"},
["sul"] = {"Surigaonon"},
["sum"] = {"Sumo-Mayangna"},
["svr"] = {"Savara"},
["szd"] = {"Seru"},
["tbb"] = {"Tapeba"},
["tdu"] = {"Tempasuk Dusun"},
["tgg"] = {"Tangga"},
["thc"] = {"Tai Hang Tong"},
["thw"] = {"Thudam"},
["thx"] = {"The"},
["tid"] = {"Tidong"},
["tie"] = {"Tingal"},
["tkk"] = {"Takpa"},
["tlw"] = {"South Wemale"},
["tmk"] = {"Northwestern Tamang"},
["tmp"] = {"Tai Mène"},
["tne"] = {"Tinoc Kallahan"},
["tnf"] = {"Tangshewi"},
["toe"] = {"Tomedes"},
["tpw"] = {"Tupí"},
["tsf"] = {"Southwestern Tamang"},
["unp"] = {"Worora"},
["uok"] = {"Uokha"},
["uun"] = {"Kulon-Pazeh"},
["vki"] = {"Ija-Zuba"},
["wgw"] = {"Wagawaga"},
["wit"] = {"Wintu"},
["wiw"] = {"Wirangu"},
["wra"] = {"Warapu"},
["wrd"] = {"Warduji"},
["wya"] = {"Wyandot"},
["xba"] = {"Kamba (Brazil)"},
["xbx"] = {"Kabixí"},
["xia"] = {"Xiandao"},
["xip"] = {"Xipináwa"},
["xkh"] = {"Karahawyana"},
["xrq"] = {"Karranga"},
["xss"] = {"Assan"},
["xtz"] = {"Tasmanian"},
["ybd"] = {"Yangbye"},
["yds"] = {"Yiddish Sign Language"},
["yen"] = {"Yendang"},
["yiy"] = {"Yir Yoront"},
["yma"] = {"Yamphe"},
["ymt"] = {"Mator-Taygi-Karagas"},
["ynh"] = {"Yangho"},
["yos"] = {"Yos"},
["yri"] = {"Yarí"},
["yuu"] = {"Yugh"},
["zir"] = {"Ziriya"},
["zkb"] = {"Koibal"},
["zua"] = {"Zeem"}
}
return {
active = active,
deprecated = deprecated,
}
d2b8387b798a45d93230d1c1b7b22a80714751a1
Module:Language/data/iana scripts
828
153
406
2023-08-21T15:41:24Z
wikipedia>Trappist the monk
0
update to 2023-08-02 data;
Scribunto
text/plain
-- File-Date: 2023-08-02
return {
["Adlm"] = {"Adlam"},
["Afak"] = {"Afaka"},
["Aghb"] = {"Caucasian Albanian"},
["Ahom"] = {"Ahom", "Tai Ahom"},
["Arab"] = {"Arabic"},
["Aran"] = {"Arabic (Nastaliq variant)"},
["Armi"] = {"Imperial Aramaic"},
["Armn"] = {"Armenian"},
["Avst"] = {"Avestan"},
["Bali"] = {"Balinese"},
["Bamu"] = {"Bamum"},
["Bass"] = {"Bassa Vah"},
["Batk"] = {"Batak"},
["Beng"] = {"Bengali", "Bangla"},
["Bhks"] = {"Bhaiksuki"},
["Blis"] = {"Blissymbols"},
["Bopo"] = {"Bopomofo"},
["Brah"] = {"Brahmi"},
["Brai"] = {"Braille"},
["Bugi"] = {"Buginese"},
["Buhd"] = {"Buhid"},
["Cakm"] = {"Chakma"},
["Cans"] = {"Unified Canadian Aboriginal Syllabics"},
["Cari"] = {"Carian"},
["Cham"] = {"Cham"},
["Cher"] = {"Cherokee"},
["Chrs"] = {"Chorasmian"},
["Cirt"] = {"Cirth"},
["Copt"] = {"Coptic"},
["Cpmn"] = {"Cypro-Minoan"},
["Cprt"] = {"Cypriot syllabary"},
["Cyrl"] = {"Cyrillic"},
["Cyrs"] = {"Cyrillic (Old Church Slavonic variant)"},
["Deva"] = {"Devanagari", "Nagari"},
["Diak"] = {"Dives Akuru"},
["Dogr"] = {"Dogra"},
["Dsrt"] = {"Deseret", "Mormon"},
["Dupl"] = {"Duployan shorthand", "Duployan stenography"},
["Egyd"] = {"Egyptian demotic"},
["Egyh"] = {"Egyptian hieratic"},
["Egyp"] = {"Egyptian hieroglyphs"},
["Elba"] = {"Elbasan"},
["Elym"] = {"Elymaic"},
["Ethi"] = {"Ethiopic", "Geʻez", "Ge'ez"},
["Geok"] = {"Khutsuri (Asomtavruli and Nuskhuri)"},
["Geor"] = {"Georgian (Mkhedruli and Mtavruli)"},
["Glag"] = {"Glagolitic"},
["Gong"] = {"Gunjala Gondi"},
["Gonm"] = {"Masaram Gondi"},
["Goth"] = {"Gothic"},
["Gran"] = {"Grantha"},
["Grek"] = {"Greek"},
["Gujr"] = {"Gujarati"},
["Guru"] = {"Gurmukhi"},
["Hanb"] = {"Han with Bopomofo (alias for Han + Bopomofo)"},
["Hang"] = {"Hangul", "Hangŭl", "Hangeul"},
["Hani"] = {"Han", "Hanzi", "Kanji", "Hanja"},
["Hano"] = {"Hanunoo", "Hanunóo"},
["Hans"] = {"Han (Simplified variant)"},
["Hant"] = {"Han (Traditional variant)"},
["Hatr"] = {"Hatran"},
["Hebr"] = {"Hebrew"},
["Hira"] = {"Hiragana"},
["Hluw"] = {"Anatolian Hieroglyphs", "Luwian Hieroglyphs", "Hittite Hieroglyphs"},
["Hmng"] = {"Pahawh Hmong"},
["Hmnp"] = {"Nyiakeng Puachue Hmong"},
["Hrkt"] = {"Japanese syllabaries (alias for Hiragana + Katakana)"},
["Hung"] = {"Old Hungarian", "Hungarian Runic"},
["Inds"] = {"Indus", "Harappan"},
["Ital"] = {"Old Italic (Etruscan, Oscan, etc.)"},
["Jamo"] = {"Jamo (alias for Jamo subset of Hangul)"},
["Java"] = {"Javanese"},
["Jpan"] = {"Japanese (alias for Han + Hiragana + Katakana)"},
["Jurc"] = {"Jurchen"},
["Kali"] = {"Kayah Li"},
["Kana"] = {"Katakana"},
["Kawi"] = {"Kawi"},
["Khar"] = {"Kharoshthi"},
["Khmr"] = {"Khmer"},
["Khoj"] = {"Khojki"},
["Kitl"] = {"Khitan large script"},
["Kits"] = {"Khitan small script"},
["Knda"] = {"Kannada"},
["Kore"] = {"Korean (alias for Hangul + Han)"},
["Kpel"] = {"Kpelle"},
["Kthi"] = {"Kaithi"},
["Lana"] = {"Tai Tham", "Lanna"},
["Laoo"] = {"Lao"},
["Latf"] = {"Latin (Fraktur variant)"},
["Latg"] = {"Latin (Gaelic variant)"},
["Latn"] = {"Latin"},
["Leke"] = {"Leke"},
["Lepc"] = {"Lepcha", "Róng"},
["Limb"] = {"Limbu"},
["Lina"] = {"Linear A"},
["Linb"] = {"Linear B"},
["Lisu"] = {"Lisu", "Fraser"},
["Loma"] = {"Loma"},
["Lyci"] = {"Lycian"},
["Lydi"] = {"Lydian"},
["Mahj"] = {"Mahajani"},
["Maka"] = {"Makasar"},
["Mand"] = {"Mandaic", "Mandaean"},
["Mani"] = {"Manichaean"},
["Marc"] = {"Marchen"},
["Maya"] = {"Mayan hieroglyphs"},
["Medf"] = {"Medefaidrin", "Oberi Okaime", "Oberi Ɔkaimɛ"},
["Mend"] = {"Mende Kikakui"},
["Merc"] = {"Meroitic Cursive"},
["Mero"] = {"Meroitic Hieroglyphs"},
["Mlym"] = {"Malayalam"},
["Modi"] = {"Modi", "Moḍī"},
["Mong"] = {"Mongolian"},
["Moon"] = {"Moon", "Moon code", "Moon script", "Moon type"},
["Mroo"] = {"Mro", "Mru"},
["Mtei"] = {"Meitei Mayek", "Meithei", "Meetei"},
["Mult"] = {"Multani"},
["Mymr"] = {"Myanmar", "Burmese"},
["Nagm"] = {"Nag Mundari"},
["Nand"] = {"Nandinagari"},
["Narb"] = {"Old North Arabian", "Ancient North Arabian"},
["Nbat"] = {"Nabataean"},
["Newa"] = {"Newa", "Newar", "Newari", "Nepāla lipi"},
["Nkdb"] = {"Naxi Dongba", "na²¹ɕi³³ to³³ba²¹", "Nakhi Tomba"},
["Nkgb"] = {"Naxi Geba", "na²¹ɕi³³ gʌ²¹ba²¹", "'Na-'Khi ²Ggŏ-¹baw", "Nakhi Geba"},
["Nkoo"] = {"N’Ko", "N'Ko"},
["Nshu"] = {"Nüshu"},
["Ogam"] = {"Ogham"},
["Olck"] = {"Ol Chiki", "Ol Cemet'", "Ol", "Santali"},
["Orkh"] = {"Old Turkic", "Orkhon Runic"},
["Orya"] = {"Oriya", "Odia"},
["Osge"] = {"Osage"},
["Osma"] = {"Osmanya"},
["Ougr"] = {"Old Uyghur"},
["Palm"] = {"Palmyrene"},
["Pauc"] = {"Pau Cin Hau"},
["Pcun"] = {"Proto-Cuneiform"},
["Pelm"] = {"Proto-Elamite"},
["Perm"] = {"Old Permic"},
["Phag"] = {"Phags-pa"},
["Phli"] = {"Inscriptional Pahlavi"},
["Phlp"] = {"Psalter Pahlavi"},
["Phlv"] = {"Book Pahlavi"},
["Phnx"] = {"Phoenician"},
["Piqd"] = {"Klingon (KLI pIqaD)"},
["Plrd"] = {"Miao", "Pollard"},
["Prti"] = {"Inscriptional Parthian"},
["Psin"] = {"Proto-Sinaitic"},
["Ranj"] = {"Ranjana"},
["Rjng"] = {"Rejang", "Redjang", "Kaganga"},
["Rohg"] = {"Hanifi Rohingya"},
["Roro"] = {"Rongorongo"},
["Runr"] = {"Runic"},
["Samr"] = {"Samaritan"},
["Sara"] = {"Sarati"},
["Sarb"] = {"Old South Arabian"},
["Saur"] = {"Saurashtra"},
["Sgnw"] = {"SignWriting"},
["Shaw"] = {"Shavian", "Shaw"},
["Shrd"] = {"Sharada", "Śāradā"},
["Shui"] = {"Shuishu"},
["Sidd"] = {"Siddham", "Siddhaṃ", "Siddhamātṛkā"},
["Sind"] = {"Khudawadi", "Sindhi"},
["Sinh"] = {"Sinhala"},
["Sogd"] = {"Sogdian"},
["Sogo"] = {"Old Sogdian"},
["Sora"] = {"Sora Sompeng"},
["Soyo"] = {"Soyombo"},
["Sund"] = {"Sundanese"},
["Sunu"] = {"Sunuwar"},
["Sylo"] = {"Syloti Nagri"},
["Syrc"] = {"Syriac"},
["Syre"] = {"Syriac (Estrangelo variant)"},
["Syrj"] = {"Syriac (Western variant)"},
["Syrn"] = {"Syriac (Eastern variant)"},
["Tagb"] = {"Tagbanwa"},
["Takr"] = {"Takri", "Ṭākrī", "Ṭāṅkrī"},
["Tale"] = {"Tai Le"},
["Talu"] = {"New Tai Lue"},
["Taml"] = {"Tamil"},
["Tang"] = {"Tangut"},
["Tavt"] = {"Tai Viet"},
["Telu"] = {"Telugu"},
["Teng"] = {"Tengwar"},
["Tfng"] = {"Tifinagh", "Berber"},
["Tglg"] = {"Tagalog", "Baybayin", "Alibata"},
["Thaa"] = {"Thaana"},
["Thai"] = {"Thai"},
["Tibt"] = {"Tibetan"},
["Tirh"] = {"Tirhuta"},
["Tnsa"] = {"Tangsa"},
["Toto"] = {"Toto"},
["Ugar"] = {"Ugaritic"},
["Vaii"] = {"Vai"},
["Visp"] = {"Visible Speech"},
["Vith"] = {"Vithkuqi"},
["Wara"] = {"Warang Citi", "Varang Kshiti"},
["Wcho"] = {"Wancho"},
["Wole"] = {"Woleai"},
["Xpeo"] = {"Old Persian"},
["Xsux"] = {"Sumero-Akkadian cuneiform"},
["Yezi"] = {"Yezidi"},
["Yiii"] = {"Yi"},
["Zanb"] = {"Zanabazar Square", "Zanabazarin Dörböljin Useg", "Xewtee Dörböljin Bicig", "Horizontal Square Script"},
["Zinh"] = {"Code for inherited script"},
["Zmth"] = {"Mathematical notation"},
["Zsye"] = {"Symbols (Emoji variant)"},
["Zsym"] = {"Symbols"},
["Zxxx"] = {"Code for unwritten documents"},
["Zyyy"] = {"Code for undetermined script"},
["Zzzz"] = {"Code for uncoded script"}
}
441e9d6e54b88bea137b8945819732a90106bd4d
Module:Language/data/iana regions
828
154
408
2023-08-21T15:41:26Z
wikipedia>Trappist the monk
0
update to 2023-08-02 data;
Scribunto
text/plain
-- File-Date: 2023-08-02
return {
["AC"] = {"Ascension Island"},
["AD"] = {"Andorra"},
["AE"] = {"United Arab Emirates"},
["AF"] = {"Afghanistan"},
["AG"] = {"Antigua and Barbuda"},
["AI"] = {"Anguilla"},
["AL"] = {"Albania"},
["AM"] = {"Armenia"},
["AO"] = {"Angola"},
["AQ"] = {"Antarctica"},
["AR"] = {"Argentina"},
["AS"] = {"American Samoa"},
["AT"] = {"Austria"},
["AU"] = {"Australia"},
["AW"] = {"Aruba"},
["AX"] = {"Åland Islands"},
["AZ"] = {"Azerbaijan"},
["BA"] = {"Bosnia and Herzegovina"},
["BB"] = {"Barbados"},
["BD"] = {"Bangladesh"},
["BE"] = {"Belgium"},
["BF"] = {"Burkina Faso"},
["BG"] = {"Bulgaria"},
["BH"] = {"Bahrain"},
["BI"] = {"Burundi"},
["BJ"] = {"Benin"},
["BL"] = {"Saint Barthélemy"},
["BM"] = {"Bermuda"},
["BN"] = {"Brunei Darussalam"},
["BO"] = {"Bolivia"},
["BQ"] = {"Bonaire, Sint Eustatius and Saba"},
["BR"] = {"Brazil"},
["BS"] = {"Bahamas"},
["BT"] = {"Bhutan"},
["BV"] = {"Bouvet Island"},
["BW"] = {"Botswana"},
["BY"] = {"Belarus"},
["BZ"] = {"Belize"},
["CA"] = {"Canada"},
["CC"] = {"Cocos (Keeling) Islands"},
["CD"] = {"The Democratic Republic of the Congo"},
["CF"] = {"Central African Republic"},
["CG"] = {"Congo"},
["CH"] = {"Switzerland"},
["CI"] = {"Côte d'Ivoire"},
["CK"] = {"Cook Islands"},
["CL"] = {"Chile"},
["CM"] = {"Cameroon"},
["CN"] = {"China"},
["CO"] = {"Colombia"},
["CP"] = {"Clipperton Island"},
["CQ"] = {"Sark"},
["CR"] = {"Costa Rica"},
["CU"] = {"Cuba"},
["CV"] = {"Cabo Verde", "Cape Verde"},
["CW"] = {"Curaçao"},
["CX"] = {"Christmas Island"},
["CY"] = {"Cyprus"},
["CZ"] = {"Czechia", "Czech Republic"},
["DE"] = {"Germany"},
["DG"] = {"Diego Garcia"},
["DJ"] = {"Djibouti"},
["DK"] = {"Denmark"},
["DM"] = {"Dominica"},
["DO"] = {"Dominican Republic"},
["DZ"] = {"Algeria"},
["EA"] = {"Ceuta, Melilla"},
["EC"] = {"Ecuador"},
["EE"] = {"Estonia"},
["EG"] = {"Egypt"},
["EH"] = {"Western Sahara"},
["ER"] = {"Eritrea"},
["ES"] = {"Spain"},
["ET"] = {"Ethiopia"},
["EU"] = {"European Union"},
["EZ"] = {"Eurozone"},
["FI"] = {"Finland"},
["FJ"] = {"Fiji"},
["FK"] = {"Falkland Islands (Malvinas)"},
["FM"] = {"Federated States of Micronesia"},
["FO"] = {"Faroe Islands"},
["FR"] = {"France"},
["GA"] = {"Gabon"},
["GB"] = {"United Kingdom"},
["GD"] = {"Grenada"},
["GE"] = {"Georgia"},
["GF"] = {"French Guiana"},
["GG"] = {"Guernsey"},
["GH"] = {"Ghana"},
["GI"] = {"Gibraltar"},
["GL"] = {"Greenland"},
["GM"] = {"Gambia"},
["GN"] = {"Guinea"},
["GP"] = {"Guadeloupe"},
["GQ"] = {"Equatorial Guinea"},
["GR"] = {"Greece"},
["GS"] = {"South Georgia and the South Sandwich Islands"},
["GT"] = {"Guatemala"},
["GU"] = {"Guam"},
["GW"] = {"Guinea-Bissau"},
["GY"] = {"Guyana"},
["HK"] = {"Hong Kong"},
["HM"] = {"Heard Island and McDonald Islands"},
["HN"] = {"Honduras"},
["HR"] = {"Croatia"},
["HT"] = {"Haiti"},
["HU"] = {"Hungary"},
["IC"] = {"Canary Islands"},
["ID"] = {"Indonesia"},
["IE"] = {"Ireland"},
["IL"] = {"Israel"},
["IM"] = {"Isle of Man"},
["IN"] = {"India"},
["IO"] = {"British Indian Ocean Territory"},
["IQ"] = {"Iraq"},
["IR"] = {"Islamic Republic of Iran"},
["IS"] = {"Iceland"},
["IT"] = {"Italy"},
["JE"] = {"Jersey"},
["JM"] = {"Jamaica"},
["JO"] = {"Jordan"},
["JP"] = {"Japan"},
["KE"] = {"Kenya"},
["KG"] = {"Kyrgyzstan"},
["KH"] = {"Cambodia"},
["KI"] = {"Kiribati"},
["KM"] = {"Comoros"},
["KN"] = {"Saint Kitts and Nevis"},
["KP"] = {"Democratic People's Republic of Korea"},
["KR"] = {"Republic of Korea"},
["KW"] = {"Kuwait"},
["KY"] = {"Cayman Islands"},
["KZ"] = {"Kazakhstan"},
["LA"] = {"Lao People's Democratic Republic"},
["LB"] = {"Lebanon"},
["LC"] = {"Saint Lucia"},
["LI"] = {"Liechtenstein"},
["LK"] = {"Sri Lanka"},
["LR"] = {"Liberia"},
["LS"] = {"Lesotho"},
["LT"] = {"Lithuania"},
["LU"] = {"Luxembourg"},
["LV"] = {"Latvia"},
["LY"] = {"Libya"},
["MA"] = {"Morocco"},
["MC"] = {"Monaco"},
["MD"] = {"Moldova"},
["ME"] = {"Montenegro"},
["MF"] = {"Saint Martin (French part)"},
["MG"] = {"Madagascar"},
["MH"] = {"Marshall Islands"},
["MK"] = {"North Macedonia"},
["ML"] = {"Mali"},
["MM"] = {"Myanmar"},
["MN"] = {"Mongolia"},
["MO"] = {"Macao"},
["MP"] = {"Northern Mariana Islands"},
["MQ"] = {"Martinique"},
["MR"] = {"Mauritania"},
["MS"] = {"Montserrat"},
["MT"] = {"Malta"},
["MU"] = {"Mauritius"},
["MV"] = {"Maldives"},
["MW"] = {"Malawi"},
["MX"] = {"Mexico"},
["MY"] = {"Malaysia"},
["MZ"] = {"Mozambique"},
["NA"] = {"Namibia"},
["NC"] = {"New Caledonia"},
["NE"] = {"Niger"},
["NF"] = {"Norfolk Island"},
["NG"] = {"Nigeria"},
["NI"] = {"Nicaragua"},
["NL"] = {"Netherlands"},
["NO"] = {"Norway"},
["NP"] = {"Nepal"},
["NR"] = {"Nauru"},
["NU"] = {"Niue"},
["NZ"] = {"New Zealand"},
["OM"] = {"Oman"},
["PA"] = {"Panama"},
["PE"] = {"Peru"},
["PF"] = {"French Polynesia"},
["PG"] = {"Papua New Guinea"},
["PH"] = {"Philippines"},
["PK"] = {"Pakistan"},
["PL"] = {"Poland"},
["PM"] = {"Saint Pierre and Miquelon"},
["PN"] = {"Pitcairn"},
["PR"] = {"Puerto Rico"},
["PS"] = {"State of Palestine"},
["PT"] = {"Portugal"},
["PW"] = {"Palau"},
["PY"] = {"Paraguay"},
["QA"] = {"Qatar"},
["RE"] = {"Réunion"},
["RO"] = {"Romania"},
["RS"] = {"Serbia"},
["RU"] = {"Russian Federation"},
["RW"] = {"Rwanda"},
["SA"] = {"Saudi Arabia"},
["SB"] = {"Solomon Islands"},
["SC"] = {"Seychelles"},
["SD"] = {"Sudan"},
["SE"] = {"Sweden"},
["SG"] = {"Singapore"},
["SH"] = {"Saint Helena, Ascension and Tristan da Cunha"},
["SI"] = {"Slovenia"},
["SJ"] = {"Svalbard and Jan Mayen"},
["SK"] = {"Slovakia"},
["SL"] = {"Sierra Leone"},
["SM"] = {"San Marino"},
["SN"] = {"Senegal"},
["SO"] = {"Somalia"},
["SR"] = {"Suriname"},
["SS"] = {"South Sudan"},
["ST"] = {"Sao Tome and Principe"},
["SV"] = {"El Salvador"},
["SX"] = {"Sint Maarten (Dutch part)"},
["SY"] = {"Syrian Arab Republic"},
["SZ"] = {"Eswatini", "eSwatini", "Swaziland"},
["TA"] = {"Tristan da Cunha"},
["TC"] = {"Turks and Caicos Islands"},
["TD"] = {"Chad"},
["TF"] = {"French Southern Territories"},
["TG"] = {"Togo"},
["TH"] = {"Thailand"},
["TJ"] = {"Tajikistan"},
["TK"] = {"Tokelau"},
["TL"] = {"Timor-Leste"},
["TM"] = {"Turkmenistan"},
["TN"] = {"Tunisia"},
["TO"] = {"Tonga"},
["TR"] = {"Türkiye", "Turkey"},
["TT"] = {"Trinidad and Tobago"},
["TV"] = {"Tuvalu"},
["TW"] = {"Taiwan, Province of China"},
["TZ"] = {"United Republic of Tanzania"},
["UA"] = {"Ukraine"},
["UG"] = {"Uganda"},
["UM"] = {"United States Minor Outlying Islands"},
["UN"] = {"United Nations"},
["US"] = {"United States"},
["UY"] = {"Uruguay"},
["UZ"] = {"Uzbekistan"},
["VA"] = {"Holy See (Vatican City State)"},
["VC"] = {"Saint Vincent and the Grenadines"},
["VE"] = {"Venezuela"},
["VG"] = {"British Virgin Islands"},
["VI"] = {"U.S. Virgin Islands"},
["VN"] = {"Viet Nam"},
["VU"] = {"Vanuatu"},
["WF"] = {"Wallis and Futuna"},
["WS"] = {"Samoa"},
["YE"] = {"Yemen"},
["YT"] = {"Mayotte"},
["ZA"] = {"South Africa"},
["ZM"] = {"Zambia"},
["ZW"] = {"Zimbabwe"},
["001"] = {"World"},
["002"] = {"Africa"},
["003"] = {"North America"},
["005"] = {"South America"},
["009"] = {"Oceania"},
["011"] = {"Western Africa"},
["013"] = {"Central America"},
["014"] = {"Eastern Africa"},
["015"] = {"Northern Africa"},
["017"] = {"Middle Africa"},
["018"] = {"Southern Africa"},
["019"] = {"Americas"},
["021"] = {"Northern America"},
["029"] = {"Caribbean"},
["030"] = {"Eastern Asia"},
["034"] = {"Southern Asia"},
["035"] = {"South-Eastern Asia"},
["039"] = {"Southern Europe"},
["053"] = {"Australia and New Zealand"},
["054"] = {"Melanesia"},
["057"] = {"Micronesia"},
["061"] = {"Polynesia"},
["142"] = {"Asia"},
["143"] = {"Central Asia"},
["145"] = {"Western Asia"},
["150"] = {"Europe"},
["151"] = {"Eastern Europe"},
["154"] = {"Northern Europe"},
["155"] = {"Western Europe"},
["202"] = {"Sub-Saharan Africa"},
["419"] = {"Latin America and the Caribbean"}
}
08de6963e81994fd00a9f7b5a76b5ed63c543989
Module:Language/data/iana variants
828
155
410
2023-08-21T15:41:29Z
wikipedia>Trappist the monk
0
update to 2023-08-02 data;
Scribunto
text/plain
-- File-Date: 2023-08-02
return {
["1606nict"] = {
["descriptions"] = {"Late Middle French (to 1606)"},
["prefixes"] = {"frm"},
},
["1694acad"] = {
["descriptions"] = {"Early Modern French"},
["prefixes"] = {"fr"},
},
["1901"] = {
["descriptions"] = {"Traditional German orthography"},
["prefixes"] = {"de"},
},
["1959acad"] = {
["descriptions"] = {"\"Academic\" (\"governmental\") variant of Belarusian as codified in 1959"},
["prefixes"] = {"be"},
},
["1994"] = {
["descriptions"] = {"Standardized Resian orthography"},
["prefixes"] = {"sl-rozaj", "sl-rozaj-biske", "sl-rozaj-njiva", "sl-rozaj-osojs", "sl-rozaj-solba"},
},
["1996"] = {
["descriptions"] = {"German orthography of 1996"},
["prefixes"] = {"de"},
},
["abl1943"] = {
["descriptions"] = {"Orthographic formulation of 1943 - Official in Brazil (Formulário Ortográfico de 1943 - Oficial no Brasil)"},
["prefixes"] = {"pt-br"},
},
["akuapem"] = {
["descriptions"] = {"Akuapem Twi"},
["prefixes"] = {"tw"},
},
["alalc97"] = {
["descriptions"] = {"ALA-LC Romanization, 1997 edition"},
["prefixes"] = {},
},
["aluku"] = {
["descriptions"] = {"Aluku dialect", "Boni dialect"},
["prefixes"] = {"djk"},
},
["ao1990"] = {
["descriptions"] = {"Portuguese Language Orthographic Agreement of 1990 (Acordo Ortográfico da Língua Portuguesa de 1990)"},
["prefixes"] = {"pt", "gl"},
},
["aranes"] = {
["descriptions"] = {"Aranese"},
["prefixes"] = {"oc"},
},
["arkaika"] = {
["descriptions"] = {"Arcaicam Esperantom", "Arkaika Esperanto"},
["prefixes"] = {"eo"},
},
["asante"] = {
["descriptions"] = {"Asante Twi", "Ashanti Twi"},
["prefixes"] = {"tw"},
},
["auvern"] = {
["descriptions"] = {"Auvergnat"},
["prefixes"] = {"oc"},
},
["baku1926"] = {
["descriptions"] = {"Unified Turkic Latin Alphabet (Historical)"},
["prefixes"] = {"az", "ba", "crh", "kk", "krc", "ky", "sah", "tk", "tt", "uz"},
},
["balanka"] = {
["descriptions"] = {"The Balanka dialect of Anii"},
["prefixes"] = {"blo"},
},
["barla"] = {
["descriptions"] = {"The Barlavento dialect group of Kabuverdianu"},
["prefixes"] = {"kea"},
},
["basiceng"] = {
["descriptions"] = {"Basic English"},
["prefixes"] = {"en"},
},
["bauddha"] = {
["descriptions"] = {"Buddhist Hybrid Sanskrit"},
["prefixes"] = {"sa"},
},
["bciav"] = {
["descriptions"] = {"BCI Blissymbolics AV"},
["prefixes"] = {"zbl"},
},
["bcizbl"] = {
["descriptions"] = {"BCI Blissymbolics"},
["prefixes"] = {"zbl"},
},
["biscayan"] = {
["descriptions"] = {"Biscayan dialect of Basque"},
["prefixes"] = {"eu"},
},
["biske"] = {
["descriptions"] = {"The San Giorgio dialect of Resian", "The Bila dialect of Resian"},
["prefixes"] = {"sl-rozaj"},
},
["blasl"] = {
["descriptions"] = {"Black American Sign Language dialect"},
["prefixes"] = {"ase", "sgn-ase"},
},
["bohoric"] = {
["descriptions"] = {"Slovene in Bohorič alphabet"},
["prefixes"] = {"sl"},
},
["boont"] = {
["descriptions"] = {"Boontling"},
["prefixes"] = {"en"},
},
["bornholm"] = {
["descriptions"] = {"Bornholmsk"},
["prefixes"] = {"da"},
},
["cisaup"] = {
["descriptions"] = {"Cisalpine"},
["prefixes"] = {"oc"},
},
["colb1945"] = {
["descriptions"] = {"Portuguese-Brazilian Orthographic Convention of 1945 (Convenção Ortográfica Luso-Brasileira de 1945)"},
["prefixes"] = {"pt"},
},
["cornu"] = {
["descriptions"] = {"Cornu-English", "Cornish English", "Anglo-Cornish"},
["prefixes"] = {"en"},
},
["creiss"] = {
["descriptions"] = {"Occitan variants of the Croissant area"},
["prefixes"] = {"oc"},
},
["dajnko"] = {
["descriptions"] = {"Slovene in Dajnko alphabet"},
["prefixes"] = {"sl"},
},
["ekavsk"] = {
["descriptions"] = {"Serbian with Ekavian pronunciation"},
["prefixes"] = {"sr", "sr-latn", "sr-cyrl"},
},
["emodeng"] = {
["descriptions"] = {"Early Modern English (1500-1700)"},
["prefixes"] = {"en"},
},
["fonipa"] = {
["descriptions"] = {"International Phonetic Alphabet"},
["prefixes"] = {},
},
["fonkirsh"] = {
["descriptions"] = {"Kirshenbaum Phonetic Alphabet"},
["prefixes"] = {},
},
["fonnapa"] = {
["descriptions"] = {"North American Phonetic Alphabet", "Americanist Phonetic Notation"},
["prefixes"] = {},
},
["fonupa"] = {
["descriptions"] = {"Uralic Phonetic Alphabet"},
["prefixes"] = {},
},
["fonxsamp"] = {
["descriptions"] = {"X-SAMPA transcription"},
["prefixes"] = {},
},
["gallo"] = {
["descriptions"] = {"Gallo"},
["prefixes"] = {"fr"},
},
["gascon"] = {
["descriptions"] = {"Gascon"},
["prefixes"] = {"oc"},
},
["grclass"] = {
["descriptions"] = {"Classical Occitan orthography"},
["prefixes"] = {"oc", "oc-aranes", "oc-auvern", "oc-cisaup", "oc-creiss", "oc-gascon", "oc-lemosin", "oc-lengadoc", "oc-nicard", "oc-provenc", "oc-vivaraup"},
},
["grital"] = {
["descriptions"] = {"Italian-inspired Occitan orthography"},
["prefixes"] = {"oc", "oc-cisaup", "oc-nicard", "oc-provenc"},
},
["grmistr"] = {
["descriptions"] = {"Mistralian or Mistralian-inspired Occitan orthography"},
["prefixes"] = {"oc", "oc-aranes", "oc-auvern", "oc-cisaup", "oc-creiss", "oc-gascon", "oc-lemosin", "oc-lengadoc", "oc-nicard", "oc-provenc", "oc-vivaraup"},
},
["hepburn"] = {
["descriptions"] = {"Hepburn romanization"},
["prefixes"] = {"ja-latn"},
},
["hognorsk"] = {
["descriptions"] = {"Norwegian in Høgnorsk (High Norwegian) orthography"},
["prefixes"] = {"nn"},
},
["hsistemo"] = {
["descriptions"] = {"Standard H-system orthographic fallback for spelling Esperanto"},
["prefixes"] = {"eo"},
},
["ijekavsk"] = {
["descriptions"] = {"Serbian with Ijekavian pronunciation"},
["prefixes"] = {"sr", "sr-latn", "sr-cyrl"},
},
["itihasa"] = {
["descriptions"] = {"Epic Sanskrit"},
["prefixes"] = {"sa"},
},
["ivanchov"] = {
["descriptions"] = {"Bulgarian in 1899 orthography"},
["prefixes"] = {"bg"},
},
["jauer"] = {
["descriptions"] = {"Jauer dialect of Romansh"},
["prefixes"] = {"rm"},
},
["jyutping"] = {
["descriptions"] = {"Jyutping Cantonese Romanization"},
["prefixes"] = {"yue"},
},
["kkcor"] = {
["descriptions"] = {"Common Cornish orthography of Revived Cornish"},
["prefixes"] = {"kw"},
},
["kociewie"] = {
["descriptions"] = {"The Kociewie dialect of Polish"},
["prefixes"] = {"pl"},
},
["kscor"] = {
["descriptions"] = {"Standard Cornish orthography of Revived Cornish", "Kernowek Standard"},
["prefixes"] = {"kw"},
},
["laukika"] = {
["descriptions"] = {"Classical Sanskrit"},
["prefixes"] = {"sa"},
},
["lemosin"] = {
["descriptions"] = {"Limousin"},
["prefixes"] = {"oc"},
},
["lengadoc"] = {
["descriptions"] = {"Languedocien"},
["prefixes"] = {"oc"},
},
["lipaw"] = {
["descriptions"] = {"The Lipovaz dialect of Resian", "The Lipovec dialect of Resian"},
["prefixes"] = {"sl-rozaj"},
},
["ltg1929"] = {
["descriptions"] = {"The Latgalian language orthography codified in 1929"},
["prefixes"] = {"ltg"},
},
["ltg2007"] = {
["descriptions"] = {"The Latgalian language orthography codified in the language law in 2007"},
["prefixes"] = {"ltg"},
},
["luna1918"] = {
["descriptions"] = {"Post-1917 Russian orthography"},
["prefixes"] = {"ru"},
},
["metelko"] = {
["descriptions"] = {"Slovene in Metelko alphabet"},
["prefixes"] = {"sl"},
},
["monoton"] = {
["descriptions"] = {"Monotonic Greek"},
["prefixes"] = {"el"},
},
["ndyuka"] = {
["descriptions"] = {"Ndyuka dialect", "Aukan dialect"},
["prefixes"] = {"djk"},
},
["nedis"] = {
["descriptions"] = {"Natisone dialect", "Nadiza dialect"},
["prefixes"] = {"sl"},
},
["newfound"] = {
["descriptions"] = {"Newfoundland English"},
["prefixes"] = {"en-ca"},
},
["nicard"] = {
["descriptions"] = {"Niçard"},
["prefixes"] = {"oc"},
},
["njiva"] = {
["descriptions"] = {"The Gniva dialect of Resian", "The Njiva dialect of Resian"},
["prefixes"] = {"sl-rozaj"},
},
["nulik"] = {
["descriptions"] = {"Volapük nulik", "Volapük perevidöl", "Volapük nulädik", "de Jong's Volapük", "New Volapük", "Revised Volapük", "Modern Volapük"},
["prefixes"] = {"vo"},
},
["osojs"] = {
["descriptions"] = {"The Oseacco dialect of Resian", "The Osojane dialect of Resian"},
["prefixes"] = {"sl-rozaj"},
},
["oxendict"] = {
["descriptions"] = {"Oxford English Dictionary spelling"},
["prefixes"] = {"en"},
},
["pahawh2"] = {
["descriptions"] = {"Pahawh Hmong Second Stage Reduced orthography"},
["prefixes"] = {"mww", "hnj"},
},
["pahawh3"] = {
["descriptions"] = {"Pahawh Hmong Third Stage Reduced orthography"},
["prefixes"] = {"mww", "hnj"},
},
["pahawh4"] = {
["descriptions"] = {"Pahawh Hmong Final Version orthography"},
["prefixes"] = {"mww", "hnj"},
},
["pamaka"] = {
["descriptions"] = {"Pamaka dialect"},
["prefixes"] = {"djk"},
},
["peano"] = {
["descriptions"] = {"Latino Sine Flexione", "Interlingua de API", "Interlingua de Peano"},
["prefixes"] = {"la"},
},
["petr1708"] = {
["descriptions"] = {"Petrine orthography"},
["prefixes"] = {"ru"},
},
["pinyin"] = {
["descriptions"] = {"Pinyin romanization"},
["prefixes"] = {"zh-latn", "bo-latn"},
},
["polyton"] = {
["descriptions"] = {"Polytonic Greek"},
["prefixes"] = {"el"},
},
["provenc"] = {
["descriptions"] = {"Provençal"},
["prefixes"] = {"oc"},
},
["puter"] = {
["descriptions"] = {"Puter idiom of Romansh"},
["prefixes"] = {"rm"},
},
["rigik"] = {
["descriptions"] = {"Volapük rigik", "Schleyer's Volapük", "Original Volapük", "Classic Volapük"},
["prefixes"] = {"vo"},
},
["rozaj"] = {
["descriptions"] = {"Resian", "Resianic", "Rezijan"},
["prefixes"] = {"sl"},
},
["rumgr"] = {
["descriptions"] = {"Rumantsch Grischun"},
["prefixes"] = {"rm"},
},
["scotland"] = {
["descriptions"] = {"Scottish Standard English"},
["prefixes"] = {"en"},
},
["scouse"] = {
["descriptions"] = {"Scouse"},
["prefixes"] = {"en"},
},
["simple"] = {
["descriptions"] = {"Simplified form"},
["prefixes"] = {},
},
["solba"] = {
["descriptions"] = {"The Stolvizza dialect of Resian", "The Solbica dialect of Resian"},
["prefixes"] = {"sl-rozaj"},
},
["sotav"] = {
["descriptions"] = {"The Sotavento dialect group of Kabuverdianu"},
["prefixes"] = {"kea"},
},
["spanglis"] = {
["descriptions"] = {"Spanglish"},
["prefixes"] = {"en", "es"},
},
["surmiran"] = {
["descriptions"] = {"Surmiran idiom of Romansh"},
["prefixes"] = {"rm"},
},
["sursilv"] = {
["descriptions"] = {"Sursilvan idiom of Romansh"},
["prefixes"] = {"rm"},
},
["sutsilv"] = {
["descriptions"] = {"Sutsilvan idiom of Romansh"},
["prefixes"] = {"rm"},
},
["synnejyl"] = {
["descriptions"] = {"Synnejysk", "South Jutish"},
["prefixes"] = {"da"},
},
["tarask"] = {
["descriptions"] = {"Belarusian in Taraskievica orthography"},
["prefixes"] = {"be"},
},
["tongyong"] = {
["descriptions"] = {"Tongyong Pinyin romanization"},
["prefixes"] = {"zh-latn"},
},
["tunumiit"] = {
["descriptions"] = {"Tunumiisiut", "East Greenlandic", "Østgrønlandsk"},
["prefixes"] = {"kl"},
},
["uccor"] = {
["descriptions"] = {"Unified Cornish orthography of Revived Cornish"},
["prefixes"] = {"kw"},
},
["ucrcor"] = {
["descriptions"] = {"Unified Cornish Revised orthography of Revived Cornish"},
["prefixes"] = {"kw"},
},
["ulster"] = {
["descriptions"] = {"Ulster dialect of Scots"},
["prefixes"] = {"sco"},
},
["unifon"] = {
["descriptions"] = {"Unifon phonetic alphabet"},
["prefixes"] = {"en", "hup", "kyh", "tol", "yur"},
},
["vaidika"] = {
["descriptions"] = {"Vedic Sanskrit"},
["prefixes"] = {"sa"},
},
["valencia"] = {
["descriptions"] = {"Valencian"},
["prefixes"] = {"ca"},
},
["vallader"] = {
["descriptions"] = {"Vallader idiom of Romansh"},
["prefixes"] = {"rm"},
},
["vecdruka"] = {
["descriptions"] = {"Latvian orthography used before 1920s (\"vecā druka\")"},
["prefixes"] = {"lv"},
},
["vivaraup"] = {
["descriptions"] = {"Vivaro-Alpine"},
["prefixes"] = {"oc"},
},
["wadegile"] = {
["descriptions"] = {"Wade-Giles romanization"},
["prefixes"] = {"zh-latn"},
},
["xsistemo"] = {
["descriptions"] = {"Standard X-system orthographic fallback for spelling Esperanto"},
["prefixes"] = {"eo"},
}
}
36f89cd82969f3b0f948034eba0fa2c149ee65c2
Module:Language/data/iana suppressed scripts
828
156
412
2023-08-21T15:41:32Z
wikipedia>Trappist the monk
0
update to 2023-08-02 data;
Scribunto
text/plain
-- File-Date: 2023-08-02
return {
["Arab"] = {"ar", "fa", "ps", "ur"},
["Armn"] = {"hy"},
["Beng"] = {"as", "bn"},
["Blis"] = {"zbl"},
["Cyrl"] = {"ab", "be", "bg", "kk", "mk", "ru", "uk"},
["Deva"] = {"hi", "mr", "ne", "kok", "mai"},
["Ethi"] = {"am", "ti"},
["Geor"] = {"ka"},
["Grek"] = {"el"},
["Gujr"] = {"gu"},
["Guru"] = {"pa"},
["Hebr"] = {"he", "iw", "yi"},
["Jpan"] = {"ja"},
["Khmr"] = {"km"},
["Knda"] = {"kn"},
["Kore"] = {"ko"},
["Laoo"] = {"lo"},
["Latn"] = {"af", "ay", "bs", "ca", "ch", "cs", "cy", "da", "de", "en", "eo",
"es", "et", "eu", "fi", "fj", "fo", "fr", "fy", "ga", "gl", "gn",
"gv", "hr", "ht", "hu", "id", "in", "is", "it", "kl", "la", "lb",
"ln", "lt", "lv", "mg", "mh", "mo", "ms", "mt", "na", "nb", "nd",
"nl", "nn", "no", "nr", "ny", "om", "pl", "pt", "qu", "rm", "rn",
"ro", "rw", "sg", "sk", "sl", "sm", "so", "sq", "ss", "st", "sv",
"sw", "tl", "tn", "to", "tr", "ts", "ve", "vi", "xh", "zu", "dsb",
"frr", "frs", "gsw", "hsb", "men", "nds", "niu", "nso", "tem", "tkl", "tmh",
"tpi", "tvl"},
["Mlym"] = {"ml"},
["Mymr"] = {"my"},
["Nkoo"] = {"nqo"},
["Orya"] = {"or"},
["Sinh"] = {"si"},
["Taml"] = {"ta"},
["Telu"] = {"te"},
["Thaa"] = {"dv"},
["Thai"] = {"th"},
["Tibt"] = {"dz"}
}
e2c364560ccc050dacdd276ebab1758584b937ad
Template:UF-hcard-geo
10
230
564
2023-08-22T10:49:12Z
wikipedia>PK2
0
bypass redirect to [[Template:Flatlist]]
wikitext
text/x-wiki
The HTML markup produced by this template includes an [[HCard| hCard microformat]], which makes the place-name and location [[Parsing|parsable]] by computers, either acting automatically to catalogue articles across Wikipedia, or via a browser tool operated by a person, to (for example) add the subject to an address book. Within the hCard is a [[Geo (microformat)|Geo microformat]], which additionally makes the [[Geographic coordinate system|coordinates]] (latitude & longitude) parsable, so that they can be, say, looked up on a map, or downloaded to a [[Global Positioning System|GPS]] unit. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
=== Sub-templates ===
If the place or venue has "established", "founded", "opened" or similar dates, use {{tl|start date}} for the earliest of those dates [[Wikipedia:WikiProject Microformats/dates|unless the date is before 1583 CE]].
If it has a URL, use {{tl|URL}}.
'''Please do not remove instances of these sub-templates.'''
=== Classes ===
hCard uses HTML classes including:
{{Flatlist|
*adr
*agent
*category
*county-name
*extended-address
*fn
*label
*locality
*nickname
*note
*org
*region
*street-address
*uid
*url
*vcard
}}
Geo is produced by calling {{tl|coord}}, and uses HTML classes:
{{Flatlist|
*geo
*latitude
*longitude
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''
=== Precision ===
When giving coordinates, '''please use an [[Wikipedia:WikiProject Geographical coordinates#Precision|appropriate level of precision]]'''. Do '''not''' use {{tl|coord}}'s {{para|name}} parameter.<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |
[[Category:Templates with coordinates fields]]
[[Category:Templates generating hCards and Geo]]
}}</includeonly><noinclude>__NOTOC__{{doc}}</noinclude>
b2e64e922ddf0a9b1b20a214e99d2d1a8d7f81c4
Template:Infobox
10
9
21
2023-08-28T04:05:10Z
meta>Tali64³
0
Undid revision 343934 by [[Special:Contributions/Corkscrew012|Corkscrew012]] ([[User talk:Corkscrew012|talk]]) Unconstructive editing; perhaps you posted your edit to the wrong wiki?
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
adcda4ac544f8af340cf47833dc2960631593988
Module:Pagetype/config
828
242
591
2023-08-28T13:36:34Z
wikipedia>Mr. Stradivarius
0
update from [[Module:Pagetype/config/sandbox]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Pagetype configuration data --
-- This page holds localisation and configuration data for Module:Pagetype. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
-- This table holds the default page types for each namespace. Keys to this
-- table should be integers that can be used as keys to mw.site.namespaces.
cfg.pagetypes = {
[0] = 'article', -- Main namespace
[2] = 'user page',
[4] = 'project page',
[6] = 'file',
[8] = 'interface page', -- MediaWiki namespace
[10] = 'template',
[12] = 'help page',
[14] = 'category',
[100] = 'portal',
[118] = 'draft',
[710] = 'Timed Text page',
[828] = 'module',
[2300] = 'gadget',
[2302] = 'gadget definition',
[-1] = 'special page',
[-2] = 'file', -- Media namespace
}
-- This table holds the namespaces to be looked up from cfg.pagetypes by
-- default.
cfg.defaultNamespaces = {
[0] = true, -- main
[6] = true, -- file
[10] = true, -- template
[14] = true, -- category
[828] = true, -- module
}
-- This table holds the namespaces to be looked up from cfg.pagetypes if
-- cfg.defaultnsExtended is set.
cfg.extendedNamespaces = {
[0] = true, -- main
[2] = true, -- user
[4] = true, -- project
[6] = true, -- file
[8] = true, -- mediawiki
[10] = true, -- template
[12] = true, -- help
[14] = true, -- category
[100] = true, -- portal
[118] = true, -- draft
[828] = true, -- module
}
-- This table holds custom aliases for each namespace.
cfg.customNamespaceAliases = {
[0] = {'main'},
}
-- The parameter name to set which default namespace values to be looked up from
-- cfg.pagetypes.
cfg.defaultns = 'defaultns'
-- The value of cfg.defaultns to set all namespaces, including talk.
cfg.defaultnsAll = 'all'
-- The value of cfg.defaultns to set the namespaces listed in
-- cfg.extendedNamespaces
cfg.defaultnsExtended = 'extended'
-- The value of cfg.defaultns to set no default namespaces.
cfg.defaultnsNone = 'none'
-- The parameter name to use for talk pages.
cfg.talk = 'talk'
-- The default value for talk pages.
cfg.talkDefault = 'talk page'
-- The parameter name to use for disambiguation pages page.
cfg.dab = 'dab'
-- This table holds the different possible aliases for disambiguation-class
-- pages. These should be lower-case.
cfg.dabAliases = {
['disambiguation'] = true,
['disambig'] = true,
['disamb'] = true,
['dab'] = true,
}
-- The default value for disambiguation pages.
cfg.dabDefault = 'page'
-- The parameter name to use for N/A-class page.
cfg.na = 'na'
-- This table holds the different possible aliases for N/A-class pages. These
-- should be lower-case.
cfg.naAliases = {
['na'] = true,
['n/a'] = true,
}
-- The default value for N/A-class pages.
cfg.naDefault = 'page'
-- The parameter name to use for redirects.
cfg.redirect = 'redirect'
-- The default value to use for redirects.
cfg.redirectDefault = 'redirect'
-- The parameter name for undefined namespaces.
cfg.other = 'other'
-- The value used if the module detects an undefined namespace.
cfg.otherDefault = 'page'
-- The usual suffix denoting a plural.
cfg.plural = 's'
-- This table holds plurals not formed by a simple suffix.
cfg.irregularPlurals = {
["category"] = "categories"
}
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line
5360b93ef5fd7551e38026f1b8df00bed8b34b2d
Module:Pagetype
828
241
589
2023-08-28T13:37:34Z
wikipedia>Mr. Stradivarius
0
switch back to using [[Module:Pagetype/config]], as it has now been updated
Scribunto
text/plain
--------------------------------------------------------------------------------
-- --
-- PAGETYPE --
-- --
-- This is a meta-module intended to replace {{pagetype}} and similar --
-- templates. It automatically detects namespaces, and allows for a --
-- great deal of customisation. It can easily be ported to other --
-- wikis by changing the values in the [[Module:Pagetype/config]]. --
-- --
--------------------------------------------------------------------------------
-- Load config.
local cfg = mw.loadData('Module:Pagetype/config')
-- Load required modules.
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local mDisambiguation = require('Module:Disambiguation')
local p = {}
-- Look up a namespace argument in the args table.
local function lookUpNamespaceArg(args, key)
local arg = args[key]
-- Convert "yes", "1" etc. to true, "no", "0" etc. to false, and leave
-- other values the same.
return yesno(arg, arg)
end
-- Append multiple values to an array
local function appendMultiple(target, source)
for _, value in ipairs(source) do
table.insert(target, value)
end
end
-- Get argument keys for a title's namespace
local function getNamespaceArgKeys(title, cfg)
local nsInfo = mw.site.namespaces[title.namespace]
local customAliases = cfg.customNamespaceAliases[title.namespace] or {}
local keys = {}
if nsInfo.name ~= '' then
table.insert(keys, nsInfo.name)
end
if nsInfo.canonicalName ~= nsInfo.name and nsInfo.canonicalName ~= '' then
table.insert(keys, nsInfo.canonicalName)
end
appendMultiple(keys, nsInfo.aliases)
appendMultiple(keys, customAliases)
return keys
end
-- Get the argument for a title's namespace, if it was specified in the args
-- table.
local function getNamespaceArg(title, args, cfg)
if title.isTalkPage then
return lookUpNamespaceArg(args, cfg.talk)
end
for _, key in ipairs(getNamespaceArgKeys(title, cfg)) do
local arg = lookUpNamespaceArg(args, mw.ustring.lower(key))
if arg ~= nil then
return arg
end
end
return nil
end
-- Look up a page type specific to the title's namespace
local function getExplicitPageType(title, cfg)
if title.isTalkPage then
return cfg.talkDefault
else
return cfg.pagetypes[title.namespace]
end
end
-- Get a default page type that is not specific to the title's namespace
local function getDefaultPageType(args, cfg)
local other = lookUpNamespaceArg(args, cfg.other)
if type(other) == 'string' then
return other
else
return cfg.otherDefault
end
end
local function detectRedirects(title, args)
local redirect = lookUpNamespaceArg(args, cfg.redirect)
if redirect == false then
-- Don't detect redirects if they have been specifically disallowed.
return nil
end
-- Allow custom values for redirects.
if not title.isRedirect then
return nil
elseif type(redirect) == 'string' then
return redirect
else
return cfg.redirectDefault
end
end
local function detectDisambiguationPages(title, args, cfg)
if title.namespace ~= 0 then
-- Only detect disambiguation pages in mainspace
return nil
end
local dab = lookUpNamespaceArg(args, cfg.dab)
if dab == false then
-- Don't detect disambiguation pages if explicitly disallowed
return nil
end
if not mDisambiguation.isDisambiguation(title:getContent()) then
return nil
elseif type(dab) == 'string' then
return dab
else
return cfg.dabDefault
end
end
-- Gets the pagetype from a class specified from the first positional
-- parameter.
local function getPageTypeFromClass(args, class, key, aliasTable, default)
local arg = lookUpNamespaceArg(args, key)
if arg == false then
-- Don't check for this class if it is specifically disallowed.
return nil
end
if aliasTable[class] then
if type(arg) == 'string' then
return arg
else
return default
end
end
return nil
end
-- Get page types for mainspaces pages with an explicit class specified
local function getMainNamespaceClassPageType(title, args, cfg)
if title.namespace ~= 0 then
return nil
end
local class = args[1]
if type(class) == 'string' then
-- Put in lower case so e.g. "na" and "NA" will both match.
class = mw.ustring.lower(class)
end
return getPageTypeFromClass(
args,
class,
cfg.na,
cfg.naAliases,
cfg.naDefault
)
end
-- Get page type specified by an explicit namespace argument.
local function getNamespaceArgPageType(title, args, cfg)
local namespaceArg = getNamespaceArg(title, args, cfg)
if namespaceArg == true then
-- Namespace has been explicitly enabled, so return the default for
-- this namespace
return getExplicitPageType(title, cfg)
elseif namespaceArg == false then
-- Namespace has been explicitly disabled
return getDefaultPageType(args, cfg)
elseif namespaceArg then
-- This namespaces uses custom text
return namespaceArg
else
return nil
end
end
-- Whether the title is in the set of default active namespaces which are
-- looked up in cfg.pagetypes.
local function isInDefaultActiveNamespace(title, args, cfg)
local defaultNamespacesKey = args[cfg.defaultns]
if defaultNamespacesKey == cfg.defaultnsAll then
return true
end
local defaultNamespaces
if defaultNamespacesKey == cfg.defaultnsExtended then
defaultNamespaces = cfg.extendedNamespaces
elseif defaultNamespacesKey == cfg.defaultnsNone then
defaultNamespaces = {}
else
defaultNamespaces = cfg.defaultNamespaces
end
return defaultNamespaces[title.namespace] or false
end
-- Get page type not specified or detected by other means
local function getOtherPageType(title, args, cfg)
if isInDefaultActiveNamespace(title, args, cfg) then
return getExplicitPageType(title, cfg)
else
return getDefaultPageType(args, cfg)
end
end
local function getPageType(title, args, cfg)
return (
detectRedirects(title, args, cfg)
or detectDisambiguationPages(title, args, cfg)
or getMainNamespaceClassPageType(title, args, cfg)
or getNamespaceArgPageType(title, args, cfg)
or getOtherPageType(title, args, cfg)
)
end
local function shouldUseSubjectTitle(args, cfg)
return not yesno(args.talk, true) and args[cfg.defaultns] ~= cfg.defaultnsAll
end
-- Get the Scribunto title object to fetch the page type of
local function getTitle(args, cfg)
local title
if args.page then
title = mw.title.new(args.page)
if not title then
return nil
end
else
title = mw.title.getCurrentTitle()
end
if shouldUseSubjectTitle(args, cfg) then
return title.subjectPageTitle
else
return title
end
end
local function pluralize(pageType, cfg)
if cfg.irregularPlurals[pageType] then
return cfg.irregularPlurals[pageType]
else
return pageType .. cfg.plural -- often 's'
end
end
local function capitalize(pageType)
local first = mw.ustring.sub(pageType, 1, 1)
local rest = mw.ustring.sub(pageType, 2)
return mw.ustring.upper(first) .. rest
end
function p._main(args)
local title = getTitle(args, cfg)
local pageType = getPageType(title, args, cfg)
if yesno(args.plural, false) then
pageType = pluralize(pageType, cfg)
end
if yesno(args.caps, false) then
pageType = capitalize(pageType)
end
return pageType
end
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
return p
ab72b17cbd3e423817484aedfd33b480e9ba3611
Module:Citation/CS1
828
158
416
2023-08-30T19:56:08Z
wikipedia>Trappist the monk
0
fix {{cs1 config}} support for |display-translators=;
Scribunto
text/plain
require ('strict');
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
each of these counts against the Lua upvalue limit
]]
local validation; -- functions in Module:Citation/CS1/Date_validation
local utilities; -- functions in Module:Citation/CS1/Utilities
local z = {}; -- table of tables in Module:Citation/CS1/Utilities
local identifiers; -- functions and tables in Module:Citation/CS1/Identifiers
local metadata; -- functions in Module:Citation/CS1/COinS
local cfg = {}; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
local whitelist = {}; -- table of tables listing valid template parameter names; defined in Module:Citation/CS1/Whitelist
--[[------------------< P A G E S C O P E V A R I A B L E S >---------------
declare variables here that have page-wide scope that are not brought in from
other modules; that are created here and used here
]]
local added_deprecated_cat; -- Boolean flag so that the category is added only once
local added_vanc_errs; -- Boolean flag so we only emit one Vancouver error / category
local added_generic_name_errs; -- Boolean flag so we only emit one generic name error / category and stop testing names once an error is encountered
local Frame; -- holds the module's frame table
local is_preview_mode; -- true when article is in preview mode; false when using 'Preview page with this template' (previewing the module)
local is_sandbox; -- true when using sandbox modules to render citation
--[[--------------------------< F I R S T _ S E T >------------------------------------------------------------
Locates and returns the first set value in a table of values where the order established in the table,
left-to-right (or top-to-bottom), is the order in which the values are evaluated. Returns nil if none are set.
This version replaces the original 'for _, val in pairs do' and a similar version that used ipairs. With the pairs
version the order of evaluation could not be guaranteed. With the ipairs version, a nil value would terminate
the for-loop before it reached the actual end of the list.
]]
local function first_set (list, count)
local i = 1;
while i <= count do -- loop through all items in list
if utilities.is_set( list[i] ) then
return list[i]; -- return the first set list member
end
i = i + 1; -- point to next
end
end
--[[--------------------------< A D D _ V A N C _ E R R O R >----------------------------------------------------
Adds a single Vancouver system error message to the template's output regardless of how many error actually exist.
To prevent duplication, added_vanc_errs is nil until an error message is emitted.
added_vanc_errs is a Boolean declared in page scope variables above
]]
local function add_vanc_error (source, position)
if added_vanc_errs then return end
added_vanc_errs = true; -- note that we've added this category
utilities.set_message ('err_vancouver', {source, position});
end
--[[--------------------------< I S _ S C H E M E >------------------------------------------------------------
does this thing that purports to be a URI scheme seem to be a valid scheme? The scheme is checked to see if it
is in agreement with http://tools.ietf.org/html/std66#section-3.1 which says:
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-").
returns true if it does, else false
]]
local function is_scheme (scheme)
return scheme and scheme:match ('^%a[%a%d%+%.%-]*:'); -- true if scheme is set and matches the pattern
end
--[=[-------------------------< I S _ D O M A I N _ N A M E >--------------------------------------------------
Does this thing that purports to be a domain name seem to be a valid domain name?
Syntax defined here: http://tools.ietf.org/html/rfc1034#section-3.5
BNF defined here: https://tools.ietf.org/html/rfc4234
Single character names are generally reserved; see https://tools.ietf.org/html/draft-ietf-dnsind-iana-dns-01#page-15;
see also [[Single-letter second-level domain]]
list of TLDs: https://www.iana.org/domains/root/db
RFC 952 (modified by RFC 1123) requires the first and last character of a hostname to be a letter or a digit. Between
the first and last characters the name may use letters, digits, and the hyphen.
Also allowed are IPv4 addresses. IPv6 not supported
domain is expected to be stripped of any path so that the last character in the last character of the TLD. tld
is two or more alpha characters. Any preceding '//' (from splitting a URL with a scheme) will be stripped
here. Perhaps not necessary but retained in case it is necessary for IPv4 dot decimal.
There are several tests:
the first character of the whole domain name including subdomains must be a letter or a digit
internationalized domain name (ASCII characters with .xn-- ASCII Compatible Encoding (ACE) prefix xn-- in the TLD) see https://tools.ietf.org/html/rfc3490
single-letter/digit second-level domains in the .org, .cash, and .today TLDs
q, x, and z SL domains in the .com TLD
i and q SL domains in the .net TLD
single-letter SL domains in the ccTLDs (where the ccTLD is two letters)
two-character SL domains in gTLDs (where the gTLD is two or more letters)
three-plus-character SL domains in gTLDs (where the gTLD is two or more letters)
IPv4 dot-decimal address format; TLD not allowed
returns true if domain appears to be a proper name and TLD or IPv4 address, else false
]=]
local function is_domain_name (domain)
if not domain then
return false; -- if not set, abandon
end
domain = domain:gsub ('^//', ''); -- strip '//' from domain name if present; done here so we only have to do it once
if not domain:match ('^[%w]') then -- first character must be letter or digit
return false;
end
if domain:match ('^%a+:') then -- hack to detect things that look like s:Page:Title where Page: is namespace at Wikisource
return false;
end
local patterns = { -- patterns that look like URLs
'%f[%w][%w][%w%-]+[%w]%.%a%a+$', -- three or more character hostname.hostname or hostname.tld
'%f[%w][%w][%w%-]+[%w]%.xn%-%-[%w]+$', -- internationalized domain name with ACE prefix
'%f[%a][qxz]%.com$', -- assigned one character .com hostname (x.com times out 2015-12-10)
'%f[%a][iq]%.net$', -- assigned one character .net hostname (q.net registered but not active 2015-12-10)
'%f[%w][%w]%.%a%a$', -- one character hostname and ccTLD (2 chars)
'%f[%w][%w][%w]%.%a%a+$', -- two character hostname and TLD
'^%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?', -- IPv4 address
}
for _, pattern in ipairs (patterns) do -- loop through the patterns list
if domain:match (pattern) then
return true; -- if a match then we think that this thing that purports to be a URL is a URL
end
end
for _, d in ipairs (cfg.single_letter_2nd_lvl_domains_t) do -- look for single letter second level domain names for these top level domains
if domain:match ('%f[%w][%w]%.' .. d) then
return true
end
end
return false; -- no matches, we don't know what this thing is
end
--[[--------------------------< I S _ U R L >------------------------------------------------------------------
returns true if the scheme and domain parts of a URL appear to be a valid URL; else false.
This function is the last step in the validation process. This function is separate because there are cases that
are not covered by split_url(), for example is_parameter_ext_wikilink() which is looking for bracketted external
wikilinks.
]]
local function is_url (scheme, domain)
if utilities.is_set (scheme) then -- if scheme is set check it and domain
return is_scheme (scheme) and is_domain_name (domain);
else
return is_domain_name (domain); -- scheme not set when URL is protocol-relative
end
end
--[[--------------------------< S P L I T _ U R L >------------------------------------------------------------
Split a URL into a scheme, authority indicator, and domain.
First remove Fully Qualified Domain Name terminator (a dot following TLD) (if any) and any path(/), query(?) or fragment(#).
If protocol-relative URL, return nil scheme and domain else return nil for both scheme and domain.
When not protocol-relative, get scheme, authority indicator, and domain. If there is an authority indicator (one
or more '/' characters immediately following the scheme's colon), make sure that there are only 2.
Any URL that does not have news: scheme must have authority indicator (//). TODO: are there other common schemes
like news: that don't use authority indicator?
Strip off any port and path;
]]
local function split_url (url_str)
local scheme, authority, domain;
url_str = url_str:gsub ('([%a%d])%.?[/%?#].*$', '%1'); -- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of '//')
if url_str:match ('^//%S*') then -- if there is what appears to be a protocol-relative URL
domain = url_str:match ('^//(%S*)')
elseif url_str:match ('%S-:/*%S+') then -- if there is what appears to be a scheme, optional authority indicator, and domain name
scheme, authority, domain = url_str:match ('(%S-:)(/*)(%S+)'); -- extract the scheme, authority indicator, and domain portions
if utilities.is_set (authority) then
authority = authority:gsub ('//', '', 1); -- replace place 1 pair of '/' with nothing;
if utilities.is_set(authority) then -- if anything left (1 or 3+ '/' where authority should be) then
return scheme; -- return scheme only making domain nil which will cause an error message
end
else
if not scheme:match ('^news:') then -- except for news:..., MediaWiki won't link URLs that do not have authority indicator; TODO: a better way to do this test?
return scheme; -- return scheme only making domain nil which will cause an error message
end
end
domain = domain:gsub ('(%a):%d+', '%1'); -- strip port number if present
end
return scheme, domain;
end
--[[--------------------------< L I N K _ P A R A M _ O K >---------------------------------------------------
checks the content of |title-link=, |series-link=, |author-link=, etc. for properly formatted content: no wikilinks, no URLs
Link parameters are to hold the title of a Wikipedia article, so none of the WP:TITLESPECIALCHARACTERS are allowed:
# < > [ ] | { } _
except the underscore which is used as a space in wiki URLs and # which is used for section links
returns false when the value contains any of these characters.
When there are no illegal characters, this function returns TRUE if value DOES NOT appear to be a valid URL (the
|<param>-link= parameter is ok); else false when value appears to be a valid URL (the |<param>-link= parameter is NOT ok).
]]
local function link_param_ok (value)
local scheme, domain;
if value:find ('[<>%[%]|{}]') then -- if any prohibited characters
return false;
end
scheme, domain = split_url (value); -- get scheme or nil and domain or nil from URL;
return not is_url (scheme, domain); -- return true if value DOES NOT appear to be a valid URL
end
--[[--------------------------< L I N K _ T I T L E _ O K >---------------------------------------------------
Use link_param_ok() to validate |<param>-link= value and its matching |<title>= value.
|<title>= may be wiki-linked but not when |<param>-link= has a value. This function emits an error message when
that condition exists
check <link> for inter-language interwiki-link prefix. prefix must be a MediaWiki-recognized language
code and must begin with a colon.
]]
local function link_title_ok (link, lorig, title, torig)
local orig;
if utilities.is_set (link) then -- don't bother if <param>-link doesn't have a value
if not link_param_ok (link) then -- check |<param>-link= markup
orig = lorig; -- identify the failing link parameter
elseif title:find ('%[%[') then -- check |title= for wikilink markup
orig = torig; -- identify the failing |title= parameter
elseif link:match ('^%a+:') then -- if the link is what looks like an interwiki
local prefix = link:match ('^(%a+):'):lower(); -- get the interwiki prefix
if cfg.inter_wiki_map[prefix] then -- if prefix is in the map, must have preceding colon
orig = lorig; -- flag as error
end
end
end
if utilities.is_set (orig) then
link = ''; -- unset
utilities.set_message ('err_bad_paramlink', orig); -- URL or wikilink in |title= with |title-link=;
end
return link; -- link if ok, empty string else
end
--[[--------------------------< C H E C K _ U R L >------------------------------------------------------------
Determines whether a URL string appears to be valid.
First we test for space characters. If any are found, return false. Then split the URL into scheme and domain
portions, or for protocol-relative (//example.com) URLs, just the domain. Use is_url() to validate the two
portions of the URL. If both are valid, or for protocol-relative if domain is valid, return true, else false.
Because it is different from a standard URL, and because this module used external_link() to make external links
that work for standard and news: links, we validate newsgroup names here. The specification for a newsgroup name
is at https://tools.ietf.org/html/rfc5536#section-3.1.4
]]
local function check_url( url_str )
if nil == url_str:match ("^%S+$") then -- if there are any spaces in |url=value it can't be a proper URL
return false;
end
local scheme, domain;
scheme, domain = split_url (url_str); -- get scheme or nil and domain or nil from URL;
if 'news:' == scheme then -- special case for newsgroups
return domain:match('^[%a%d%+%-_]+%.[%a%d%+%-_%.]*[%a%d%+%-_]$');
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[=[-------------------------< I S _ P A R A M E T E R _ E X T _ W I K I L I N K >----------------------------
Return true if a parameter value has a string that begins and ends with square brackets [ and ] and the first
non-space characters following the opening bracket appear to be a URL. The test will also find external wikilinks
that use protocol-relative URLs. Also finds bare URLs.
The frontier pattern prevents a match on interwiki-links which are similar to scheme:path URLs. The tests that
find bracketed URLs are required because the parameters that call this test (currently |title=, |chapter=, |work=,
and |publisher=) may have wikilinks and there are articles or redirects like '//Hus' so, while uncommon, |title=[[//Hus]]
is possible as might be [[en://Hus]].
]=]
local function is_parameter_ext_wikilink (value)
local scheme, domain;
if value:match ('%f[%[]%[%a%S*:%S+.*%]') then -- if ext. wikilink with scheme and domain: [xxxx://yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(%a%S*:%S+).*%]'));
elseif value:match ('%f[%[]%[//%S+.*%]') then -- if protocol-relative ext. wikilink: [//yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(//%S+).*%]'));
elseif value:match ('%a%S*:%S+') then -- if bare URL with scheme; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(%a%S*:%S+)'));
elseif value:match ('//%S+') then -- if protocol-relative bare URL: //yyyyy.zzz; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(//%S+)')); -- what is left should be the domain
else
return false; -- didn't find anything that is obviously a URL
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[[-------------------------< C H E C K _ F O R _ U R L >-----------------------------------------------------
loop through a list of parameters and their values. Look at the value and if it has an external link, emit an error message.
]]
local function check_for_url (parameter_list, error_list)
for k, v in pairs (parameter_list) do -- for each parameter in the list
if is_parameter_ext_wikilink (v) then -- look at the value; if there is a URL add an error message
table.insert (error_list, utilities.wrap_style ('parameter', k));
end
end
end
--[[--------------------------< S A F E _ F O R _ U R L >------------------------------------------------------
Escape sequences for content that will be used for URL descriptions
]]
local function safe_for_url( str )
if str:match( "%[%[.-%]%]" ) ~= nil then
utilities.set_message ('err_wikilink_in_url', {});
end
return str:gsub( '[%[%]\n]', {
['['] = '[',
[']'] = ']',
['\n'] = ' ' } );
end
--[[--------------------------< E X T E R N A L _ L I N K >----------------------------------------------------
Format an external link with error checking
]]
local function external_link (URL, label, source, access)
local err_msg = '';
local domain;
local path;
local base_url;
if not utilities.is_set (label) then
label = URL;
if utilities.is_set (source) then
utilities.set_message ('err_bare_url_missing_title', {utilities.wrap_style ('parameter', source)});
else
error (cfg.messages["bare_url_no_origin"]); -- programmer error; valid parameter name does not have matching meta-parameter
end
end
if not check_url (URL) then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)});
end
domain, path = URL:match ('^([/%.%-%+:%a%d]+)([/%?#].*)$'); -- split the URL into scheme plus domain and path
if path then -- if there is a path portion
path = path:gsub ('[%[%]]', {['['] = '%5b', [']'] = '%5d'}); -- replace '[' and ']' with their percent-encoded values
URL = table.concat ({domain, path}); -- and reassemble
end
base_url = table.concat ({ "[", URL, " ", safe_for_url (label), "]" }); -- assemble a wiki-markup URL
if utilities.is_set (access) then -- access level (subscription, registration, limited)
base_url = utilities.substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[access].class, cfg.presentation[access].title, base_url}); -- add the appropriate icon
end
return base_url;
end
--[[--------------------------< D E P R E C A T E D _ P A R A M E T E R >--------------------------------------
Categorize and emit an error message when the citation contains one or more deprecated parameters. The function includes the
offending parameter name to the error message. Only one error message is emitted regardless of the number of deprecated
parameters in the citation.
added_deprecated_cat is a Boolean declared in page scope variables above
]]
local function deprecated_parameter(name)
if not added_deprecated_cat then
added_deprecated_cat = true; -- note that we've added this category
utilities.set_message ('err_deprecated_params', {name}); -- add error message
end
end
--[=[-------------------------< K E R N _ Q U O T E S >--------------------------------------------------------
Apply kerning to open the space between the quote mark provided by the module and a leading or trailing quote
mark contained in a |title= or |chapter= parameter's value.
This function will positive kern either single or double quotes:
"'Unkerned title with leading and trailing single quote marks'"
" 'Kerned title with leading and trailing single quote marks' " (in real life the kerning isn't as wide as this example)
Double single quotes (italic or bold wiki-markup) are not kerned.
Replaces Unicode quote marks in plain text or in the label portion of a [[L|D]] style wikilink with typewriter
quote marks regardless of the need for kerning. Unicode quote marks are not replaced in simple [[D]] wikilinks.
Call this function for chapter titles, for website titles, etc.; not for book titles.
]=]
local function kern_quotes (str)
local cap = '';
local wl_type, label, link;
wl_type, label, link = utilities.is_wikilink (str); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
if 1 == wl_type then -- [[D]] simple wikilink with or without quote marks
if mw.ustring.match (str, '%[%[[\"“”\'‘’].+[\"“”\'‘’]%]%]') then -- leading and trailing quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
str = utilities.substitute (cfg.presentation['kern-right'], str);
elseif mw.ustring.match (str, '%[%[[\"“”\'‘’].+%]%]') then -- leading quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
elseif mw.ustring.match (str, '%[%[.+[\"“”\'‘’]%]%]') then -- trailing quote marks
str = utilities.substitute (cfg.presentation['kern-right'], str);
end
else -- plain text or [[L|D]]; text in label variable
label = mw.ustring.gsub (label, '[“”]', '\"'); -- replace “” (U+201C & U+201D) with " (typewriter double quote mark)
label = mw.ustring.gsub (label, '[‘’]', '\''); -- replace ‘’ (U+2018 & U+2019) with ' (typewriter single quote mark)
cap = mw.ustring.match (label, "^([\"\'][^\'].+)"); -- match leading double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-left'], cap);
end
cap = mw.ustring.match (label, "^(.+[^\'][\"\'])$") -- match trailing double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-right'], cap);
end
if 2 == wl_type then
str = utilities.make_wikilink (link, label); -- reassemble the wikilink
else
str = label;
end
end
return str;
end
--[[--------------------------< F O R M A T _ S C R I P T _ V A L U E >----------------------------------------
|script-title= holds title parameters that are not written in Latin-based scripts: Chinese, Japanese, Arabic, Hebrew, etc. These scripts should
not be italicized and may be written right-to-left. The value supplied by |script-title= is concatenated onto Title after Title has been wrapped
in italic markup.
Regardless of language, all values provided by |script-title= are wrapped in <bdi>...</bdi> tags to isolate RTL languages from the English left to right.
|script-title= provides a unique feature. The value in |script-title= may be prefixed with a two-character ISO 639-1 language code and a colon:
|script-title=ja:*** *** (where * represents a Japanese character)
Spaces between the two-character code and the colon and the colon and the first script character are allowed:
|script-title=ja : *** ***
|script-title=ja: *** ***
|script-title=ja :*** ***
Spaces preceding the prefix are allowed: |script-title = ja:*** ***
The prefix is checked for validity. If it is a valid ISO 639-1 language code, the lang attribute (lang="ja") is added to the <bdi> tag so that browsers can
know the language the tag contains. This may help the browser render the script more correctly. If the prefix is invalid, the lang attribute
is not added. At this time there is no error message for this condition.
Supports |script-title=, |script-chapter=, |script-<periodical>=
]]
local function format_script_value (script_value, script_param)
local lang=''; -- initialize to empty string
local name;
if script_value:match('^%l%l%l?%s*:') then -- if first 3 or 4 non-space characters are script language prefix
lang = script_value:match('^(%l%l%l?)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
if not utilities.is_set (lang) then
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing title part']}); -- prefix without 'title'; add error message
return ''; -- script_value was just the prefix so return empty string
end
-- if we get this far we have prefix and script
name = cfg.lang_tag_remap[lang] or mw.language.fetchLanguageName( lang, cfg.this_wiki_code ); -- get language name so that we can use it to categorize
if utilities.is_set (name) then -- is prefix a proper ISO 639-1 language code?
script_value = script_value:gsub ('^%l+%s*:%s*', ''); -- strip prefix from script
-- is prefix one of these language codes?
if utilities.in_array (lang, cfg.script_lang_codes) then
utilities.add_prop_cat ('script', {name, lang})
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['unknown language code']}); -- unknown script-language; add error message
end
lang = ' lang="' .. lang .. '" '; -- convert prefix into a lang attribute
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['invalid language code']}); -- invalid language code; add error message
lang = ''; -- invalid so set lang to empty string
end
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing prefix']}); -- no language code prefix; add error message
end
script_value = utilities.substitute (cfg.presentation['bdi'], {lang, script_value}); -- isolate in case script is RTL
return script_value;
end
--[[--------------------------< S C R I P T _ C O N C A T E N A T E >------------------------------------------
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script
value has been wrapped in <bdi> tags.
]]
local function script_concatenate (title, script, script_param)
if utilities.is_set (script) then
script = format_script_value (script, script_param); -- <bdi> tags, lang attribute, categorization, etc.; returns empty string on error
if utilities.is_set (script) then
title = title .. ' ' .. script; -- concatenate title and script title
end
end
return title;
end
--[[--------------------------< W R A P _ M S G >--------------------------------------------------------------
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list
configuration taking one argument. Supports lower case text for {{citation}} templates. Additional text taken
from citation_config.messages - the reason this function is similar to but separate from wrap_style().
]]
local function wrap_msg (key, str, lower)
if not utilities.is_set ( str ) then
return "";
end
if true == lower then
local msg;
msg = cfg.messages[key]:lower(); -- set the message to lower case before
return utilities.substitute ( msg, str ); -- including template text
else
return utilities.substitute ( cfg.messages[key], str );
end
end
--[[----------------< W I K I S O U R C E _ U R L _ M A K E >-------------------
Makes a Wikisource URL from Wikisource interwiki-link. Returns the URL and appropriate
label; nil else.
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=
]]
local function wikisource_url_make (str)
local wl_type, D, L;
local ws_url, ws_label;
local wikisource_prefix = table.concat ({'https://', cfg.this_wiki_code, '.wikisource.org/wiki/'});
wl_type, D, L = utilities.is_wikilink (str); -- wl_type is 0 (not a wikilink), 1 (simple wikilink), 2 (complex wikilink)
if 0 == wl_type then -- not a wikilink; might be from |title-link=
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 1 == wl_type then -- simple wikilink: [[Wikisource:ws article]]
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 2 == wl_type then -- non-so-simple wikilink: [[Wikisource:ws article|displayed text]] ([[L|D]])
str = L:match ('^[Ww]ikisource:(.+)') or L:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_label = D; -- get ws article name from display portion of interwiki link
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title without namespace from link portion of wikilink
});
end
end
if ws_url then
ws_url = mw.uri.encode (ws_url, 'WIKI'); -- make a usable URL
ws_url = ws_url:gsub ('%%23', '#'); -- undo percent-encoding of fragment marker
end
return ws_url, ws_label, L or D; -- return proper URL or nil and a label or nil
end
--[[----------------< F O R M A T _ P E R I O D I C A L >-----------------------
Format the three periodical parameters: |script-<periodical>=, |<periodical>=,
and |trans-<periodical>= into a single Periodical meta-parameter.
]]
local function format_periodical (script_periodical, script_periodical_source, periodical, trans_periodical)
if not utilities.is_set (periodical) then
periodical = ''; -- to be safe for concatenation
else
periodical = utilities.wrap_style ('italic-title', periodical); -- style
end
periodical = script_concatenate (periodical, script_periodical, script_periodical_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (trans_periodical) then
trans_periodical = utilities.wrap_style ('trans-italic-title', trans_periodical);
if utilities.is_set (periodical) then
periodical = periodical .. ' ' .. trans_periodical;
else -- here when trans-periodical without periodical or script-periodical
periodical = trans_periodical;
utilities.set_message ('err_trans_missing_title', {'periodical'});
end
end
return periodical;
end
--[[------------------< F O R M A T _ C H A P T E R _ T I T L E >---------------
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=,
and |chapter-url= into a single chapter meta- parameter (chapter_url_source used
for error messages).
]]
local function format_chapter_title (script_chapter, script_chapter_source, chapter, chapter_source, trans_chapter, trans_chapter_source, chapter_url, chapter_url_source, no_quotes, access)
local ws_url, ws_label, L = wikisource_url_make (chapter); -- make a wikisource URL and label from a wikisource interwiki link
if ws_url then
ws_label = ws_label:gsub ('_', ' '); -- replace underscore separators with space characters
chapter = ws_label;
end
if not utilities.is_set (chapter) then
chapter = ''; -- to be safe for concatenation
else
if false == no_quotes then
chapter = kern_quotes (chapter); -- if necessary, separate chapter title's leading and trailing quote marks from module provided quote marks
chapter = utilities.wrap_style ('quoted-title', chapter);
end
end
chapter = script_concatenate (chapter, script_chapter, script_chapter_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (chapter_url) then
chapter = external_link (chapter_url, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
elseif ws_url then
chapter = external_link (ws_url, chapter .. ' ', 'ws link in chapter'); -- adds bare_url_missing_title error if appropriate; space char to move icon away from chap text; TODO: better way to do this?
chapter = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, chapter});
end
if utilities.is_set (trans_chapter) then
trans_chapter = utilities.wrap_style ('trans-quoted-title', trans_chapter);
if utilities.is_set (chapter) then
chapter = chapter .. ' ' .. trans_chapter;
else -- here when trans_chapter without chapter or script-chapter
chapter = trans_chapter;
chapter_source = trans_chapter_source:match ('trans%-?(.+)'); -- when no chapter, get matching name from trans-<param>
utilities.set_message ('err_trans_missing_title', {chapter_source});
end
end
return chapter;
end
--[[----------------< H A S _ I N V I S I B L E _ C H A R S >-------------------
This function searches a parameter's value for non-printable or invisible characters.
The search stops at the first match.
This function will detect the visible replacement character when it is part of the Wikisource.
Detects but ignores nowiki and math stripmarkers. Also detects other named stripmarkers
(gallery, math, pre, ref) and identifies them with a slightly different error message.
See also coins_cleanup().
Output of this function is an error message that identifies the character or the
Unicode group, or the stripmarker that was detected along with its position (or,
for multi-byte characters, the position of its first byte) in the parameter value.
]]
local function has_invisible_chars (param, v)
local position = ''; -- position of invisible char or starting position of stripmarker
local capture; -- used by stripmarker detection to hold name of the stripmarker
local stripmarker; -- boolean set true when a stripmarker is found
capture = string.match (v, '[%w%p ]*'); -- test for values that are simple ASCII text and bypass other tests if true
if capture == v then -- if same there are no Unicode characters
return;
end
for _, invisible_char in ipairs (cfg.invisible_chars) do
local char_name = invisible_char[1]; -- the character or group name
local pattern = invisible_char[2]; -- the pattern used to find it
position, _, capture = mw.ustring.find (v, pattern); -- see if the parameter value contains characters that match the pattern
if position and (cfg.invisible_defs.zwj == capture) then -- if we found a zero-width joiner character
if mw.ustring.find (v, cfg.indic_script) then -- it's ok if one of the Indic scripts
position = nil; -- unset position
elseif cfg.emoji_t[mw.ustring.codepoint (v, position+1)] then -- is zwj followed by a character listed in emoji{}?
position = nil; -- unset position
end
end
if position then
if 'nowiki' == capture or 'math' == capture or -- nowiki and math stripmarkers (not an error condition)
('templatestyles' == capture and utilities.in_array (param, {'id', 'quote'})) then -- templatestyles stripmarker allowed in these parameters
stripmarker = true; -- set a flag
elseif true == stripmarker and cfg.invisible_defs.del == capture then -- because stripmakers begin and end with the delete char, assume that we've found one end of a stripmarker
position = nil; -- unset
else
local err_msg;
if capture and not (cfg.invisible_defs.del == capture or cfg.invisible_defs.zwj == capture) then
err_msg = capture .. ' ' .. char_name;
else
err_msg = char_name .. ' ' .. 'character';
end
utilities.set_message ('err_invisible_char', {err_msg, utilities.wrap_style ('parameter', param), position}); -- add error message
return; -- and done with this parameter
end
end
end
end
--[[-------------------< A R G U M E N T _ W R A P P E R >----------------------
Argument wrapper. This function provides support for argument mapping defined
in the configuration file so that multiple names can be transparently aliased to
single internal variable.
]]
local function argument_wrapper ( args )
local origin = {};
return setmetatable({
ORIGIN = function ( self, k )
local dummy = self[k]; -- force the variable to be loaded.
return origin[k];
end
},
{
__index = function ( tbl, k )
if origin[k] ~= nil then
return nil;
end
local args, list, v = args, cfg.aliases[k];
if type( list ) == 'table' then
v, origin[k] = utilities.select_one ( args, list, 'err_redundant_parameters' );
if origin[k] == nil then
origin[k] = ''; -- Empty string, not nil
end
elseif list ~= nil then
v, origin[k] = args[list], list;
else
-- maybe let through instead of raising an error?
-- v, origin[k] = args[k], k;
error( cfg.messages['unknown_argument_map'] .. ': ' .. k);
end
-- Empty strings, not nil;
if v == nil then
v = '';
origin[k] = '';
end
tbl = rawset( tbl, k, v );
return v;
end,
});
end
--[[--------------------------< N O W R A P _ D A T E >-------------------------
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>.
When date is DD MMMM YYYY or is MMMM DD, YYYY then wrap in nowrap span:
<span ...>DD MMMM</span> YYYY or <span ...>MMMM DD,</span> YYYY
DOES NOT yet support MMMM YYYY or any of the date ranges.
]]
local function nowrap_date (date)
local cap = '';
local cap2 = '';
if date:match("^%d%d%d%d%-%d%d%-%d%d$") then
date = utilities.substitute (cfg.presentation['nowrap1'], date);
elseif date:match("^%a+%s*%d%d?,%s+%d%d%d%d$") or date:match ("^%d%d?%s*%a+%s+%d%d%d%d$") then
cap, cap2 = string.match (date, "^(.*)%s+(%d%d%d%d)$");
date = utilities.substitute (cfg.presentation['nowrap2'], {cap, cap2});
end
return date;
end
--[[--------------------------< S E T _ T I T L E T Y P E >---------------------
This function sets default title types (equivalent to the citation including
|type=<default value>) for those templates that have defaults. Also handles the
special case where it is desirable to omit the title type from the rendered citation
(|type=none).
]]
local function set_titletype (cite_class, title_type)
if utilities.is_set (title_type) then
if 'none' == cfg.keywords_xlate[title_type] then
title_type = ''; -- if |type=none then type parameter not displayed
end
return title_type; -- if |type= has been set to any other value use that value
end
return cfg.title_types [cite_class] or ''; -- set template's default title type; else empty string for concatenation
end
--[[--------------------------< S A F E _ J O I N >-----------------------------
Joins a sequence of strings together while checking for duplicate separation characters.
]]
local function safe_join( tbl, duplicate_char )
local f = {}; -- create a function table appropriate to type of 'duplicate character'
if 1 == #duplicate_char then -- for single byte ASCII characters use the string library functions
f.gsub = string.gsub
f.match = string.match
f.sub = string.sub
else -- for multi-byte characters use the ustring library functions
f.gsub = mw.ustring.gsub
f.match = mw.ustring.match
f.sub = mw.ustring.sub
end
local str = ''; -- the output string
local comp = ''; -- what does 'comp' mean?
local end_chr = '';
local trim;
for _, value in ipairs( tbl ) do
if value == nil then value = ''; end
if str == '' then -- if output string is empty
str = value; -- assign value to it (first time through the loop)
elseif value ~= '' then
if value:sub(1, 1) == '<' then -- special case of values enclosed in spans and other markup.
comp = value:gsub( "%b<>", "" ); -- remove HTML markup (<span>string</span> -> string)
else
comp = value;
end
-- typically duplicate_char is sepc
if f.sub(comp, 1, 1) == duplicate_char then -- is first character same as duplicate_char? why test first character?
-- Because individual string segments often (always?) begin with terminal punct for the
-- preceding segment: 'First element' .. 'sepc next element' .. etc.?
trim = false;
end_chr = f.sub(str, -1, -1); -- get the last character of the output string
-- str = str .. "<HERE(enchr=" .. end_chr .. ")" -- debug stuff?
if end_chr == duplicate_char then -- if same as separator
str = f.sub(str, 1, -2); -- remove it
elseif end_chr == "'" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "''" then -- if last three chars of str are sepc''
str = f.sub(str, 1, -4) .. "''"; -- remove them and add back ''
elseif f.sub(str, -5, -1) == duplicate_char .. "]]''" then -- if last five chars of str are sepc]]''
trim = true; -- why? why do this and next differently from previous?
elseif f.sub(str, -4, -1) == duplicate_char .. "]''" then -- if last four chars of str are sepc]''
trim = true; -- same question
end
elseif end_chr == "]" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "]]" then -- if last three chars of str are sepc]] wikilink
trim = true;
elseif f.sub(str, -3, -1) == duplicate_char .. '"]' then -- if last three chars of str are sepc"] quoted external link
trim = true;
elseif f.sub(str, -2, -1) == duplicate_char .. "]" then -- if last two chars of str are sepc] external link
trim = true;
elseif f.sub(str, -4, -1) == duplicate_char .. "'']" then -- normal case when |url=something & |title=Title.
trim = true;
end
elseif end_chr == " " then -- if last char of output string is a space
if f.sub(str, -2, -1) == duplicate_char .. " " then -- if last two chars of str are <sepc><space>
str = f.sub(str, 1, -3); -- remove them both
end
end
if trim then
if value ~= comp then -- value does not equal comp when value contains HTML markup
local dup2 = duplicate_char;
if f.match(dup2, "%A" ) then dup2 = "%" .. dup2; end -- if duplicate_char not a letter then escape it
value = f.gsub(value, "(%b<>)" .. dup2, "%1", 1 ) -- remove duplicate_char if it follows HTML markup
else
value = f.sub(value, 2, -1 ); -- remove duplicate_char when it is first character
end
end
end
str = str .. value; -- add it to the output string
end
end
return str;
end
--[[--------------------------< I S _ S U F F I X >-----------------------------
returns true if suffix is properly formed Jr, Sr, or ordinal in the range 1–9.
Puncutation not allowed.
]]
local function is_suffix (suffix)
if utilities.in_array (suffix, {'Jr', 'Sr', 'Jnr', 'Snr', '1st', '2nd', '3rd'}) or suffix:match ('^%dth$') then
return true;
end
return false;
end
--[[--------------------< I S _ G O O D _ V A N C _ N A M E >-------------------
For Vancouver style, author/editor names are supposed to be rendered in Latin
(read ASCII) characters. When a name uses characters that contain diacritical
marks, those characters are to be converted to the corresponding Latin
character. When a name is written using a non-Latin alphabet or logogram, that
name is to be transliterated into Latin characters. The module doesn't do this
so editors may/must.
This test allows |first= and |last= names to contain any of the letters defined
in the four Unicode Latin character sets
[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A
[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF
[http://www.unicode.org/charts/PDF/U0100.pdf Latin Extended-A] 0100–017F
[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F
|lastn= also allowed to contain hyphens, spaces, and apostrophes.
(http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods
This original test:
if nil == mw.ustring.find (last, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%']*$")
or nil == mw.ustring.find (first, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%'%.]+[2-6%a]*$") then
was written outside of the code editor and pasted here because the code editor
gets confused between character insertion point and cursor position. The test has
been rewritten to use decimal character escape sequence for the individual bytes
of the Unicode characters so that it is not necessary to use an external editor
to maintain this code.
\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)
\195\152-\195\182 – Ø-ö (U+00D8-U+00F6 – C0 controls)
\195\184-\198\191 – ø-ƿ (U+00F8-U+01BF – C0 controls, Latin extended A & B)
\199\132-\201\143 – DŽ-ɏ (U+01C4-U+024F – Latin extended B)
]]
local function is_good_vanc_name (last, first, suffix, position)
if not suffix then
if first:find ('[,%s]') then -- when there is a space or comma, might be first name/initials + generational suffix
first = first:match ('(.-)[,%s]+'); -- get name/initials
suffix = first:match ('[,%s]+(.+)$'); -- get generational suffix
end
end
if utilities.is_set (suffix) then
if not is_suffix (suffix) then
add_vanc_error (cfg.err_msg_supl.suffix, position);
return false; -- not a name with an appropriate suffix
end
end
if nil == mw.ustring.find (last, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%']*$") or
nil == mw.ustring.find (first, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%'%.]*$") then
add_vanc_error (cfg.err_msg_supl['non-Latin char'], position);
return false; -- not a string of Latin characters; Vancouver requires Romanization
end;
return true;
end
--[[--------------------------< R E D U C E _ T O _ I N I T I A L S >------------------------------------------
Attempts to convert names to initials in support of |name-list-style=vanc.
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period.
See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.
Vancouver style requires family rank designations (Jr, II, III, etc.) to be rendered
as Jr, 2nd, 3rd, etc. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.
This code only accepts and understands generational suffix in the Vancouver format
because Roman numerals look like, and can be mistaken for, initials.
This function uses ustring functions because firstname initials may be any of the
Unicode Latin characters accepted by is_good_vanc_name ().
]]
local function reduce_to_initials(first, position)
local name, suffix = mw.ustring.match(first, "^(%u+) ([%dJS][%drndth]+)$");
if not name then -- if not initials and a suffix
name = mw.ustring.match(first, "^(%u+)$"); -- is it just initials?
end
if name then -- if first is initials with or without suffix
if 3 > mw.ustring.len (name) then -- if one or two initials
if suffix then -- if there is a suffix
if is_suffix (suffix) then -- is it legitimate?
return first; -- one or two initials and a valid suffix so nothing to do
else
add_vanc_error (cfg.err_msg_supl.suffix, position); -- one or two initials with invalid suffix so error message
return first; -- and return first unmolested
end
else
return first; -- one or two initials without suffix; nothing to do
end
end
end -- if here then name has 3 or more uppercase letters so treat them as a word
local initials, names = {}, {}; -- tables to hold name parts and initials
local i = 1; -- counter for number of initials
names = mw.text.split (first, '[%s,]+'); -- split into a table of names and possible suffix
while names[i] do -- loop through the table
if 1 < i and names[i]:match ('[%dJS][%drndth]+%.?$') then -- if not the first name, and looks like a suffix (may have trailing dot)
names[i] = names[i]:gsub ('%.', ''); -- remove terminal dot if present
if is_suffix (names[i]) then -- if a legitimate suffix
table.insert (initials, ' ' .. names[i]); -- add a separator space, insert at end of initials table
break; -- and done because suffix must fall at the end of a name
end -- no error message if not a suffix; possibly because of Romanization
end
if 3 > i then
table.insert (initials, mw.ustring.sub(names[i], 1, 1)); -- insert the initial at end of initials table
end
i = i + 1; -- bump the counter
end
return table.concat(initials) -- Vancouver format does not include spaces.
end
--[[--------------------------< I N T E R W I K I _ P R E F I X E N _ G E T >----------------------------------
extract interwiki prefixen from <value>. Returns two one or two values:
false – no prefixen
nil – prefix exists but not recognized
project prefix, language prefix – when value has either of:
:<project>:<language>:<article>
:<language>:<project>:<article>
project prefix, nil – when <value> has only a known single-letter prefix
nil, language prefix – when <value> has only a known language prefix
accepts single-letter project prefixen: 'd' (wikidata), 's' (wikisource), and 'w' (wikipedia) prefixes; at this
writing, the other single-letter prefixen (b (wikibook), c (commons), m (meta), n (wikinews), q (wikiquote), and
v (wikiversity)) are not supported.
]]
local function interwiki_prefixen_get (value, is_link)
if not value:find (':%l+:') then -- if no prefix
return false; -- abandon; boolean here to distinguish from nil fail returns later
end
local prefix_patterns_linked_t = { -- sequence of valid interwiki and inter project prefixen
'^%[%[:([dsw]):(%l%l+):', -- wikilinked; project and language prefixes
'^%[%[:(%l%l+):([dsw]):', -- wikilinked; language and project prefixes
'^%[%[:([dsw]):', -- wikilinked; project prefix
'^%[%[:(%l%l+):', -- wikilinked; language prefix
}
local prefix_patterns_unlinked_t = { -- sequence of valid interwiki and inter project prefixen
'^:([dsw]):(%l%l+):', -- project and language prefixes
'^:(%l%l+):([dsw]):', -- language and project prefixes
'^:([dsw]):', -- project prefix
'^:(%l%l+):', -- language prefix
}
local cap1, cap2;
for _, pattern in ipairs ((is_link and prefix_patterns_linked_t) or prefix_patterns_unlinked_t) do
cap1, cap2 = value:match (pattern);
if cap1 then
break; -- found a match so stop looking
end
end
if cap1 and cap2 then -- when both then :project:language: or :language:project: (both forms allowed)
if 1 == #cap1 then -- length == 1 then :project:language:
if cfg.inter_wiki_map[cap2] then -- is language prefix in the interwiki map?
return cap1, cap2; -- return interwiki project and interwiki language
end
else -- here when :language:project:
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return cap2, cap1; -- return interwiki project and interwiki language
end
end
return nil; -- unknown interwiki language
elseif not (cap1 or cap2) then -- both are nil?
return nil; -- we got something that looks like a project prefix but isn't; return fail
elseif 1 == #cap1 then -- here when one capture
return cap1, nil; -- length is 1 so return project, nil language
else -- here when one capture and its length it more than 1
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return nil, cap1; -- return nil project, language
end
end
end
--[[--------------------------< L I S T _ P E O P L E >--------------------------
Formats a list of people (authors, contributors, editors, interviewers, translators)
names in the list will be linked when
|<name>-link= has a value
|<name>-mask- does NOT have a value; masked names are presumed to have been
rendered previously so should have been linked there
when |<name>-mask=0, the associated name is not rendered
]]
local function list_people (control, people, etal)
local sep;
local namesep;
local format = control.format;
local maximum = control.maximum;
local name_list = {};
if 'vanc' == format then -- Vancouver-like name styling?
sep = cfg.presentation['sep_nl_vanc']; -- name-list separator between names is a comma
namesep = cfg.presentation['sep_name_vanc']; -- last/first separator is a space
else
sep = cfg.presentation['sep_nl']; -- name-list separator between names is a semicolon
namesep = cfg.presentation['sep_name']; -- last/first separator is <comma><space>
end
if sep:sub (-1, -1) ~= " " then sep = sep .. " " end
if utilities.is_set (maximum) and maximum < 1 then return "", 0; end -- returned 0 is for EditorCount; not used for other names
for i, person in ipairs (people) do
if utilities.is_set (person.last) then
local mask = person.mask;
local one;
local sep_one = sep;
if utilities.is_set (maximum) and i > maximum then
etal = true;
break;
end
if mask then
local n = tonumber (mask); -- convert to a number if it can be converted; nil else
if n then
one = 0 ~= n and string.rep("—", n) or nil; -- make a string of (n > 0) mdashes, nil else, to replace name
person.link = nil; -- don't create link to name if name is replaces with mdash string or has been set nil
else
one = mask; -- replace name with mask text (must include name-list separator)
sep_one = " "; -- modify name-list separator
end
else
one = person.last; -- get surname
local first = person.first -- get given name
if utilities.is_set (first) then
if ("vanc" == format) then -- if Vancouver format
one = one:gsub ('%.', ''); -- remove periods from surnames (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
if not person.corporate and is_good_vanc_name (one, first, nil, i) then -- and name is all Latin characters; corporate authors not tested
first = reduce_to_initials (first, i); -- attempt to convert first name(s) to initials
end
end
one = one .. namesep .. first;
end
end
if utilities.is_set (person.link) then
one = utilities.make_wikilink (person.link, one); -- link author/editor
end
if one then -- if <one> has a value (name, mdash replacement, or mask text replacement)
local proj, tag = interwiki_prefixen_get (one, true); -- get the interwiki prefixen if present
if 'w' == proj and ('Wikipedia' == mw.site.namespaces.Project['name']) then
proj = nil; -- for stuff like :w:de:<article>, :w is unnecessary TODO: maint cat?
end
if proj then
proj = ({['d'] = 'Wikidata', ['s'] = 'Wikisource', ['w'] = 'Wikipedia'})[proj]; -- :w (wikipedia) for linking from a non-wikipedia project
if proj then
one = one .. utilities.wrap_style ('interproj', proj); -- add resized leading space, brackets, static text, language name
tag = nil; -- unset; don't do both project and language
end
end
if tag == cfg.this_wiki_code then
tag = nil; -- stuff like :en:<article> at en.wiki is pointless TODO: maint cat?
end
if tag then
local lang = cfg.lang_tag_remap[tag] or cfg.mw_languages_by_tag_t[tag];
if lang then -- error messaging done in extract_names() where we know parameter names
one = one .. utilities.wrap_style ('interwiki', lang); -- add resized leading space, brackets, static text, language name
end
end
table.insert (name_list, one); -- add it to the list of names
table.insert (name_list, sep_one); -- add the proper name-list separator
end
end
end
local count = #name_list / 2; -- (number of names + number of separators) divided by 2
if 0 < count then
if 1 < count and not etal then
if 'amp' == format then
name_list[#name_list-2] = " & "; -- replace last separator with ampersand text
elseif 'and' == format then
if 2 == count then
name_list[#name_list-2] = cfg.presentation.sep_nl_and; -- replace last separator with 'and' text
else
name_list[#name_list-2] = cfg.presentation.sep_nl_end; -- replace last separator with '(sep) and' text
end
end
end
name_list[#name_list] = nil; -- erase the last separator
end
local result = table.concat (name_list); -- construct list
if etal and utilities.is_set (result) then -- etal may be set by |display-authors=etal but we might not have a last-first list
result = result .. sep .. cfg.messages['et al']; -- we've got a last-first list and etal so add et al.
end
return result, count; -- return name-list string and count of number of names (count used for editor names only)
end
--[[--------------------< M A K E _ C I T E R E F _ I D >-----------------------
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise
returns an empty string.
namelist is one of the contributor-, author-, or editor-name lists chosen in that
order. year is Year or anchor_year.
]]
local function make_citeref_id (namelist, year)
local names={}; -- a table for the one to four names and year
for i,v in ipairs (namelist) do -- loop through the list and take up to the first four last names
names[i] = v.last
if i == 4 then break end -- if four then done
end
table.insert (names, year); -- add the year at the end
local id = table.concat(names); -- concatenate names and year for CITEREF id
if utilities.is_set (id) then -- if concatenation is not an empty string
return "CITEREF" .. id; -- add the CITEREF portion
else
return ''; -- return an empty string; no reason to include CITEREF id in this citation
end
end
--[[--------------------------< C I T E _ C L A S S _A T T R I B U T E _M A K E >------------------------------
construct <cite> tag class attribute for this citation.
<cite_class> – config.CitationClass from calling template
<mode> – value from |mode= parameter
]]
local function cite_class_attribute_make (cite_class, mode)
local class_t = {};
table.insert (class_t, 'citation'); -- required for blue highlight
if 'citation' ~= cite_class then
table.insert (class_t, cite_class); -- identify this template for user css
table.insert (class_t, utilities.is_set (mode) and mode or 'cs1'); -- identify the citation style for user css or javascript
else
table.insert (class_t, utilities.is_set (mode) and mode or 'cs2'); -- identify the citation style for user css or javascript
end
for _, prop_key in ipairs (z.prop_keys_t) do
table.insert (class_t, prop_key); -- identify various properties for user css or javascript
end
return table.concat (class_t, ' '); -- make a big string and done
end
--[[---------------------< N A M E _ H A S _ E T A L >--------------------------
Evaluates the content of name parameters (author, editor, etc.) for variations on
the theme of et al. If found, the et al. is removed, a flag is set to true and
the function returns the modified name and the flag.
This function never sets the flag to false but returns its previous state because
it may have been set by previous passes through this function or by the associated
|display-<names>=etal parameter
]]
local function name_has_etal (name, etal, nocat, param)
if utilities.is_set (name) then -- name can be nil in which case just return
local patterns = cfg.et_al_patterns; -- get patterns from configuration
for _, pattern in ipairs (patterns) do -- loop through all of the patterns
if name:match (pattern) then -- if this 'et al' pattern is found in name
name = name:gsub (pattern, ''); -- remove the offending text
etal = true; -- set flag (may have been set previously here or by |display-<names>=etal)
if not nocat then -- no categorization for |vauthors=
utilities.set_message ('err_etal', {param}); -- and set an error if not added
end
end
end
end
return name, etal;
end
--[[---------------------< N A M E _ I S _ N U M E R I C >----------------------
Add maint cat when name parameter value does not contain letters. Does not catch
mixed alphanumeric names so |last=A. Green (1922-1987) does not get caught in the
current version of this test but |first=(1888) is caught.
returns nothing
]]
local function name_is_numeric (name, list_name)
if utilities.is_set (name) then
if mw.ustring.match (name, '^[%A]+$') then -- when name does not contain any letters
utilities.set_message ('maint_numeric_names', cfg.special_case_translation [list_name]); -- add a maint cat for this template
end
end
end
--[[-----------------< N A M E _ H A S _ M U L T _ N A M E S >------------------
Evaluates the content of last/surname (authors etc.) parameters for multiple names.
Multiple names are indicated if there is more than one comma or any "unescaped"
semicolons. Escaped semicolons are ones used as part of selected HTML entities.
If the condition is met, the function adds the multiple name maintenance category.
Same test for first except that commas should not appear in given names (MOS:JR says
that the generational suffix does not take a separator character). Titles, degrees,
postnominals, affiliations, all normally comma separated don't belong in a citation.
<name> – name parameter value
<list_name> – AuthorList, EditorList, etc
<limit> – number of allowed commas; 1 (default) for surnames; 0 for given names
returns nothing
]]
local function name_has_mult_names (name, list_name, limit)
local _, commas, semicolons, nbsps;
limit = limit and limit or 1;
if utilities.is_set (name) then
_, commas = name:gsub (',', ''); -- count the number of commas
_, semicolons = name:gsub (';', ''); -- count the number of semicolons
-- nbsps probably should be its own separate count rather than merged in
-- some way with semicolons because Lua patterns do not support the
-- grouping operator that regex does, which means there is no way to add
-- more entities to escape except by adding more counts with the new
-- entities
_, nbsps = name:gsub (' ',''); -- count nbsps
-- There is exactly 1 semicolon per entity, so subtract nbsps
-- from semicolons to 'escape' them. If additional entities are added,
-- they also can be subtracted.
if limit < commas or 0 < (semicolons - nbsps) then
utilities.set_message ('maint_mult_names', cfg.special_case_translation [list_name]); -- add a maint message
end
end
end
--[=[-------------------------< I S _ G E N E R I C >----------------------------------------------------------
Compares values assigned to various parameters according to the string provided as <item> in the function call.
<item> can have on of two values:
'generic_names' – for name-holding parameters: |last=, |first=, |editor-last=, etc
'generic_titles' – for |title=
There are two types of generic tests. The 'accept' tests look for a pattern that should not be rejected by the
'reject' test. For example,
|author=[[John Smith (author)|Smith, John]]
would be rejected by the 'author' reject test. But piped wikilinks with 'author' disambiguation should not be
rejected so the 'accept' test prevents that from happening. Accept tests are always performed before reject
tests.
Each of the 'accept' and 'reject' sequence tables hold tables for en.wiki (['en']) and local.wiki (['local'])
that each can hold a test sequence table The sequence table holds, at index [1], a test pattern, and, at index
[2], a boolean control value. The control value tells string.find() or mw.ustring.find() to do plain-text search (true)
or a pattern search (false). The intent of all this complexity is to make these searches as fast as possible so
that we don't run out of processing time on very large articles.
Returns
true when a reject test finds the pattern or string
false when an accept test finds the pattern or string
nil else
]=]
local function is_generic (item, value, wiki)
local test_val;
local str_lower = { -- use string.lower() for en.wiki (['en']) and use mw.ustring.lower() or local.wiki (['local'])
['en'] = string.lower,
['local'] = mw.ustring.lower,
}
local str_find = { -- use string.find() for en.wiki (['en']) and use mw.ustring.find() or local.wiki (['local'])
['en'] = string.find,
['local'] = mw.ustring.find,
}
local function test (val, test_t, wiki) -- local function to do the testing; <wiki> selects lower() and find() functions
val = test_t[2] and str_lower[wiki](value) or val; -- when <test_t[2]> set to 'true', plaintext search using lowercase value
return str_find[wiki] (val, test_t[1], 1, test_t[2]); -- return nil when not found or matched
end
local test_types_t = {'accept', 'reject'}; -- test accept patterns first, then reject patterns
local wikis_t = {'en', 'local'}; -- do tests for each of these keys; en.wiki first, local.wiki second
for _, test_type in ipairs (test_types_t) do -- for each test type
for _, generic_value in pairs (cfg.special_case_translation[item][test_type]) do -- spin through the list of generic value fragments to accept or reject
for _, wiki in ipairs (wikis_t) do
if generic_value[wiki] then
if test (value, generic_value[wiki], wiki) then -- go do the test
return ('reject' == test_type); -- param value rejected, return true; false else
end
end
end
end
end
end
--[[--------------------------< N A M E _ I S _ G E N E R I C >------------------------------------------------
calls is_generic() to determine if <name> is a 'generic name' listed in cfg.generic_names; <name_alias> is the
parameter name used in error messaging
]]
local function name_is_generic (name, name_alias)
if not added_generic_name_errs and is_generic ('generic_names', name) then
utilities.set_message ('err_generic_name', name_alias); -- set an error message
added_generic_name_errs = true;
end
end
--[[--------------------------< N A M E _ C H E C K S >--------------------------------------------------------
This function calls various name checking functions used to validate the content of the various name-holding parameters.
]]
local function name_checks (last, first, list_name, last_alias, first_alias)
local accept_name;
if utilities.is_set (last) then
last, accept_name = utilities.has_accept_as_written (last); -- remove accept-this-as-written markup when it wraps all of <last>
if not accept_name then -- <last> not wrapped in accept-as-written markup
name_has_mult_names (last, list_name); -- check for multiple names in the parameter
name_is_numeric (last, list_name); -- check for names that are composed of digits and punctuation
name_is_generic (last, last_alias); -- check for names found in the generic names list
end
end
if utilities.is_set (first) then
first, accept_name = utilities.has_accept_as_written (first); -- remove accept-this-as-written markup when it wraps all of <first>
if not accept_name then -- <first> not wrapped in accept-as-written markup
name_has_mult_names (first, list_name, 0); -- check for multiple names in the parameter; 0 is number of allowed commas in a given name
name_is_numeric (first, list_name); -- check for names that are composed of digits and punctuation
name_is_generic (first, first_alias); -- check for names found in the generic names list
end
local wl_type, D = utilities.is_wikilink (first);
if 0 ~= wl_type then
first = D;
utilities.set_message ('err_bad_paramlink', first_alias);
end
end
return last, first; -- done
end
--[[----------------------< E X T R A C T _ N A M E S >-------------------------
Gets name list from the input arguments
Searches through args in sequential order to find |lastn= and |firstn= parameters
(or their aliases), and their matching link and mask parameters. Stops searching
when both |lastn= and |firstn= are not found in args after two sequential attempts:
found |last1=, |last2=, and |last3= but doesn't find |last4= and |last5= then the
search is done.
This function emits an error message when there is a |firstn= without a matching
|lastn=. When there are 'holes' in the list of last names, |last1= and |last3=
are present but |last2= is missing, an error message is emitted. |lastn= is not
required to have a matching |firstn=.
When an author or editor parameter contains some form of 'et al.', the 'et al.'
is stripped from the parameter and a flag (etal) returned that will cause list_people()
to add the static 'et al.' text from Module:Citation/CS1/Configuration. This keeps
'et al.' out of the template's metadata. When this occurs, an error is emitted.
]]
local function extract_names(args, list_name)
local names = {}; -- table of names
local last; -- individual name components
local first;
local link;
local mask;
local i = 1; -- loop counter/indexer
local n = 1; -- output table indexer
local count = 0; -- used to count the number of times we haven't found a |last= (or alias for authors, |editor-last or alias for editors)
local etal = false; -- return value set to true when we find some form of et al. in an author parameter
local last_alias, first_alias, link_alias; -- selected parameter aliases used in error messaging
while true do
last, last_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'err_redundant_parameters', i ); -- search through args for name components beginning at 1
first, first_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'err_redundant_parameters', i );
link, link_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i );
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
if last then -- error check |lastn= alias for unknown interwiki link prefix; done here because this is where we have the parameter name
local project, language = interwiki_prefixen_get (last, true); -- true because we expect interwiki links in |lastn= to be wikilinked
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', last_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
last = utilities.remove_wiki_link (last); -- remove wikilink markup; show display value only
end
end
if link then -- error check |linkn= alias for unknown interwiki link prefix
local project, language = interwiki_prefixen_get (link, false); -- false because wiki links in |author-linkn= is an error
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', link_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
link = nil; -- unset so we don't link
link_alias = nil;
end
end
last, etal = name_has_etal (last, etal, false, last_alias); -- find and remove variations on et al.
first, etal = name_has_etal (first, etal, false, first_alias); -- find and remove variations on et al.
last, first = name_checks (last, first, list_name, last_alias, first_alias); -- multiple names, extraneous annotation, etc. checks
if first and not last then -- if there is a firstn without a matching lastn
local alias = first_alias:find ('given', 1, true) and 'given' or 'first'; -- get first or given form of the alias
utilities.set_message ('err_first_missing_last', {
first_alias, -- param name of alias missing its mate
first_alias:gsub (alias, {['first'] = 'last', ['given'] = 'surname'}), -- make param name appropriate to the alias form
}); -- add this error message
elseif not first and not last then -- if both firstn and lastn aren't found, are we done?
count = count + 1; -- number of times we haven't found last and first
if 2 <= count then -- two missing names and we give up
break; -- normal exit or there is a two-name hole in the list; can't tell which
end
else -- we have last with or without a first
local result;
link = link_title_ok (link, link_alias, last, last_alias); -- check for improper wiki-markup
if first then
link = link_title_ok (link, link_alias, first, first_alias); -- check for improper wiki-markup
end
names[n] = {last = last, first = first, link = link, mask = mask, corporate = false}; -- add this name to our names list (corporate for |vauthors= only)
n = n + 1; -- point to next location in the names table
if 1 == count then -- if the previous name was missing
utilities.set_message ('err_missing_name', {list_name:match ("(%w+)List"):lower(), i - 1}); -- add this error message
end
count = 0; -- reset the counter, we're looking for two consecutive missing names
end
i = i + 1; -- point to next args location
end
return names, etal; -- all done, return our list of names and the etal flag
end
--[[--------------------------< N A M E _ T A G _ G E T >------------------------------------------------------
attempt to decode |language=<lang_param> and return language name and matching tag; nil else.
This function looks for:
<lang_param> as a tag in cfg.lang_tag_remap{}
<lang_param> as a name in cfg.lang_name_remap{}
<lang_param> as a name in cfg.mw_languages_by_name_t
<lang_param> as a tag in cfg.mw_languages_by_tag_t
when those fail, presume that <lang_param> is an IETF-like tag that MediaWiki does not recognize. Strip all
script, region, variant, whatever subtags from <lang_param> to leave just a two or three character language tag
and look for the new <lang_param> in cfg.mw_languages_by_tag_t{}
on success, returns name (in properly capitalized form) and matching tag (in lowercase); on failure returns nil
]]
local function name_tag_get (lang_param)
local lang_param_lc = mw.ustring.lower (lang_param); -- use lowercase as an index into the various tables
local name;
local tag;
name = cfg.lang_tag_remap[lang_param_lc]; -- assume <lang_param_lc> is a tag; attempt to get remapped language name
if name then -- when <name>, <lang_param> is a tag for a remapped language name
return name, lang_param_lc; -- so return <name> from remap and <lang_param_lc>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- still assuming that <lang_param_lc> is a tag; strip script, region, variant subtags
name = cfg.lang_tag_remap[tag]; -- attempt to get remapped language name with language subtag only
if name then -- when <name>, <tag> is a tag for a remapped language name
return name, tag; -- so return <name> from remap and <tag>
end
if cfg.lang_name_remap[lang_param_lc] then -- not a tag, assume <lang_param_lc> is a name; attempt to get remapped language tag
return cfg.lang_name_remap[lang_param_lc][1], cfg.lang_name_remap[lang_param_lc][2]; -- for this <lang_param_lc>, return a (possibly) new name and appropriate tag
end
tag = cfg.mw_languages_by_name_t[lang_param_lc]; -- assume that <lang_param_lc> is a language name; attempt to get its matching tag
if tag then
return cfg.mw_languages_by_tag_t[tag], tag; -- <lang_param_lc> is a name so return the name from the table and <tag>
end
name = cfg.mw_languages_by_tag_t[lang_param_lc]; -- assume that <lang_param_lc> is a tag; attempt to get its matching language name
if name then
return name, lang_param_lc; -- <lang_param_lc> is a tag so return it and <name>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- is <lang_param_lc> an IETF-like tag that MediaWiki doesn't recognize? <tag> gets the language subtag; nil else
if tag then
name = cfg.mw_languages_by_tag_t[tag]; -- attempt to get a language name using the shortened <tag>
if name then
return name, tag; -- <lang_param_lc> is an unrecognized IETF-like tag so return <name> and language subtag
end
end
end
--[[-------------------< L A N G U A G E _ P A R A M E T E R >------------------
Gets language name from a provided two- or three-character ISO 639 code. If a code
is recognized by MediaWiki, use the returned name; if not, then use the value that
was provided with the language parameter.
When |language= contains a recognized language (either code or name), the page is
assigned to the category for that code: Category:Norwegian-language sources (no).
For valid three-character code languages, the page is assigned to the single category
for '639-2' codes: Category:CS1 ISO 639-2 language sources.
Languages that are the same as the local wiki are not categorized. MediaWiki does
not recognize three-character equivalents of two-character codes: code 'ar' is
recognized but code 'ara' is not.
This function supports multiple languages in the form |language=nb, French, th
where the language names or codes are separated from each other by commas with
optional space characters.
]]
local function language_parameter (lang)
local tag; -- some form of IETF-like language tag; language subtag with optional region, sript, vatiant, etc subtags
local lang_subtag; -- ve populates |language= with mostly unecessary region subtags the MediaWiki does not recognize; this is the base language subtag
local name; -- the language name
local language_list = {}; -- table of language names to be rendered
local names_t = {}; -- table made from the value assigned to |language=
local this_wiki_name = mw.language.fetchLanguageName (cfg.this_wiki_code, cfg.this_wiki_code); -- get this wiki's language name
names_t = mw.text.split (lang, '%s*,%s*'); -- names should be a comma separated list
for _, lang in ipairs (names_t) do -- reuse lang here because we don't yet know if lang is a language name or a language tag
name, tag = name_tag_get (lang); -- attempt to get name/tag pair for <lang>; <name> has proper capitalization; <tag> is lowercase
if utilities.is_set (tag) then
lang_subtag = tag:gsub ('^(%a%a%a?)%-.*', '%1'); -- for categorization, strip any IETF-like tags from language tag
if cfg.this_wiki_code ~= lang_subtag then -- when the language is not the same as this wiki's language
if 2 == lang_subtag:len() then -- and is a two-character tag
utilities.add_prop_cat ('foreign-lang-source', {name, tag}, lang_subtag); -- categorize it; tag appended to allow for multiple language categorization
else -- or is a recognized language (but has a three-character tag)
utilities.add_prop_cat ('foreign-lang-source-2', {lang_subtag}, lang_subtag); -- categorize it differently TODO: support multiple three-character tag categories per cs1|2 template?
end
elseif cfg.local_lang_cat_enable then -- when the language and this wiki's language are the same and categorization is enabled
utilities.add_prop_cat ('local-lang-source', {name, lang_subtag}); -- categorize it
end
else
name = lang; -- return whatever <lang> has so that we show something
utilities.set_message ('maint_unknown_lang'); -- add maint category if not already added
end
table.insert (language_list, name);
name = ''; -- so we can reuse it
end
name = utilities.make_sep_list (#language_list, language_list);
if (1 == #language_list) and (lang_subtag == cfg.this_wiki_code) then -- when only one language, find lang name in this wiki lang name; for |language=en-us, 'English' in 'American English'
return ''; -- if one language and that language is this wiki's return an empty string (no annotation)
end
return (" " .. wrap_msg ('language', name)); -- otherwise wrap with '(in ...)'
--[[ TODO: should only return blank or name rather than full list
so we can clean up the bunched parenthetical elements Language, Type, Format
]]
end
--[[-----------------------< S E T _ C S _ S T Y L E >--------------------------
Gets the default CS style configuration for the given mode.
Returns default separator and either postscript as passed in or the default.
In CS1, the default postscript and separator are '.'.
In CS2, the default postscript is the empty string and the default separator is ','.
]]
local function set_cs_style (postscript, mode)
if utilities.is_set(postscript) then
-- emit a maintenance message if user postscript is the default cs1 postscript
-- we catch the opposite case for cs2 in set_style
if mode == 'cs1' and postscript == cfg.presentation['ps_' .. mode] then
utilities.set_message ('maint_postscript');
end
else
postscript = cfg.presentation['ps_' .. mode];
end
return cfg.presentation['sep_' .. mode], postscript;
end
--[[--------------------------< S E T _ S T Y L E >-----------------------------
Sets the separator and postscript styles. Checks the |mode= first and the
#invoke CitationClass second. Removes the postscript if postscript == none.
]]
local function set_style (mode, postscript, cite_class)
local sep;
if 'cs2' == mode then
sep, postscript = set_cs_style (postscript, 'cs2');
elseif 'cs1' == mode then
sep, postscript = set_cs_style (postscript, 'cs1');
elseif 'citation' == cite_class then
sep, postscript = set_cs_style (postscript, 'cs2');
else
sep, postscript = set_cs_style (postscript, 'cs1');
end
if cfg.keywords_xlate[postscript:lower()] == 'none' then
-- emit a maintenance message if user postscript is the default cs2 postscript
-- we catch the opposite case for cs1 in set_cs_style
if 'cs2' == mode or 'citation' == cite_class then
utilities.set_message ('maint_postscript');
end
postscript = '';
end
return sep, postscript
end
--[=[-------------------------< I S _ P D F >-----------------------------------
Determines if a URL has the file extension that is one of the PDF file extensions
used by [[MediaWiki:Common.css]] when applying the PDF icon to external links.
returns true if file extension is one of the recognized extensions, else false
]=]
local function is_pdf (url)
return url:match ('%.pdf$') or url:match ('%.PDF$') or
url:match ('%.pdf[%?#]') or url:match ('%.PDF[%?#]') or
url:match ('%.PDF#') or url:match ('%.pdf#');
end
--[[--------------------------< S T Y L E _ F O R M A T >-----------------------
Applies CSS style to |format=, |chapter-format=, etc. Also emits an error message
if the format parameter does not have a matching URL parameter. If the format parameter
is not set and the URL contains a file extension that is recognized as a PDF document
by MediaWiki's commons.css, this code will set the format parameter to (PDF) with
the appropriate styling.
]]
local function style_format (format, url, fmt_param, url_param)
if utilities.is_set (format) then
format = utilities.wrap_style ('format', format); -- add leading space, parentheses, resize
if not utilities.is_set (url) then
utilities.set_message ('err_format_missing_url', {fmt_param, url_param}); -- add an error message
end
elseif is_pdf (url) then -- format is not set so if URL is a PDF file then
format = utilities.wrap_style ('format', 'PDF'); -- set format to PDF
else
format = ''; -- empty string for concatenation
end
return format;
end
--[[---------------------< G E T _ D I S P L A Y _ N A M E S >------------------
Returns a number that defines the number of names displayed for author and editor
name lists and a Boolean flag to indicate when et al. should be appended to the name list.
When the value assigned to |display-xxxxors= is a number greater than or equal to zero,
return the number and the previous state of the 'etal' flag (false by default
but may have been set to true if the name list contains some variant of the text 'et al.').
When the value assigned to |display-xxxxors= is the keyword 'etal', return a number
that is one greater than the number of authors in the list and set the 'etal' flag true.
This will cause the list_people() to display all of the names in the name list followed by 'et al.'
In all other cases, returns nil and the previous state of the 'etal' flag.
inputs:
max: A['DisplayAuthors'] or A['DisplayEditors'], etc; a number or some flavor of etal
count: #a or #e
list_name: 'authors' or 'editors'
etal: author_etal or editor_etal
This function sets an error message when |display-xxxxors= value greater than or equal to number of names but
not when <max> comes from {{cs1 config}} global settings. When using global settings, <param> is set to the
keyword 'cs1 config' which is used to supress the normal error. Error is suppressed because it is to be expected
that some citations in an article will have the same or fewer names that the limit specified in {{cs1 config}}.
]]
local function get_display_names (max, count, list_name, etal, param)
if utilities.is_set (max) then
if 'etal' == max:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
max = count + 1; -- number of authors + 1 so display all author name plus et al.
etal = true; -- overrides value set by extract_names()
elseif max:match ('^%d+$') then -- if is a string of numbers
max = tonumber (max); -- make it a number
if (max >= count) and ('cs1 config' ~= param) then -- error when local |display-xxxxors= value greater than or equal to number of names; not an error when using global setting
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil;
end
else -- not a valid keyword or number
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil; -- unset; as if |display-xxxxors= had not been set
end
end
return max, etal;
end
--[[----------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >---------------
Adds error if |page=, |pages=, |quote-page=, |quote-pages= has what appears to be
some form of p. or pp. abbreviation in the first characters of the parameter content.
check page for extraneous p, p., pp, pp., pg, pg. at start of parameter value:
good pattern: '^P[^%.P%l]' matches when page begins PX or P# but not Px
where x and X are letters and # is a digit
bad pattern: '^[Pp][PpGg]' matches when page begins pp, pP, Pp, PP, pg, pG, Pg, PG
]]
local function extra_text_in_page_check (val, name)
if not val:match (cfg.vol_iss_pg_patterns.good_ppattern) then
for _, pattern in ipairs (cfg.vol_iss_pg_patterns.bad_ppatterns) do -- spin through the selected sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message ('err_extra_text_pages', name); -- add error message
return; -- and done
end
end
end
end
--[[--------------------------< E X T R A _ T E X T _ I N _ V O L _ I S S _ C H E C K >------------------------
Adds error if |volume= or |issue= has what appears to be some form of redundant 'type' indicator.
For |volume=:
'V.', or 'Vol.' (with or without the dot) abbreviations or 'Volume' in the first characters of the parameter
content (all case insensitive). 'V' and 'v' (without the dot) are presumed to be roman numerals so
are allowed.
For |issue=:
'No.', 'I.', 'Iss.' (with or without the dot) abbreviations, or 'Issue' in the first characters of the
parameter content (all case insensitive).
Single character values ('v', 'i', 'n') allowed when not followed by separator character ('.', ':', '=', or
whitespace character) – param values are trimmed of whitespace by MediaWiki before delivered to the module.
<val> is |volume= or |issue= parameter value
<name> is |volume= or |issue= parameter name for error message
<selector> is 'v' for |volume=, 'i' for |issue=
sets error message on failure; returns nothing
]]
local function extra_text_in_vol_iss_check (val, name, selector)
if not utilities.is_set (val) then
return;
end
local patterns = 'v' == selector and cfg.vol_iss_pg_patterns.vpatterns or cfg.vol_iss_pg_patterns.ipatterns;
local handler = 'v' == selector and 'err_extra_text_volume' or 'err_extra_text_issue';
val = val:lower(); -- force parameter value to lower case
for _, pattern in ipairs (patterns) do -- spin through the selected sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message (handler, name); -- add error message
return; -- and done
end
end
end
--[=[-------------------------< G E T _ V _ N A M E _ T A B L E >----------------------------------------------
split apart a |vauthors= or |veditors= parameter. This function allows for corporate names, wrapped in doubled
parentheses to also have commas; in the old version of the code, the doubled parentheses were included in the
rendered citation and in the metadata. Individual author names may be wikilinked
|vauthors=Jones AB, [[E. B. White|White EB]], ((Black, Brown, and Co.))
]=]
local function get_v_name_table (vparam, output_table, output_link_table)
local name_table = mw.text.split(vparam, "%s*,%s*"); -- names are separated by commas
local wl_type, label, link; -- wl_type not used here; just a placeholder
local i = 1;
while name_table[i] do
if name_table[i]:match ('^%(%(.*[^%)][^%)]$') then -- first segment of corporate with one or more commas; this segment has the opening doubled parentheses
local name = name_table[i];
i = i + 1; -- bump indexer to next segment
while name_table[i] do
name = name .. ', ' .. name_table[i]; -- concatenate with previous segments
if name_table[i]:match ('^.*%)%)$') then -- if this table member has the closing doubled parentheses
break; -- and done reassembling so
end
i = i + 1; -- bump indexer
end
table.insert (output_table, name); -- and add corporate name to the output table
table.insert (output_link_table, ''); -- no wikilink
else
wl_type, label, link = utilities.is_wikilink (name_table[i]); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
table.insert (output_table, label); -- add this name
if 1 == wl_type then
table.insert (output_link_table, label); -- simple wikilink [[D]]
else
table.insert (output_link_table, link); -- no wikilink or [[L|D]]; add this link if there is one, else empty string
end
end
i = i + 1;
end
return output_table;
end
--[[--------------------------< P A R S E _ V A U T H O R S _ V E D I T O R S >--------------------------------
This function extracts author / editor names from |vauthors= or |veditors= and finds matching |xxxxor-maskn= and
|xxxxor-linkn= in args. It then returns a table of assembled names just as extract_names() does.
Author / editor names in |vauthors= or |veditors= must be in Vancouver system style. Corporate or institutional names
may sometimes be required and because such names will often fail the is_good_vanc_name() and other format compliance
tests, are wrapped in doubled parentheses ((corporate name)) to suppress the format tests.
Supports generational suffixes Jr, 2nd, 3rd, 4th–6th.
This function sets the Vancouver error when a required comma is missing and when there is a space between an author's initials.
]]
local function parse_vauthors_veditors (args, vparam, list_name)
local names = {}; -- table of names assembled from |vauthors=, |author-maskn=, |author-linkn=
local v_name_table = {};
local v_link_table = {}; -- when name is wikilinked, targets go in this table
local etal = false; -- return value set to true when we find some form of et al. vauthors parameter
local last, first, link, mask, suffix;
local corporate = false;
vparam, etal = name_has_etal (vparam, etal, true); -- find and remove variations on et al. do not categorize (do it here because et al. might have a period)
v_name_table = get_v_name_table (vparam, v_name_table, v_link_table); -- names are separated by commas
for i, v_name in ipairs(v_name_table) do
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
local accept_name;
v_name, accept_name = utilities.has_accept_as_written (v_name); -- remove accept-this-as-written markup when it wraps all of <v_name>
if accept_name then
last = v_name;
corporate = true; -- flag used in list_people()
elseif string.find(v_name, "%s") then
if v_name:find('[;%.]') then -- look for commonly occurring punctuation characters;
add_vanc_error (cfg.err_msg_supl.punctuation, i);
end
local lastfirstTable = {}
lastfirstTable = mw.text.split(v_name, "%s+")
first = table.remove(lastfirstTable); -- removes and returns value of last element in table which should be initials or generational suffix
if not mw.ustring.match (first, '^%u+$') then -- mw.ustring here so that later we will catch non-Latin characters
suffix = first; -- not initials so assume that whatever we got is a generational suffix
first = table.remove(lastfirstTable); -- get what should be the initials from the table
end
last = table.concat(lastfirstTable, ' ') -- returns a string that is the concatenation of all other names that are not initials and generational suffix
if not utilities.is_set (last) then
first = ''; -- unset
last = v_name; -- last empty because something wrong with first
add_vanc_error (cfg.err_msg_supl.name, i);
end
if mw.ustring.match (last, '%a+%s+%u+%s+%a+') then
add_vanc_error (cfg.err_msg_supl['missing comma'], i); -- matches last II last; the case when a comma is missing
end
if mw.ustring.match (v_name, ' %u %u$') then -- this test is in the wrong place TODO: move or replace with a more appropriate test
add_vanc_error (cfg.err_msg_supl.initials, i); -- matches a space between two initials
end
else
last = v_name; -- last name or single corporate name? Doesn't support multiword corporate names? do we need this?
end
if utilities.is_set (first) then
if not mw.ustring.match (first, "^%u?%u$") then -- first shall contain one or two upper-case letters, nothing else
add_vanc_error (cfg.err_msg_supl.initials, i); -- too many initials; mixed case initials (which may be ok Romanization); hyphenated initials
end
is_good_vanc_name (last, first, suffix, i); -- check first and last before restoring the suffix which may have a non-Latin digit
if utilities.is_set (suffix) then
first = first .. ' ' .. suffix; -- if there was a suffix concatenate with the initials
suffix = ''; -- unset so we don't add this suffix to all subsequent names
end
else
if not corporate then
is_good_vanc_name (last, '', nil, i);
end
end
link = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i ) or v_link_table[i];
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
names[i] = {last = last, first = first, link = link, mask = mask, corporate = corporate}; -- add this assembled name to our names list
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< S E L E C T _ A U T H O R _ E D I T O R _ S O U R C E >------------------------
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or
select one of |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.
Only one of these appropriate three will be used. The hierarchy is: |authorn= (and aliases) highest and |authors= lowest;
|editorn= (and aliases) highest and |veditors= lowest (support for |editors= withdrawn)
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second
test which mimicks the test used in extract_names() when looking for a hole in the author name list. There may be a better
way to do this, I just haven't discovered what that way is.
Emits an error message when more than one xxxxor name source is provided.
In this function, vxxxxors = vauthors or veditors; xxxxors = authors as appropriate.
]]
local function select_author_editor_source (vxxxxors, xxxxors, args, list_name)
local lastfirst = false;
if utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 1 ) or -- do this twice in case we have a |first1= without a |last1=; this ...
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 1 ) or -- ... also catches the case where |first= is used with |vauthors=
utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 2 ) or
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 2 ) then
lastfirst = true;
end
if (utilities.is_set (vxxxxors) and true == lastfirst) or -- these are the three error conditions
(utilities.is_set (vxxxxors) and utilities.is_set (xxxxors)) or
(true == lastfirst and utilities.is_set (xxxxors)) then
local err_name;
if 'AuthorList' == list_name then -- figure out which name should be used in error message
err_name = 'author';
else
err_name = 'editor';
end
utilities.set_message ('err_redundant_parameters', err_name .. '-name-list parameters'); -- add error message
end
if true == lastfirst then return 1 end; -- return a number indicating which author name source to use
if utilities.is_set (vxxxxors) then return 2 end;
if utilities.is_set (xxxxors) then return 3 end;
return 1; -- no authors so return 1; this allows missing author name test to run in case there is a first without last
end
--[[--------------------------< I S _ V A L I D _ P A R A M E T E R _ V A L U E >------------------------------
This function is used to validate a parameter's assigned value for those parameters that have only a limited number
of allowable values (yes, y, true, live, dead, etc.). When the parameter value has not been assigned a value (missing
or empty in the source template) the function returns the value specified by ret_val. If the parameter value is one
of the list of allowed values returns the translated value; else, emits an error message and returns the value
specified by ret_val.
TODO: explain <invert>
]]
local function is_valid_parameter_value (value, name, possible, ret_val, invert)
if not utilities.is_set (value) then
return ret_val; -- an empty parameter is ok
end
if (not invert and utilities.in_array (value, possible)) then -- normal; <value> is in <possible> table
return cfg.keywords_xlate[value]; -- return translation of parameter keyword
elseif invert and not utilities.in_array (value, possible) then -- invert; <value> is not in <possible> table
return value; -- return <value> as it is
else
utilities.set_message ('err_invalid_param_val', {name, value}); -- not an allowed value so add error message
return ret_val;
end
end
--[[--------------------------< T E R M I N A T E _ N A M E _ L I S T >----------------------------------------
This function terminates a name list (author, contributor, editor) with a separator character (sepc) and a space
when the last character is not a sepc character or when the last three characters are not sepc followed by two
closing square brackets (close of a wikilink). When either of these is true, the name_list is terminated with a
single space character.
]]
local function terminate_name_list (name_list, sepc)
if (string.sub (name_list, -3, -1) == sepc .. '. ') then -- if already properly terminated
return name_list; -- just return the name list
elseif (string.sub (name_list, -1, -1) == sepc) or (string.sub (name_list, -3, -1) == sepc .. ']]') then -- if last name in list ends with sepc char
return name_list .. " "; -- don't add another
else
return name_list .. sepc .. ' '; -- otherwise terminate the name list
end
end
--[[-------------------------< F O R M A T _ V O L U M E _ I S S U E >-----------------------------------------
returns the concatenation of the formatted volume and issue (or journal article number) parameters as a single
string; or formatted volume or formatted issue, or an empty string if neither are set.
]]
local function format_volume_issue (volume, issue, article, cite_class, origin, sepc, lower)
if not utilities.is_set (volume) and not utilities.is_set (issue) and not utilities.is_set (article) then
return '';
end
-- same condition as in format_pages_sheets()
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
local is_numeric_vol = volume and (volume:match ('^[MDCLXVI]+$') or volume:match ('^%d+$')); -- is only uppercase roman numerals or only digits?
local is_long_vol = volume and (4 < mw.ustring.len(volume)); -- is |volume= value longer than 4 characters?
if volume and (not is_numeric_vol and is_long_vol) then -- when not all digits or Roman numerals, is |volume= longer than 4 characters?
utilities.add_prop_cat ('long-vol'); -- yes, add properties cat
end
if is_journal then -- journal-style formatting
local vol = '';
if utilities.is_set (volume) then
if is_numeric_vol then -- |volume= value all digits or all uppercase Roman numerals?
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, volume}); -- render in bold face
elseif is_long_vol then -- not all digits or Roman numerals; longer than 4 characters?
vol = utilities.substitute (cfg.messages['j-vol'], {sepc, utilities.hyphen_to_dash (volume)}); -- not bold
else -- four or fewer characters
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, utilities.hyphen_to_dash (volume)}); -- bold
end
end
vol = vol .. (utilities.is_set (issue) and utilities.substitute (cfg.messages['j-issue'], issue) or '')
vol = vol .. (utilities.is_set (article) and utilities.substitute (cfg.messages['j-article-num'], article) or '')
return vol;
end
if 'podcast' == cite_class and utilities.is_set (issue) then
return wrap_msg ('issue', {sepc, issue}, lower);
end
if 'conference' == cite_class and utilities.is_set (article) then -- |article-number= supported only in journal and conference cites
if utilities.is_set (volume) and utilities.is_set (article) then -- both volume and article number
return wrap_msg ('vol-art', {sepc, utilities.hyphen_to_dash (volume), article}, lower);
elseif utilities.is_set (article) then -- article number alone; when volume alone, handled below
return wrap_msg ('art', {sepc, article}, lower);
end
end
-- all other types of citation
if utilities.is_set (volume) and utilities.is_set (issue) then
return wrap_msg ('vol-no', {sepc, utilities.hyphen_to_dash (volume), issue}, lower);
elseif utilities.is_set (volume) then
return wrap_msg ('vol', {sepc, utilities.hyphen_to_dash (volume)}, lower);
else
return wrap_msg ('issue', {sepc, issue}, lower);
end
end
--[[-------------------------< F O R M A T _ P A G E S _ S H E E T S >-----------------------------------------
adds static text to one of |page(s)= or |sheet(s)= values and returns it with all of the others set to empty strings.
The return order is:
page, pages, sheet, sheets
Singular has priority over plural when both are provided.
]]
local function format_pages_sheets (page, pages, sheet, sheets, cite_class, origin, sepc, nopp, lower)
if 'map' == cite_class then -- only cite map supports sheet(s) as in-source locators
if utilities.is_set (sheet) then
if 'journal' == origin then
return '', '', wrap_msg ('j-sheet', sheet, lower), '';
else
return '', '', wrap_msg ('sheet', {sepc, sheet}, lower), '';
end
elseif utilities.is_set (sheets) then
if 'journal' == origin then
return '', '', '', wrap_msg ('j-sheets', sheets, lower);
else
return '', '', '', wrap_msg ('sheets', {sepc, sheets}, lower);
end
end
end
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
if utilities.is_set (page) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], page), '', '', '';
elseif not nopp then
return utilities.substitute (cfg.messages['p-prefix'], {sepc, page}), '', '', '';
else
return utilities.substitute (cfg.messages['nopp'], {sepc, page}), '', '', '';
end
elseif utilities.is_set (pages) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], pages), '', '', '';
elseif tonumber(pages) ~= nil and not nopp then -- if pages is only digits, assume a single page number
return '', utilities.substitute (cfg.messages['p-prefix'], {sepc, pages}), '', '';
elseif not nopp then
return '', utilities.substitute (cfg.messages['pp-prefix'], {sepc, pages}), '', '';
else
return '', utilities.substitute (cfg.messages['nopp'], {sepc, pages}), '', '';
end
end
return '', '', '', ''; -- return empty strings
end
--[[--------------------------< I N S O U R C E _ L O C _ G E T >----------------------------------------------
returns one of the in-source locators: page, pages, or at.
If any of these are interwiki links to Wikisource, returns the label portion of the interwiki-link as plain text
for use in COinS. This COinS thing is done because here we convert an interwiki-link to an external link and
add an icon span around that; get_coins_pages() doesn't know about the span. TODO: should it?
TODO: add support for sheet and sheets?; streamline;
TODO: make it so that this function returns only one of the three as the single in-source (the return value assigned
to a new name)?
]]
local function insource_loc_get (page, page_orig, pages, pages_orig, at)
local ws_url, ws_label, coins_pages, L; -- for Wikisource interwiki-links; TODO: this corrupts page metadata (span remains in place after cleanup; fix there?)
if utilities.is_set (page) then
if utilities.is_set (pages) or utilities.is_set (at) then
pages = ''; -- unset the others
at = '';
end
extra_text_in_page_check (page, page_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (page); -- make ws URL from |page= interwiki link; link portion L becomes tooltip label
if ws_url then
page = external_link (ws_url, ws_label .. ' ', 'ws link in page'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
page = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, page});
coins_pages = ws_label;
end
elseif utilities.is_set (pages) then
if utilities.is_set (at) then
at = ''; -- unset
end
extra_text_in_page_check (pages, pages_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (pages); -- make ws URL from |pages= interwiki link; link portion L becomes tooltip label
if ws_url then
pages = external_link (ws_url, ws_label .. ' ', 'ws link in pages'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
pages = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, pages});
coins_pages = ws_label;
end
elseif utilities.is_set (at) then
ws_url, ws_label, L = wikisource_url_make (at); -- make ws URL from |at= interwiki link; link portion L becomes tooltip label
if ws_url then
at = external_link (ws_url, ws_label .. ' ', 'ws link in at'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
at = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, at});
coins_pages = ws_label;
end
end
return page, pages, at, coins_pages;
end
--[[--------------------------< I S _ U N I Q U E _ A R C H I V E _ U R L >------------------------------------
add error message when |archive-url= value is same as |url= or chapter-url= (or alias...) value
]]
local function is_unique_archive_url (archive, url, c_url, source, date)
if utilities.is_set (archive) then
if archive == url or archive == c_url then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)}); -- add error message
return '', ''; -- unset |archive-url= and |archive-date= because same as |url= or |chapter-url=
end
end
return archive, date;
end
--[=[-------------------------< A R C H I V E _ U R L _ C H E C K >--------------------------------------------
Check archive.org URLs to make sure they at least look like they are pointing at valid archives and not to the
save snapshot URL or to calendar pages. When the archive URL is 'https://web.archive.org/save/' (or http://...)
archive.org saves a snapshot of the target page in the URL. That is something that Wikipedia should not allow
unwitting readers to do.
When the archive.org URL does not have a complete timestamp, archive.org chooses a snapshot according to its own
algorithm or provides a calendar 'search' result. [[WP:ELNO]] discourages links to search results.
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
|archive-date= and an error message when:
|archive-url= holds an archive.org save command URL
|archive-url= is an archive.org URL that does not have a complete timestamp (YYYYMMDDhhmmss 14 digits) in the
correct place
otherwise returns |archive-url= and |archive-date=
There are two mostly compatible archive.org URLs:
//web.archive.org/<timestamp>... -- the old form
//web.archive.org/web/<timestamp>... -- the new form
The old form does not support or map to the new form when it contains a display flag. There are four identified flags
('id_', 'js_', 'cs_', 'im_') but since archive.org ignores others following the same form (two letters and an underscore)
we don't check for these specific flags but we do check the form.
This function supports a preview mode. When the article is rendered in preview mode, this function may return a modified
archive URL:
for save command errors, return undated wildcard (/*/)
for timestamp errors when the timestamp has a wildcard, return the URL unmodified
for timestamp errors when the timestamp does not have a wildcard, return with timestamp limited to six digits plus wildcard (/yyyymm*/)
A secondary function is to return an archive-url timestamp from those urls that have them (archive.org and
archive.today). The timestamp is used by validation.archive_date_check() to see if the value in |archive-date=
matches the timestamp in the archive url.
]=]
local function archive_url_check (url, date)
local err_msg = ''; -- start with the error message empty
local path, timestamp, flag; -- portions of the archive.org URL
timestamp = url:match ('//archive.today/(%d%d%d%d%d%d%d%d%d%d%d%d%d%d)/'); -- get timestamp from archive.today urls
if timestamp then -- if this was an archive.today url ...
return url, date, timestamp; -- return ArchiveURL, ArchiveDate, and timestamp from |archive-url=, and done
end
-- here for archive.org urls
if (not url:match('//web%.archive%.org/')) and (not url:match('//liveweb%.archive%.org/')) then -- also deprecated liveweb Wayback machine URL
return url, date; -- not an archive.org archive, return ArchiveURL and ArchiveDate
end
if url:match('//web%.archive%.org/save/') then -- if a save command URL, we don't want to allow saving of the target page
err_msg = cfg.err_msg_supl.save;
url = url:gsub ('(//web%.archive%.org)/save/', '%1/*/', 1); -- for preview mode: modify ArchiveURL
elseif url:match('//liveweb%.archive%.org/') then
err_msg = cfg.err_msg_supl.liveweb;
else
path, timestamp, flag = url:match('//web%.archive%.org/([^%d]*)(%d+)([^/]*)/'); -- split out some of the URL parts for evaluation
if not path then -- malformed in some way; pattern did not match
err_msg = cfg.err_msg_supl.timestamp;
elseif 14 ~= timestamp:len() then -- path and flag optional, must have 14-digit timestamp here
err_msg = cfg.err_msg_supl.timestamp;
if '*' ~= flag then
local replacement = timestamp:match ('^%d%d%d%d%d%d') or timestamp:match ('^%d%d%d%d'); -- get the first 6 (YYYYMM) or first 4 digits (YYYY)
if replacement then -- nil if there aren't at least 4 digits (year)
replacement = replacement .. string.rep ('0', 14 - replacement:len()); -- year or yearmo (4 or 6 digits) zero-fill to make 14-digit timestamp
url=url:gsub ('(//web%.archive%.org/[^%d]*)%d[^/]*', '%1' .. replacement .. '*', 1) -- for preview, modify ts to 14 digits plus splat for calendar display
end
end
elseif utilities.is_set (path) and 'web/' ~= path then -- older archive URLs do not have the extra 'web/' path element
err_msg = cfg.err_msg_supl.path;
elseif utilities.is_set (flag) and not utilities.is_set (path) then -- flag not allowed with the old form URL (without the 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
elseif utilities.is_set (flag) and not flag:match ('%a%a_') then -- flag if present must be two alpha characters and underscore (requires 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
else
return url, date, timestamp; -- return ArchiveURL, ArchiveDate, and timestamp from |archive-url=
end
end
-- if here, something not right so
utilities.set_message ('err_archive_url', {err_msg}); -- add error message and
if is_preview_mode then
return url, date, timestamp; -- preview mode so return ArchiveURL, ArchiveDate, and timestamp from |archive-url=
else
return '', ''; -- return empty strings for ArchiveURL and ArchiveDate
end
end
--[[--------------------------< P L A C E _ C H E C K >--------------------------------------------------------
check |place=, |publication-place=, |location= to see if these params include digits. This function added because
many editors misuse location to specify the in-source location (|page(s)= and |at= are supposed to do that)
returns the original parameter value without modification; added maint cat when parameter value contains digits
]]
local function place_check (param_val)
if not utilities.is_set (param_val) then -- parameter empty or omitted
return param_val; -- return that empty state
end
if mw.ustring.find (param_val, '%d') then -- not empty, are there digits in the parameter value
utilities.set_message ('maint_location'); -- yep, add maint cat
end
return param_val; -- and done
end
--[[--------------------------< I S _ A R C H I V E D _ C O P Y >----------------------------------------------
compares |title= to 'Archived copy' (placeholder added by bots that can't find proper title); if matches, return true; nil else
]]
local function is_archived_copy (title)
title = mw.ustring.lower(title); -- switch title to lower case
if title:find (cfg.special_case_translation.archived_copy.en) then -- if title is 'Archived copy'
return true;
elseif cfg.special_case_translation.archived_copy['local'] then
if mw.ustring.find (title, cfg.special_case_translation.archived_copy['local']) then -- mw.ustring() because might not be Latin script
return true;
end
end
end
--[[--------------------------< C I T A T I O N 0 >------------------------------------------------------------
This is the main function doing the majority of the citation formatting.
]]
local function citation0( config, args )
--[[
Load Input Parameters
The argument_wrapper facilitates the mapping of multiple aliases to single internal variable.
]]
local A = argument_wrapper ( args );
local i
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
local author_etal;
local a = {}; -- authors list from |lastn= / |firstn= pairs or |vauthors=
local Authors;
local NameListStyle;
if cfg.global_cs1_config_t['NameListStyle'] then -- global setting in {{cs1 config}} overrides local |name-list-style= parameter value; nil when empty or assigned value invalid
NameListStyle = is_valid_parameter_value (cfg.global_cs1_config_t['NameListStyle'], 'cs1 config: name-list-style', cfg.keywords_lists['name-list-style'], ''); -- error messaging 'param' here is a hoax
else
NameListStyle = is_valid_parameter_value (A['NameListStyle'], A:ORIGIN('NameListStyle'), cfg.keywords_lists['name-list-style'], '');
end
if cfg.global_cs1_config_t['NameListStyle'] and utilities.is_set (A['NameListStyle']) then -- when template has |name-list-style=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
local Collaboration = A['Collaboration'];
do -- to limit scope of selected
local selected = select_author_editor_source (A['Vauthors'], A['Authors'], args, 'AuthorList');
if 1 == selected then
a, author_etal = extract_names (args, 'AuthorList'); -- fetch author list from |authorn= / |lastn= / |firstn=, |author-linkn=, and |author-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
a, author_etal = parse_vauthors_veditors (args, A['Vauthors'], 'AuthorList'); -- fetch author list from |vauthors=, |author-linkn=, and |author-maskn=
elseif 3 == selected then
Authors = A['Authors']; -- use content of |authors=
if 'authors' == A:ORIGIN('Authors') then -- but add a maint cat if the parameter is |authors=
utilities.set_message ('maint_authors'); -- because use of this parameter is discouraged; what to do about the aliases is a TODO:
end
end
if utilities.is_set (Collaboration) then
author_etal = true; -- so that |display-authors=etal not required
end
end
local editor_etal;
local e = {}; -- editors list from |editor-lastn= / |editor-firstn= pairs or |veditors=
do -- to limit scope of selected
local selected = select_author_editor_source (A['Veditors'], nil, args, 'EditorList'); -- support for |editors= withdrawn
if 1 == selected then
e, editor_etal = extract_names (args, 'EditorList'); -- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
e, editor_etal = parse_vauthors_veditors (args, args.veditors, 'EditorList'); -- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=
end
end
local Chapter = A['Chapter']; -- done here so that we have access to |contribution= from |chapter= aliases
local Chapter_origin = A:ORIGIN ('Chapter');
local Contribution; -- because contribution is required for contributor(s)
if 'contribution' == Chapter_origin then
Contribution = Chapter; -- get the name of the contribution
end
local c = {}; -- contributors list from |contributor-lastn= / contributor-firstn= pairs
if utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (A['Periodical']) then -- |contributor= and |contribution= only supported in book cites
c = extract_names (args, 'ContributorList'); -- fetch contributor list from |contributorn= / |contributor-lastn=, -firstn=, -linkn=, -maskn=
if 0 < #c then
if not utilities.is_set (Contribution) then -- |contributor= requires |contribution=
utilities.set_message ('err_contributor_missing_required_param', 'contribution'); -- add missing contribution error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
if 0 == #a then -- |contributor= requires |author=
utilities.set_message ('err_contributor_missing_required_param', 'author'); -- add missing author error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
end
else -- if not a book cite
if utilities.select_one (args, cfg.aliases['ContributorList-Last'], 'err_redundant_parameters', 1 ) then -- are there contributor name list parameters?
utilities.set_message ('err_contributor_ignored'); -- add contributor ignored error message
end
Contribution = nil; -- unset
end
local Title = A['Title'];
local TitleLink = A['TitleLink'];
local auto_select = ''; -- default is auto
local accept_link;
TitleLink, accept_link = utilities.has_accept_as_written (TitleLink, true); -- test for accept-this-as-written markup
if (not accept_link) and utilities.in_array (TitleLink, {'none', 'pmc', 'doi'}) then -- check for special keywords
auto_select = TitleLink; -- remember selection for later
TitleLink = ''; -- treat as if |title-link= would have been empty
end
TitleLink = link_title_ok (TitleLink, A:ORIGIN ('TitleLink'), Title, 'title'); -- check for wiki-markup in |title-link= or wiki-markup in |title= when |title-link= is set
local Section = ''; -- {{cite map}} only; preset to empty string for concatenation if not used
if 'map' == config.CitationClass and 'section' == Chapter_origin then
Section = A['Chapter']; -- get |section= from |chapter= alias list; |chapter= and the other aliases not supported in {{cite map}}
Chapter = ''; -- unset for now; will be reset later from |map= if present
end
local Periodical = A['Periodical'];
local Periodical_origin = A:ORIGIN('Periodical');
local ScriptPeriodical = A['ScriptPeriodical'];
local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
local TransPeriodical = A['TransPeriodical'];
local TransPeriodical_origin = A:ORIGIN ('TransPeriodical');
if (utilities.in_array (config.CitationClass, {'book', 'encyclopaedia'}) and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (ScriptPeriodical))) then
local param;
if utilities.is_set (Periodical) then -- get a parameter name from one of these periodical related meta-parameters
Periodical = nil; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = Periodical_origin -- get parameter name for error messaging
elseif utilities.is_set (TransPeriodical) then
TransPeriodical = nil; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = TransPeriodical_origin; -- get parameter name for error messaging
elseif utilities.is_set (ScriptPeriodical) then
ScriptPeriodical = nil; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = ScriptPeriodical_origin; -- get parameter name for error messaging
end
if utilities.is_set (param) then -- if we found one
utilities.set_message ('err_periodical_ignored', {param}); -- emit an error message
end
end
if utilities.is_set (Periodical) then
local i;
Periodical, i = utilities.strip_apostrophe_markup (Periodical); -- strip apostrophe markup so that metadata isn't contaminated
if i then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {Periodical_origin});
end
end
if 'mailinglist' == config.CitationClass then -- special case for {{cite mailing list}}
if utilities.is_set (Periodical) and utilities.is_set (A ['MailingList']) then -- both set emit an error TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', Periodical_origin) .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'mailinglist')});
end
Periodical = A ['MailingList']; -- error or no, set Periodical to |mailinglist= value because this template is {{cite mailing list}}
Periodical_origin = A:ORIGIN('MailingList');
end
-- web and news not tested for now because of
-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
if not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message
local p = {['journal'] = 'journal', ['magazine'] = 'magazine'}; -- for error message
if p[config.CitationClass] then
utilities.set_message ('err_missing_periodical', {config.CitationClass, p[config.CitationClass]});
end
end
local Volume;
-- local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) then
if not utilities.in_array (Periodical_origin, cfg.citation_no_volume_t) then -- {{citation}} does not render |volume= when these parameters are used
Volume = A['Volume']; -- but does for all other 'periodicals'
end
elseif utilities.is_set (ScriptPeriodical) then
if 'script-website' ~= ScriptPeriodical_origin then -- {{citation}} does not render volume for |script-website=
Volume = A['Volume']; -- but does for all other 'periodicals'
end
else
Volume = A['Volume']; -- and does for non-'periodical' cites
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_volume) then -- render |volume= for cs1 according to the configuration settings
Volume = A['Volume'];
end
extra_text_in_vol_iss_check (Volume, A:ORIGIN ('Volume'), 'v');
local Issue;
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) and utilities.in_array (Periodical_origin, cfg.citation_issue_t) then -- {{citation}} may render |issue= when these parameters are used
Issue = utilities.hyphen_to_dash (A['Issue']);
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_issue) then -- conference & map books do not support issue; {{citation}} listed here because included in settings table
if not (utilities.in_array (config.CitationClass, {'conference', 'map', 'citation'}) and not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical))) then
Issue = utilities.hyphen_to_dash (A['Issue']);
end
end
local ArticleNumber;
if utilities.in_array (config.CitationClass, {'journal', 'conference'}) or ('citation' == config.CitationClass and utilities.is_set (Periodical) and 'journal' == Periodical_origin) then
ArticleNumber = A['ArticleNumber'];
end
extra_text_in_vol_iss_check (Issue, A:ORIGIN ('Issue'), 'i');
local Page;
local Pages;
local At;
local QuotePage;
local QuotePages;
if not utilities.in_array (config.CitationClass, cfg.templates_not_using_page) then -- TODO: rewrite to emit ignored parameter error message?
Page = A['Page'];
Pages = utilities.hyphen_to_dash (A['Pages']);
At = A['At'];
QuotePage = A['QuotePage'];
QuotePages = utilities.hyphen_to_dash (A['QuotePages']);
end
local Edition = A['Edition'];
local PublicationPlace = place_check (A['PublicationPlace'], A:ORIGIN('PublicationPlace'));
local Place = place_check (A['Place'], A:ORIGIN('Place'));
local PublisherName = A['PublisherName'];
local PublisherName_origin = A:ORIGIN('PublisherName');
if utilities.is_set (PublisherName) and (cfg.keywords_xlate['none'] ~= PublisherName) then
local i = 0;
PublisherName, i = utilities.strip_apostrophe_markup (PublisherName); -- strip apostrophe markup so that metadata isn't contaminated; publisher is never italicized
if i and (0 < i) then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {PublisherName_origin});
end
end
if ('document' == config.CitationClass) and not utilities.is_set (PublisherName) then
utilities.set_message ('err_missing_publisher', {config.CitationClass, 'publisher'});
end
local Newsgroup = A['Newsgroup']; -- TODO: strip apostrophe markup?
local Newsgroup_origin = A:ORIGIN('Newsgroup');
if 'newsgroup' == config.CitationClass then
if utilities.is_set (PublisherName) and (cfg.keywords_xlate['none'] ~= PublisherName) then -- general use parameter |publisher= not allowed in cite newsgroup
utilities.set_message ('err_parameter_ignored', {PublisherName_origin});
end
PublisherName = nil; -- ensure that this parameter is unset for the time being; will be used again after COinS
end
local URL = A['URL']; -- TODO: better way to do this for URL, ChapterURL, and MapURL?
local UrlAccess = is_valid_parameter_value (A['UrlAccess'], A:ORIGIN('UrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (URL) and utilities.is_set (UrlAccess) then
UrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', 'url');
end
local ChapterURL = A['ChapterURL'];
local ChapterUrlAccess = is_valid_parameter_value (A['ChapterUrlAccess'], A:ORIGIN('ChapterUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (ChapterURL) and utilities.is_set (ChapterUrlAccess) then
ChapterUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {A:ORIGIN('ChapterUrlAccess'):gsub ('%-access', '')});
end
local MapUrlAccess = is_valid_parameter_value (A['MapUrlAccess'], A:ORIGIN('MapUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (A['MapURL']) and utilities.is_set (MapUrlAccess) then
MapUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {'map-url'});
end
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
local no_tracking_cats = is_valid_parameter_value (A['NoTracking'], A:ORIGIN('NoTracking'), cfg.keywords_lists['yes_true_y'], nil);
-- check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories
if not utilities.is_set (no_tracking_cats) then -- ignore if we are already not going to categorize this page
if cfg.uncategorized_namespaces[this_page.namespace] then -- is this page's namespace id one of the uncategorized namespace ids?
no_tracking_cats = "true"; -- set no_tracking_cats
end
for _, v in ipairs (cfg.uncategorized_subpages) do -- cycle through page name patterns
if this_page.text:match (v) then -- test page name against each pattern
no_tracking_cats = "true"; -- set no_tracking_cats
break; -- bail out if one is found
end
end
end
-- check for extra |page=, |pages= or |at= parameters. (also sheet and sheets while we're at it)
utilities.select_one (args, {'page', 'p', 'pp', 'pages', 'at', 'sheet', 'sheets'}, 'err_redundant_parameters'); -- this is a dummy call simply to get the error message and category
local coins_pages;
Page, Pages, At, coins_pages = insource_loc_get (Page, A:ORIGIN('Page'), Pages, A:ORIGIN('Pages'), At);
local NoPP = is_valid_parameter_value (A['NoPP'], A:ORIGIN('NoPP'), cfg.keywords_lists['yes_true_y'], nil);
if utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- both |publication-place= and |place= (|location=) allowed if different
utilities.add_prop_cat ('location-test'); -- add property cat to evaluate how often PublicationPlace and Place are used together
if PublicationPlace == Place then
Place = ''; -- unset; don't need both if they are the same
end
elseif not utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- when only |place= (|location=) is set ...
PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
end
if PublicationPlace == Place then Place = ''; end -- don't need both if they are the same
local URL_origin = A:ORIGIN('URL'); -- get name of parameter that holds URL
local ChapterURL_origin = A:ORIGIN('ChapterURL'); -- get name of parameter that holds ChapterURL
local ScriptChapter = A['ScriptChapter'];
local ScriptChapter_origin = A:ORIGIN ('ScriptChapter');
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local TransChapter = A['TransChapter'];
local TransChapter_origin = A:ORIGIN ('TransChapter');
local TransTitle = A['TransTitle'];
local ScriptTitle = A['ScriptTitle'];
--[[
Parameter remapping for cite encyclopedia:
When the citation has these parameters:
|encyclopedia= and |title= then map |title= to |article= and |encyclopedia= to |title= for rendering
|encyclopedia= and |article= then map |encyclopedia= to |title= for rendering
|trans-title= maps to |trans-chapter= when |title= is re-mapped
|url= maps to |chapter-url= when |title= is remapped
All other combinations of |encyclopedia=, |title=, and |article= are not modified
]]
local Encyclopedia = A['Encyclopedia']; -- used as a flag by this module and by ~/COinS
if utilities.is_set (Encyclopedia) then -- emit error message when Encyclopedia set but template is other than {{cite encyclopedia}} or {{citation}}
if 'encyclopaedia' ~= config.CitationClass and 'citation' ~= config.CitationClass then
utilities.set_message ('err_parameter_ignored', {A:ORIGIN ('Encyclopedia')});
Encyclopedia = nil; -- unset because not supported by this template
end
end
if ('encyclopaedia' == config.CitationClass) or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Periodical) and utilities.is_set (Encyclopedia) then -- when both parameters set emit an error message; {{citation}} only; Periodical not allowed in {{cite encyclopedia}}
utilities.set_message ('err_periodical_ignored', {Periodical_origin});
end
if utilities.is_set (Encyclopedia) then
Periodical = Encyclopedia; -- error or no, set Periodical to Encyclopedia for rendering; {{citation}} could (not legitimately) have both; use Encyclopedia
Periodical_origin = A:ORIGIN ('Encyclopedia');
if utilities.is_set (Title) or utilities.is_set (ScriptTitle) then
if not utilities.is_set (Chapter) then
Chapter = Title; -- |encyclopedia= and |title= are set so map |title= to |article= and |encyclopedia= to |title= for rendering
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle')
TransChapter = TransTitle;
ChapterURL = URL;
ChapterURL_origin = URL_origin;
ChapterUrlAccess = UrlAccess;
if not utilities.is_set (ChapterURL) and utilities.is_set (TitleLink) then
Chapter = utilities.make_wikilink (TitleLink, Chapter);
end
Title = Periodical;
ChapterFormat = Format;
Periodical = ''; -- redundant so unset
TransTitle = '';
URL = '';
Format = '';
TitleLink = '';
ScriptTitle = '';
end
elseif utilities.is_set (Chapter) or utilities.is_set (ScriptChapter) then -- |title= not set
Title = Periodical; -- |encyclopedia= set and |article= set so map |encyclopedia= to |title= for rendering
Periodical = ''; -- redundant so unset
end
end
end
-- special case for cite techreport.
local ID = A['ID'];
if (config.CitationClass == "techreport") then -- special case for cite techreport
if utilities.is_set (A['Number']) then -- cite techreport uses 'number', which other citations alias to 'issue'
if not utilities.is_set (ID) then -- can we use ID for the "number"?
ID = A['Number']; -- yes, use it
else -- ID has a value so emit error message
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'id') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'number')});
end
end
end
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.
local ChapterLink -- = A['ChapterLink']; -- deprecated as a parameter but still used internally by cite episode
local Conference = A['Conference'];
local BookTitle = A['BookTitle'];
local TransTitle_origin = A:ORIGIN ('TransTitle');
if 'conference' == config.CitationClass then
if utilities.is_set (BookTitle) then
Chapter = Title;
Chapter_origin = 'title';
-- ChapterLink = TitleLink; -- |chapter-link= is deprecated
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
URL_origin = '';
ChapterFormat = Format;
TransChapter = TransTitle;
TransChapter_origin = TransTitle_origin;
Title = BookTitle;
Format = '';
-- TitleLink = '';
TransTitle = '';
URL = '';
end
elseif 'speech' ~= config.CitationClass then
Conference = ''; -- not cite conference or cite speech so make sure this is empty string
end
-- CS1/2 mode
local Mode;
if cfg.global_cs1_config_t['Mode'] then -- global setting in {{cs1 config}} overrides local |mode= parameter value; nil when empty or assigned value invalid
Mode = is_valid_parameter_value (cfg.global_cs1_config_t['Mode'], 'cs1 config: mode', cfg.keywords_lists['mode'], ''); -- error messaging 'param' here is a hoax
else
Mode = is_valid_parameter_value (A['Mode'], A:ORIGIN('Mode'), cfg.keywords_lists['mode'], '');
end
if cfg.global_cs1_config_t['Mode'] and utilities.is_set (A['Mode']) then -- when template has |mode=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
-- separator character and postscript
local sepc, PostScript = set_style (Mode:lower(), A['PostScript'], config.CitationClass);
-- controls capitalization of certain static text
local use_lowercase = ( sepc == ',' );
-- cite map oddities
local Cartography = "";
local Scale = "";
local Sheet = A['Sheet'] or '';
local Sheets = A['Sheets'] or '';
if config.CitationClass == "map" then
if utilities.is_set (Chapter) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'map') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', Chapter_origin)}); -- add error message
end
Chapter = A['Map'];
Chapter_origin = A:ORIGIN('Map');
ChapterURL = A['MapURL'];
ChapterURL_origin = A:ORIGIN('MapURL');
TransChapter = A['TransMap'];
ScriptChapter = A['ScriptMap']
ScriptChapter_origin = A:ORIGIN('ScriptMap')
ChapterUrlAccess = MapUrlAccess;
ChapterFormat = A['MapFormat'];
Cartography = A['Cartography'];
if utilities.is_set ( Cartography ) then
Cartography = sepc .. " " .. wrap_msg ('cartography', Cartography, use_lowercase);
end
Scale = A['Scale'];
if utilities.is_set ( Scale ) then
Scale = sepc .. " " .. Scale;
end
end
-- Account for the oddities that are {{cite episode}} and {{cite serial}}, before generation of COinS data.
local Series = A['Series'];
if 'episode' == config.CitationClass or 'serial' == config.CitationClass then
local SeriesLink = A['SeriesLink'];
SeriesLink = link_title_ok (SeriesLink, A:ORIGIN ('SeriesLink'), Series, 'series'); -- check for wiki-markup in |series-link= or wiki-markup in |series= when |series-link= is set
local Network = A['Network'];
local Station = A['Station'];
local s, n = {}, {};
-- do common parameters first
if utilities.is_set (Network) then table.insert(n, Network); end
if utilities.is_set (Station) then table.insert(n, Station); end
ID = table.concat(n, sepc .. ' ');
if 'episode' == config.CitationClass then -- handle the oddities that are strictly {{cite episode}}
local Season = A['Season'];
local SeriesNumber = A['SeriesNumber'];
if utilities.is_set (Season) and utilities.is_set (SeriesNumber) then -- these are mutually exclusive so if both are set TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'season') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'seriesno')}); -- add error message
SeriesNumber = ''; -- unset; prefer |season= over |seriesno=
end
-- assemble a table of parts concatenated later into Series
if utilities.is_set (Season) then table.insert(s, wrap_msg ('season', Season, use_lowercase)); end
if utilities.is_set (SeriesNumber) then table.insert(s, wrap_msg ('seriesnum', SeriesNumber, use_lowercase)); end
if utilities.is_set (Issue) then table.insert(s, wrap_msg ('episode', Issue, use_lowercase)); end
Issue = ''; -- unset because this is not a unique parameter
Chapter = Title; -- promote title parameters to chapter
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle');
ChapterLink = TitleLink; -- alias |episode-link=
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
ChapterFormat = Format;
Title = Series; -- promote series to title
TitleLink = SeriesLink;
Series = table.concat(s, sepc .. ' '); -- this is concatenation of season, seriesno, episode number
if utilities.is_set (ChapterLink) and not utilities.is_set (ChapterURL) then -- link but not URL
Chapter = utilities.make_wikilink (ChapterLink, Chapter);
elseif utilities.is_set (ChapterLink) and utilities.is_set (ChapterURL) then -- if both are set, URL links episode;
Series = utilities.make_wikilink (ChapterLink, Series);
end
URL = ''; -- unset
TransTitle = '';
ScriptTitle = '';
Format = '';
else -- now oddities that are cite serial
Issue = ''; -- unset because this parameter no longer supported by the citation/core version of cite serial
Chapter = A['Episode']; -- TODO: make |episode= available to cite episode someday?
if utilities.is_set (Series) and utilities.is_set (SeriesLink) then
Series = utilities.make_wikilink (SeriesLink, Series);
end
Series = utilities.wrap_style ('italic-title', Series); -- series is italicized
end
end
-- end of {{cite episode}} stuff
-- handle type parameter for those CS1 citations that have default values
local TitleType = A['TitleType'];
local Degree = A['Degree'];
if utilities.in_array (config.CitationClass, {'AV-media-notes', 'document', 'interview', 'mailinglist', 'map', 'podcast', 'pressrelease', 'report', 'speech', 'techreport', 'thesis'}) then
TitleType = set_titletype (config.CitationClass, TitleType);
if utilities.is_set (Degree) and "Thesis" == TitleType then -- special case for cite thesis
TitleType = Degree .. ' ' .. cfg.title_types ['thesis']:lower();
end
end
if utilities.is_set (TitleType) then -- if type parameter is specified
TitleType = utilities.substitute ( cfg.messages['type'], TitleType); -- display it in parentheses
-- TODO: Hack on TitleType to fix bunched parentheses problem
end
-- legacy: promote PublicationDate to Date if neither Date nor Year are set.
local Date = A['Date'];
local Date_origin; -- to hold the name of parameter promoted to Date; required for date error messaging
local PublicationDate = A['PublicationDate'];
local Year = A['Year'];
if not utilities.is_set (Date) then
Date = Year; -- promote Year to Date
Year = nil; -- make nil so Year as empty string isn't used for CITEREF
if not utilities.is_set (Date) and utilities.is_set (PublicationDate) then -- use PublicationDate when |date= and |year= are not set
Date = PublicationDate; -- promote PublicationDate to Date
PublicationDate = ''; -- unset, no longer needed
Date_origin = A:ORIGIN('PublicationDate'); -- save the name of the promoted parameter
else
Date_origin = A:ORIGIN('Year'); -- save the name of the promoted parameter
end
else
Date_origin = A:ORIGIN('Date'); -- not a promotion; name required for error messaging
end
if PublicationDate == Date then PublicationDate = ''; end -- if PublicationDate is same as Date, don't display in rendered citation
--[[
Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where
we get the date used in the metadata.
Date validation supporting code is in Module:Citation/CS1/Date_validation
]]
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], '');
if not utilities.is_set (DF) then
DF = cfg.global_df; -- local |df= if present overrides global df set by {{use xxx date}} template
end
local ArchiveURL;
local ArchiveDate;
local ArchiveFormat = A['ArchiveFormat'];
local archive_url_timestamp; -- timestamp from wayback machine url
ArchiveURL, ArchiveDate, archive_url_timestamp = archive_url_check (A['ArchiveURL'], A['ArchiveDate'])
ArchiveFormat = style_format (ArchiveFormat, ArchiveURL, 'archive-format', 'archive-url');
ArchiveURL, ArchiveDate = is_unique_archive_url (ArchiveURL, URL, ChapterURL, A:ORIGIN('ArchiveURL'), ArchiveDate); -- add error message when URL or ChapterURL == ArchiveURL
local AccessDate = A['AccessDate'];
-- local LayDate = A['LayDate'];
local COinS_date = {}; -- holds date info extracted from |date= for the COinS metadata by Module:Date verification
local DoiBroken = A['DoiBroken'];
local Embargo = A['Embargo'];
local anchor_year; -- used in the CITEREF identifier
do -- create defined block to contain local variables error_message, date_parameters_list, mismatch
local error_message = '';
-- AirDate has been promoted to Date so not necessary to check it
local date_parameters_list = {
['access-date'] = {val = AccessDate, name = A:ORIGIN ('AccessDate')},
['archive-date'] = {val = ArchiveDate, name = A:ORIGIN ('ArchiveDate')},
['date'] = {val = Date, name = Date_origin},
['doi-broken-date'] = {val = DoiBroken, name = A:ORIGIN ('DoiBroken')},
['pmc-embargo-date'] = {val = Embargo, name = A:ORIGIN ('Embargo')},
-- ['lay-date'] = {val = LayDate, name = A:ORIGIN ('LayDate')},
['publication-date'] = {val = PublicationDate, name = A:ORIGIN ('PublicationDate')},
['year'] = {val = Year, name = A:ORIGIN ('Year')},
};
local error_list = {};
anchor_year, Embargo = validation.dates(date_parameters_list, COinS_date, error_list);
-- start temporary Julian / Gregorian calendar uncertainty categorization
if COinS_date.inter_cal_cat then
utilities.add_prop_cat ('jul-greg-uncertainty');
end
-- end temporary Julian / Gregorian calendar uncertainty categorization
if utilities.is_set (Year) and utilities.is_set (Date) then -- both |date= and |year= not normally needed;
validation.year_date_check (Year, A:ORIGIN ('Year'), Date, A:ORIGIN ('Date'), error_list);
end
if 0 == #error_list then -- error free dates only; 0 when error_list is empty
local modified = false; -- flag
if utilities.is_set (DF) then -- if we need to reformat dates
modified = validation.reformat_dates (date_parameters_list, DF); -- reformat to DF format, use long month names if appropriate
end
if true == validation.date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate
modified = true;
utilities.set_message ('maint_date_format'); -- hyphens were converted so add maint category
end
-- for those wikis that can and want to have English date names translated to the local language; not supported at en.wiki
if cfg.date_name_auto_xlate_enable and validation.date_name_xlate (date_parameters_list, cfg.date_digit_auto_xlate_enable ) then
utilities.set_message ('maint_date_auto_xlated'); -- add maint cat
modified = true;
end
if modified then -- if the date_parameters_list values were modified
AccessDate = date_parameters_list['access-date'].val; -- overwrite date holding parameters with modified values
ArchiveDate = date_parameters_list['archive-date'].val;
Date = date_parameters_list['date'].val;
DoiBroken = date_parameters_list['doi-broken-date'].val;
-- LayDate = date_parameters_list['lay-date'].val;
PublicationDate = date_parameters_list['publication-date'].val;
end
if archive_url_timestamp and utilities.is_set (ArchiveDate) then
validation.archive_date_check (ArchiveDate, archive_url_timestamp); -- does YYYYMMDD in archive_url_timestamp match date in ArchiveDate
end
else
utilities.set_message ('err_bad_date', {utilities.make_sep_list (#error_list, error_list)}); -- add this error message
end
end -- end of do
if utilities.in_array (config.CitationClass, {'book', 'encyclopaedia'}) or -- {{cite book}}, {{cite encyclopedia}}; TODO: {{cite conference}} and others?
('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) or -- {{citation}} as an encylopedia citation
('citation' == config.CitationClass and not utilities.is_set (Periodical)) then -- {{citation}} as a book citation
if utilities.is_set (PublicationPlace) then
if not utilities.is_set (PublisherName) then
local date = COinS_date.rftdate and tonumber (COinS_date.rftdate:match ('%d%d%d%d')); -- get year portion of COinS date (because in Arabic numerals); convert string to number
if date and (1850 <= date) then -- location has no publisher; if date is 1850 or later
utilities.set_message ('maint_location_no_publisher'); -- add maint cat
end
else -- PublisherName has a value
if cfg.keywords_xlate['none'] == PublisherName then -- if that value is 'none' (only for book and encyclopedia citations)
PublisherName = ''; -- unset
end
end
end
end
local ID_list = {}; -- sequence table of rendered identifiers
local ID_list_coins = {}; -- table of identifiers and their values from args; key is same as cfg.id_handlers's key
local Class = A['Class']; -- arxiv class identifier
local ID_support = {
{A['ASINTLD'], 'ASIN', 'err_asintld_missing_asin', A:ORIGIN ('ASINTLD')},
{DoiBroken, 'DOI', 'err_doibroken_missing_doi', A:ORIGIN ('DoiBroken')},
{Embargo, 'PMC', 'err_embargo_missing_pmc', A:ORIGIN ('Embargo')},
}
ID_list, ID_list_coins = identifiers.identifier_lists_get (args, {DoiBroken = DoiBroken, ASINTLD = A['ASINTLD'], Embargo = Embargo, Class = Class}, ID_support);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, {{cite ssrn}}, before generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then -- |arxiv= or |eprint= required for cite arxiv; |biorxiv=, |citeseerx=, |medrxiv=, |ssrn= required for their templates
if not (args[cfg.id_handlers[config.CitationClass:upper()].parameters[1]] or -- can't use ID_list_coins k/v table here because invalid parameters omitted
args[cfg.id_handlers[config.CitationClass:upper()].parameters[2]]) then -- which causes unexpected parameter missing error message
utilities.set_message ('err_' .. config.CitationClass .. '_missing'); -- add error message
end
Periodical = ({['arxiv'] = 'arXiv', ['biorxiv'] = 'bioRxiv', ['citeseerx'] = 'CiteSeerX', ['medrxiv'] = 'medRxiv', ['ssrn'] = 'Social Science Research Network'})[config.CitationClass];
end
-- Link the title of the work if no |url= was provided, but we have a |pmc= or a |doi= with |doi-access=free
if config.CitationClass == "journal" and not utilities.is_set (URL) and not utilities.is_set (TitleLink) and not utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) then -- TODO: remove 'none' once existing citations have been switched to 'off', so 'none' can be used as token for "no title" instead
if 'none' ~= cfg.keywords_xlate[auto_select] then -- if auto-linking not disabled
if identifiers.auto_link_urls[auto_select] then -- manual selection
URL = identifiers.auto_link_urls[auto_select]; -- set URL to be the same as identifier's external link
URL_origin = cfg.id_handlers[auto_select:upper()].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['pmc'] then -- auto-select PMC
URL = identifiers.auto_link_urls['pmc']; -- set URL to be the same as the PMC external link if not embargoed
URL_origin = cfg.id_handlers['PMC'].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['doi'] then -- auto-select DOI
URL = identifiers.auto_link_urls['doi'];
URL_origin = cfg.id_handlers['DOI'].parameters[1];
end
end
if utilities.is_set (URL) then -- set when using an identifier-created URL
if utilities.is_set (AccessDate) then -- |access-date= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_accessdate_missing_url'); -- add an error message
AccessDate = ''; -- unset
end
if utilities.is_set (ArchiveURL) then -- |archive-url= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_archive_missing_url'); -- add an error message
ArchiveURL = ''; -- unset
end
end
end
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
-- Test if citation has no title
if not utilities.is_set (Title) and not utilities.is_set (TransTitle) and not utilities.is_set (ScriptTitle) then -- has special case for cite episode
utilities.set_message ('err_citation_missing_title', {'episode' == config.CitationClass and 'series' or 'title'});
end
if utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) and
utilities.in_array (config.CitationClass, {'journal', 'citation'}) and
(utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and
('journal' == Periodical_origin or 'script-journal' == ScriptPeriodical_origin) then -- special case for journal cites
Title = ''; -- set title to empty string
utilities.set_message ('maint_untitled'); -- add maint cat
end
-- COinS metadata (see <http://ocoins.info/>) for automated parsing of citation information.
-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that
-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title
-- is the article title, and Chapter is a section within the article. So, we remap
local coins_chapter = Chapter; -- default assuming that remapping not required
local coins_title = Title; -- et tu
if 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Chapter) and utilities.is_set (Title) and utilities.is_set (Periodical) then -- if all are used then
coins_chapter = Title; -- remap
coins_title = Periodical;
end
end
local coins_author = a; -- default for coins rft.au
if 0 < #c then -- but if contributor list
coins_author = c; -- use that instead
end
-- this is the function call to COinS()
local OCinSoutput = metadata.COinS({
['Periodical'] = utilities.strip_apostrophe_markup (Periodical), -- no markup in the metadata
['Encyclopedia'] = Encyclopedia, -- just a flag; content ignored by ~/COinS
['Chapter'] = metadata.make_coins_title (coins_chapter, ScriptChapter), -- Chapter and ScriptChapter stripped of bold / italic / accept-as-written markup
['Degree'] = Degree; -- cite thesis only
['Title'] = metadata.make_coins_title (coins_title, ScriptTitle), -- Title and ScriptTitle stripped of bold / italic / accept-as-written markup
['PublicationPlace'] = PublicationPlace,
['Date'] = COinS_date.rftdate, -- COinS_date.* has correctly formatted date values if Date is valid;
['Season'] = COinS_date.rftssn,
['Quarter'] = COinS_date.rftquarter,
['Chron'] = COinS_date.rftchron,
['Series'] = Series,
['Volume'] = Volume,
['Issue'] = Issue,
['ArticleNumber'] = ArticleNumber,
['Pages'] = coins_pages or metadata.get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At, QuotePage, QuotePages}, 7)), -- pages stripped of external links
['Edition'] = Edition,
['PublisherName'] = PublisherName or Newsgroup, -- any apostrophe markup already removed from PublisherName
['URL'] = first_set ({ChapterURL, URL}, 2),
['Authors'] = coins_author,
['ID_list'] = ID_list_coins,
['RawPage'] = this_page.prefixedText,
}, config.CitationClass);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, and {{cite ssrn}} AFTER generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then -- we have set rft.jtitle in COinS to arXiv, bioRxiv, CiteSeerX, medRxiv, or ssrn now unset so it isn't displayed
Periodical = ''; -- periodical not allowed in these templates; if article has been published, use cite journal
end
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername to include some static text
if 'newsgroup' == config.CitationClass and utilities.is_set (Newsgroup) then
PublisherName = utilities.substitute (cfg.messages['newsgroup'], external_link( 'news:' .. Newsgroup, Newsgroup, Newsgroup_origin, nil ));
end
local Editors;
local EditorCount; -- used only for choosing {ed.) or (eds.) annotation at end of editor name-list
local Contributors; -- assembled contributors name list
local contributor_etal;
local Translators; -- assembled translators name list
local translator_etal;
local t = {}; -- translators list from |translator-lastn= / translator-firstn= pairs
t = extract_names (args, 'TranslatorList'); -- fetch translator list from |translatorn= / |translator-lastn=, -firstn=, -linkn=, -maskn=
local Interviewers;
local interviewers_list = {};
interviewers_list = extract_names (args, 'InterviewerList'); -- process preferred interviewers parameters
local interviewer_etal;
-- Now perform various field substitutions.
-- We also add leading spaces and surrounding markup and punctuation to the
-- various parts of the citation, but only when they are non-nil.
do
local last_first_list;
local control = {
format = NameListStyle, -- empty string, '&', 'amp', 'and', or 'vanc'
maximum = nil, -- as if display-authors or display-editors not set
mode = Mode
};
do -- do editor name list first because the now unsupported coauthors used to modify control table
if cfg.global_cs1_config_t['DisplayEditors'] then -- global setting from {{cs1 config}} overrides local setting
control.maximum , editor_etal = get_display_names (cfg.global_cs1_config_t['DisplayEditors'], #e, 'editors', editor_etal, 'cs1 config');
else
control.maximum , editor_etal = get_display_names (A['DisplayEditors'], #e, 'editors', editor_etal, A:ORIGIN ('DisplayEditors'));
end
if cfg.global_cs1_config_t['DisplayEditors'] and utilities.is_set (A['DisplayEditors']) then -- when template has |display-editors=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
Editors, EditorCount = list_people (control, e, editor_etal);
if 1 == EditorCount and (true == editor_etal or 1 < #e) then -- only one editor displayed but includes etal then
EditorCount = 2; -- spoof to display (eds.) annotation
end
end
do -- now do interviewers
if cfg.global_cs1_config_t['DisplayInterviewers'] then -- global setting from {{cs1 config}} overrides local setting
control.maximum, interviewer_etal = get_display_names (cfg.global_cs1_config_t['DisplayInterviewers'], #interviewers_list, 'interviewers', interviewer_etal, 'cs1 config');
else
control.maximum, interviewer_etal = get_display_names (A['DisplayInterviewers'], #interviewers_list, 'interviewers', interviewer_etal, A:ORIGIN ('DisplayInterviewers'));
end
if cfg.global_cs1_config_t['DisplayInterviewers'] and utilities.is_set (A['DisplayInterviewers']) then -- when template has |display-interviewers=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
Interviewers = list_people (control, interviewers_list, interviewer_etal);
end
do -- now do translators
if cfg.global_cs1_config_t['DisplayTranslators'] then -- global setting from {{cs1 config}} overrides local setting
control.maximum, translator_etal = get_display_names (cfg.global_cs1_config_t['DisplayTranslators'], #t, 'translators', translator_etal, 'cs1 config');
else
control.maximum, translator_etal = get_display_names (A['DisplayTranslators'], #t, 'translators', translator_etal, A:ORIGIN ('DisplayTranslators'));
end
if cfg.global_cs1_config_t['DisplayTranslators'] and utilities.is_set (A['DisplayTranslators']) then -- when template has |display-translators=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
Translators = list_people (control, t, translator_etal);
end
do -- now do contributors
if cfg.global_cs1_config_t['DisplayContributors'] then -- global setting from {{cs1 config}} overrides local setting
control.maximum, contributor_etal = get_display_names (cfg.global_cs1_config_t['DisplayContributors'], #c, 'contributors', contributor_etal, 'cs1 config');
else
control.maximum, contributor_etal = get_display_names (A['DisplayContributors'], #c, 'contributors', contributor_etal, A:ORIGIN ('DisplayContributors'));
end
if cfg.global_cs1_config_t['DisplayContributors'] and utilities.is_set (A['DisplayContributors']) then -- when template has |display-contributors=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
Contributors = list_people (control, c, contributor_etal);
end
do -- now do authors
if cfg.global_cs1_config_t['DisplayAuthors'] then -- global setting from {{cs1 config}} overrides local setting
control.maximum, author_etal = get_display_names (cfg.global_cs1_config_t['DisplayAuthors'], #a, 'authors', author_etal, 'cs1 config');
else
control.maximum, author_etal = get_display_names (A['DisplayAuthors'], #a, 'authors', author_etal, A:ORIGIN ('DisplayAuthors'));
end
if cfg.global_cs1_config_t['DisplayAuthors'] and utilities.is_set (A['DisplayAuthors']) then -- when template has |display-authors=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
last_first_list = list_people (control, a, author_etal);
if utilities.is_set (Authors) then
Authors, author_etal = name_has_etal (Authors, author_etal, false, 'authors'); -- find and remove variations on et al.
if author_etal then
Authors = Authors .. ' ' .. cfg.messages['et al']; -- add et al. to authors parameter
end
else
Authors = last_first_list; -- either an author name list or an empty string
end
end -- end of do
if utilities.is_set (Authors) and utilities.is_set (Collaboration) then
Authors = Authors .. ' (' .. Collaboration .. ')'; -- add collaboration after et al.
end
end
local ConferenceFormat = A['ConferenceFormat'];
local ConferenceURL = A['ConferenceURL'];
ConferenceFormat = style_format (ConferenceFormat, ConferenceURL, 'conference-format', 'conference-url');
Format = style_format (Format, URL, 'format', 'url');
-- special case for chapter format so no error message or cat when chapter not supported
if not (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia))) then
ChapterFormat = style_format (ChapterFormat, ChapterURL, 'chapter-format', 'chapter-url');
end
if not utilities.is_set (URL) then
if utilities.in_array (config.CitationClass, {"web", "podcast", "mailinglist"}) or -- |url= required for cite web, cite podcast, and cite mailinglist
('citation' == config.CitationClass and ('website' == Periodical_origin or 'script-website' == ScriptPeriodical_origin)) then -- and required for {{citation}} with |website= or |script-website=
utilities.set_message ('err_cite_web_url');
end
-- do we have |accessdate= without either |url= or |chapter-url=?
if utilities.is_set (AccessDate) and not utilities.is_set (ChapterURL) then -- ChapterURL may be set when URL is not set;
utilities.set_message ('err_accessdate_missing_url');
AccessDate = '';
end
end
local UrlStatus = is_valid_parameter_value (A['UrlStatus'], A:ORIGIN('UrlStatus'), cfg.keywords_lists['url-status'], '');
local OriginalURL
local OriginalURL_origin
local OriginalFormat
local OriginalAccess;
UrlStatus = UrlStatus:lower(); -- used later when assembling archived text
if utilities.is_set ( ArchiveURL ) then
if utilities.is_set (ChapterURL) then -- if chapter-url= is set apply archive url to it
OriginalURL = ChapterURL; -- save copy of source chapter's url for archive text
OriginalURL_origin = ChapterURL_origin; -- name of |chapter-url= parameter for error messages
OriginalFormat = ChapterFormat; -- and original |chapter-format=
if 'live' ~= UrlStatus then
ChapterURL = ArchiveURL -- swap-in the archive's URL
ChapterURL_origin = A:ORIGIN('ArchiveURL') -- name of |archive-url= parameter for error messages
ChapterFormat = ArchiveFormat or ''; -- swap in archive's format
ChapterUrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
elseif utilities.is_set (URL) then
OriginalURL = URL; -- save copy of original source URL
OriginalURL_origin = URL_origin; -- name of URL parameter for error messages
OriginalFormat = Format; -- and original |format=
OriginalAccess = UrlAccess;
if 'live' ~= UrlStatus then -- if URL set then |archive-url= applies to it
URL = ArchiveURL -- swap-in the archive's URL
URL_origin = A:ORIGIN('ArchiveURL') -- name of archive URL parameter for error messages
Format = ArchiveFormat or ''; -- swap in archive's format
UrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
end
elseif utilities.is_set (UrlStatus) then -- if |url-status= is set when |archive-url= is not set
utilities.set_message ('maint_url_status'); -- add maint cat
end
if utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or -- if any of the 'periodical' cites except encyclopedia
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) then
local chap_param;
if utilities.is_set (Chapter) then -- get a parameter name from one of these chapter related meta-parameters
chap_param = A:ORIGIN ('Chapter')
elseif utilities.is_set (TransChapter) then
chap_param = A:ORIGIN ('TransChapter')
elseif utilities.is_set (ChapterURL) then
chap_param = A:ORIGIN ('ChapterURL')
elseif utilities.is_set (ScriptChapter) then
chap_param = ScriptChapter_origin;
else utilities.is_set (ChapterFormat)
chap_param = A:ORIGIN ('ChapterFormat')
end
if utilities.is_set (chap_param) then -- if we found one
utilities.set_message ('err_chapter_ignored', {chap_param}); -- add error message
Chapter = ''; -- and set them to empty string to be safe with concatenation
TransChapter = '';
ChapterURL = '';
ScriptChapter = '';
ChapterFormat = '';
end
else -- otherwise, format chapter / article title
local no_quotes = false; -- default assume that we will be quoting the chapter parameter value
if utilities.is_set (Contribution) and 0 < #c then -- if this is a contribution with contributor(s)
if utilities.in_array (Contribution:lower(), cfg.keywords_lists.contribution) then -- and a generic contribution title
no_quotes = true; -- then render it unquoted
end
end
Chapter = format_chapter_title (ScriptChapter, ScriptChapter_origin, Chapter, Chapter_origin, TransChapter, TransChapter_origin, ChapterURL, ChapterURL_origin, no_quotes, ChapterUrlAccess); -- Contribution is also in Chapter
if utilities.is_set (Chapter) then
Chapter = Chapter .. ChapterFormat ;
if 'map' == config.CitationClass and utilities.is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType; -- map annotation here; not after title
end
Chapter = Chapter .. sepc .. ' ';
elseif utilities.is_set (ChapterFormat) then -- |chapter= not set but |chapter-format= is so ...
Chapter = ChapterFormat .. sepc .. ' '; -- ... ChapterFormat has error message, we want to see it
end
end
-- Format main title
local plain_title = false;
local accept_title;
Title, accept_title = utilities.has_accept_as_written (Title, true); -- remove accept-this-as-written markup when it wraps all of <Title>
if accept_title and ('' == Title) then -- only support forced empty for now "(())"
Title = cfg.messages['notitle']; -- replace by predefined "No title" message
-- TODO: utilities.set_message ( 'err_redundant_parameters', ...); -- issue proper error message instead of muting
ScriptTitle = ''; -- just mute for now
TransTitle = ''; -- just mute for now
plain_title = true; -- suppress text decoration for descriptive title
utilities.set_message ('maint_untitled'); -- add maint cat
end
if not accept_title then -- <Title> not wrapped in accept-as-written markup
if '...' == Title:sub (-3) then -- if ellipsis is the last three characters of |title=
Title = Title:gsub ('(%.%.%.)%.+$', '%1'); -- limit the number of dots to three
elseif not mw.ustring.find (Title, '%.%s*%a%.$') and -- end of title is not a 'dot-(optional space-)letter-dot' initialism ...
not mw.ustring.find (Title, '%s+%a%.$') then -- ...and not a 'space-letter-dot' initial (''Allium canadense'' L.)
Title = mw.ustring.gsub(Title, '%' .. sepc .. '$', ''); -- remove any trailing separator character; sepc and ms.ustring() here for languages that use multibyte separator characters
end
if utilities.is_set (ArchiveURL) and is_archived_copy (Title) then
utilities.set_message ('maint_archived_copy'); -- add maintenance category before we modify the content of Title
end
if is_generic ('generic_titles', Title) then
utilities.set_message ('err_generic_title'); -- set an error message
end
end
if (not plain_title) and (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'document', 'pressrelease', 'podcast', 'newsgroup', 'mailinglist', 'interview', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) or
('map' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)))) then -- special case for cite map when the map is in a periodical treat as an article
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from module provided quote marks
Title = utilities.wrap_style ('quoted-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle );
elseif plain_title or ('report' == config.CitationClass) then -- no styling for cite report and descriptive titles (otherwise same as above)
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle ); -- for cite report, use this form for trans-title
else
Title = utilities.wrap_style ('italic-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-italic-title', TransTitle);
end
if utilities.is_set (TransTitle) then
if utilities.is_set (Title) then
TransTitle = " " .. TransTitle;
else
utilities.set_message ('err_trans_missing_title', {'title'});
end
end
if utilities.is_set (Title) then -- TODO: is this the right place to be making Wikisource URLs?
if utilities.is_set (TitleLink) and utilities.is_set (URL) then
utilities.set_message ('err_wikilink_in_url'); -- set an error message because we can't have both
TitleLink = ''; -- unset
end
if not utilities.is_set (TitleLink) and utilities.is_set (URL) then
Title = external_link (URL, Title, URL_origin, UrlAccess) .. TransTitle .. Format;
URL = ''; -- unset these because no longer needed
Format = "";
elseif utilities.is_set (TitleLink) and not utilities.is_set (URL) then
local ws_url;
ws_url = wikisource_url_make (TitleLink); -- ignore ws_label return; not used here
if ws_url then
Title = external_link (ws_url, Title .. ' ', 'ws link in title-link'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], TitleLink, Title});
Title = Title .. TransTitle;
else
Title = utilities.make_wikilink (TitleLink, Title) .. TransTitle;
end
else
local ws_url, ws_label, L; -- Title has italic or quote markup by the time we get here which causes is_wikilink() to return 0 (not a wikilink)
ws_url, ws_label, L = wikisource_url_make (Title:gsub('^[\'"]*(.-)[\'"]*$', '%1')); -- make ws URL from |title= interwiki link (strip italic or quote markup); link portion L becomes tooltip label
if ws_url then
Title = Title:gsub ('%b[]', ws_label); -- replace interwiki link with ws_label to retain markup
Title = external_link (ws_url, Title .. ' ', 'ws link in title'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, Title});
Title = Title .. TransTitle;
else
Title = Title .. TransTitle;
end
end
else
Title = TransTitle;
end
if utilities.is_set (Place) then
Place = " " .. wrap_msg ('written', Place, use_lowercase) .. sepc .. " ";
end
local ConferenceURL_origin = A:ORIGIN('ConferenceURL'); -- get name of parameter that holds ConferenceURL
if utilities.is_set (Conference) then
if utilities.is_set (ConferenceURL) then
Conference = external_link( ConferenceURL, Conference, ConferenceURL_origin, nil );
end
Conference = sepc .. " " .. Conference .. ConferenceFormat;
elseif utilities.is_set (ConferenceURL) then
Conference = sepc .. " " .. external_link( ConferenceURL, nil, ConferenceURL_origin, nil );
end
local Position = '';
if not utilities.is_set (Position) then
local Minutes = A['Minutes'];
local Time = A['Time'];
if utilities.is_set (Minutes) then
if utilities.is_set (Time) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'minutes') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'time')});
end
Position = " " .. Minutes .. " " .. cfg.messages['minutes'];
else
if utilities.is_set (Time) then
local TimeCaption = A['TimeCaption']
if not utilities.is_set (TimeCaption) then
TimeCaption = cfg.messages['event'];
if sepc ~= '.' then
TimeCaption = TimeCaption:lower();
end
end
Position = " " .. TimeCaption .. " " .. Time;
end
end
else
Position = " " .. Position;
At = '';
end
Page, Pages, Sheet, Sheets = format_pages_sheets (Page, Pages, Sheet, Sheets, config.CitationClass, Periodical_origin, sepc, NoPP, use_lowercase);
At = utilities.is_set (At) and (sepc .. " " .. At) or "";
Position = utilities.is_set (Position) and (sepc .. " " .. Position) or "";
if config.CitationClass == 'map' then
local Sections = A['Sections']; -- Section (singular) is an alias of Chapter so set earlier
local Inset = A['Inset'];
if utilities.is_set ( Inset ) then
Inset = sepc .. " " .. wrap_msg ('inset', Inset, use_lowercase);
end
if utilities.is_set ( Sections ) then
Section = sepc .. " " .. wrap_msg ('sections', Sections, use_lowercase);
elseif utilities.is_set ( Section ) then
Section = sepc .. " " .. wrap_msg ('section', Section, use_lowercase);
end
At = At .. Inset .. Section;
end
local Others = A['Others'];
if utilities.is_set (Others) and 0 == #a and 0 == #e then -- add maint cat when |others= has value and used without |author=, |editor=
if config.CitationClass == "AV-media-notes"
or config.CitationClass == "audio-visual" then -- special maint for AV/M which has a lot of 'false' positives right now
utilities.set_message ('maint_others_avm')
else
utilities.set_message ('maint_others');
end
end
Others = utilities.is_set (Others) and (sepc .. " " .. Others) or "";
if utilities.is_set (Translators) then
Others = safe_join ({sepc .. ' ', wrap_msg ('translated', Translators, use_lowercase), Others}, sepc);
end
if utilities.is_set (Interviewers) then
Others = safe_join ({sepc .. ' ', wrap_msg ('interview', Interviewers, use_lowercase), Others}, sepc);
end
local TitleNote = A['TitleNote'];
TitleNote = utilities.is_set (TitleNote) and (sepc .. " " .. TitleNote) or "";
if utilities.is_set (Edition) then
if Edition:match ('%f[%a][Ee]d%n?%.?$') or Edition:match ('%f[%a][Ee]dition$') then -- Ed, ed, Ed., ed., Edn, edn, Edn., edn.
utilities.set_message ('err_extra_text_edition'); -- add error message
end
Edition = " " .. wrap_msg ('edition', Edition);
else
Edition = '';
end
Series = utilities.is_set (Series) and wrap_msg ('series', {sepc, Series}) or ""; -- not the same as SeriesNum
local Agency = A['Agency'];
Agency = utilities.is_set (Agency) and wrap_msg ('agency', {sepc, Agency}) or "";
Volume = format_volume_issue (Volume, Issue, ArticleNumber, config.CitationClass, Periodical_origin, sepc, use_lowercase);
if utilities.is_set (AccessDate) then
local retrv_text = " " .. cfg.messages['retrieved']
AccessDate = nowrap_date (AccessDate); -- wrap in nowrap span if date in appropriate format
if (sepc ~= ".") then retrv_text = retrv_text:lower() end -- if mode is cs2, lower case
AccessDate = utilities.substitute (retrv_text, AccessDate); -- add retrieved text
AccessDate = utilities.substitute (cfg.presentation['accessdate'], {sepc, AccessDate}); -- allow editors to hide accessdates
end
if utilities.is_set (ID) then ID = sepc .. " " .. ID; end
local Docket = A['Docket'];
if "thesis" == config.CitationClass and utilities.is_set (Docket) then
ID = sepc .. " Docket " .. Docket .. ID;
end
if "report" == config.CitationClass and utilities.is_set (Docket) then -- for cite report when |docket= is set
ID = sepc .. ' ' .. Docket; -- overwrite ID even if |id= is set
end
if utilities.is_set (URL) then
URL = " " .. external_link( URL, nil, URL_origin, UrlAccess );
end
local Quote = A['Quote'];
local TransQuote = A['TransQuote'];
local ScriptQuote = A['ScriptQuote'];
if utilities.is_set (Quote) or utilities.is_set (TransQuote) or utilities.is_set (ScriptQuote) then
if utilities.is_set (Quote) then
if Quote:sub(1, 1) == '"' and Quote:sub(-1, -1) == '"' then -- if first and last characters of quote are quote marks
Quote = Quote:sub(2, -2); -- strip them off
end
end
Quote = kern_quotes (Quote); -- kern if needed
Quote = utilities.wrap_style ('quoted-text', Quote ); -- wrap in <q>...</q> tags
if utilities.is_set (ScriptQuote) then
Quote = script_concatenate (Quote, ScriptQuote, 'script-quote'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after quote is wrapped
end
if utilities.is_set (TransQuote) then
if TransQuote:sub(1, 1) == '"' and TransQuote:sub(-1, -1) == '"' then -- if first and last characters of |trans-quote are quote marks
TransQuote = TransQuote:sub(2, -2); -- strip them off
end
Quote = Quote .. " " .. utilities.wrap_style ('trans-quoted-title', TransQuote );
end
if utilities.is_set (QuotePage) or utilities.is_set (QuotePages) then -- add page prefix
local quote_prefix = '';
if utilities.is_set (QuotePage) then
extra_text_in_page_check (QuotePage, 'quote-page'); -- add to maint cat if |quote-page= value begins with what looks like p., pp., etc.
if not NoPP then
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePage}), '', '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePage}), '', '', '';
end
elseif utilities.is_set (QuotePages) then
extra_text_in_page_check (QuotePages, 'quote-pages'); -- add to maint cat if |quote-pages= value begins with what looks like p., pp., etc.
if tonumber(QuotePages) ~= nil and not NoPP then -- if only digits, assume single page
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePages}), '', '';
elseif not NoPP then
quote_prefix = utilities.substitute (cfg.messages['pp-prefix'], {sepc, QuotePages}), '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePages}), '', '';
end
end
Quote = quote_prefix .. ": " .. Quote;
else
Quote = sepc .. " " .. Quote;
end
PostScript = ""; -- cs1|2 does not supply terminal punctuation when |quote= is set
end
-- We check length of PostScript here because it will have been nuked by
-- the quote parameters. We'd otherwise emit a message even if there wasn't
-- a displayed postscript.
-- TODO: Should the max size (1) be configurable?
-- TODO: Should we check a specific pattern?
if utilities.is_set(PostScript) and mw.ustring.len(PostScript) > 1 then
utilities.set_message ('maint_postscript')
end
local Archived;
if utilities.is_set (ArchiveURL) then
if not utilities.is_set (ArchiveDate) then -- ArchiveURL set but ArchiveDate not set
utilities.set_message ('err_archive_missing_date'); -- emit an error message
ArchiveURL = ''; -- empty string for concatenation
ArchiveDate = ''; -- empty string for concatenation
end
else
if utilities.is_set (ArchiveDate) then -- ArchiveURL not set but ArchiveDate is set
utilities.set_message ('err_archive_date_missing_url'); -- emit an error message
ArchiveURL = ''; -- empty string for concatenation
ArchiveDate = ''; -- empty string for concatenation
end
end
if utilities.is_set (ArchiveURL) then
local arch_text;
-- if not utilities.is_set (ArchiveDate) then
-- utilities.set_message ('err_archive_missing_date');
-- ArchiveDate = ''; -- empty string for concatenation
-- end
if "live" == UrlStatus then
arch_text = cfg.messages['archived'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. ' ' .. utilities.substitute ( cfg.messages['archived-live'],
{external_link( ArchiveURL, arch_text, A:ORIGIN('ArchiveURL'), nil) .. ArchiveFormat, ArchiveDate } );
else
Archived = '';
end
if not utilities.is_set (OriginalURL) then
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (OriginalURL) then -- UrlStatus is empty, 'dead', 'unfit', 'usurped', 'bot: unknown'
if utilities.in_array (UrlStatus, {'unfit', 'usurped', 'bot: unknown'}) then
arch_text = cfg.messages['archived-unfit'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. ' ' .. arch_text .. ArchiveDate; -- format already styled
if 'bot: unknown' == UrlStatus then
utilities.set_message ('maint_bot_unknown'); -- and add a category if not already added
else
utilities.set_message ('maint_unfit'); -- and add a category if not already added
end
else -- UrlStatus is empty, 'dead'
arch_text = cfg.messages['archived-dead'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. " " .. utilities.substitute ( arch_text,
{ external_link( OriginalURL, cfg.messages['original'], OriginalURL_origin, OriginalAccess ) .. OriginalFormat, ArchiveDate } ); -- format already styled
else
Archived = ''; -- unset for concatenation
end
end
else -- OriginalUrl not set
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (ArchiveFormat) then
Archived = ArchiveFormat; -- if set and ArchiveURL not set ArchiveFormat has error message
else
Archived = '';
end
-- local Lay = '';
-- local LaySource = A['LaySource'];
-- local LayURL = A['LayURL'];
-- local LayFormat = A['LayFormat'];
-- LayFormat = style_format (LayFormat, LayURL, 'lay-format', 'lay-url');
-- if utilities.is_set (LayURL) then
-- if utilities.is_set (LayDate) then LayDate = " (" .. LayDate .. ")" end
-- if utilities.is_set (LaySource) then
-- LaySource = " – ''" .. utilities.safe_for_italics (LaySource) .. "''";
-- else
-- LaySource = "";
-- end
-- if sepc == '.' then
-- Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary'], A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
-- else
-- Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary']:lower(), A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
-- end
-- elseif utilities.is_set (LayFormat) then -- Test if |lay-format= is given without giving a |lay-url=
-- Lay = sepc .. LayFormat; -- if set and LayURL not set, then LayFormat has error message
-- end
local TranscriptURL = A['TranscriptURL']
local TranscriptFormat = A['TranscriptFormat'];
TranscriptFormat = style_format (TranscriptFormat, TranscriptURL, 'transcript-format', 'transcripturl');
local Transcript = A['Transcript'];
local TranscriptURL_origin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
if utilities.is_set (Transcript) then
if utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, Transcript, TranscriptURL_origin, nil );
end
Transcript = sepc .. ' ' .. Transcript .. TranscriptFormat;
elseif utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, nil, TranscriptURL_origin, nil );
end
local Publisher;
if utilities.is_set (PublicationDate) then
PublicationDate = wrap_msg ('published', PublicationDate);
end
if utilities.is_set (PublisherName) then
if utilities.is_set (PublicationPlace) then
Publisher = sepc .. " " .. PublicationPlace .. ": " .. PublisherName .. PublicationDate;
else
Publisher = sepc .. " " .. PublisherName .. PublicationDate;
end
elseif utilities.is_set (PublicationPlace) then
Publisher= sepc .. " " .. PublicationPlace .. PublicationDate;
else
Publisher = PublicationDate;
end
-- Several of the above rely upon detecting this as nil, so do it last.
if (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical)) then
if utilities.is_set (Title) or utilities.is_set (TitleNote) then
Periodical = sepc .. " " .. format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
else
Periodical = format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
end
end
local Language = A['Language'];
if utilities.is_set (Language) then
Language = language_parameter (Language); -- format, categories, name from ISO639-1, etc.
else
Language=''; -- language not specified so make sure this is an empty string;
--[[ TODO: need to extract the wrap_msg from language_parameter
so that we can solve parentheses bunching problem with Format/Language/TitleType
]]
end
--[[
Handle the oddity that is cite speech. This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be " (Speech)" so that
the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).
]]
if "speech" == config.CitationClass then -- cite speech only
TitleNote = TitleType; -- move TitleType to TitleNote so that it renders ahead of |event=
TitleType = ''; -- and unset
if utilities.is_set (Periodical) then -- if Periodical, perhaps because of an included |website= or |journal= parameter
if utilities.is_set (Conference) then -- and if |event= is set
Conference = Conference .. sepc .. " "; -- then add appropriate punctuation to the end of the Conference variable before rendering
end
end
end
-- Piece all bits together at last. Here, all should be non-nil.
-- We build things this way because it is more efficient in LUA
-- not to keep reassigning to the same string variable over and over.
local tcommon;
local tcommon2; -- used for book cite when |contributor= is set
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
if not (utilities.is_set (Authors) or utilities.is_set (Editors)) then
Others = Others:gsub ('^' .. sepc .. ' ', ''); -- when no authors and no editors, strip leading sepc and space
end
if utilities.is_set (Others) then Others = safe_join ({Others, sepc .. " "}, sepc) end -- add terminal punctuation & space; check for dup sepc; TODO why do we need to do this here?
tcommon = safe_join( {Others, Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Edition, Publisher, Agency, Volume}, sepc );
elseif utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (Periodical) then -- special cases for book cites
if utilities.is_set (Contributors) then -- when we are citing foreword, preface, introduction, etc.
tcommon = safe_join( {Title, TitleNote}, sepc ); -- author and other stuff will come after this and before tcommon2
tcommon2 = safe_join( {Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
else
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
end
elseif 'map' == config.CitationClass then -- special cases for cite map
if utilities.is_set (Chapter) then -- map in a book; TitleType is part of Chapter
tcommon = safe_join( {Title, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
elseif utilities.is_set (Periodical) then -- map in a periodical
tcommon = safe_join( {Title, TitleType, Format, Periodical, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
else -- a sheet or stand-alone map
tcommon = safe_join( {Title, TitleType, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher}, sepc );
end
elseif 'episode' == config.CitationClass then -- special case for cite episode
tcommon = safe_join( {Title, TitleNote, TitleType, Series, Language, Edition, Publisher}, sepc );
else -- all other CS1 templates
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language,
Volume, Others, Edition, Publisher, Agency}, sepc );
end
if #ID_list > 0 then
ID_list = safe_join( { sepc .. " ", table.concat( ID_list, sepc .. " " ), ID }, sepc );
else
ID_list = ID;
end
local Via = A['Via'];
Via = utilities.is_set (Via) and wrap_msg ('via', Via) or '';
local idcommon;
if 'audio-visual' == config.CitationClass or 'episode' == config.CitationClass then -- special case for cite AV media & cite episode position transcript
-- idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Lay, Quote }, sepc );
idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Quote }, sepc );
else
-- idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Lay, Quote }, sepc );
idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Quote }, sepc );
end
local text;
local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;
local OrigDate = A['OrigDate'];
OrigDate = utilities.is_set (OrigDate) and wrap_msg ('origdate', OrigDate) or '';
if utilities.is_set (Date) then
if utilities.is_set (Authors) or utilities.is_set (Editors) then -- date follows authors or editors when authors not set
Date = " (" .. Date .. ")" .. OrigDate .. sepc .. " "; -- in parentheses
else -- neither of authors and editors set
if (string.sub(tcommon, -1, -1) == sepc) then -- if the last character of tcommon is sepc
Date = " " .. Date .. OrigDate; -- Date does not begin with sepc
else
Date = sepc .. " " .. Date .. OrigDate; -- Date begins with sepc
end
end
end
if utilities.is_set (Authors) then
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Authors termination
Authors = terminate_name_list (Authors, sepc); -- when no date, terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Editors) then
local in_text = '';
local post_text = '';
if utilities.is_set (Chapter) and 0 == #c then
in_text = cfg.messages['in'] .. ' ';
if (sepc ~= '.') then
in_text = in_text:lower(); -- lowercase for cs2
end
end
if EditorCount <= 1 then
post_text = ' (' .. cfg.messages['editor'] .. ')'; -- be consistent with no-author, no-date case
else
post_text = ' (' .. cfg.messages['editors'] .. ')';
end
Editors = terminate_name_list (in_text .. Editors .. post_text, sepc); -- terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Contributors) then -- book cite and we're citing the intro, preface, etc.
local by_text = sepc .. ' ' .. cfg.messages['by'] .. ' ';
if (sepc ~= '.') then by_text = by_text:lower() end -- lowercase for cs2
Authors = by_text .. Authors; -- author follows title so tweak it here
if utilities.is_set (Editors) and utilities.is_set (Date) then -- when Editors make sure that Authors gets terminated
Authors = terminate_name_list (Authors, sepc); -- terminate with 0 or 1 sepc and a space
end
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Contributors termination
Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc and a space
end
text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext, idcommon }, sepc );
else
text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, pgtext, idcommon }, sepc );
end
elseif utilities.is_set (Editors) then
if utilities.is_set (Date) then
if EditorCount <= 1 then
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editor'];
else
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editors'];
end
else
if EditorCount <= 1 then
Editors = Editors .. " (" .. cfg.messages['editor'] .. ")" .. sepc .. " "
else
Editors = Editors .. " (" .. cfg.messages['editors'] .. ")" .. sepc .. " "
end
end
text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );
else
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );
else
text = safe_join( {Chapter, Place, tcommon, Date, pgtext, idcommon}, sepc );
end
end
if utilities.is_set (PostScript) and PostScript ~= sepc then
text = safe_join( {text, sepc}, sepc ); -- Deals with italics, spaces, etc.
text = text:sub(1, -sepc:len() - 1);
end
text = safe_join( {text, PostScript}, sepc );
-- Now enclose the whole thing in a <cite> element
local options_t = {};
options_t.class = cite_class_attribute_make (config.CitationClass, Mode);
local Ref = is_valid_parameter_value (A['Ref'], A:ORIGIN('Ref'), cfg.keywords_lists['ref'], nil, true); -- nil when |ref=harv; A['Ref'] else
if 'none' ~= cfg.keywords_xlate[(Ref and Ref:lower()) or ''] then
local namelist_t = {}; -- holds selected contributor, author, editor name list
local year = first_set ({Year, anchor_year}, 2); -- Year first for legacy citations and for YMD dates that require disambiguation
if #c > 0 then -- if there is a contributor list
namelist_t = c; -- select it
elseif #a > 0 then -- or an author list
namelist_t = a;
elseif #e > 0 then -- or an editor list
namelist_t = e;
end
local citeref_id;
if #namelist_t > 0 then -- if there are names in namelist_t
citeref_id = make_citeref_id (namelist_t, year); -- go make the CITEREF anchor
if mw.uri.anchorEncode (citeref_id) == ((Ref and mw.uri.anchorEncode (Ref)) or '') then -- Ref may already be encoded (by {{sfnref}}) so citeref_id must be encoded before comparison
utilities.set_message ('maint_ref_duplicates_default');
end
else
citeref_id = ''; -- unset
end
options_t.id = Ref or citeref_id;
end
if string.len (text:gsub('%b<>', '')) <= 2 then -- remove html and html-like tags; then get length of what remains;
z.error_cats_t = {}; -- blank the categories list
z.error_msgs_t = {}; -- blank the error messages list
OCinSoutput = nil; -- blank the metadata string
text = ''; -- blank the the citation
utilities.set_message ('err_empty_citation'); -- set empty citation message and category
end
local render_t = {}; -- here we collect the final bits for concatenation into the rendered citation
if utilities.is_set (options_t.id) then -- here we wrap the rendered citation in <cite ...>...</cite> tags
table.insert (render_t, utilities.substitute (cfg.presentation['cite-id'], {mw.uri.anchorEncode(options_t.id), mw.text.nowiki(options_t.class), text})); -- when |ref= is set or when there is a namelist
else
table.insert (render_t, utilities.substitute (cfg.presentation['cite'], {mw.text.nowiki(options_t.class), text})); -- when |ref=none or when namelist_t empty and |ref= is missing or is empty
end
if OCinSoutput then -- blanked when citation is 'empty' so don't bother to add boilerplate metadata span
table.insert (render_t, utilities.substitute (cfg.presentation['ocins'], OCinSoutput)); -- format and append metadata to the citation
end
local template_name = ('citation' == config.CitationClass) and 'citation' or 'cite ' .. (cfg.citation_class_map_t[config.CitationClass] or config.CitationClass);
local template_link = '[[Template:' .. template_name .. '|' .. template_name .. ']]';
local msg_prefix = '<code class="cs1-code">{{' .. template_link .. '}}</code>: ';
if 0 ~= #z.error_msgs_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_e, template_link));
table.insert (render_t, ' '); -- insert a space between citation and its error messages
table.sort (z.error_msgs_t); -- sort the error messages list; sorting includes wrapping <span> and <code> tags; hidden-error sorts ahead of visible-error
local hidden = true; -- presume that the only error messages emited by this template are hidden
for _, v in ipairs (z.error_msgs_t) do -- spin through the list of error messages
if v:find ('cs1-visible-error', 1, true) then -- look for the visible error class name
hidden = false; -- found one; so don't hide the error message prefix
break; -- and done because no need to look further
end
end
z.error_msgs_t[1] = table.concat ({utilities.error_comment (msg_prefix, hidden), z.error_msgs_t[1]}); -- add error message prefix to first error message to prevent extraneous punctuation
table.insert (render_t, table.concat (z.error_msgs_t, '; ')); -- make a big string of error messages and add it to the rendering
end
if 0 ~= #z.maint_cats_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_m, template_link));
table.sort (z.maint_cats_t); -- sort the maintenance messages list
local maint_msgs_t = {}; -- here we collect all of the maint messages
if 0 == #z.error_msgs_t then -- if no error messages
table.insert (maint_msgs_t, msg_prefix); -- insert message prefix in maint message livery
end
for _, v in ipairs( z.maint_cats_t ) do -- append maintenance categories
table.insert (maint_msgs_t, -- assemble new maint message and add it to the maint_msgs_t table
table.concat ({v, ' (', utilities.substitute (cfg.messages[':cat wikilink'], v), ')'})
);
end
table.insert (render_t, utilities.substitute (cfg.presentation['hidden-maint'], table.concat (maint_msgs_t, ' '))); -- wrap the group of maint messages with proper presentation and save
end
if not no_tracking_cats then
for _, v in ipairs (z.error_cats_t) do -- append error categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
for _, v in ipairs (z.maint_cats_t) do -- append maintenance categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
for _, v in ipairs (z.prop_cats_t) do -- append properties categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
end
return table.concat (render_t); -- make a big string and done
end
--[[--------------------------< V A L I D A T E >--------------------------------------------------------------
Looks for a parameter's name in one of several whitelists.
Parameters in the whitelist can have three values:
true - active, supported parameters
false - deprecated, supported parameters
nil - unsupported parameters
]]
local function validate (name, cite_class, empty)
local name = tostring (name);
local enum_name; -- parameter name with enumerator (if any) replaced with '#'
local state;
local function state_test (state, name) -- local function to do testing of state values
if true == state then return true; end -- valid actively supported parameter
if false == state then
if empty then return nil; end -- empty deprecated parameters are treated as unknowns
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
if 'tracked' == state then
local base_name = name:gsub ('%d', ''); -- strip enumerators from parameter names that have them to get the base name
utilities.add_prop_cat ('tracked-param', {base_name}, base_name); -- add a properties category; <base_name> modifies <key>
return true;
end
return nil;
end
if name:find ('#') then -- # is a cs1|2 reserved character so parameters with # not permitted
return nil;
end
-- replace wnumerator digit(s) with # (|last25= becomes |last#=) (mw.ustring because non-Western 'local' digits)
enum_name = mw.ustring.gsub (name, '%d+$', '#'); -- where enumerator is last charaters in parameter name (these to protect |s2cid=)
enum_name = mw.ustring.gsub (enum_name, '%d+([%-l])', '#%1'); -- where enumerator is in the middle of the parameter name; |author#link= is the oddity
if 'document' == cite_class then -- special case for {{cite document}}
state = whitelist.document_parameters_t[enum_name]; -- this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
return false;
end
if utilities.in_array (cite_class, whitelist.preprint_template_list_t) then -- limited parameter sets allowed for these templates
state = whitelist.limited_parameters_t[enum_name]; -- this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
state = whitelist.preprint_arguments_t[cite_class][name]; -- look in the parameter-list for the template identified by cite_class
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end -- end limited parameter-set templates
if utilities.in_array (cite_class, whitelist.unique_param_template_list_t) then -- template-specific parameters for templates that accept parameters from the basic argument list
state = whitelist.unique_arguments_t[cite_class][name]; -- look in the template-specific parameter-lists for the template identified by cite_class
if true == state_test (state, name) then return true; end
end -- if here, fall into general validation
state = whitelist.common_parameters_t[enum_name]; -- all other templates; all normal parameters allowed; this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end
--[=[-------------------------< I N T E R _ W I K I _ C H E C K >----------------------------------------------
check <value> for inter-language interwiki-link markup. <prefix> must be a MediaWiki-recognized language
code. when these values have the form (without leading colon):
[[<prefix>:link|label]] return label as plain-text
[[<prefix>:link]] return <prefix>:link as plain-text
return value as is else
]=]
local function inter_wiki_check (parameter, value)
local prefix = value:match ('%[%[(%a+):'); -- get an interwiki prefix if one exists
local _;
if prefix and cfg.inter_wiki_map[prefix:lower()] then -- if prefix is in the map, needs preceding colon so
utilities.set_message ('err_bad_paramlink', parameter); -- emit an error message
_, value, _ = utilities.is_wikilink (value); -- extract label portion from wikilink
end
return value;
end
--[[--------------------------< M I S S I N G _ P I P E _ C H E C K >------------------------------------------
Look at the contents of a parameter. If the content has a string of characters and digits followed by an equal
sign, compare the alphanumeric string to the list of cs1|2 parameters. If found, then the string is possibly a
parameter that is missing its pipe. There are two tests made:
{{cite ... |title=Title access-date=2016-03-17}} -- the first parameter has a value and whitespace separates that value from the missing pipe parameter name
{{cite ... |title=access-date=2016-03-17}} -- the first parameter has no value (whitespace after the first = is trimmed by MediaWiki)
cs1|2 shares some parameter names with XML/HTML attributes: class=, title=, etc. To prevent false positives XML/HTML
tags are removed before the search.
If a missing pipe is detected, this function adds the missing pipe maintenance category.
]]
local function missing_pipe_check (parameter, value)
local capture;
value = value:gsub ('%b<>', ''); -- remove XML/HTML tags because attributes: class=, title=, etc.
capture = value:match ('%s+(%a[%w%-]+)%s*=') or value:match ('^(%a[%w%-]+)%s*='); -- find and categorize parameters with possible missing pipes
if capture and validate (capture) then -- if the capture is a valid parameter name
utilities.set_message ('err_missing_pipe', parameter);
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ P U N C T >--------------------------------------
look for extraneous terminal punctuation in most parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_punc (param, value)
if 'number' == type (param) then
return;
end
param = param:gsub ('%d+', '#'); -- enumerated name-list mask params allow terminal punct; normalize
if cfg.punct_skip[param] then
return; -- parameter name found in the skip table so done
end
if value:match ('[,;:]$') then
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
if value:match ('^=') then -- sometimes an extraneous '=' character appears ...
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ U R L >------------------------------------------
look for extraneous url parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_url (url_param_t)
local url_error_t = {};
check_for_url (url_param_t, url_error_t); -- extraneous url check
if 0 ~= #url_error_t then -- non-zero when there are errors
table.sort (url_error_t);
utilities.set_message ('err_param_has_ext_link', {utilities.make_sep_list (#url_error_t, url_error_t)}); -- add this error message
end
end
--[[--------------------------< C I T A T I O N >--------------------------------------------------------------
This is used by templates such as {{cite book}} to create the actual citation text.
]]
local function citation(frame)
Frame = frame; -- save a copy in case we need to display an error message in preview mode
local config = {}; -- table to store parameters from the module {{#invoke:}}
for k, v in pairs( frame.args ) do -- get parameters from the {{#invoke}} frame
config[k] = v;
-- args[k] = v; -- crude debug support that allows us to render a citation from module {{#invoke:}}; skips parameter validation; TODO: keep?
end
-- i18n: set the name that your wiki uses to identify sandbox subpages from sandbox template invoke (or can be set here)
local sandbox = ((config.SandboxPath and '' ~= config.SandboxPath) and config.SandboxPath) or '/sandbox'; -- sandbox path from {{#invoke:Citation/CS1/sandbox|citation|SandboxPath=/...}}
is_sandbox = nil ~= string.find (frame:getTitle(), sandbox, 1, true); -- is this invoke the sandbox module?
sandbox = is_sandbox and sandbox or ''; -- use i18n sandbox to load sandbox modules when this module is the sandox; live modules else
local pframe = frame:getParent()
local styles;
cfg = mw.loadData ('Module:Citation/CS1/Configuration' .. sandbox); -- load sandbox versions of support modules when {{#invoke:Citation/CS1/sandbox|...}}; live modules else
whitelist = mw.loadData ('Module:Citation/CS1/Whitelist' .. sandbox);
utilities = require ('Module:Citation/CS1/Utilities' .. sandbox);
validation = require ('Module:Citation/CS1/Date_validation' .. sandbox);
identifiers = require ('Module:Citation/CS1/Identifiers' .. sandbox);
metadata = require ('Module:Citation/CS1/COinS' .. sandbox);
styles = 'Module:Citation/CS1' .. sandbox .. '/styles.css';
utilities.set_selected_modules (cfg); -- so that functions in Utilities can see the selected cfg tables
identifiers.set_selected_modules (cfg, utilities); -- so that functions in Identifiers can see the selected cfg tables and selected Utilities module
validation.set_selected_modules (cfg, utilities); -- so that functions in Date validataion can see selected cfg tables and the selected Utilities module
metadata.set_selected_modules (cfg, utilities); -- so that functions in COinS can see the selected cfg tables and selected Utilities module
z = utilities.z; -- table of error and category tables in Module:Citation/CS1/Utilities
is_preview_mode = not utilities.is_set (frame:preprocess ('{{REVISIONID}}'));
local args = {}; -- table where we store all of the template's arguments
local suggestions = {}; -- table where we store suggestions if we need to loadData them
local error_text; -- used as a flag
local capture; -- the single supported capture when matching unknown parameters using patterns
local empty_unknowns = {}; -- sequence table to hold empty unknown params for error message listing
for k, v in pairs( pframe.args ) do -- get parameters from the parent (template) frame
v = mw.ustring.gsub (v, '^%s*(.-)%s*$', '%1'); -- trim leading/trailing whitespace; when v is only whitespace, becomes empty string
if v ~= '' then
if ('string' == type (k)) then
k = mw.ustring.gsub (k, '%d', cfg.date_names.local_digits); -- for enumerated parameters, translate 'local' digits to Western 0-9
end
if not validate( k, config.CitationClass ) then
if type (k) ~= 'string' then -- exclude empty numbered parameters
if v:match("%S+") ~= nil then
error_text = utilities.set_message ('err_text_ignored', {v});
end
elseif validate (k:lower(), config.CitationClass) then
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, k:lower()}); -- suggest the lowercase version of the parameter
else
if nil == suggestions.suggestions then -- if this table is nil then we need to load it
suggestions = mw.loadData ('Module:Citation/CS1/Suggestions' .. sandbox); --load sandbox version of suggestion module when {{#invoke:Citation/CS1/sandbox|...}}; live module else
end
for pattern, param in pairs (suggestions.patterns) do -- loop through the patterns to see if we can suggest a proper parameter
capture = k:match (pattern); -- the whole match if no capture in pattern else the capture if a match
if capture then -- if the pattern matches
param = utilities.substitute (param, capture); -- add the capture to the suggested parameter (typically the enumerator)
if validate (param, config.CitationClass) then -- validate the suggestion to make sure that the suggestion is supported by this template (necessary for limited parameter lists)
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, param}); -- set the suggestion error message
else
error_text = utilities.set_message ('err_parameter_ignored', {k}); -- suggested param not supported by this template
v = ''; -- unset
end
end
end
if not utilities.is_set (error_text) then -- couldn't match with a pattern, is there an explicit suggestion?
if (suggestions.suggestions[ k:lower() ] ~= nil) and validate (suggestions.suggestions[ k:lower() ], config.CitationClass) then
utilities.set_message ('err_parameter_ignored_suggest', {k, suggestions.suggestions[ k:lower() ]});
else
utilities.set_message ('err_parameter_ignored', {k});
v = ''; -- unset value assigned to unrecognized parameters (this for the limited parameter lists)
end
end
end
end
args[k] = v; -- save this parameter and its value
elseif not utilities.is_set (v) then -- for empty parameters
if not validate (k, config.CitationClass, true) then -- is this empty parameter a valid parameter
k = ('' == k) and '(empty string)' or k; -- when k is empty string (or was space(s) trimmed to empty string), replace with descriptive text
table.insert (empty_unknowns, utilities.wrap_style ('parameter', k)); -- format for error message and add to the list
end
-- crude debug support that allows us to render a citation from module {{#invoke:}} TODO: keep?
-- elseif args[k] ~= nil or (k == 'postscript') then -- when args[k] has a value from {{#invoke}} frame (we don't normally do that)
-- args[k] = v; -- overwrite args[k] with empty string from pframe.args[k] (template frame); v is empty string here
end -- not sure about the postscript bit; that gets handled in parameter validation; historical artifact?
end
if 0 ~= #empty_unknowns then -- create empty unknown error message
utilities.set_message ('err_param_unknown_empty', {
1 == #empty_unknowns and '' or 's',
utilities.make_sep_list (#empty_unknowns, empty_unknowns)
});
end
local url_param_t = {};
for k, v in pairs( args ) do
if 'string' == type (k) then -- don't evaluate positional parameters
has_invisible_chars (k, v); -- look for invisible characters
end
has_extraneous_punc (k, v); -- look for extraneous terminal punctuation in parameter values
missing_pipe_check (k, v); -- do we think that there is a parameter that is missing a pipe?
args[k] = inter_wiki_check (k, v); -- when language interwiki-linked parameter missing leading colon replace with wiki-link label
if 'string' == type (k) and not cfg.url_skip[k] then -- when parameter k is not positional and not in url skip table
url_param_t[k] = v; -- make a parameter/value list for extraneous url check
end
end
has_extraneous_url (url_param_t); -- look for url in parameter values where a url does not belong
return table.concat ({
frame:extensionTag ('templatestyles', '', {src=styles}),
citation0( config, args)
});
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {citation = citation};
03d0c65e9544044eef296e124f940c7cc9319972
Module:Message box
828
18
143
29
2023-09-02T22:54:30Z
wikipedia>Anomie
0
[[:File:Cscr-featured.svg]] needs a link to the description page for license and attribution. Add the ability for the configuration to specify a flag to accomplish this.
Scribunto
text/plain
require('strict')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
self.typeImageNeedsLink = typeData.imageNeedsLink
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s%s|alt=]]', self.typeImage
or 'Information icon4.svg', imageSize, self.typeImageNeedsLink and "" or "|link=" )
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
f2fb84f7b817d2d88747f57c40902a0d8be8158a
Module:Message box/configuration
828
20
145
33
2023-09-08T14:09:56Z
wikipedia>Pppery
0
Use SVG per edit request
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '<small>[[Help:Maintenance template removal|Learn how and when to remove this template message]]</small>',
templatestyles = 'Module:Message box/ambox.css'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true,
templatestyles = 'Module:Message box/cmbox.css'
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false,
templatestyles = 'Module:Message box/fmbox.css'
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox-license.svg'
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg',
imageNeedsLink = true
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes',
templatestyles = 'Module:Message box/imbox.css'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true,
templatestyles = 'Module:Message box/ombox.css'
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
templateCategory = 'Talk message boxes',
templatestyles = 'Module:Message box/tmbox.css'
}
}
27f00af5cf3939613e9156acd5e62a3469d03d81
Template:Infobox/doc
10
11
265
107
2023-09-09T08:06:21Z
wikipedia>Tjmj
0
/* Examples */ Suppress [[Category:Pages using infobox templates with ignored data cells]]
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{distinguish|Template:Userbox}}
{{#ifeq:{{SUBPAGENAME}}|sandbox||{{High-use}}}}
{{Lua|Module:Infobox}}
{{Parameter names example
|name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
|image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>......
|header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div>
|label2={{{label1}}} |data2={{{data1}}}
|data3=( ''or'' ) |data4=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data1}}}</div>
|header5={{{header2}}}<br/><div style="padding:0.75em 0 0.5em;">{{nobold|( ''or'' )}}</div>
|label6={{{label2}}} |data6={{{data2}}}
|data7=( ''or'' ) |data8=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data2}}}</div>
|data9=<div style="padding:0.75em 0 0.5em;">( ''etc'' )</div>
|below
}}
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[Help:Infobox]] contains an introduction about the recommended content and design of infoboxes; [[Wikipedia:Manual of Style/Infoboxes]] contains additional style guidelines. See [[WP:List of infoboxes]] and [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
== Usage ==
{{tlf|Infobox}} is a meta-template: used to organise an actual <nowiki>{{Infobox sometopic}}</nowiki> template (like {{tl|Infobox building}}).
For <code><nowiki>[[Template:Infobox sometopic]]</nowiki></code>, template code then looks like this, simplified:
<syntaxhighlight lang="wikitext">
{{Infobox
| name = {{{name|{{PAGENAME}}}}}
| image = {{{image|}}}
| caption1 = {{{caption|}}}
| label1 = Former names
| data1 = {{{former_names|}}}
| header2 = General information
| label3 = Status
| data3 = {{{status|}}}
... <!-- etc. -->
}}
</syntaxhighlight>
== Optional control parameters ==
; name : If this parameter is present, "view/talk/edit" links will be added to the bottom of the infobox pointing to the named page, prefixed by <code>Template:</code> if no namespace is specified. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however, this is rarely what you want because it will send users clicking these links in an infobox to the template code rather than the data in the infobox they probably want to change.
; child : See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
; subbox : See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
; autoheaders: If this is set to any non-blank value, headers which are not followed by data fields are suppressed. See the "[[#Hiding headers when all its data fields are empty|hiding headers when all its data fields are empty]]" section for more details.
== Content parameters ==
=== Title ===
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts it as a caption on top of the table. You can use them both together, or just one or the other, or neither (though this is not recommended):
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For [[Wikipedia:Manual of Style/Accessibility#Tables|accessibility reasons]], this is the most recommended alternative.
; above : Text to put within the uppermost cell of the table.
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
Examples:
{{Infobox
| name = Infobox/doc
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</syntaxhighlight>{{clear}}
{{Infobox
| name = Infobox/doc
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</syntaxhighlight>{{clear}}
=== Illustration images ===
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default. See [[WP:ALT]] for more on alt text.
; caption(n) : Text to put underneath the images.
=== Main data ===
; header(n) : Text to use as a header in row n.
; label(n) : Text to use as a label in row n.
; data(n) : Text to display as data in row n.
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a {{para|header''(n)''}} will cause the corresponding {{para|data''(n)''}} (and {{para|rowclass''(n)''}} {{para|label''(n)''}}, see below) to be ignored; the absence of a {{para|data''(n)''}} will cause the corresponding {{para|label''(n)''}} to be ignored. Valid combinations for any single row are:
* {{para|class''(n)''}} {{para|header''(n)''}}
* {{para|rowclass''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
* {{para|rowclass''(n)''}} {{para|label''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
==== Number ranges ====
To allow flexibility when the layout of an infobox is changed, it may be helpful when developing an infobox to use non-contiguous numbers for header and label/data rows. Parameters for new rows can then be inserted in future without having to renumber existing parameters. For example:
<syntaxhighlight lang="wikitext" style="overflow:auto">
| header3 = Section 1
| label5 = Label A
| data5 = Data A
| label7 = Label C
| data7 = Data C
| header10 = Section 2
| label12 = Label D
| data12 = Data D
</syntaxhighlight>{{clear}}
It is also possible to automatically renumber parameter names by using [[User:Frietjes/infoboxgap.js]] or [[Module:IncrementParams]].
There is no upper limit on numbers but there must be at most 50 between each used number.
==== Making data fields optional ====
A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:
<syntaxhighlight lang="wikitext" style="overflow:auto">
| label5 = Population
| data5 = {{{population|}}}
</syntaxhighlight>{{clear}}
This way if an article doesn't define the population parameter in its infobox the row won't be displayed.
For more complex fields with pre-formatted contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter ''mass'' has been supplied |then display it, followed by 'kg'":
<syntaxhighlight lang="wikitext" style="overflow:auto">
| label6 = Mass
| data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}
</syntaxhighlight>{{clear}}
For more on #if, see [[meta:ParserFunctions##if:|here]].
==== Hiding headers when all its data fields are empty ====
You can also make headers automatically hide when their section is empty (has no data-row showing).
Consider this situation:
{{Infobox
| title = Example: header with & without data
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
</syntaxhighlight>{{clear}}
If you want hide the header when no {{para|data''N''}} values are present, use '''{{para|autoheaders|y}}''':
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
</syntaxhighlight>{{clear}}
So, header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no empty row appears before the next visible content.
Note: if the data has empty css elements, like {{para|data|2=<span style="background:yellow;"></span>}}, this will be treated as non-empty (having data).
If {{para|autoheaders|y}} but there are items that you ''do not'' want to trigger a header, place {{para|headerX|_BLANK_}}. This will serve as an empty header and separate it from the subsequent items.
{{Infobox
| title = Example: blank header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = _BLANK_
| label6 = label6 text | data6 = Some value, but does not trigger header1 or show header5
}}
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = _BLANK_
| label6 = label6 text | data6 = Some value, but does not trigger header1 or show header5
}}
</syntaxhighlight>{{clear}}
=== Footer ===
; below : Text to put in the bottom cell. The bottom cell is intended for footnotes, see-also, and other such information.
== Presentation parameters ==
=== Italic titles ===
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
* Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{para|italic title|<nowiki>{{{italic title|no}}}</nowiki>}}
* Do not make any titles italic by not passing the parameter at all.
=== CSS styling ===
{{div col}}
; bodystyle : Applies to the infobox table as a whole
; titlestyle : Applies only to the title caption. Adding a background color is usually inadvisable since the text is rendered "outside" the infobox.
; abovestyle : Applies only to the "above" cell at the top. The default style has font-size:125%; since this cell is usually used for a title, if you want to use the above cell for regular-sized text include "font-size:100%;" in the abovestyle.
; imagestyle : Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
; captionstyle : Applies to the text of the image caption.
; rowstyle(n) : This parameter is inserted into the <code>style</code> attribute for the specified row.
; headerstyle : Applies to all header cells
; subheaderstyle : Applies to all subheader cells
; labelstyle : Applies to all label cells
; datastyle : Applies to all data cells
; belowstyle : Applies only to the below cell
{{div col end}}
=== HTML classes and microformats ===
{{div col}}
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
<!-- currently not implemented in Lua module
; aboverowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''above''' cell is on.
-->
; aboveclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''above''' cell.
; subheaderrowclass(n) : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''subheader''' is on.
; subheaderclass(n) : This parameter is inserted into the <code>class</code> attribute for the infobox's '''subheader'''.
; imagerowclass(n) : These parameters are inserted into the <code>class</code> attribute for the complete table row their respective '''image''' is on.
; imageclass : This parameter is inserted into the <code>class</code> attribute for the '''image'''.
; rowclass(n) : This parameter is inserted into the <code>class</code> attribute for the specified row including the '''label''' and '''data''' cells.
; class(n) : This parameter is inserted into the <code>class</code> attribute for the '''data''' cell of the specified row. If there's no '''data''' cell it has no effect.
<!-- currently not implemented in Lua module
; belowrowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''below''' cell is on.
-->
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
{{div col end}}
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others being used for microformats.
To flag an infobox as containing [[hCard]] information, for example, add the following parameter:
<syntaxhighlight lang="wikitext" style="overflow:auto">
| bodyclass = vcard
</syntaxhighlight>{{clear}}
And for each row containing a data cell that's part of the vcard, add a corresponding class parameter:
<syntaxhighlight lang="wikitext" style="overflow:auto">
| class1 = fn
| class2 = org
| class3 = tel
</syntaxhighlight>{{clear}}
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
== Examples ==
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
{{Suppress categories|
{{Infobox
|name = Infobox/doc
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
}}
<syntaxhighlight lang="wikitext">
{{Infobox
|name = Infobox/doc
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
</syntaxhighlight>
For this example, the {{para|bodystyle}} and {{para|labelstyle}} parameters are used to adjust the infobox width and define a default width for the column of labels:
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
<syntaxhighlight lang="wikitext">
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
</syntaxhighlight>
== Embedding ==
<!--Linked from [[Template:Subinfobox bodystyle/doc]]-->
One infobox template can be embedded into another using the {{para|child}} parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</syntaxhighlight>{{clear}}
Note, in the examples above, the child infobox is placed in a <code>data</code> field, not a <code>header</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a '''header''' field (but not in a '''label''' field because it would not be displayed!), either using
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</syntaxhighlight>{{clear}}
or,
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</syntaxhighlight>{{clear}}
Note that omitting the {{para|title}} parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation. The garbage output can be suppressed using {{para|rowstyleN|display: none}}, replacing N with the data/header number.
[[Wikipedia:WikiProject Infoboxes/embed]] includes some links to Wikipedia articles which include infoboxes embedded within other infoboxes.
== Subboxes ==
An alternative method for embedding is to use {{para|subbox|yes}}, which removes the outer border from the infobox, but preserves the interior structure. One feature of this approach is that the parent and child boxes need not have the same structure, and the label and data fields are not aligned between the parent and child boxes because they are not in the same parent table.
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
</syntaxhighlight>{{clear}}
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
</syntaxhighlight>{{clear}}
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
== Controlling line-breaking in embedded bulletless lists ==
Template {{tlx|nbsp}} may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists embedded in infoboxes (e.g. cast list in {{tlx|Infobox film}}), to prevent wrapped long entries from being confused with multiple entries. See [[Template:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
== Full blank syntax ==
(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| child = {{{child|}}}
| subbox = {{{subbox|}}}
| italic title = {{{italic title|no}}}
| templatestyles =
| child templatestyles =
| grandchild templatestyles =
| bodystyle =
| titlestyle =
| abovestyle =
| subheaderstyle =
| title =
| above =
| subheader =
| imagestyle =
| captionstyle =
| image =
| caption =
| image2 =
| caption2 =
| headerstyle =
| labelstyle =
| datastyle =
| header1 =
| label1 =
| data1 =
| header2 =
| label2 =
| data2 =
| header3 =
| label3 =
| data3 =
| header4 =
| label4 =
| data4 =
| header5 =
| label5 =
| data5 =
| header6 =
| label6 =
| data6 =
| header7 =
| label7 =
| data7 =
| header8 =
| label8 =
| data8 =
| header9 =
| label9 =
| data9 =
| header10 =
| label10 =
| data10 =
| header11 =
| label11 =
| data11 =
| header12 =
| label12 =
| data12 =
| header13 =
| label13 =
| data13 =
| header14 =
| label14 =
| data14 =
| header15 =
| label15 =
| data15 =
| header16 =
| label16 =
| data16 =
| header17 =
| label17 =
| data17 =
| header18 =
| label18 =
| data18 =
| header19 =
| label19 =
| data19 =
| header20 =
| label20 =
| data20 =
| belowstyle =
| below =
}}
</syntaxhighlight>{{clear}}
{{Help:Infobox/user style}}
== Porting to other MediaWikis ==
The infobox template requires the [[:mw:Extension:Scribunto|Scribunto]] and [[:mw:Extension:TemplateStyles|TemplateStyles]] extensions. [[Wikipedia:WikiProject Transwiki|WikiProject Transwiki]] has a version of this template that has been modified to work on other MediaWikis.
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "This template is intended as a meta template, a template used for constructing other templates. In general, it is not meant for use directly in an article but can be used on a one-off basis if required.",
"format": "{{_\n| ________________ = _\n}}\n",
"params": {
"title": {
"label": "Title",
"description": "Title displayed above the infobox",
"type": "string",
"suggested": true
},
"image": {
"label": "Image",
"description": "Image illustrating the topic. Use full image syntax.",
"type": "content",
"suggested": true,
"example": "[[File:example.png|200px|alt=Example alt text]]"
},
"caption": {
"label": "Caption",
"description": "caption for the image",
"type": "content",
"suggested": true
}
},
"paramOrder": [
"title",
"image",
"caption"
]
}
</templatedata>
==Tracking categories==
* {{Category link with count|Articles with missing Wikidata information}}
* {{Category link with count|Articles using infobox templates with no data rows}}
* {{Category link with count|Pages using embedded infobox templates with the title parameter}}
==See also==
* [[Module:Infobox]], the [[WP:LUA|Lua]] module on which this template is based
* [[Module:Check for unknown parameters]]
* {{tl|Infobox3cols}}
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[Wikipedia:List of infoboxes|List of infoboxes]]
* [[:Module:InfoboxImage]]
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Infobox templates| ]]
[[Category:Wikipedia metatemplates|Infobox]]
[[Category:Templates generating microformats]]
[[Category:Templates that add a tracking category]]
[[Category:Templates based on the Infobox Lua module]]
}}</includeonly>
b7ba187ea76ee960bbe295ad01c44c646eaedadb
Module:Unicode data
828
150
400
2023-09-12T16:56:59Z
wikipedia>Drmccreedy
0
Add new block for Unicode v15.1
Scribunto
text/plain
local p = {}
local floor = math.floor
local function errorf(level, ...)
if type(level) == "number" then
return error(string.format(...), level + 1)
else -- level is actually the format string.
return error(string.format(level, ...), 2)
end
end
local function binary_range_search(codepoint, ranges)
local low, mid, high
low, high = 1, ranges.length or require "Module:TableTools".length(ranges)
while low <= high do
mid = floor((low + high) / 2)
local range = ranges[mid]
if codepoint < range[1] then
high = mid - 1
elseif codepoint <= range[2] then
return range, mid
else
low = mid + 1
end
end
return nil, mid
end
p.binary_range_search = binary_range_search
--[[
local function linear_range_search(codepoint, ranges)
for i, range in ipairs(ranges) do
if range[1] <= codepoint and codepoint <= range[2] then
return range
end
end
end
--]]
-- Load a module by indexing "loader" with the name of the module minus the
-- "Module:Unicode data/" part. For instance, loader.blocks returns
-- [[Module:Unicode data/blocks]]. If a module cannot be loaded, false will be
-- returned.
local loader = setmetatable({}, {
__index = function (self, key)
local success, data = pcall(mw.loadData, "Module:Unicode data/" .. key)
if not success then
data = false
end
self[key] = data
return data
end
})
-- For the algorithm used to generate Hangul Syllable names,
-- see "Hangul Syllable Name Generation" in section 3.12 of the
-- Unicode Specification:
-- https://www.unicode.org/versions/Unicode11.0.0/ch03.pdf
local name_hooks = {
{ 0x00, 0x1F, "<control-%04X>" }, -- C0 control characters
{ 0x7F, 0x9F, "<control-%04X>" }, -- DEL and C1 control characters
{ 0x3400, 0x4DBF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension A
{ 0x4E00, 0x9FFF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph
{ 0xAC00, 0xD7A3, function (codepoint) -- Hangul Syllables
local Hangul_data = loader.Hangul
local syllable_index = codepoint - 0xAC00
return ("HANGUL SYLLABLE %s%s%s"):format(
Hangul_data.leads[floor(syllable_index / Hangul_data.final_count)],
Hangul_data.vowels[floor((syllable_index % Hangul_data.final_count)
/ Hangul_data.trail_count)],
Hangul_data.trails[syllable_index % Hangul_data.trail_count]
)
end },
-- High Surrogates, High Private Use Surrogates, Low Surrogates
{ 0xD800, 0xDFFF, "<surrogate-%04X>" },
{ 0xE000, 0xF8FF, "<private-use-%04X>" }, -- Private Use
-- CJK Compatibility Ideographs
{ 0xF900, 0xFA6D, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xFA70, 0xFAD9, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0x17000, 0x187F7, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph
{ 0x18800, 0x18AFF, function (codepoint)
return ("TANGUT COMPONENT-%03d"):format(codepoint - 0x187FF)
end },
{ 0x18D00, 0x18D08, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph Supplement
{ 0x1B170, 0x1B2FB, "NUSHU CHARACTER-%04X" }, -- Nushu
{ 0x20000, 0x2A6DF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension B
{ 0x2A700, 0x2B739, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension C
{ 0x2B740, 0x2B81D, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension D
{ 0x2B820, 0x2CEA1, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension E
{ 0x2CEB0, 0x2EBE0, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension F
-- CJK Compatibility Ideographs Supplement (Supplementary Ideographic Plane)
{ 0x2F800, 0x2FA1D, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xE0100, 0xE01EF, function (codepoint) -- Variation Selectors Supplement
return ("VARIATION SELECTOR-%d"):format(codepoint - 0xE0100 + 17)
end},
{ 0x30000, 0x3134A, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension G
{ 0x31350, 0x323AF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension H
{ 0x2EBF0, 0x2EE5D, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension I
{ 0xF0000, 0xFFFFD, "<private-use-%04X>" }, -- Plane 15 Private Use
{ 0x100000, 0x10FFFD, "<private-use-%04X>" } -- Plane 16 Private Use
}
name_hooks.length = #name_hooks
local name_range_cache
local function generate_name(data, codepoint)
if type(data) == "string" then
return data:format(codepoint)
else
return data(codepoint)
end
end
--[[
-- Checks that the code point is a number and in range.
-- Does not check whether code point is an integer.
-- Not used
local function check_codepoint(funcName, argIdx, val)
require 'libraryUtil'.checkType(funcName, argIdx, val, 'number')
if codepoint < 0 or 0x10FFFF < codepoint then
errorf("Codepoint %04X out of range", codepoint)
end
end
--]]
-- https://www.unicode.org/versions/Unicode11.0.0/ch04.pdf, section 4.8
function p.lookup_name(codepoint)
-- U+FDD0-U+FDEF and all code points ending in FFFE or FFFF are Unassigned
-- (Cn) and specifically noncharacters:
-- https://www.unicode.org/faq/private_use.html#nonchar4
if 0xFDD0 <= codepoint and (codepoint <= 0xFDEF
or floor(codepoint % 0x10000) >= 0xFFFE) then
return ("<noncharacter-%04X>"):format(codepoint)
end
if name_range_cache -- Check if previously used "name hook" applies to this code point.
and codepoint >= name_range_cache[1]
and codepoint <= name_range_cache[2] then
return generate_name(name_range_cache[3], codepoint)
end
local range = binary_range_search(codepoint, name_hooks)
if range then
name_range_cache = range
return generate_name(range[3], codepoint)
end
local data = loader[('names/%03X'):format(codepoint / 0x1000)]
if data and data[codepoint] then
return data[codepoint]
-- Unassigned (Cn) consists of noncharacters and reserved characters.
-- The character has been established not to be a noncharacter,
-- and if it were assigned, its name would already been retrieved,
-- so it must be reserved.
else
return ("<reserved-%04X>"):format(codepoint)
end
end
--[[
-- No image data modules on Wikipedia yet.
function p.lookup_image(codepoint)
local data = loader[('images/%03X'):format(codepoint / 0x1000)]
if data then
return data[codepoint]
end
end
--]]
local planes = {
[ 0] = "Basic Multilingual Plane";
[ 1] = "Supplementary Multilingual Plane";
[ 2] = "Supplementary Ideographic Plane";
[ 3] = "Tertiary Ideographic Plane";
[14] = "Supplementary Special-purpose Plane";
[15] = "Supplementary Private Use Area-A";
[16] = "Supplementary Private Use Area-B";
}
-- Load [[Module:Unicode data/blocks]] if needed and assign it to this variable.
local blocks
local function block_iter(blocks, i)
i = i + 1
local data = blocks[i]
if data then
-- Unpack doesn't work on tables loaded with mw.loadData.
return i, data[1], data[2], data[3]
end
end
-- An ipairs-type iterator generator for the list of blocks.
function p.enum_blocks()
local blocks = loader.blocks
return block_iter, blocks, 0
end
function p.lookup_plane(codepoint)
local i = floor(codepoint / 0x10000)
return planes[i] or ("Plane %u"):format(i)
end
function p.lookup_block(codepoint)
local blocks = loader.blocks
local range = binary_range_search(codepoint, blocks)
if range then
return range[3]
else
return "No Block"
end
end
function p.get_block_info(name)
for i, block in ipairs(loader.blocks) do
if block[3] == name then
return block
end
end
end
function p.is_valid_pagename(pagename)
local has_nonws = false
for cp in mw.ustring.gcodepoint(pagename) do
if (cp == 0x0023) -- #
or (cp == 0x005B) -- [
or (cp == 0x005D) -- ]
or (cp == 0x007B) -- {
or (cp == 0x007C) -- |
or (cp == 0x007D) -- }
or (cp == 0x180E) -- MONGOLIAN VOWEL SEPARATOR
or ((cp >= 0x2000) and (cp <= 0x200A)) -- spaces in General Punctuation block
or (cp == 0xFFFD) -- REPLACEMENT CHARACTER
then
return false
end
local printable, result = p.is_printable(cp)
if not printable then
return false
end
if result ~= "space-separator" then
has_nonws = true
end
end
return has_nonws
end
local function manual_unpack(what, from)
if what[from + 1] == nil then
return what[from]
end
local result = {}
from = from or 1
for i, item in ipairs(what) do
if i >= from then
table.insert(result, item)
end
end
return unpack(result)
end
local function compare_ranges(range1, range2)
return range1[1] < range2[1]
end
-- Creates a function to look up data in a module that contains "singles" (a
-- code point-to-data map) and "ranges" (an array containing arrays that contain
-- the low and high code points of a range and the data associated with that
-- range).
-- "loader" loads and returns the "singles" and "ranges" tables.
-- "match_func" is passed the code point and either the data or the "dots", and
-- generates the final result of the function.
-- The varargs ("dots") describes the default data to be returned if there wasn't
-- a match.
-- In case the function is used more than once, "cache" saves ranges that have
-- already been found to match, or a range whose data is the default if there
-- was no match.
local function memo_lookup(data_module_subpage, match_func, ...)
local dots = { ... }
local cache = {}
local singles, ranges
return function (codepoint)
if not singles then
local data_module = loader[data_module_subpage]
singles, ranges = data_module.singles, data_module.ranges
end
if singles[codepoint] then
return match_func(codepoint, singles[codepoint])
end
local range = binary_range_search(codepoint, cache)
if range then
return match_func(codepoint, manual_unpack(range, 3))
end
local range, index = binary_range_search(codepoint, ranges)
if range then
table.insert(cache, range)
table.sort(cache, compare_ranges)
return match_func(codepoint, manual_unpack(range, 3))
end
if ranges[index] then
local dots_range
if codepoint > ranges[index][2] then
dots_range = {
ranges[index][2] + 1,
ranges[index + 1] and ranges[index + 1][1] - 1 or 0x10FFFF,
unpack(dots)
}
else -- codepoint < range[index][1]
dots_range = {
ranges[index - 1] and ranges[index - 1][2] + 1 or 0,
ranges[index][1] - 1,
unpack(dots)
}
end
table.sort(cache, compare_ranges)
end
return match_func(codepoint)
end
end
-- Get a code point's combining class value in [[Module:Unicode data/combining]],
-- and return whether this value is not zero. Zero is assigned as the default
-- if the combining class value is not found in this data module.
-- That is, return true if character is combining, or false if it is not.
-- See https://www.unicode.org/reports/tr44/#Canonical_Combining_Class_Values for
-- more information.
p.is_combining = memo_lookup(
"combining",
function (codepoint, combining_class)
return combining_class and combining_class ~= 0 or false
end,
0)
function p.add_dotted_circle(str)
return (mw.ustring.gsub(str, ".",
function(char)
if p.is_combining(mw.ustring.codepoint(char)) then
return '◌' .. char
end
end))
end
local lookup_control = memo_lookup(
"control",
function (codepoint, ccc)
return ccc or "assigned"
end,
"assigned")
p.lookup_control = lookup_control
function p.is_assigned(codepoint)
return lookup_control(codepoint) ~= "unassigned"
end
function p.is_printable(codepoint)
local result = lookup_control(codepoint)
return (result == "assigned") or (result == "space-separator"), result
end
function p.is_whitespace(codepoint)
local result = lookup_control(codepoint)
return (result == "space-separator"), result
end
p.lookup_category = memo_lookup(
"category",
function (codepoint, category)
return category
end,
"Cn")
local lookup_script = memo_lookup(
"scripts",
function (codepoint, script_code)
return script_code or 'Zzzz'
end,
"Zzzz")
p.lookup_script = lookup_script
function p.get_best_script(str)
-- Check type of argument, because mw.text.decode coerces numbers to strings!
require "libraryUtil".checkType("get_best_script", 1, str, "string")
-- Convert HTML character references (including named character references,
-- or character entities) to characters.
str = mw.text.decode(str, true)
local scripts = {}
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
-- Ignore "Inherited", "Undetermined", or "Uncoded" scripts.
if not (script == "Zyyy" or script == "Zinh" or script == "Zzzz") then
scripts[script] = true
end
end
-- If scripts does not contain two or more keys,
-- return first and only key (script code) in table.
if not next(scripts, next(scripts)) then
return next(scripts)
end -- else return majority script, or else "Zzzz"?
end
function p.is_Latin(str)
require "libraryUtil".checkType("get_best_script", 1, str, "string")
str = mw.text.decode(str, true)
-- Search for the leading bytes that introduce the UTF-8 encoding of the
-- code points U+0340-U+10FFFF. If they are not found and there is at least
-- one Latin-script character, the string counts as Latin, because the rest
-- of the characters can only be Zyyy, Zinh, and Zzzz.
-- The only scripts found below U+0370 (the first code point of the Greek
-- and Coptic block) are Latn, Zyyy, Zinh, and Zzzz.
-- See the codepage in the [[UTF-8]] article.
if not str:find "[\205-\244]" then
for codepoint in mw.ustring.gcodepoint(str) do
if lookup_script(codepoint) == "Latn" then
return true
end
end
end
local Latn = false
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
if script == "Latn" then
Latn = true
elseif not (script == "Zyyy" or script == "Zinh"
or script == "Zzzz") then
return false
end
end
return Latn
end
-- Checks that a string contains only characters belonging to right-to-left
-- scripts, or characters of ignorable scripts.
function p.is_rtl(str)
require "libraryUtil".checkType("get_best_script", 1, str, "string")
str = mw.text.decode(str, true)
-- Search for the leading bytes that introduce the UTF-8 encoding of the
-- code points U+0580-U+10FFFF. If they are not found, the string can only
-- have characters from a left-to-right script, because the first code point
-- in a right-to-left script is U+0591, in the Hebrew block.
if not str:find "[\214-\244]" then
return false
end
local result = false
local rtl = loader.scripts.rtl
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
if rtl[script] then
result = true
elseif not (script == "Zyyy" or script == "Zinh"
or script == "Zzzz") then
return false
end
end
return result
end
--[[--------------------------< I S _ R T L _ F R A M E >------------------------------------------------------
external entry from an {{#invoke:}} to determine if a string of text is rtl. Strips html and html-like tags so
that those tags don't corrupt the is-rtl-is-not-rtl determination; this added for the cases where the rtl text
has <br /> tags.
]]
function p.is_rtl_frame (frame)
local str = frame.args[1]; -- get the string from the {{#invoke:}} frame
str = str:gsub ('%b<>', ''); -- strip any html and html-like tags
return p.is_rtl (str); -- return if whatever remains rtl; false else
end
local function get_codepoint(args, arg)
local codepoint_string = args[arg]
or errorf(2, "Parameter %s is required", tostring(arg))
local codepoint = tonumber(codepoint_string, 16)
or errorf(2, "Parameter %s is not a code point in hexadecimal base",
tostring(arg))
if not (0 <= codepoint and codepoint <= 0x10FFFF) then
errorf(2, "code point in parameter %s out of range", tostring(arg))
end
return codepoint
end
local function get_func(args, arg, prefix)
local suffix = args[arg]
or errorf(2, "Parameter %s is required", tostring(arg))
suffix = mw.text.trim(suffix)
local func_name = prefix .. suffix
local func = p[func_name]
or errorf(2, "There is no function '%s'", func_name)
return func
end
-- This function allows any of the "lookup" functions to be invoked. The first
-- parameter is the word after "lookup_"; the second parameter is the code point
-- in hexadecimal base.
function p.lookup(frame)
local func = get_func(frame.args, 1, "lookup_")
local codepoint = get_codepoint(frame.args, 2)
local result = func(codepoint)
if func == p.lookup_name then
-- Prevent code point labels such as <control-0000> from being
-- interpreted as HTML tags.
result = result:gsub("<", "<")
end
return result
end
function p.is(frame)
local func = get_func(frame.args, 1, "is_")
-- is_Latin and is_valid_pagename take strings.
if func == p.is_Latin or func == p.is_valid_pagename or func == p.is_rtl then
return (func(frame.args[2]))
else -- The rest take code points.
local codepoint = get_codepoint(frame.args, 2)
return (func(codepoint)) -- Adjust to one result.
end
end
return p
898b5f0689e2646f633acbbd08143920c87abef2
Template:Infobox law enforcement agency
10
2
355
2023-09-19T12:43:30Z
wikipedia>Melbguy05
0
Revert Procrastinater edits removed Dissolved parameter used by 148 articles
wikitext
text/x-wiki
{{Infobox
| child = {{{embed|}}}
| abovestyle = background-color: #EFEFEF;
| above = {{Br separated entries
|1={{{agencyname|<includeonly>{{PAGENAMEBASE}}</includeonly>}}}
|2={{{nativename|}}}
|3={{{nativenamea|}}}
|4={{{nativenamer|}}}
}}
| headerstyle= background-color: #EFEFEF;
| subheaderstyle = background-color: #EFEFEF; font-size:120%; font-weight:bold;
| autoheaders = yes
| subheader = {{#if:{{{fictional|}}}|This is a fictional organisation}}
| image1 = {{#invoke:InfoboxImage|InfoboxImage|image={{{patch|}}}|alt={{{patchcaption}}}|size={{#if:{{{image_size|}}}|{{{image_size|}}}|140px}}|sizedefault=frameless|suppressplaceholder=yes}}
| caption1 = {{{patchcaption|}}}
| image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{{logo|}}}|alt={{{logocaption}}}|size={{#if:{{{image_size|}}}|{{{image_size|}}}|140px}}|sizedefault=frameless|suppressplaceholder=yes}}
| caption2 = {{{logocaption|}}}
| image3 = {{#invoke:InfoboxImage|InfoboxImage|image={{{badge|}}}|alt={{{badgecaption}}}|size={{#if:{{{image_size|}}}|{{{image_size|}}}|140px}}|sizedefault=frameless|suppressplaceholder=yes}}
| caption3 = {{{badgecaption|}}}
| image4 = {{#invoke:InfoboxImage|InfoboxImage|image={{{flag|}}}|alt={{{flagcaption}}}|size={{#if:{{{image_size|}}}|{{{image_size|}}}|140px}}|sizedefault=frameless|suppressplaceholder=yes}}
| caption4 = {{{flagcaption|}}}
| label2 = Common name
| data2 = {{{commonname|}}}
| label3 = Abbreviation
| data3 = {{{abbreviation|}}}
| label4 = Motto
| data4 = {{Br separated entries
|1={{{motto|}}}
|2={{{mottotranslated|}}}
}}
| header5 = Agency overview
| label6 = Formed
| data6 = {{#if:{{{formedyear|}}}|{{#if:{{{formedmonthday|}}}|{{{formedmonthday}}},}} {{{formedyear}}}|{{{formed|}}}}}
| label7 = Preceding {{#if:{{{preceding2|}}}{{{preceding3|}}}{{{preceding4|}}}{{{preceding5|}}}{{{preceding6|}}}|agencies|agency}}
| data7 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{#if:{{{preceding1|}}}|{{{preceding1|}}}|{{{preceding1|}}}}}
|2={{#if:{{{preceding2|}}}|{{{preceding2|}}}|{{{preceding2|}}}}}
|3={{#if:{{{preceding3|}}}|{{{preceding3|}}}|{{{preceding3|}}}}}
|4={{#if:{{{preceding4|}}}|{{{preceding4|}}}|{{{preceding4|}}}}}
|5={{#if:{{{preceding5|}}}|{{{preceding5|}}}|{{{preceding5|}}}}}
|6={{#if:{{{preceding6|}}}|{{{preceding6|}}}|{{{preceding6|}}}}}
}}
| label8 = Dissolved
| data8 = {{{dissolved|}}}
| label9 = Superseding agency
| data9 = {{{superseding|}}}
| label10 = Employees
| data10 = {{{employees|}}}
| label11 = Volunteers
| data11 = {{{volunteers|}}}
| label12 = Annual budget
| data12 = {{{budget|}}}
| label13 = Legal personality
| data13 = {{#switch:{{lc:{{{legalpersonality|}}}}}
|=
|government agency|government-owned corporation|government ministry = Governmental: [[{{Trim brackets|{{ucfirst:{{{legalpersonality}}}}}}}]]
|partnership|privately-held company|cooperative|body corporate = Non-governmental: [[{{Trim brackets|{{ucfirst:{{{legalpersonality}}}}}}}]]
|#default = [[{{Trim brackets|{{ucfirst:{{{legalpersonality}}}}}}}]]
}}
| header14 = Jurisdictional structure
| label15 = [[Law enforcement agency#natlea|National agency]]{{#if:{{{legaljuris|}}}|<br>{{nobold|(Operations jurisdiction)}}}}
| data15 = {{#if:{{{national|}}}| {{#if: {{{country|}}}| {{#if:{{{countryabbr|}}} |[[{{{country}}}|{{{countryabbr}}}]]|[[{{{country}}}]]}} }}<nowiki />}}
| label16 = [[Law enforcement agency#fedlea|Federal agency]]{{#if: {{{legaljuris|}}} | <br>{{nobold|(Operations jurisdiction)}} }}
| data16 = {{#if:{{{federal|}}} | {{#if: {{{country|}}}| {{#if:{{{countryabbr|}}} |[[{{{country}}}|{{{countryabbr}}}]]|[[{{{country}}}]]}} }}<nowiki />}}
| label17 = [[Law enforcement agency#internat|International agency]]
| data17 = {{#if:{{{international|}}}| {{#if: {{{country|}}}| {{#if:{{{countryabbr|}}} |[[{{{country}}}|{{{countryabbr}}}]]|[[{{{country}}}]]}} }}<nowiki />}}
| label18 = Countries
| data18 = {{{international|}}}
| label19 = Operations jurisdiction
| data19 = {{comma separated entries
|1={{{subdivname|}}}
|2={{{divname|}}}
|3={{#if:{{{countryabbr|}}} | [[{{{country}}}|{{{countryabbr}}}]] |{{#if:{{{country|}}}|[[{{{country}}}]]}}}}
}}
| data20 = {{#invoke:InfoboxImage|InfoboxImage|image={{{map|}}}|size=250x250px}}
| data21 = {{{dmap|}}}
| data22 = {{#if:{{{map|}}}|{{#if:{{{mapcaption|}}}|{{{mapcaption}}}|Map of {{{agencyname}}}'s jurisdiction}}}}
| label23 = Size
| data23 = {{{sizearea|}}}
| label24 = Population
| data24 = {{{sizepopulation|}}}
| label25 = Legal jurisdiction
| data25 = {{#ifeq:{{{legaljuris}}}|opsjuris|As per operations jurisdiction|{{{legaljuris|}}}}}
| label26 = {{#if:{{{governingbodyscnd|}}}|Primary governing body|Governing body}}
| data26 = {{#if:{{{governingbody|}}}|[[{{Trim brackets|{{{governingbody}}}}}]]}}
| label27 = Secondary governing body
| data27 = {{#if:{{{governingbodyscnd|}}}| [[{{Trim brackets|{{{governingbodyscnd}}}}}]] }}
| label28 = {{#if:{{{constitution2|}}}{{{constitution3|}}}{{{constitution4|}}}{{{constitution5|}}}{{{constitution6|}}}|Constituting instruments|Constituting instrument}}
| data28 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{constitution1|}}}
|2={{{constitution2|}}}
|3={{{constitution3|}}}
|4={{{constitution4|}}}
|5={{{constitution5|}}}
|6={{{constitution6|}}}
}}
| label29 = General nature
| data29 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
| 1 = {{#if:{{{federal|}}}|[[Law enforcement agency#fedlea|Federal law enforcement]]}}
| 2 = {{#if:{{{gendarmerie|}}}
| [[Gendarmerie]]
|{{#if:{{{provost|}}}
| [[Law enforcement agency#provost|Military provost]]
| {{#if:{{{military|}}}|[[Law enforcement agency#milpol|Military police]]}}
}}
}}
| 3 = {{#if:{{{police|}}}
|{{#if:{{{local|}}}
| [[Law enforcement agency#locpol|Local civilian police]]{{main other|[[Category:Pages using law enforcement agency with local civilian police general nature]]}}
| [[Law enforcement agency#civpol|Civilian police]]{{main other|[[Category:Pages using law enforcement agency with civilian police general nature]]}}
}}
}}
| 4 = {{#if:{{{secret|}}}|[[Secret police]]}}
| 5 = {{#if:{{{religious|}}}|[[Law enforcement agency#relpol|Religious police]]}}
}}<!-- end general nature -->
| label30 = {{#if:{{{speciality2|}}}{{{speciality3|}}}{{{speciality4|}}}{{{speciality5|}}}{{{speciality6|}}}|Specialist jurisdictions|Specialist jurisdiction}}
| data30 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{#if:{{{speciality1|}}}|{{Specialist lea type descr|1={{lc:{{{speciality1|}}}}}}}|}}
|2={{#if:{{{speciality2|}}}|{{Specialist lea type descr|1={{lc:{{{speciality2|}}}}}}}|}}
|3={{#if:{{{speciality3|}}}|{{Specialist lea type descr|1={{lc:{{{speciality3|}}}}}}}|}}
|4={{#if:{{{speciality4|}}}|{{Specialist lea type descr|1={{lc:{{{speciality4|}}}}}}}|}}
|5={{#if:{{{speciality5|}}}|{{Specialist lea type descr|1={{lc:{{{speciality5|}}}}}}}|}}
|6={{#if:{{{speciality6|}}}|{{Specialist lea type descr|1={{lc:{{{speciality6|}}}}}}}|}}
}}
| header31 = Operational structure
| label32 = Overviewed by {{#if:{{{overviewtype|}}}|{{{overviewtype}}}}}
| data32 = {{{overviewbody|}}}
| label33 = Headquarters
| data33 = {{{headquarters|}}}
| data34 = <includeonly>{{#invoke:InfoboxImage|InfoboxImage|image={{{hqlocmap|}}}|size={{{hqlocmapsize|}}}}}{{#if:{{{hqlocmappoptitle|}}}|<br/>{{{hqlocmappoptitle|}}}}}</includeonly>
| label35 = {{#if: {{{sworntype|}}} | {{#invoke:string|replace|{{{sworntype}}}|s$||plain=false}} |Sworn member}}s
| data35 = {{{sworn|}}}
| label36 = {{#if:{{{unsworntype|}}}|{{#invoke:string|replace|{{{unsworntype}}}|s$||plain=false}}|Unsworn member}}s
| data36 = {{{unsworn|}}}
| label37 = [[Law enforcement agency#multinat|Multinational agency]]
| data37 = {{#if: {{{multinational|}}} | {{#if: {{{country|}}}| {{#if:{{{countryabbr|}}} |[[{{{country}}}|{{{countryabbr}}}]]|[[{{{country}}}]]}} }}<nowiki />}}
| label38 = Nationalities of personnel
| data38 = {{{multinational|}}}
| label39 = {{#if:{{{electeetype|}}} | {{{electeetype}}} | Elected officer}}{{#if:{{{minister2name|}}}{{{minister3name|}}}{{{minister4name|}}}{{{minister5name|}}}{{{minister6name|}}}|s}} responsible
| data39 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{#if:{{{minister1name|}}} | {{{minister1name}}}{{#if:{{{minister1pfo|}}}|, {{{minister1pfo}}}}} }}
|2={{#if:{{{minister2name|}}} | {{{minister2name}}}{{#if:{{{minister2pfo|}}}|, {{{minister2pfo}}}}} }}
|3={{#if:{{{minister3name|}}} | {{{minister3name}}}{{#if:{{{minister3pfo|}}}|, {{{minister3pfo}}}}} }}
|4={{#if:{{{minister4name|}}} | {{{minister4name}}}{{#if:{{{minister4pfo|}}}|, {{{minister4pfo}}}}} }}
|5={{#if:{{{minister5name|}}} | {{{minister5name}}}{{#if:{{{minister5pfo|}}}|, {{{minister5pfo}}}}} }}
|6={{#if:{{{minister6name|}}} | {{{minister6name}}}{{#if:{{{minister6pfo|}}}|, {{{minister6pfo}}}}} }}
}}
| label40 = Agency executive{{#if:{{{chief2name|}}}{{{chief3name|}}}{{{chief4name|}}}{{{chief5name|}}}{{{chief6name|}}} |s}}
| data40 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{#if:{{{chief1name|}}} | {{{chief1name}}}{{#if:{{{chief1position|}}}|, {{{chief1position}}}}} }}
|2={{#if:{{{chief2name|}}} | {{{chief2name}}}{{#if:{{{chief2position|}}}|, {{{chief2position}}}}} }}
|3={{#if:{{{chief3name|}}} | {{{chief3name}}}{{#if:{{{chief3position|}}}|, {{{chief3position}}}}} }}
|4={{#if:{{{chief4name|}}} | {{{chief4name}}}{{#if:{{{chief4position|}}}|, {{{chief4position}}}}} }}
|5={{#if:{{{chief5name|}}} | {{{chief5name}}}{{#if:{{{chief5position|}}}|, {{{chief5position}}}}} }}
|6={{#if:{{{chief6name|}}} | {{{chief6name}}}{{#if:{{{chief6position|}}}|, {{{chief6position}}}}} }}
}}
| label41 = Parent agency
| data41 = {{{parentagency|}}}
| label42 = Child {{#if:{{{child2agency|}}}{{{child3agency|}}}{{{child4agency|}}}{{{child5agency|}}}{{{child6agency|}}}{{{child7agency|}}} |agencies|agency}}
| data42 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{child1agency|}}}
|2={{{child2agency|}}}
|3={{{child3agency|}}}
|4={{{child4agency|}}}
|5={{{child5agency|}}}
|6={{{child6agency|}}}
|7={{{child7agency|}}}
}}
| label43 = {{#if: {{{unittype|}}} | {{#invoke:string|replace|{{{unittype}}}|s$||plain=false}} |Unit }}s
| data43 = {{{unitname|}}}
| label44 = {{#if: {{{officetype|}}} | {{#invoke:string|replace|{{{officetype}}}|s$||plain=false}} |Command }}s
| data44 = {{{officename|}}}
| label45 = Services provided by
| data45 = {{{provideragency|}}}
| label46 = Uniformed as
| data46 = {{#if: {{{provideragency|}}} | {{#if: {{{uniformedas|}}} | {{{uniformedas}}} | {{{agencyname}}} }} }}
| header47 = Facilities
| label48 = {{#if: {{{stationtype|}}} | {{#invoke:string|replace|{{{stationtype}}}|s$||plain=false}} |Station }}s
| data48 = {{{stations|}}}
| label49 = Airbases
| data49 = {{{airbases|}}}
| label50 = {{#if: {{{lockuptype|}}} | {{#invoke:string|replace|{{{lockuptype}}}|s$||plain=false}} |Lockup }}s
| data50 = {{{lockups|}}}
| label51 = {{#if: {{{vehicle1type|}}} | {{#invoke:string|replace|{{{vehicle1type}}}|s$||plain=false}} |Patrol car }}s
| data51 = {{{vehicles1|}}}
| label52 = {{#if: {{{vehicle2type|}}} | {{#invoke:string|replace|{{{vehicle2type}}}|s$||plain=false}} |Patrol car }}s
| data52 = {{{vehicles2|}}}
| label53 = {{#if: {{{vehicle3type|}}} | {{#invoke:string|replace|{{{vehicle3type}}}|s$||plain=false}} |Patrol car }}s
| data53 = {{{vehicles3|}}}
| label54 = {{#if: {{{boat1type|}}} | {{#invoke:string|replace|{{{boat1type}}}|s$||plain=false}} |Boat }}s
| data54 = {{{boats1|}}}
| label55 = {{#if: {{{boat2type|}}} | {{#invoke:string|replace|{{{boat2type}}}|s$||plain=false}} |Boat }}s
| data55 = {{{boats2|}}}
| label56 = {{#if: {{{boat3type|}}} | {{#invoke:string|replace|{{{boat3type}}}|s$||plain=false}} |Boat }}s
| data56 = {{{boats3|}}}
| label57 = {{#if:{{{aircraft1type|}}}|{{#ifeq:{{#invoke:string|replace|{{{aircraft1type|}}}|^.*ircraft$|aircraft|plain=false}}|aircraft|{{{aircraft1type}}}|{{#invoke:string|replace|{{{aircraft1type}}}|s$||plain=false}}s}}|Planes}}
| data57 = {{{aircraft1|}}}
| label58 = {{#if:{{{aircraft2type|}}}|{{#ifeq:{{#invoke:string|replace|{{{aircraft2type|}}}|^.*ircraft$|aircraft|plain=false}}|aircraft|{{{aircraft2type}}}|{{#invoke:string|replace|{{{aircraft2type}}}|s$||plain=false}}s}}|Planes}}
| data58 = {{{aircraft2|}}}
| label59 = {{#if:{{{aircraft3type|}}}|{{#ifeq:{{#invoke:string|replace|{{{aircraft3type|}}}|^.*ircraft$|aircraft|plain=false}}|aircraft|{{{aircraft3type}}}|{{#invoke:string|replace|{{{aircraft3type}}}|s$||plain=false}}s}}|Planes}}
| data59 = {{{aircraft3|}}}
| label60 = {{#if: {{{animal1type|}}} | {{#invoke:string|replace|{{{animal1type}}}|s$||plain=false}} |Dog }}s
| data60 = {{{animals1|}}}
| label61 = {{#if: {{{animal2type|}}} | {{#invoke:string|replace|{{{animal2type}}}|s$||plain=false}} |Dog }}s
| data61 = {{{animals2|}}}
| label62 = {{#if: {{{animal3type|}}} | {{#invoke:string|replace|{{{animal3type}}}|s$||plain=false}} |Dog }}s
| data62 = {{{animals3|}}}
| header63 = Notables
| label64 = {{#if:{{{person2name|}}}{{{person3name|}}}{{{person4name|}}}{{{person5name|}}}{{{person6name|}}}|People|Person}}
| data64 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{#if:{{{person1name|}}} | {{{person1name}}}{{#if:{{{person1type|}}}|, {{{person1type}}}}}{{#if:{{{person1reason|}}}|, for {{{person1reason}}}}} }}
|2={{#if:{{{person2name|}}} | {{{person2name}}}{{#if:{{{person2type|}}}|, {{{person2type}}}}}{{#if:{{{person2reason|}}}|, for {{{person2reason}}}}} }}
|3={{#if:{{{person3name|}}} | {{{person3name}}}{{#if:{{{person3type|}}}|, {{{person3type}}}}}{{#if:{{{person3reason|}}}|, for {{{person3reason}}}}} }}
|4={{#if:{{{person4name|}}} | {{{person4name}}}{{#if:{{{person4type|}}}|, {{{person4type}}}}}{{#if:{{{person4reason|}}}|, for {{{person4reason}}}}} }}
|5={{#if:{{{person5name|}}} | {{{person5name}}}{{#if:{{{person5type|}}}|, {{{person5type}}}}}{{#if:{{{person5reason|}}}|, for {{{person5reason}}}}} }}
|6={{#if:{{{person6name|}}} | {{{person6name}}}{{#if:{{{person6type|}}}|, {{{person6type}}}}}{{#if:{{{person6reason|}}}|, for {{{person6reason}}}}} }}
}}
| label65 = {{#if:{{{programme1|}}}{{{programme2|}}}{{{programme3|}}}{{{programme5|}}}{{{programme6|}}}
|Programme{{#if:{{{programme2|}}}{{{programme3|}}}{{{programme4|}}}{{{programme5|}}}{{{programme6|}}}|s}}
|Program{{#if:{{{program2|}}}{{{program3|}}}{{{program4|}}}{{{program5|}}}{{{program6|}}}|s}}
}}
| data65 = {{#if:{{{programme1|}}}{{{programme2|}}}{{{programme3|}}}{{{programme5|}}}{{{programme6|}}}
|{{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{programme1|}}}
|2={{{programme2|}}}
|3={{{programme3|}}}
|4={{{programme4|}}}
|5={{{programme5|}}}
|6={{{programme6|}}}
}}
|{{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{program1|}}}
|2={{{program2|}}}
|3={{{program3|}}}
|4={{{program4|}}}
|5={{{program5|}}}
|6={{{program6|}}}
}}
}}
| label66 = {{#if:{{{activity1name|}}} | Significant {{#if: {{{activitytype|}}} |{{{activitytype}}} |operation}}}}{{#if:{{{activity2name|}}}{{{activity3name|}}}{{{activity4name|}}}{{{activity5name|}}}{{{activity6name|}}}|s}}
| data66 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{activity1name|}}}
|2={{{activity2name|}}}
|3={{{activity3name|}}}
|4={{{activity4name|}}}
|5={{{activity5name|}}}
|6={{{activity6name|}}}
}}
| label67 = Anniversar{{#if:{{{anniversary2|}}}{{{anniversary3|}}}{{{anniversary4|}}}{{{anniversary5|}}}{{{anniversary6|}}}|ies|y}}
| data67 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{anniversary1|}}}
|2={{{anniversary2|}}}
|3={{{anniversary3|}}}
|4={{{anniversary4|}}}
|5={{{anniversary5|}}}
|6={{{anniversary6|}}}
}}
| label68 = Award{{#if:{{{award2|}}}{{{award3|}}}{{{award4|}}}{{{award5|}}}{{{award6|}}}|s}}
| data68 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{award1|}}}
|2={{{award2|}}}
|3={{{award3|}}}
|4={{{award4|}}}
|5={{{award5|}}}
|6={{{award6|}}}
}}
| header69 = Website
| data70 = {{{website|}}}
| below = {{{footnotes|}}}
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox law enforcement agency with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox law enforcement agency]] with unknown parameter "_VALUE_"|ignoreblank=y| abbreviation | activity1name | activity2name | activity3name | activity4name | activity5name | activity6name | activitytype | actvity1name | agencyclass | agencyname | airbases | aircraft1 | aircraft1type | aircraft2 | aircraft2type | aircraft3 | aircraft3type | animal1type | animal2type | animal3type | animals1 | animals2 | animals3 | anniversary1 | anniversary2 | anniversary3 | anniversary4 | anniversary5 | anniversary6 | award1 | award2 | award3 | award4 | award5 | award6 | badge | badgecaption | boat1type | boat2type | boat3type | boats1 | boats2 | boats3 | budget | chief1name | chief1position | chief2name | chief2position | chief3name | chief3position | chief4name | chief4position | chief5name | chief5position | chief6name | chief6position | child1agency | child2agency | child3agency | child4agency | child5agency | child6agency | child7agency | commonname | constitution1 | constitution2 | constitution3 | constitution4 | constitution5 | constitution6 | country | countryabbr | dissolved | divname | divtype | dmap | electeetype | embed | employees | federal | fictional | flag | flagcaption | footnotes | {{#if:{{{formedyear|}}}|¶|}}formed | {{#if:{{{formedyear|}}}||¶}}formedmonthday | formedyear | gendarmerie | governingbody | governingbodyscnd | headquarters | hqlocmap | hqlocmappoptitle | hqlocmapsize | image_size | international | legaljuris | legalpersonality | local | lockups | lockuptype | logo | logocaption | map | mapcaption | military | minister1name | minister1pfo | minister2name | minister2pfo | minister3name | minister3pfo | minister4name | minister4pfo | minister5name | minister5pfo | minister6name | minister6pfo | motto | mottotranslated | multinational | national | nativename | nativenamea | nativenamer | officename | officetype | overviewbody | overviewtype | parentagency | patch | patchcaption | person1name | person1reason | person1type | person2name | person2reason | person2type | person3name | person3reason | person3type | person4name | person4reason | person4type | person5name | person5reason | person5type | person6name | person6reason | person6type | police | preceding1 | preceding2 | preceding3 | preceding4 | preceding5 | preceding6 | program1 | program2 | program3 | program4 | program5 | program6 | programme1 | programme2 | programme3 | programme4 | programme5 | programme6 | provideragency | provost | religious | secret | sizearea | sizepopulation | speciality1 | speciality2 | speciality3 | speciality4 | speciality5 | speciality6 | stations | stationtype | subdivname | subdivtype | superseding | sworn | sworntype | uniformedas | unitname | unittype | unsworn | unsworntype | vehicle1type | vehicle2type | vehicle3type | vehicles1 | vehicles2 | vehicles3 | volunteers | website | paramilitary}}{{main other|{{#if:{{{paramilitary|}}}|{{main other|[[Category:Pages using infobox law enforcement agency with paramilitary parameter]]}}
}}}}<noinclude>
{{documentation}}
</noinclude>
5ec196daed8ada045d245db5613daaa547b7fafe
Module:Disambiguation
828
243
593
2023-09-19T18:27:51Z
wikipedia>MSGJ
0
deploy new version, code by [[User:Mr. Stradivarius]]
Scribunto
text/plain
local p = {}
local mRedirect = require('Module:Redirect')
local disambiguationTemplates = mw.loadData('Module:Disambiguation/templates')
local function capitalize(s)
-- This function only works on ASCII strings. If your wiki has
-- disambiguation templates that use Unicode strings, use the commented-out
-- line instead. Enwiki uses ASCII string manipulation only here to improve
-- performance.
return s:sub(1, 1):upper() .. s:sub(2, -1)
-- return mw.ustring.upper(mw.ustring.sub(1, 1)) .. mw.ustring.sub(2, -1)
end
local function isDisambiguationTemplate(template)
return disambiguationTemplates[capitalize(template)] or false
end
p.isDisambiguation = function(content)
-- false if there is no content
if content == nil then
return false
end
-- redirects are not disambiguation pages
if mRedirect.getTargetFromText(content) ~= nil then
return false
end
-- check for disambiguation templates in the content
local templateNames = {}
for template in string.gmatch(content, "{{%s*([^|}]-)%s*[|}]") do
if isDisambiguationTemplate(template) then
return true
end
end
-- check for magic word
if string.find(content, "__DISAMBIG__", 1, true) ~= nil then
return true
end
return false
end
p._isDisambiguationPage = function(page)
-- Look "(disambiguation)" in the title
if string.find(page, "(disambiguation)",0,true) ~= nil then
return true;
end
-- Look for disamiguation template in page content
local title = mw.title.new(page)
if not title then return false end
local content = title:getContent()
return p.isDisambiguation(content)
end
-- Entry points for templates
p.isDisambiguationPage = function(frame)
local title = frame.args[1]
return p._isDisambiguationPage(title) and "yes" or ""
end
return p
fedda4d3046080cab39fcd65ab9a9318912a8d57
Module:Citation/CS1/Identifiers
828
163
426
2023-09-20T15:12:36Z
wikipedia>Trappist the monk
0
tweak to support new oclc limit;
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local has_accept_as_written, is_set, in_array, set_message, select_one, -- functions in Module:Citation/CS1/Utilities
substitute, make_wikilink;
local z; -- table of tables defined in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< P A G E S C O P E V A R I A B L E S >--------------------------------------
declare variables here that have page-wide scope that are not brought in from other modules; that are created here and used here
]]
local auto_link_urls = {}; -- holds identifier URLs for those identifiers that can auto-link |title=
--============================<< H E L P E R F U N C T I O N S >>============================================
--[[--------------------------< W I K I D A T A _ A R T I C L E _ N A M E _ G E T >----------------------------
as an aid to internationalizing identifier-label wikilinks, gets identifier article names from Wikidata.
returns :<lang code>:<article title> when <q> has an <article title> for <lang code>; nil else
for identifiers that do not have q, returns nil
for wikis that do not have mw.wikibase installed, returns nil
]]
local function wikidata_article_name_get (q)
if not is_set (q) or (q and not mw.wikibase) then -- when no q number or when a q number but mw.wikibase not installed on this wiki
return nil; -- abandon
end
local wd_article;
local this_wiki_code = cfg.this_wiki_code; -- Wikipedia subdomain; 'en' for en.wikipedia.org
wd_article = mw.wikibase.getSitelink (q, this_wiki_code .. 'wiki'); -- fetch article title from WD; nil when no title available at this wiki
if wd_article then
wd_article = table.concat ({':', this_wiki_code, ':', wd_article}); -- interwiki-style link without brackets if taken from WD; leading colon required
end
return wd_article; -- article title from WD; nil else
end
--[[--------------------------< L I N K _ L A B E L _ M A K E >------------------------------------------------
common function to create identifier link label from handler table or from Wikidata
returns the first available of
1. redirect from local wiki's handler table (if enabled)
2. Wikidata (if there is a Wikidata entry for this identifier in the local wiki's language)
3. label specified in the local wiki's handler table
]]
local function link_label_make (handler)
local wd_article;
if not (cfg.use_identifier_redirects and is_set (handler.redirect)) then -- redirect has priority so if enabled and available don't fetch from Wikidata because expensive
wd_article = wikidata_article_name_get (handler.q); -- if Wikidata has an article title for this wiki, get it;
end
return (cfg.use_identifier_redirects and is_set (handler.redirect) and handler.redirect) or wd_article or handler.link;
end
--[[--------------------------< E X T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki-style external link
]]
local function external_link_id (options)
local url_string = options.id;
local ext_link;
local this_wiki_code = cfg.this_wiki_code; -- Wikipedia subdomain; 'en' for en.wikipedia.org
local wd_article; -- article title from Wikidata
if options.encode == true or options.encode == nil then
url_string = mw.uri.encode (url_string, 'PATH');
end
if options.auto_link and is_set (options.access) then
auto_link_urls[options.auto_link] = table.concat ({options.prefix, url_string, options.suffix});
end
ext_link = mw.ustring.format ('[%s%s%s %s]', options.prefix, url_string, options.suffix or "", mw.text.nowiki (options.id));
if is_set (options.access) then
ext_link = substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[options.access].class, cfg.presentation[options.access].title, ext_link}); -- add the free-to-read / paywall lock
end
return table.concat ({
make_wikilink (link_label_make (options), options.label), -- redirect, Wikidata link, or locally specified link (in that order)
options.separator or ' ',
ext_link
});
end
--[[--------------------------< I N T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki-style internal link
TODO: Does not currently need to support options.access, options.encode, auto-linking and COinS (as in external_link_id),
but may be needed in the future for :m:Interwiki_map custom-prefixes like :arxiv:, :bibcode:, :DOI:, :hdl:, :ISSN:,
:JSTOR:, :Openlibrary:, :PMID:, :RFC:.
]]
local function internal_link_id (options)
local id = mw.ustring.gsub (options.id, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
return table.concat (
{
make_wikilink (link_label_make (options), options.label), -- wiki-link the identifier label
options.separator or ' ', -- add the separator
make_wikilink (
table.concat (
{
options.prefix,
id, -- translated to Western digits
options.suffix or ''
}),
substitute (cfg.presentation['bdi'], {'', mw.text.nowiki (options.id)}) -- bdi tags to prevent Latin script identifiers from being reversed at RTL language wikis
); -- nowiki because MediaWiki still has magic links for ISBN and the like; TODO: is it really required?
});
end
--[[--------------------------< I S _ E M B A R G O E D >------------------------------------------------------
Determines if a PMC identifier's online version is embargoed. Compares the date in |pmc-embargo-date= against
today's date. If embargo date is in the future, returns the content of |pmc-embargo-date=; otherwise, returns
an empty string because the embargo has expired or because |pmc-embargo-date= was not set in this cite.
]]
local function is_embargoed (embargo)
if is_set (embargo) then
local lang = mw.getContentLanguage();
local good1, embargo_date, todays_date;
good1, embargo_date = pcall (lang.formatDate, lang, 'U', embargo);
todays_date = lang:formatDate ('U');
if good1 then -- if embargo date is a good date
if tonumber (embargo_date) >= tonumber (todays_date) then -- is embargo date is in the future?
return embargo; -- still embargoed
else
set_message ('maint_pmc_embargo'); -- embargo has expired; add main cat
return ''; -- unset because embargo has expired
end
end
end
return ''; -- |pmc-embargo-date= not set return empty string
end
--[=[-------------------------< I S _ V A L I D _ R X I V _ D A T E >------------------------------------------
for biorxiv, returns true if:
2019-12-11T00:00Z <= biorxiv_date < today + 2 days
for medrxiv, returns true if:
2020-01-01T00:00Z <= medrxiv_date < today + 2 days
The dated form of biorxiv identifier has a start date of 2019-12-11. The Unix timestamp for that date is {{#time:U|2019-12-11}} = 1576022400
The medrxiv identifier has a start date of 2020-01-01. The Unix timestamp for that date is {{#time:U|2020-01-01}} = 1577836800
<rxiv_date> is the date provided in those |biorxiv= parameter values that are dated and in |medrxiv= parameter values at time 00:00:00 UTC
<today> is the current date at time 00:00:00 UTC plus 48 hours
if today's date is 2023-01-01T00:00:00 then
adding 24 hours gives 2023-01-02T00:00:00 – one second more than today
adding 24 hours gives 2023-01-03T00:00:00 – one second more than tomorrow
inputs:
<y>, <m>, <d> – year, month, day parts of the date from the birxiv or medrxiv identifier
<select> 'b' for biorxiv, 'm' for medrxiv; defaults to 'b'
]=]
local function is_valid_rxiv_date (y, m, d, select)
if 0 == tonumber (m) and 12 < tonumber (m) then -- <m> must be a number 1–12
return false;
end
if 0 == tonumber (d) and 31 < tonumber (d) then -- <d> must be a number 1–31; TODO: account for month length and leap yer?
return false;
end
local rxiv_date = table.concat ({y, m, d}, '-'); -- make ymd date string
local good1, good2;
local rxiv_ts, tomorrow_ts; -- to hold Unix timestamps representing the dates
local lang_object = mw.getContentLanguage();
good1, rxiv_ts = pcall (lang_object.formatDate, lang_object, 'U', rxiv_date); -- convert rxiv_date value to Unix timestamp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which tonumber() may not understand
rxiv_ts = tonumber (rxiv_ts) or lang_object:parseFormattedNumber (rxiv_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to Unix timestamp
end
local limit_ts = ((select and ('m' == select)) and 1577836800) or 1576022400; -- choose the appropriate limit timesatmp
return ((limit_ts <= rxiv_ts) and (rxiv_ts < tomorrow_ts)) -- limit_ts <= rxiv_date < tomorrow's date
end
--[[--------------------------< IS _ V A L I D _ I S X N >-----------------------------------------------------
ISBN-10 and ISSN validator code calculates checksum across all ISBN/ISSN digits including the check digit.
ISBN-13 is checked in isbn().
If the number is valid the result will be 0. Before calling this function, ISBN/ISSN must be checked for length
and stripped of dashes, spaces and other non-ISxN characters.
]]
local function is_valid_isxn (isxn_str, len)
local temp = 0;
isxn_str = { isxn_str:byte(1, len) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39, 'X' → 0x58
len = len + 1; -- adjust to be a loop counter
for i, v in ipairs (isxn_str) do -- loop through all of the bytes and calculate the checksum
if v == string.byte ("X" ) then -- if checkdigit is X (compares the byte value of 'X' which is 0x58)
temp = temp + 10 * (len - i); -- it represents 10 decimal
else
temp = temp + tonumber (string.char (v) )*(len-i);
end
end
return temp % 11 == 0; -- returns true if calculation result is zero
end
--[[--------------------------< IS _ V A L I D _ I S X N _ 1 3 >-----------------------------------------------
ISBN-13 and ISMN validator code calculates checksum across all 13 ISBN/ISMN digits including the check digit.
If the number is valid, the result will be 0. Before calling this function, ISBN-13/ISMN must be checked for length
and stripped of dashes, spaces and other non-ISxN-13 characters.
]]
local function is_valid_isxn_13 (isxn_str)
local temp=0;
isxn_str = { isxn_str:byte(1, 13) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39
for i, v in ipairs (isxn_str) do
temp = temp + (3 - 2*(i % 2)) * tonumber (string.char (v) ); -- multiply odd index digits by 1, even index digits by 3 and sum; includes check digit
end
return temp % 10 == 0; -- sum modulo 10 is zero when ISBN-13/ISMN is correct
end
--[[--------------------------< N O R M A L I Z E _ L C C N >--------------------------------------------------
LCCN normalization (https://www.loc.gov/marc/lccn-namespace.html#normalization)
1. Remove all blanks.
2. If there is a forward slash (/) in the string, remove it, and remove all characters to the right of the forward slash.
3. If there is a hyphen in the string:
a. Remove it.
b. Inspect the substring following (to the right of) the (removed) hyphen. Then (and assuming that steps 1 and 2 have been carried out):
1. All these characters should be digits, and there should be six or less. (not done in this function)
2. If the length of the substring is less than 6, left-fill the substring with zeroes until the length is six.
Returns a normalized LCCN for lccn() to validate. There is no error checking (step 3.b.1) performed in this function.
]]
local function normalize_lccn (lccn)
lccn = lccn:gsub ("%s", ""); -- 1. strip whitespace
if nil ~= string.find (lccn, '/') then
lccn = lccn:match ("(.-)/"); -- 2. remove forward slash and all character to the right of it
end
local prefix
local suffix
prefix, suffix = lccn:match ("(.+)%-(.+)"); -- 3.a remove hyphen by splitting the string into prefix and suffix
if nil ~= suffix then -- if there was a hyphen
suffix = string.rep("0", 6-string.len (suffix)) .. suffix; -- 3.b.2 left fill the suffix with 0s if suffix length less than 6
lccn = prefix..suffix; -- reassemble the LCCN
end
return lccn;
end
--============================<< I D E N T I F I E R F U N C T I O N S >>====================================
--[[--------------------------< A R X I V >--------------------------------------------------------------------
See: https://arxiv.org/help/arxiv_identifier
format and error check arXiv identifier. There are three valid forms of the identifier:
the first form, valid only between date codes 9107 and 0703, is:
arXiv:<archive>.<class>/<date code><number><version>
where:
<archive> is a string of alpha characters - may be hyphenated; no other punctuation
<class> is a string of alpha characters - may be hyphenated; no other punctuation; not the same as |class= parameter which is not supported in this form
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
first digit of YY for this form can only 9 and 0
<number> is a three-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces (undocumented)
the second form, valid from April 2007 through December 2014 is:
arXiv:<date code>.<number><version>
where:
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
<number> is a four-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces
the third form, valid from January 2015 is:
arXiv:<date code>.<number><version>
where:
<date code> and <version> are as defined for 0704-1412
<number> is a five-digit number
]]
local function arxiv (options)
local id = options.id;
local class = options.Class; -- TODO: lowercase?
local handler = options.handler;
local year, month, version;
local err_msg = false; -- assume no error message
local text; -- output text
if id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%d$") or id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%dv%d+$") then -- test for the 9107-0703 format with or without version
year, month = id:match("^%a[%a%.%-]+/([90]%d)([01]%d)%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((not (90 < year or 8 > year)) or (1 > month or 12 < month)) or -- if invalid year or invalid month
((91 == year and 7 > month) or (7 == year and 3 < month)) then -- if years ok, are starting and ending months ok?
err_msg = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%dv%d+$") then -- test for the 0704-1412 with or without version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((7 > year) or (14 < year) or (1 > month or 12 < month)) or -- is year invalid or is month invalid? (doesn't test for future years)
((7 == year) and (4 > month)) then -- when year is 07, is month invalid (before April)?
err_msg = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%d%dv%d+$") then -- test for the 1501- format with or without version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((15 > year) or (1 > month or 12 < month)) then -- is year invalid or is month invalid? (doesn't test for future years)
err_msg = true; -- flag for error message
end
else
err_msg = true; -- not a recognized format; flag for error message
end
if err_msg then
options.coins_list_t['ARXIV'] = nil; -- when error, unset so not included in COinS
end
local err_msg_t = {};
if err_msg then
set_message ('err_bad_arxiv');
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access});
if is_set (class) then
if id:match ('^%d+') then
text = table.concat ({text, ' [[https://arxiv.org/archive/', class, ' ', class, ']]'}); -- external link within square brackets, not wikilink
else
set_message ('err_class_ignored');
end
end
return text;
end
--[[--------------------------< B I B C O D E >--------------------------------------------------------------------
Validates (sort of) and formats a bibcode ID.
Format for bibcodes is specified here: https://adsabs.harvard.edu/abs_doc/help_pages/data.html#bibcodes
But, this: 2015arXiv151206696F is apparently valid so apparently, the only things that really matter are length, 19 characters
and first four digits must be a year. This function makes these tests:
length must be 19 characters
characters in position
1–4 must be digits and must represent a year in the range of 1000 – next year
5 must be a letter
6–8 must be letter, digit, ampersand, or dot (ampersand cannot directly precede a dot; &. )
9–18 must be letter, digit, or dot
19 must be a letter or dot
]]
local function bibcode (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local ignore_invalid = options.accept;
local err_type;
local err_msg = '';
local year;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode,
access = access});
if 19 ~= id:len() then
err_type = cfg.err_msg_supl.length;
else
year = id:match ("^(%d%d%d%d)[%a][%w&%.][%w&%.][%w&%.][%w.]+[%a%.]$");
if not year then -- if nil then no pattern match
err_type = cfg.err_msg_supl.value; -- so value error
else
local next_year = tonumber (os.date ('%Y')) + 1; -- get the current year as a number and add one for next year
year = tonumber (year); -- convert year portion of bibcode to a number
if (1000 > year) or (year > next_year) then
err_type = cfg.err_msg_supl.year; -- year out of bounds
end
if id:find('&%.') then
err_type = cfg.err_msg_supl.journal; -- journal abbreviation must not have '&.' (if it does it's missing a letter)
end
if id:match ('.........%.tmp%.') then -- temporary bibcodes when positions 10–14 are '.tmp.'
set_message ('maint_bibcode');
end
end
end
if is_set (err_type) and not ignore_invalid then -- if there was an error detected and accept-as-written markup not used
set_message ('err_bad_bibcode', {err_type});
options.coins_list_t['BIBCODE'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< B I O R X I V >-----------------------------------------------------------------
Format bioRxiv ID and do simple error checking. Before 2019-12-11, biorXiv IDs were 10.1101/ followed by exactly
6 digits. After 2019-12-11, biorXiv IDs retained the six-digit identifier but prefixed that with a yyyy.mm.dd.
date and suffixed with an optional version identifier.
The bioRxiv ID is the string of characters:
https://doi.org/10.1101/078733 -> 10.1101/078733
or a date followed by a six-digit number followed by an optional version indicator 'v' and one or more digits:
https://www.biorxiv.org/content/10.1101/2019.12.11.123456v2 -> 10.1101/2019.12.11.123456v2
see https://www.biorxiv.org/about-biorxiv
]]
local function biorxiv (options)
local id = options.id;
local handler = options.handler;
local err_msg = true; -- flag; assume that there will be an error
local patterns = {
'^10%.1101/%d%d%d%d%d%d$', -- simple 6-digit identifier (before 2019-12-11)
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%dv%d+$', -- y.m.d. date + 6-digit identifier + version (after 2019-12-11)
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d$', -- y.m.d. date + 6-digit identifier (after 2019-12-11)
}
for _, pattern in ipairs (patterns) do -- spin through the patterns looking for a match
if id:match (pattern) then
local y, m, d = id:match (pattern); -- found a match, attempt to get year, month and date from the identifier
if m then -- m is nil when id is the six-digit form
if not is_valid_rxiv_date (y, m, d, 'b') then -- validate the encoded date; 'b' for biorxiv limit
break; -- date fail; break out early so we don't unset the error message
end
end
err_msg = nil; -- we found a match so unset the error message
break; -- and done
end
end -- err_cat remains set here when no match
if err_msg then
options.coins_list_t['BIORXIV'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_biorxiv'); -- and set the error message
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator,
encode = handler.encode, access = handler.access});
end
--[[--------------------------< C I T E S E E R X >------------------------------------------------------------
CiteSeerX use their own notion of "doi" (not to be confused with the identifiers resolved via doi.org).
The description of the structure of this identifier can be found at Help_talk:Citation_Style_1/Archive_26#CiteSeerX_id_structure
]]
local function citeseerx (options)
local id = options.id;
local handler = options.handler;
local matched;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode,
access = handler.access});
matched = id:match ("^10%.1%.1%.[1-9]%d?%d?%d?%.[1-9]%d?%d?%d?$");
if not matched then
set_message ('err_bad_citeseerx' );
options.coins_list_t['CITESEERX'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< D O I >------------------------------------------------------------------------
Formats a DOI and checks for DOI errors.
DOI names contain two parts: prefix and suffix separated by a forward slash.
Prefix: directory indicator '10.' followed by a registrant code
Suffix: character string of any length chosen by the registrant
This function checks a DOI name for: prefix/suffix. If the DOI name contains spaces or endashes, or, if it ends
with a period or a comma, this function will emit a bad_doi error message.
DOI names are case-insensitive and can incorporate any printable Unicode characters so the test for spaces, endash,
and terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in DOI names.
https://www.doi.org/doi_handbook/2_Numbering.html -- 2.2 Syntax of a DOI name
https://www.doi.org/doi_handbook/2_Numbering.html#2.2.2 -- 2.2.2 DOI prefix
]]
local function doi (options)
local id = options.id;
local inactive = options.DoiBroken
local access = options.access;
local ignore_invalid = options.accept;
local handler = options.handler;
local err_flag;
local text;
if is_set (inactive) then
local inactive_year = inactive:match("%d%d%d%d"); -- try to get the year portion from the inactive date
local inactive_month, good;
if is_set (inactive_year) then
if 4 < inactive:len() then -- inactive date has more than just a year (could be anything)
local lang_obj = mw.getContentLanguage(); -- get a language object for this wiki
good, inactive_month = pcall (lang_obj.formatDate, lang_obj, 'F', inactive); -- try to get the month name from the inactive date
if not good then
inactive_month = nil; -- something went wrong so make sure this is unset
end
end
end -- otherwise, |doi-broken-date= has something but it isn't a date
if is_set (inactive_year) and is_set (inactive_month) then
set_message ('maint_doi_inactive_dated', {inactive_year, inactive_month, ' '});
elseif is_set (inactive_year) then
set_message ('maint_doi_inactive_dated', {inactive_year, '', ''});
else
set_message ('maint_doi_inactive');
end
inactive = " (" .. cfg.messages['inactive'] .. ' ' .. inactive .. ')';
end
local registrant = mw.ustring.match (id, '^10%.([^/]+)/[^%s–]-[^%.,]$'); -- registrant set when DOI has the proper basic form
local registrant_err_patterns = { -- these patterns are for code ranges that are not supported
'^[^1-3]%d%d%d%d%.%d+$', -- 5 digits with subcode (0xxxx, 40000+); accepts: 10000–39999
'^[^1-6]%d%d%d%d$', -- 5 digits without subcode (0xxxx, 60000+); accepts: 10000–69999
'^[^1-9]%d%d%d%.%d+$', -- 4 digits with subcode (0xxx); accepts: 1000–9999
'^[^1-9]%d%d%d$', -- 4 digits without subcode (0xxx); accepts: 1000–9999
'^%d%d%d%d%d%d+', -- 6 or more digits
'^%d%d?%d?$', -- less than 4 digits without subcode (3 digits with subcode is legitimate)
'^%d%d?%.[%d%.]+', -- 1 or 2 digits with subcode
'^5555$', -- test registrant will never resolve
'[^%d%.]', -- any character that isn't a digit or a dot
}
if not ignore_invalid then
if registrant then -- when DOI has proper form
for i, pattern in ipairs (registrant_err_patterns) do -- spin through error patterns
if registrant:match (pattern) then -- to validate registrant codes
err_flag = set_message ('err_bad_doi'); -- when found, mark this DOI as bad
break; -- and done
end
end
else
err_flag = set_message ('err_bad_doi'); -- invalid directory or malformed
end
else
set_message ('maint_doi_ignore');
end
if err_flag then
options.coins_list_t['DOI'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access,
auto_link = not (err_flag or is_set (inactive) or ignore_invalid) and 'doi' or nil -- do not auto-link when |doi-broken-date= has a value or when there is a DOI error or (to play it safe, after all, auto-linking is not essential) when invalid DOIs are ignored
}) .. (inactive or '');
return text;
end
--[[--------------------------< H D L >------------------------------------------------------------------------
Formats an HDL with minor error checking.
HDL names contain two parts: prefix and suffix separated by a forward slash.
Prefix: character string using any character in the UCS-2 character set except '/'
Suffix: character string of any length using any character in the UCS-2 character set chosen by the registrant
This function checks a HDL name for: prefix/suffix. If the HDL name contains spaces, endashes, or, if it ends
with a period or a comma, this function will emit a bad_hdl error message.
HDL names are case-insensitive and can incorporate any printable Unicode characters so the test for endashes and
terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in HDLs.
Query string parameters are named here: https://www.handle.net/proxy_servlet.html. query strings are not displayed
but since '?' is an allowed character in an HDL, '?' followed by one of the query parameters is the only way we
have to detect the query string so that it isn't URL-encoded with the rest of the identifier.
]]
local function hdl (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local query_params = { -- list of known query parameters from https://www.handle.net/proxy_servlet.html
'noredirect',
'ignore_aliases',
'auth',
'cert',
'index',
'type',
'urlappend',
'locatt',
'action',
}
local hdl, suffix, param = id:match ('(.-)(%?(%a+).+)$'); -- look for query string
local found;
if hdl then -- when there are query strings, this is the handle identifier portion
for _, q in ipairs (query_params) do -- spin through the list of query parameters
if param:match ('^' .. q) then -- if the query string begins with one of the parameters
found = true; -- announce a find
break; -- and stop looking
end
end
end
if found then
id = hdl; -- found so replace id with the handle portion; this will be URL-encoded, suffix will not
else
suffix = ''; -- make sure suffix is empty string for concatenation else
end
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, suffix = suffix, separator = handler.separator, encode = handler.encode, access = access})
if nil == id:match("^[^%s–]-/[^%s–]-[^%.,]$") then -- HDL must contain a forward slash, must not contain spaces, endashes, and must not end with period or comma
set_message ('err_bad_hdl' );
options.coins_list_t['HDL'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< I S B N >----------------------------------------------------------------------
Determines whether an ISBN string is valid
]]
local function isbn (options)
local isbn_str = options.id;
local ignore_invalid = options.accept;
local handler = options.handler;
local function return_result (check, err_type) -- local function to handle the various returns
local ISBN = internal_link_id ({link = handler.link, label = handler.label, redirect = handler.redirect,
prefix = handler.prefix, id = isbn_str, separator = handler.separator});
if ignore_invalid then -- if ignoring ISBN errors
set_message ('maint_isbn_ignore'); -- add a maint category even when there is no error
else -- here when not ignoring
if not check then -- and there is an error
options.coins_list_t['ISBN'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_isbn', err_type); -- set an error message
return ISBN; -- return id text
end
end
return ISBN; -- return id text
end
if nil ~= isbn_str:match ('[^%s-0-9X]') then
return return_result (false, cfg.err_msg_supl.char); -- fail if isbn_str contains anything but digits, hyphens, or the uppercase X
end
local id = isbn_str:gsub ('[%s-]', ''); -- remove hyphens and whitespace
local len = id:len();
if len ~= 10 and len ~= 13 then
return return_result (false, cfg.err_msg_supl.length); -- fail if incorrect length
end
if len == 10 then
if id:match ('^%d*X?$') == nil then -- fail if isbn_str has 'X' anywhere but last position
return return_result (false, cfg.err_msg_supl.form);
end
if not is_valid_isxn (id, 10) then -- test isbn-10 for numerical validity
return return_result (false, cfg.err_msg_supl.check); -- fail if isbn-10 is not numerically valid
end
if id:find ('^63[01]') then -- 630xxxxxxx and 631xxxxxxx are (apparently) not valid isbn group ids but are used by amazon as numeric identifiers (asin)
return return_result (false, cfg.err_msg_supl.group); -- fail if isbn-10 begins with 630/1
end
return return_result (true, cfg.err_msg_supl.check); -- pass if isbn-10 is numerically valid
else
if id:match ('^%d+$') == nil then
return return_result (false, cfg.err_msg_supl.char); -- fail if ISBN-13 is not all digits
end
if id:match ('^97[89]%d*$') == nil then
return return_result (false, cfg.err_msg_supl.prefix); -- fail when ISBN-13 does not begin with 978 or 979
end
if id:match ('^9790') then
return return_result (false, cfg.err_msg_supl.group); -- group identifier '0' is reserved to ISMN
end
return return_result (is_valid_isxn_13 (id), cfg.err_msg_supl.check);
end
end
--[[--------------------------< A S I N >----------------------------------------------------------------------
Formats a link to Amazon. Do simple error checking: ASIN must be mix of 10 numeric or uppercase alpha
characters. If a mix, first character must be uppercase alpha; if all numeric, ASINs must be 10-digit
ISBN. If 10-digit ISBN, add a maintenance category so a bot or AWB script can replace |asin= with |isbn=.
Error message if not 10 characters, if not ISBN-10, if mixed and first character is a digit.
|asin=630....... and |asin=631....... are (apparently) not a legitimate ISBN though it checksums as one; these
do not cause this function to emit the maint_asin message
This function is positioned here because it calls isbn()
]]
local function asin (options)
local id = options.id;
local domain = options.ASINTLD;
local err_flag;
if not id:match("^[%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u]$") then
err_flag = set_message ('err_bad_asin'); -- ASIN is not a mix of 10 uppercase alpha and numeric characters
else
if id:match("^%d%d%d%d%d%d%d%d%d[%dX]$") then -- if 10-digit numeric (or 9 digits with terminal X)
if is_valid_isxn (id, 10) then -- see if ASIN value is or validates as ISBN-10
if not id:find ('^63[01]') then -- 630xxxxxxx and 631xxxxxxx are (apparently) not a valid isbn prefixes but are used by amazon as a numeric identifier
err_flag = set_message ('err_bad_asin'); -- ASIN has ISBN-10 form but begins with something other than 630/1 so probably an isbn
end
elseif not is_set (err_flag) then
err_flag = set_message ('err_bad_asin'); -- ASIN is not ISBN-10
end
elseif not id:match("^%u[%d%u]+$") then
err_flag = set_message ('err_bad_asin'); -- asin doesn't begin with uppercase alpha
end
end
if (not is_set (domain)) or in_array (domain, {'us'}) then -- default: United States
domain = "com";
elseif in_array (domain, {'jp', 'uk'}) then -- Japan, United Kingdom
domain = "co." .. domain;
elseif in_array (domain, {'z.cn'}) then -- China
domain = "cn";
elseif in_array (domain, {'au', 'br', 'mx', 'sg', 'tr'}) then -- Australia, Brazil, Mexico, Singapore, Turkey
domain = "com." .. domain;
elseif not in_array (domain, {'ae', 'ca', 'cn', 'de', 'es', 'fr', 'in', 'it', 'nl', 'pl', 'sa', 'se', 'co.jp', 'co.uk', 'com', 'com.au', 'com.br', 'com.mx', 'com.sg', 'com.tr'}) then -- Arabic Emirates, Canada, China, Germany, Spain, France, Indonesia, Italy, Netherlands, Poland, Saudi Arabia, Sweden (as of 2021-03 Austria (.at), Liechtenstein (.li) and Switzerland (.ch) still redirect to the German site (.de) with special settings, so don't maintain local ASINs for them)
err_flag = set_message ('err_bad_asin_tld'); -- unsupported asin-tld value
end
local handler = options.handler;
if not is_set (err_flag) then
options.coins_list_t['ASIN'] = handler.prefix .. domain .. "/dp/" .. id; -- asin for coins
else
options.coins_list_t['ASIN'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix .. domain .. "/dp/",
id = id, encode = handler.encode, separator = handler.separator})
end
--[[--------------------------< I S M N >----------------------------------------------------------------------
Determines whether an ISMN string is valid. Similar to ISBN-13, ISMN is 13 digits beginning 979-0-... and uses the
same check digit calculations. See https://www.ismn-international.org/download/Web_ISMN_Users_Manual_2008-6.pdf
section 2, pages 9–12.
ismn value not made part of COinS metadata because we don't have a url or isn't a COinS-defined identifier (rft.xxx)
or an identifier registered at info-uri.info (info:)
]]
local function ismn (options)
local id = options.id;
local handler = options.handler;
local text;
local valid_ismn = true;
local id_copy;
id_copy = id; -- save a copy because this testing is destructive
id = id:gsub ('[%s-]', ''); -- remove hyphens and white space
if 13 ~= id:len() or id:match ("^9790%d*$" ) == nil then -- ISMN must be 13 digits and begin with 9790
valid_ismn = false;
else
valid_ismn=is_valid_isxn_13 (id); -- validate ISMN
end
-- text = internal_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect, -- use this (or external version) when there is some place to link to
-- prefix = handler.prefix, id = id_copy, separator = handler.separator, encode = handler.encode})
text = table.concat ( -- because no place to link to yet
{
make_wikilink (link_label_make (handler), handler.label),
handler.separator,
id_copy
});
if false == valid_ismn then
options.coins_list_t['ISMN'] = nil; -- when error, unset so not included in COinS; not really necessary here because ismn not made part of COinS
set_message ('err_bad_ismn'); -- create an error message if the ISMN is invalid
end
return text;
end
--[[--------------------------< I S S N >----------------------------------------------------------------------
Validate and format an ISSN. This code fixes the case where an editor has included an ISSN in the citation but
has separated the two groups of four digits with a space. When that condition occurred, the resulting link looked
like this:
|issn=0819 4327 gives: [https://www.worldcat.org/issn/0819 4327 0819 4327] -- can't have spaces in an external link
This code now prevents that by inserting a hyphen at the ISSN midpoint. It also validates the ISSN for length
and makes sure that the checkdigit agrees with the calculated value. Incorrect length (8 digits), characters
other than 0-9 and X, or checkdigit / calculated value mismatch will all cause a check ISSN error message. The
ISSN is always displayed with a hyphen, even if the ISSN was given as a single group of 8 digits.
]]
local function issn (options)
local id = options.id;
local handler = options.handler;
local ignore_invalid = options.accept;
local issn_copy = id; -- save a copy of unadulterated ISSN; use this version for display if ISSN does not validate
local text;
local valid_issn = true;
id = id:gsub ('[%s-]', ''); -- remove hyphens and whitespace
if 8 ~= id:len() or nil == id:match ("^%d*X?$" ) then -- validate the ISSN: 8 digits long, containing only 0-9 or X in the last position
valid_issn = false; -- wrong length or improper character
else
valid_issn = is_valid_isxn (id, 8); -- validate ISSN
end
if true == valid_issn then
id = string.sub (id, 1, 4 ) .. "-" .. string.sub (id, 5 ); -- if valid, display correctly formatted version
else
id = issn_copy; -- if not valid, show the invalid ISSN with error message
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode})
if ignore_invalid then
set_message ('maint_issn_ignore');
else
if false == valid_issn then
options.coins_list_t['ISSN'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_issn', (options.hkey == 'EISSN') and 'e' or ''); -- create an error message if the ISSN is invalid
end
end
return text;
end
--[[--------------------------< J F M >-----------------------------------------------------------------------
A numerical identifier in the form nn.nnnn.nn
]]
local function jfm (options)
local id = options.id;
local handler = options.handler;
local id_num;
id_num = id:match ('^[Jj][Ff][Mm](.*)$'); -- identifier with jfm prefix; extract identifier
if is_set (id_num) then
set_message ('maint_jfm_format');
else -- plain number without JFM prefix
id_num = id; -- if here id does not have prefix
end
if id_num and id_num:match('^%d%d%.%d%d%d%d%.%d%d$') then
id = id_num; -- jfm matches pattern
else
set_message ('err_bad_jfm' ); -- set an error message
options.coins_list_t['JFM'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< J S T O R >--------------------------------------------------------------------
Format a JSTOR with some error checking
]]
local function jstor (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
if id:find ('[Jj][Ss][Tt][Oo][Rr]') or id:find ('^https?://') or id:find ('%s') then
set_message ('err_bad_jstor'); -- set an error message
options.coins_list_t['JSTOR'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
end
--[[--------------------------< L C C N >----------------------------------------------------------------------
Format LCCN link and do simple error checking. LCCN is a character string 8-12 characters long. The length of
the LCCN dictates the character type of the first 1-3 characters; the rightmost eight are always digits.
https://oclc-research.github.io/infoURI-Frozen/info-uri.info/info:lccn/reg.html
length = 8 then all digits
length = 9 then lccn[1] is lowercase alpha
length = 10 then lccn[1] and lccn[2] are both lowercase alpha or both digits
length = 11 then lccn[1] is lower case alpha, lccn[2] and lccn[3] are both lowercase alpha or both digits
length = 12 then lccn[1] and lccn[2] are both lowercase alpha
]]
local function lccn (options)
local lccn = options.id;
local handler = options.handler;
local err_flag; -- presume that LCCN is valid
local id = lccn; -- local copy of the LCCN
id = normalize_lccn (id); -- get canonical form (no whitespace, hyphens, forward slashes)
local len = id:len(); -- get the length of the LCCN
if 8 == len then
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits)
err_flag = set_message ('err_bad_lccn'); -- set an error message
end
elseif 9 == len then -- LCCN should be adddddddd
if nil == id:match("%l%d%d%d%d%d%d%d%d") then -- does it match our pattern?
err_flag = set_message ('err_bad_lccn'); -- set an error message
end
elseif 10 == len then -- LCCN should be aadddddddd or dddddddddd
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits) ...
if nil == id:match("^%l%l%d%d%d%d%d%d%d%d") then -- ... see if it matches our pattern
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
end
elseif 11 == len then -- LCCN should be aaadddddddd or adddddddddd
if not (id:match("^%l%l%l%d%d%d%d%d%d%d%d") or id:match("^%l%d%d%d%d%d%d%d%d%d%d")) then -- see if it matches one of our patterns
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
elseif 12 == len then -- LCCN should be aadddddddddd
if not id:match("^%l%l%d%d%d%d%d%d%d%d%d%d") then -- see if it matches our pattern
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
else
err_flag = set_message ('err_bad_lccn'); -- wrong length, set an error message
end
if not is_set (err_flag) and nil ~= lccn:find ('%s') then
err_flag = set_message ('err_bad_lccn'); -- lccn contains a space, set an error message
end
if is_set (err_flag) then
options.coins_list_t['LCCN'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = lccn, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< M E D R X I V >-----------------------------------------------------------------
Format medRxiv ID and do simple error checking. Similar to later bioRxiv IDs, medRxiv IDs are prefixed with a
yyyy.mm.dd. date and suffixed with an optional version identifier. Ealiest date accepted is 2020.01.01
The medRxiv ID is a date followed by an eight-digit number followed by an optional version indicator 'v' and one or more digits:
https://www.medrxiv.org/content/10.1101/2020.11.16.20232009v2 -> 10.1101/2020.11.16.20232009v2
]]
local function medrxiv (options)
local id = options.id;
local handler = options.handler;
local err_msg_flag = true; -- flag; assume that there will be an error
local patterns = {
'%d%d%d%d%d%d%d%d$', -- simple 8-digit identifier; these should be relatively rare
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d%d%dv%d+$', -- y.m.d. date + 8-digit identifier + version (2020-01-01 and later)
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d%d%d$', -- y.m.d. date + 8-digit identifier (2020-01-01 and later)
}
for _, pattern in ipairs (patterns) do -- spin through the patterns looking for a match
if id:match (pattern) then
local y, m, d = id:match (pattern); -- found a match, attempt to get year, month and date from the identifier
if m then -- m is nil when id is the 8-digit form
if not is_valid_rxiv_date (y, m, d, 'b') then -- validate the encoded date; 'b' for medrxiv limit
break; -- date fail; break out early so we don't unset the error message
end
end
err_msg_flag = nil; -- we found a match so unset the error message
break; -- and done
end
end -- <err_msg_flag> remains set here when no match
if err_msg_flag then
options.coins_list_t['MEDRXIV'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_medrxiv'); -- and set the error message
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator,
encode = handler.encode, access = handler.access});
end
--[[--------------------------< M R >--------------------------------------------------------------------------
A seven digit number; if not seven digits, zero-fill leading digits to make seven digits.
]]
local function mr (options)
local id = options.id;
local handler = options.handler;
local id_num;
local id_len;
id_num = id:match ('^[Mm][Rr](%d+)$'); -- identifier with mr prefix
if is_set (id_num) then
set_message ('maint_mr_format'); -- add maint cat
else -- plain number without mr prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
id_len = id_num and id_num:len() or 0;
if (7 >= id_len) and (0 ~= id_len) then
id = string.rep ('0', 7-id_len) .. id_num; -- zero-fill leading digits
else
set_message ('err_bad_mr'); -- set an error message
options.coins_list_t['MR'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< O C L C >----------------------------------------------------------------------
Validate and format an OCLC ID. https://www.oclc.org/batchload/controlnumber.en.html {{dead link}}
archived at: https://web.archive.org/web/20161228233804/https://www.oclc.org/batchload/controlnumber.en.html
]]
local function oclc (options)
local id = options.id;
local handler = options.handler;
local number;
if id:match('^ocm%d%d%d%d%d%d%d%d$') then -- ocm prefix and 8 digits; 001 field (12 characters)
number = id:match('ocm(%d+)'); -- get the number
elseif id:match('^ocn%d%d%d%d%d%d%d%d%d$') then -- ocn prefix and 9 digits; 001 field (12 characters)
number = id:match('ocn(%d+)'); -- get the number
elseif id:match('^on%d%d%d%d%d%d%d%d%d%d+$') then -- on prefix and 10 or more digits; 001 field (12 characters)
number = id:match('^on(%d%d%d%d%d%d%d%d%d%d+)$'); -- get the number
elseif id:match('^%(OCoLC%)[1-9]%d*$') then -- (OCoLC) prefix and variable number digits; no leading zeros; 035 field
number = id:match('%(OCoLC%)([1-9]%d*)'); -- get the number
if 9 < number:len() then
number = nil; -- constrain to 1 to 9 digits; change this when OCLC issues 10-digit numbers
end
elseif id:match('^%d+$') then -- no prefix
number = id; -- get the number
if tonumber (id) > handler.id_limit then
number = nil; -- unset when id value exceeds the limit
end
end
if number then -- proper format
id = number; -- exclude prefix, if any, from external link
else
set_message ('err_bad_oclc') -- add an error message if the id is malformed
options.coins_list_t['OCLC'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< O P E N L I B R A R Y >--------------------------------------------------------
Formats an OpenLibrary link, and checks for associated errors.
]]
local function openlibrary (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local ident, code = id:gsub('^OL', ''):match("^(%d+([AMW]))$"); -- strip optional OL prefix followed immediately by digits followed by 'A', 'M', or 'W';
local err_flag;
local prefix = { -- these are appended to the handler.prefix according to code
['A']='authors/OL',
['M']='books/OL',
['W']='works/OL',
['X']='OL' -- not a code; spoof when 'code' in id is invalid
};
if not ident then
code = 'X'; -- no code or id completely invalid
ident = id; -- copy id to ident so that we display the flawed identifier
err_flag = set_message ('err_bad_ol');
end
if not is_set (err_flag) then
options.coins_list_t['OL'] = handler.prefix .. prefix[code] .. ident; -- experiment for ol coins
else
options.coins_list_t['OL'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix .. prefix[code],
id = ident, separator = handler.separator, encode = handler.encode,
access = access});
end
--[[--------------------------< O S T I >----------------------------------------------------------------------
Format OSTI and do simple error checking. OSTIs are sequential numbers beginning at 1 and counting up. This
code checks the OSTI to see that it contains only digits and is less than test_limit specified in the configuration;
the value in test_limit will need to be updated periodically as more OSTIs are issued.
NB. 1018 is the lowest OSTI number found in the wild (so far) and resolving OK on the OSTI site
]]
local function osti (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
if id:match("[^%d]") then -- if OSTI has anything but digits
set_message ('err_bad_osti'); -- set an error message
options.coins_list_t['OSTI'] = nil; -- when error, unset so not included in COinS
else -- OSTI is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1018 > id_num or handler.id_limit < id_num then -- if OSTI is outside test limit boundaries
set_message ('err_bad_osti'); -- set an error message
options.coins_list_t['OSTI'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
end
--[[--------------------------< P M C >------------------------------------------------------------------------
Format a PMC, do simple error checking, and check for embargoed articles.
The embargo parameter takes a date for a value. If the embargo date is in the future the PMC identifier will not
be linked to the article. If the embargo date is today or in the past, or if it is empty or omitted, then the
PMC identifier is linked to the article through the link at cfg.id_handlers['PMC'].prefix.
PMC embargo date testing is done in function is_embargoed () which is called earlier because when the citation
has |pmc=<value> but does not have a |url= then |title= is linked with the PMC link. Function is_embargoed ()
returns the embargo date if the PMC article is still embargoed, otherwise it returns an empty string.
PMCs are sequential numbers beginning at 1 and counting up. This code checks the PMC to see that it contains only digits and is less
than test_limit; the value in local variable test_limit will need to be updated periodically as more PMCs are issued.
]]
local function pmc (options)
local id = options.id;
local embargo = options.Embargo; -- TODO: lowercase?
local handler = options.handler;
local err_flag;
local id_num;
local text;
id_num = id:match ('^[Pp][Mm][Cc](%d+)$'); -- identifier with PMC prefix
if is_set (id_num) then
set_message ('maint_pmc_format');
else -- plain number without PMC prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if PMC is outside test limit boundaries
err_flag = set_message ('err_bad_pmc'); -- set an error message
else
id = tostring (id_num); -- make sure id is a string
end
else -- when id format incorrect
err_flag = set_message ('err_bad_pmc'); -- set an error message
end
if is_set (embargo) and is_set (is_embargoed (embargo)) then -- is PMC is still embargoed?
text = table.concat ( -- still embargoed so no external link
{
make_wikilink (link_label_make (handler), handler.label),
handler.separator,
id,
});
else
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect, -- no embargo date or embargo has expired, ok to link to article
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access,
auto_link = not err_flag and 'pmc' or nil -- do not auto-link when PMC has error
});
end
if err_flag then
options.coins_list_t['PMC'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< P M I D >----------------------------------------------------------------------
Format PMID and do simple error checking. PMIDs are sequential numbers beginning at 1 and counting up. This
code checks the PMID to see that it contains only digits and is less than test_limit; the value in local variable
test_limit will need to be updated periodically as more PMIDs are issued.
]]
local function pmid (options)
local id = options.id;
local handler = options.handler;
if id:match("[^%d]") then -- if PMID has anything but digits
set_message ('err_bad_pmid'); -- set an error message
options.coins_list_t['PMID'] = nil; -- when error, unset so not included in COinS
else -- PMID is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if PMID is outside test limit boundaries
set_message ('err_bad_pmid'); -- set an error message
options.coins_list_t['PMID'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< R F C >------------------------------------------------------------------------
Format RFC and do simple error checking. RFCs are sequential numbers beginning at 1 and counting up. This
code checks the RFC to see that it contains only digits and is less than test_limit specified in the configuration;
the value in test_limit will need to be updated periodically as more RFCs are issued.
An index of all RFCs is here: https://tools.ietf.org/rfc/
]]
local function rfc (options)
local id = options.id;
local handler = options.handler;
if id:match("[^%d]") then -- if RFC has anything but digits
set_message ('err_bad_rfc'); -- set an error message
options.coins_list_t['RFC'] = nil; -- when error, unset so not included in COinS
else -- RFC is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if RFC is outside test limit boundaries
set_message ('err_bad_rfc'); -- set an error message
options.coins_list_t['RFC'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access});
end
--[[--------------------------< S 2 C I D >--------------------------------------------------------------------
Format an S2CID, do simple error checking
S2CIDs are sequential numbers beginning at 1 and counting up. This code checks the S2CID to see that it is only
digits and is less than test_limit; the value in local variable test_limit will need to be updated periodically
as more S2CIDs are issued.
]]
local function s2cid (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local id_num;
local text;
id_num = id:match ('^[1-9]%d*$'); -- id must be all digits; must not begin with 0; no open access flag
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if handler.id_limit < id_num then -- if S2CID is outside test limit boundaries
set_message ('err_bad_s2cid'); -- set an error message
options.coins_list_t['S2CID'] = nil; -- when error, unset so not included in COinS
end
else -- when id format incorrect
set_message ('err_bad_s2cid'); -- set an error message
options.coins_list_t['S2CID'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
return text;
end
--[[--------------------------< S B N >------------------------------------------------------------------------
9-digit form of ISBN-10; uses same check-digit validation when SBN is prefixed with an additional '0' to make 10 digits
sbn value not made part of COinS metadata because we don't have a url or isn't a COinS-defined identifier (rft.xxx)
or an identifier registered at info-uri.info (info:)
]]
local function sbn (options)
local id = options.id;
local ignore_invalid = options.accept;
local handler = options.handler;
local function return_result (check, err_type) -- local function to handle the various returns
local SBN = internal_link_id ({link = handler.link, label = handler.label, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator});
if not ignore_invalid then -- if not ignoring SBN errors
if not check then
options.coins_list_t['SBN'] = nil; -- when error, unset so not included in COinS; not really necessary here because sbn not made part of COinS
set_message ('err_bad_sbn', {err_type}); -- display an error message
return SBN;
end
else
set_message ('maint_isbn_ignore'); -- add a maint category even when there is no error (ToDo: Possibly switch to separate message for SBNs only)
end
return SBN;
end
if id:match ('[^%s-0-9X]') then
return return_result (false, cfg.err_msg_supl.char); -- fail if SBN contains anything but digits, hyphens, or the uppercase X
end
local ident = id:gsub ('[%s-]', ''); -- remove hyphens and whitespace; they interfere with the rest of the tests
if 9 ~= ident:len() then
return return_result (false, cfg.err_msg_supl.length); -- fail if incorrect length
end
if ident:match ('^%d*X?$') == nil then
return return_result (false, cfg.err_msg_supl.form); -- fail if SBN has 'X' anywhere but last position
end
return return_result (is_valid_isxn ('0' .. ident, 10), cfg.err_msg_supl.check);
end
--[[--------------------------< S S R N >----------------------------------------------------------------------
Format an SSRN, do simple error checking
SSRNs are sequential numbers beginning at 100? and counting up. This code checks the SSRN to see that it is
only digits and is greater than 99 and less than test_limit; the value in local variable test_limit will need
to be updated periodically as more SSRNs are issued.
]]
local function ssrn (options)
local id = options.id;
local handler = options.handler;
local id_num;
local text;
id_num = id:match ('^%d+$'); -- id must be all digits
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if 100 > id_num or handler.id_limit < id_num then -- if SSRN is outside test limit boundaries
set_message ('err_bad_ssrn'); -- set an error message
options.coins_list_t['SSRN'] = nil; -- when error, unset so not included in COinS
end
else -- when id format incorrect
set_message ('err_bad_ssrn'); -- set an error message
options.coins_list_t['SSRN'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = options.access});
return text;
end
--[[--------------------------< U S E N E T _ I D >------------------------------------------------------------
Validate and format a usenet message id. Simple error checking, looks for 'id-left@id-right' not enclosed in
'<' and/or '>' angle brackets.
]]
local function usenet_id (options)
local id = options.id;
local handler = options.handler;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode})
if not id:match('^.+@.+$') or not id:match('^[^<].*[^>]$') then -- doesn't have '@' or has one or first or last character is '< or '>'
set_message ('err_bad_usenet_id') -- add an error message if the message id is invalid
options.coins_list_t['USENETID'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< Z B L >-----------------------------------------------------------------------
A numerical identifier in the form nnnn.nnnnn - leading zeros in the first quartet optional
format described here: http://emis.mi.sanu.ac.rs/ZMATH/zmath/en/help/search/
temporary format is apparently eight digits. Anything else is an error
]]
local function zbl (options)
local id = options.id;
local handler = options.handler;
if id:match('^%d%d%d%d%d%d%d%d$') then -- is this identifier using temporary format?
set_message ('maint_zbl'); -- yes, add maint cat
elseif not id:match('^%d?%d?%d?%d%.%d%d%d%d%d$') then -- not temporary, is it normal format?
set_message ('err_bad_zbl'); -- no, set an error message
options.coins_list_t['ZBL'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--============================<< I N T E R F A C E F U N C T I O N S >>==========================================
--[[--------------------------< E X T R A C T _ I D S >------------------------------------------------------------
Populates ID table from arguments using configuration settings. Loops through cfg.id_handlers and searches args for
any of the parameters listed in each cfg.id_handlers['...'].parameters. If found, adds the parameter and value to
the identifier list. Emits redundant error message if more than one alias exists in args
]]
local function extract_ids (args)
local id_list = {}; -- list of identifiers found in args
for k, v in pairs (cfg.id_handlers) do -- k is uppercase identifier name as index to cfg.id_handlers; e.g. cfg.id_handlers['ISBN'], v is a table
v = select_one (args, v.parameters, 'err_redundant_parameters' ); -- v.parameters is a table of aliases for k; here we pick one from args if present
if is_set (v) then id_list[k] = v; end -- if found in args, add identifier to our list
end
return id_list;
end
--[[--------------------------< E X T R A C T _ I D _ A C C E S S _ L E V E L S >--------------------------------------
Fetches custom id access levels from arguments using configuration settings. Parameters which have a predefined access
level (e.g. arxiv) do not use this function as they are directly rendered as free without using an additional parameter.
returns a table of k/v pairs where k is same as the identifier's key in cfg.id_handlers and v is the assigned (valid) keyword
access-level values must match the case used in cfg.keywords_lists['id-access'] (lowercase unless there is some special reason for something else)
]]
local function extract_id_access_levels (args, id_list)
local id_accesses_list = {};
for k, v in pairs (cfg.id_handlers) do
local access_param = v.custom_access; -- name of identifier's access-level parameter
if is_set (access_param) then
local access_level = args[access_param]; -- get the assigned value if there is one
if is_set (access_level) then
if not in_array (access_level, cfg.keywords_lists['id-access']) then -- exact match required
set_message ('err_invalid_param_val', {access_param, access_level});
access_level = nil; -- invalid so unset
end
if not is_set (id_list[k]) then -- identifier access-level must have a matching identifier
set_message ('err_param_access_requires_param', {k:lower()}); -- parameter name is uppercase in cfg.id_handlers (k); lowercase for error message
end
id_accesses_list[k] = cfg.keywords_xlate[access_level]; -- get translated keyword
end
end
end
return id_accesses_list;
end
--[[--------------------------< B U I L D _ I D _ L I S T >----------------------------------------------------
render the identifiers into a sorted sequence table
<ID_list_coins_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value
<options_t> is a table of various k/v option pairs provided in the call to new_build_id_list();
modified by this function and passed to all identifier rendering functions
<access_levels_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value (if valid)
returns a sequence table of sorted (by hkey - 'handler' key) rendered identifier strings
]]
local function build_id_list (ID_list_coins_t, options_t, access_levels_t)
local ID_list_t = {};
local accept;
local func_map = { --function map points to functions associated with hkey identifier
['ARXIV'] = arxiv,
['ASIN'] = asin,
['BIBCODE'] = bibcode,
['BIORXIV'] = biorxiv,
['CITESEERX'] = citeseerx,
['DOI'] = doi,
['EISSN'] = issn,
['HDL'] = hdl,
['ISBN'] = isbn,
['ISMN'] = ismn,
['ISSN'] = issn,
['JFM'] = jfm,
['JSTOR'] = jstor,
['LCCN'] = lccn,
['MEDRXIV'] = medrxiv,
['MR'] = mr,
['OCLC'] = oclc,
['OL'] = openlibrary,
['OSTI'] = osti,
['PMC'] = pmc,
['PMID'] = pmid,
['RFC'] = rfc,
['S2CID'] = s2cid,
['SBN'] = sbn,
['SSRN'] = ssrn,
['USENETID'] = usenet_id,
['ZBL'] = zbl,
}
for hkey, v in pairs (ID_list_coins_t) do
v, accept = has_accept_as_written (v); -- remove accept-as-written markup if present; accept is boolean true when markup removed; false else
-- every function gets the options table with value v and accept boolean
options_t.hkey = hkey; -- ~/Configuration handler key
options_t.id = v; -- add that identifier value to the options table
options_t.accept = accept; -- add the accept boolean flag
options_t.access = access_levels_t[hkey]; -- add the access level for those that have an |<identifier-access= parameter
options_t.handler = cfg.id_handlers[hkey];
options_t.coins_list_t = ID_list_coins_t; -- pointer to ID_list_coins_t; for |asin= and |ol=; also to keep erroneous values out of the citation's metadata
options_t.coins_list_t[hkey] = v; -- id value without accept-as-written markup for metadata
if options_t.handler.access and not in_array (options_t.handler.access, cfg.keywords_lists['id-access']) then
error (cfg.messages['unknown_ID_access'] .. options_t.handler.access); -- here when handler access key set to a value not listed in list of allowed id access keywords
end
if func_map[hkey] then
local id_text = func_map[hkey] (options_t); -- call the function to get identifier text and any error message
table.insert (ID_list_t, {hkey, id_text}); -- add identifier text to the output sequence table
else
error (cfg.messages['unknown_ID_key'] .. hkey); -- here when func_map doesn't have a function for hkey
end
end
local function comp (a, b) -- used by following table.sort()
return a[1]:lower() < b[1]:lower(); -- sort by hkey
end
table.sort (ID_list_t, comp); -- sequence table of tables sort
for k, v in ipairs (ID_list_t) do -- convert sequence table of tables to simple sequence table of strings
ID_list_t[k] = v[2]; -- v[2] is the identifier rendering from the call to the various functions in func_map{}
end
return ID_list_t;
end
--[[--------------------------< O P T I O N S _ C H E C K >----------------------------------------------------
check that certain option parameters have their associated identifier parameters with values
<ID_list_coins_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value
<ID_support_t> is a sequence table of tables created in citation0() where each subtable has four elements:
[1] is the support parameter's assigned value; empty string if not set
[2] is a text string same as key in cfg.id_handlers
[3] is cfg.error_conditions key used to create error message
[4] is original ID support parameter name used to create error message
returns nothing; on error emits an appropriate error message
]]
local function options_check (ID_list_coins_t, ID_support_t)
for _, v in ipairs (ID_support_t) do
if is_set (v[1]) and not ID_list_coins_t[v[2]] then -- when support parameter has a value but matching identifier parameter is missing or empty
set_message (v[3], (v[4])); -- emit the appropriate error message
end
end
end
--[[--------------------------< I D E N T I F I E R _ L I S T S _ G E T >--------------------------------------
Creates two identifier lists: a k/v table of identifiers and their values to be used locally and for use in the
COinS metadata, and a sequence table of the rendered identifier strings that will be included in the rendered
citation.
]]
local function identifier_lists_get (args_t, options_t, ID_support_t)
local ID_list_coins_t = extract_ids (args_t); -- get a table of identifiers and their values for use locally and for use in COinS
options_check (ID_list_coins_t, ID_support_t); -- ID support parameters must have matching identifier parameters
local ID_access_levels_t = extract_id_access_levels (args_t, ID_list_coins_t); -- get a table of identifier access levels
local ID_list_t = build_id_list (ID_list_coins_t, options_t, ID_access_levels_t); -- get a sequence table of rendered identifier strings
return ID_list_t, ID_list_coins_t; -- return the tables
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
has_accept_as_written = utilities_page_ptr.has_accept_as_written; -- import functions from select Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
set_message = utilities_page_ptr.set_message;
select_one = utilities_page_ptr.select_one;
substitute = utilities_page_ptr.substitute;
make_wikilink = utilities_page_ptr.make_wikilink;
z = utilities_page_ptr.z; -- table of tables in Module:Citation/CS1/Utilities
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
auto_link_urls = auto_link_urls, -- table of identifier URLs to be used when auto-linking |title=
identifier_lists_get = identifier_lists_get, -- experiment to replace individual calls to build_id_list(), extract_ids, extract_id_access_levels
is_embargoed = is_embargoed;
set_selected_modules = set_selected_modules;
}
3cd8b5ef8d199885cc0c92aabeb5bc338fa6f42c
Template:Organization infoboxes
10
143
385
2023-09-27T23:17:19Z
wikipedia>Jonesey95
0
fix redirect
wikitext
text/x-wiki
{{Navbox
| name = Organization infoboxes
| state = {{{state<includeonly>|expanded</includeonly>}}}
| bodyclass = hlist
| title = [[Wikipedia:Template index|Wikipedia templates]]: [[organization]] [[Template:Infobox|infoboxes]]
| above = [[Wikipedia:Manual of Style/Infoboxes]]
| group1 = General
| list1 =
* {{Tl|Infobox organization}}
* {{Tl|Infobox official post}}
* {{tl|Infobox criminal organization}}
* {{tl|Infobox fictional organisation}}
| group2 = {{longitem|Government<br/>and politics}}
| list2 =
* {{Tl|Infobox government}}
* {{Tl|Infobox government agency}}
* {{Tl|Infobox legislature}}
* {{Tl|Infobox political party}}
* {{Tl|Infobox court}}
* {{Tl|Infobox detention facility}}
* {{tl|Infobox fire department}}
* {{Tl|Infobox law enforcement agency}}
* {{Tl|Infobox space agency}}
| group3 = Military
| list3 =
* {{Tl|Infobox national military}}
* {{Tl|Infobox military unit}}
* {{tl|Infobox military rank}}
* {{Tl|Infobox military gear}}
| group4 = Religion
| list4 =
* {{Tl|Infobox religious group}}
* {{Tl|Infobox religion}}
* {{Tl|Infobox diocese}}
* {{Tl|Infobox church}}
* {{Tl|Infobox monastery}}
| group5 = People
| list5 =
* {{Tl|Infobox ethnic group}}
* {{Tl|Infobox caste}}
* {{Tl|Infobox clan}}
* {{Tl|Infobox family}}
* {{Tl|Infobox iwi}}
* {{Tl|Infobox hereditary title}}
* {{Tl|Infobox monarchy}}
* {{Tl|Infobox officeholder}}
* {{Tl|Infobox tribe}}
| group6 = {{longitem|Typically<br/>non-profit}}
| list6 =
* {{tl|Infobox hospital}}
* {{Tl|Infobox institute}}
* {{Tl|Infobox laboratory}}{{smallsup|1}}
* {{tl|Infobox museum}}
* {{Tl|Infobox observatory}}
* {{Tl|Infobox school}}
* {{tl|Infobox school district}}
* {{Tl|Infobox university}}{{smallsup|2}}
| group7 = Publications
| list7 =
* {{Tl|Infobox journal}}
* {{Tl|Infobox magazine}}
* {{Tl|Infobox newspaper}}
* {{Tl|Infobox publisher}}
| group8 = Business
| list8 =
* {{Tl|Infobox company}}
* {{tl|Infobox brewery}}
* {{Tl|Infobox law firm}}
* {{tl|Infobox restaurant}}
* {{tl|Infobox website}} – ''type of business or publication''
| group9 = Distinctions
| list9 =
* {{Tl|Infobox order}}
* {{Tl|Infobox fraternity}}
* {{Tl|Infobox Grand Lodge}}
| group10 = Subtemplates
| list10 =
* '''Coordinates''' {{Tl|coord}}
* '''Dates'''
** {{Tl|start date}}}—for {{para|established}}, {{para|founded}}, {{para|opened}} etc.
** {{Tl|end date}}}—for {{para|dissolved}}, {{para|defunct}}
* '''Lists'''
**{{tl|plainlist}}
** {{tl|flatlist}}
** {{tl|unbulleted list}}
* '''Non-English text''' {{Tl|lang}}
* '''Website'''
** {{tl|URL}}
** {{tl|Official URL}}
** {{tl|Official website}}
* '''Documentation'''
** {{Tl|mf-adr}}}—Address
** {{Tl|UF-hcard-org}}—[[Microformat]]/metadata
| below =
* {{smallsup|1}} or research institution
* {{smallsup|2}} or college
* [[:Category:Infobox templates|Category]]
* [[Help:Infobox|Help]]
* [[Wikipedia:List of infoboxes|List of infoboxes]]
}}<noinclude>{{documentation}}</noinclude>
8e81fe7179216c1823e098fa600be889f26cbeba
Template:Infobox settlement/doc
10
233
570
2023-10-02T22:49:17Z
wikipedia>Moxy
0
wikitext
text/x-wiki
{{Documentation subpage}}
<!--Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[Wikipedia:Wikidata]])-->
{{Auto short description}}
{{High-use}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Coordinates|Module:Check for unknown parameters|Module:Settlement short description}}
{{Uses TemplateStyles|Template:Infobox settlement/styles.css}}
{{Uses Wikidata|P41|P94|P158|P625|P856}}
This template should be used to produce an [[WP:Infobox|Infobox]] for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, et cetera—in fact, any subdivision below the level of a country, for which {{tl|Infobox country}} should be used. Parameters are described in the table below. For questions, see the [[Template talk:Infobox settlement|talk page]]. For a US city guideline, see [[WP:USCITIES]].
The template is aliased or used as a sub-template for several infobox front-end templates.
==Usage==
* '''Important''': Please enter all numeric values in a raw, unformatted fashion. References and {{tl|citation needed}} tags are to be included in their respective section footnotes field. Numeric values that are not "raw" may create an "Expression error". Raw values will be automatically formatted by the template. If you find a raw value is not formatted in your usage of the template, please post a notice on the discussion page for this template.
* An expression error may also occur when any coordinate parameter has a value, but one or more coordinate parameters are blank or invalid.
Basic blank template, ready to cut and paste. See the next section for a copy of the template with all parameters and comments. See the table below that for a full description of each parameter.
===Using metric units===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name = <!-- Settlement name in local language(s), if different from the English name -->
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|image_flag =
|flag_alt =
|image_seal =
|seal_alt =
|image_shield =
|shield_alt =
|etymology =
|nickname =
|motto =
|image_map =
|map_alt =
|map_caption =
|pushpin_map =
|pushpin_map_alt =
|pushpin_map_caption =
|pushpin_mapsize =
|pushpin_label_position =
|coordinates = <!-- {{coord|latitude|longitude|type:city|display=inline,title}} -->
|coor_pinpoint =
|coordinates_footnotes =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|subdivision_type3 =
|subdivision_name3 =
|established_title =
|established_date =
|founder =
|seat_type =
|seat =
|government_footnotes =
|government_type =
|governing_body =
|leader_party =
|leader_title =
|leader_name =
|leader_title1 =
|leader_name1 =
|leader_title2 =
|leader_name2 =
|leader_title3 =
|leader_name3 =
|leader_title4 =
|leader_name4 =
|unit_pref = Metric
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
|area_footnotes =
|area_urban_footnotes = <!-- <ref> </ref> -->
|area_rural_footnotes = <!-- <ref> </ref> -->
|area_metro_footnotes = <!-- <ref> </ref> -->
|area_note =
|area_water_percent =
|area_rank =
|area_blank1_title =
|area_blank2_title =
<!-- square kilometers -->
|area_total_km2 =
|area_land_km2 =
|area_water_km2 =
|area_urban_km2 =
|area_rural_km2 =
|area_metro_km2 =
|area_blank1_km2 =
|area_blank2_km2 =
<!-- hectares -->
|area_total_ha =
|area_land_ha =
|area_water_ha =
|area_urban_ha =
|area_rural_ha =
|area_metro_ha =
|area_blank1_ha =
|area_blank2_ha =
|length_km =
|width_km =
|dimensions_footnotes =
|elevation_footnotes =
|elevation_m =
|population_footnotes =
|population_as_of =
|population_total =
|population_density_km2 = auto
|population_note =
|population_demonym =
|timezone1 =
|utc_offset1 =
|timezone1_DST =
|utc_offset1_DST =
|postal_code_type =
|postal_code =
|area_code_type =
|area_code =
|area_codes = <!-- for multiple area codes -->
|iso_code =
|website = <!-- {{URL|example.com}} -->
|module =
|footnotes =
}}
</syntaxhighlight>
===Using non-metric units===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name =
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|image_flag =
|flag_alt =
|image_seal =
|seal_alt =
|image_shield =
|shield_alt =
|etymology =
|nickname =
|motto =
|image_map =
|map_alt =
|map_caption =
|pushpin_map =
|pushpin_map_alt =
|pushpin_map_caption =
|pushpin_label_position =
|coordinates = <!-- {{coord|latitude|longitude|type:city|display=inline,title}} -->
|coor_pinpoint =
|coordinates_footnotes =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|subdivision_type3 =
|subdivision_name3 =
|established_title =
|established_date =
|founder =
|seat_type =
|seat =
|government_footnotes =
|leader_party =
|leader_title =
|leader_name =
|unit_pref = US<!-- or UK -->
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
|area_footnotes =
|area_urban_footnotes = <!-- <ref> </ref> -->
|area_rural_footnotes = <!-- <ref> </ref> -->
|area_metro_footnotes = <!-- <ref> </ref> -->
|area_note =
|area_water_percent =
|area_rank =
|area_blank1_title =
|area_blank2_title =
<!-- square miles -->
|area_total_sq_mi =
|area_land_sq_mi =
|area_water_sq_mi =
|area_urban_sq_mi =
|area_rural_sq_mi =
|area_metro_sq_mi =
|area_blank1_sq_mi =
|area_blank2_sq_mi =
<!-- acres -->
|area_total_acre =
|area_land_acre =
|area_water_acre =
|area_urban_acre =
|area_rural_acre =
|area_metro_acre =
|area_blank1_acre =
|area_blank2_acre =
|length_mi =
|width_mi =
|dimensions_footnotes =
|elevation_footnotes =
|elevation_ft =
|population_footnotes =
|population_as_of =
|population_total =
|population_density_sq_mi = auto
|population_note =
|population_demonym =
|timezone1 =
|utc_offset1 =
|timezone1_DST =
|utc_offset1_DST =
|postal_code_type =
|postal_code =
|area_code_type =
|area_code =
|iso_code =
|website = <!-- {{URL|example.com}} -->
|module =
|footnotes =
}}
</syntaxhighlight>
===Short version===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name =
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|etymology =
|nickname =
|coordinates = <!-- {{Coord}} -->
|population_total =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|website = <!-- {{URL|example.com}} -->
}}
</syntaxhighlight>
===Complete empty syntax, with comments===
This copy of the template lists all parameters except for some of the repeating numbered parameters which are noted in the comments. Comments here should be brief; see the table below for full descriptions of each parameter.
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Infobox settlement
| name = <!-- at least one of the first two fields must be filled in -->
| official_name =
| native_name = <!-- if different from the English name -->
| native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| other_name =
| settlement_type = <!-- such as Town, Village, City, Borough etc. -->
<!-- transliteration(s) -->
| translit_lang1 =
| translit_lang1_type =
| translit_lang1_info =
| translit_lang1_type1 =
| translit_lang1_info1 =
| translit_lang1_type2 =
| translit_lang1_info2 = <!-- etc., up to translit_lang1_type6 / translit_lang1_info6 -->
| translit_lang2 =
| translit_lang2_type =
| translit_lang2_info =
| translit_lang2_type1 =
| translit_lang2_info1 =
| translit_lang2_type2 =
| translit_lang2_info2 = <!-- etc., up to translit_lang2_type6 / translit_lang2_info6 -->
<!-- images, nickname, motto -->
| image_skyline =
| imagesize =
| image_alt =
| image_caption =
| image_flag =
| flag_size =
| flag_alt =
| flag_border =
| flag_link =
| image_seal =
| seal_size =
| seal_alt =
| seal_link =
| seal_type =
| image_shield =
| shield_size =
| shield_alt =
| shield_link =
| image_blank_emblem =
| blank_emblem_type =
| blank_emblem_size =
| blank_emblem_alt =
| blank_emblem_link =
| etymology =
| nickname =
| nicknames =
| motto =
| mottoes =
| anthem =
<!-- maps and coordinates -->
| image_map =
| mapsize =
| map_alt =
| map_caption =
| image_map1 =
| mapsize1 =
| map_alt1 =
| map_caption1 =
| pushpin_map = <!-- name of a location map as per Template:Location_map -->
| pushpin_mapsize =
| pushpin_map_alt =
| pushpin_map_caption =
| pushpin_map_caption_notsmall =
| pushpin_label = <!-- only necessary if "name" or "official_name" are too long -->
| pushpin_label_position = <!-- position of the pushpin label: left, right, top, bottom, none -->
| pushpin_outside =
| pushpin_relief =
| pushpin_image =
| pushpin_overlay =
| coordinates = <!-- {{Coord}} -->
| coor_pinpoint = <!-- to specify exact location of coordinates (was coor_type) -->
| coordinates_footnotes = <!-- for references: use <ref> tags -->
| grid_name = <!-- name of a regional grid system -->
| grid_position = <!-- position on the regional grid system -->
<!-- location -->
| subdivision_type = Country
| subdivision_name = <!-- the name of the country -->
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 = <!-- etc., subdivision_type6 / subdivision_name6 -->
<!-- established -->
| established_title = <!-- Founded -->
| established_date = <!-- requires established_title= -->
| established_title1 = <!-- Incorporated (town) -->
| established_date1 = <!-- requires established_title1= -->
| established_title2 = <!-- Incorporated (city) -->
| established_date2 = <!-- requires established_title2= -->
| established_title3 =
| established_date3 = <!-- requires established_title3= -->
| established_title4 =
| established_date4 = <!-- requires established_title4= -->
| established_title5 =
| established_date5 = <!-- requires established_title5= -->
| established_title6 =
| established_date6 = <!-- requires established_title6= -->
| established_title7 =
| established_date7 = <!-- requires established_title7= -->
| extinct_title =
| extinct_date =
| founder =
| named_for =
<!-- seat, smaller parts -->
| seat_type = <!-- defaults to: Seat -->
| seat =
| seat1_type = <!-- defaults to: Former seat -->
| seat1 =
| parts_type = <!-- defaults to: Boroughs -->
| parts_style = <!-- list, coll (collapsed list), para (paragraph format) -->
| parts = <!-- parts text, or header for parts list -->
| p1 =
| p2 = <!-- etc., up to p50: for separate parts to be listed-->
<!-- government type, leaders -->
| government_footnotes = <!-- for references: use <ref> tags -->
| government_type =
| governing_body =
| leader_party =
| leader_title =
| leader_name = <!-- add &nbsp; (no-break space) to disable automatic links -->
| leader_title1 =
| leader_name1 = <!-- etc., up to leader_title4 / leader_name4 -->
<!-- display settings -->
| total_type = <!-- to set a non-standard label for total area and population rows -->
| unit_pref = <!-- enter: Imperial, to display imperial before metric -->
<!-- area -->
| area_footnotes = <!-- for references: use <ref> tags -->
| dunam_link = <!-- If dunams are used, this specifies which dunam to link. -->
| area_total_km2 = <!-- ALL fields with measurements have automatic unit conversion -->
| area_total_sq_mi = <!-- see table @ Template:Infobox settlement for details -->
| area_total_ha =
| area_total_acre =
| area_total_dunam = <!-- used in Middle East articles only -->
| area_land_km2 =
| area_land_sq_mi =
| area_land_ha =
| area_land_acre =
| area_land_dunam = <!-- used in Middle East articles only -->
| area_water_km2 =
| area_water_sq_mi =
| area_water_ha =
| area_water_acre =
| area_water_dunam = <!-- used in Middle East articles only -->
| area_water_percent =
| area_urban_footnotes = <!-- for references: use <ref> tags -->
| area_urban_km2 =
| area_urban_sq_mi =
| area_urban_ha =
| area_urban_acre =
| area_urban_dunam = <!-- used in Middle East articles only -->
| area_rural_footnotes = <!-- for references: use <ref> tags -->
| area_rural_km2 =
| area_rural_sq_mi =
| area_rural_ha =
| area_rural_acre =
| area_rural_dunam = <!-- used in Middle East articles only -->
| area_metro_footnotes = <!-- for references: use <ref> tags -->
| area_metro_km2 =
| area_metro_sq_mi =
| area_metro_ha =
| area_metro_acre =
| area_metro_dunam = <!-- used in Middle East articles only -->
| area_rank =
| area_blank1_title =
| area_blank1_km2 =
| area_blank1_sq_mi =
| area_blank1_ha =
| area_blank1_acre =
| area_blank1_dunam = <!-- used in Middle East articles only -->
| area_blank2_title =
| area_blank2_km2 =
| area_blank2_sq_mi =
| area_blank2_ha =
| area_blank2_acre =
| area_blank2_dunam = <!-- used in Middle East articles only -->
| area_note =
<!-- dimensions -->
| dimensions_footnotes = <!-- for references: use <ref> tags -->
| length_km =
| length_mi =
| width_km =
| width_mi =
<!-- elevation -->
| elevation_footnotes = <!-- for references: use <ref> tags -->
| elevation_m =
| elevation_ft =
| elevation_point = <!-- for denoting the measurement point -->
| elevation_max_footnotes = <!-- for references: use <ref> tags -->
| elevation_max_m =
| elevation_max_ft =
| elevation_max_point = <!-- for denoting the measurement point -->
| elevation_max_rank =
| elevation_min_footnotes = <!-- for references: use <ref> tags -->
| elevation_min_m =
| elevation_min_ft =
| elevation_min_point = <!-- for denoting the measurement point -->
| elevation_min_rank =
<!-- population -->
| population_footnotes = <!-- for references: use <ref> tags -->
| population_as_of =
| population_total =
| pop_est_footnotes =
| pop_est_as_of =
| population_est =
| population_rank =
| population_density_km2 = <!-- for automatic calculation of any density field, use: auto -->
| population_density_sq_mi =
| population_urban_footnotes =
| population_urban =
| population_density_urban_km2 =
| population_density_urban_sq_mi =
| population_rural_footnotes =
| population_rural =
| population_density_rural_km2 =
| population_density_rural_sq_mi =
| population_metro_footnotes =
| population_metro =
| population_density_metro_km2 =
| population_density_metro_sq_mi =
| population_density_rank =
| population_blank1_title =
| population_blank1 =
| population_density_blank1_km2 =
| population_density_blank1_sq_mi =
| population_blank2_title =
| population_blank2 =
| population_density_blank2_km2 =
| population_density_blank2_sq_mi =
| population_demonym = <!-- demonym, e.g. Liverpudlian for someone from Liverpool -->
| population_demonyms =
| population_note =
<!-- demographics (section 1) -->
| demographics_type1 =
| demographics1_footnotes = <!-- for references: use <ref> tags -->
| demographics1_title1 =
| demographics1_info1 = <!-- etc., up to demographics1_title7 / demographics1_info7 -->
<!-- demographics (section 2) -->
| demographics_type2 =
| demographics2_footnotes = <!-- for references: use <ref> tags -->
| demographics2_title1 =
| demographics2_info1 = <!-- etc., up to demographics2_title10 / demographics2_info10 -->
<!-- time zone(s) -->
| timezone_link =
| timezone1_location =
| timezone1 =
| utc_offset1 =
| timezone1_DST =
| utc_offset1_DST =
| timezone2_location =
| timezone2 =
| utc_offset2 =
| timezone2_DST =
| utc_offset2_DST =
| timezone3_location =
| timezone3 =
| utc_offset3 =
| timezone3_DST =
| utc_offset3_DST =
| timezone4_location =
| timezone4 =
| utc_offset4 =
| timezone4_DST =
| utc_offset4_DST =
| timezone5_location =
| timezone5 =
| utc_offset5 =
| timezone5_DST =
| utc_offset5_DST =
<!-- postal codes, area code -->
| postal_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal_code =
| postal2_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal2_code =
| area_code_type = <!-- defaults to: Area code(s) -->
| area_code =
| area_codes =
| geocode =
| iso_code =
| registration_plate_type =
| registration_plate =
| code1_name =
| code1_info =
| code2_name =
| code2_info =
<!-- blank fields (section 1) -->
| blank_name_sec1 =
| blank_info_sec1 =
| blank1_name_sec1 =
| blank1_info_sec1 =
| blank2_name_sec1 =
| blank2_info_sec1 = <!-- etc., up to blank7_name_sec1 / blank7_info_sec1 -->
<!-- blank fields (section 2) -->
| blank_name_sec2 =
| blank_info_sec2 =
| blank1_name_sec2 =
| blank1_info_sec2 =
| blank2_name_sec2 =
| blank2_info_sec2 = <!-- etc., up to blank7_name_sec2 / blank7_info_sec2 -->
<!-- website, footnotes -->
| website = <!-- {{URL|example.com}} -->
| module =
| footnotes =
}}
</syntaxhighlight>
==Parameter names and descriptions==
{| class="wikitable" style="background: white"
| colspan=3 style="background: orange; text-align: center;" |
===Name and transliteration===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
| '''name''' || optional || This is the usual name in English. If it's not specified, the infobox will use the '''official_name''' as a title unless this too is missing, in which case the page name will be used.
|- style="vertical-align:top;"
| '''official_name''' || optional || The official name in English. Avoid using '''official_name''' if it leads to redundancy with '''name''' and '''settlement_type'''. Use '''official_name''' if the official name is unusual or cannot be simply deduced from the name and settlement type.
|- style="vertical-align:top;"
| '''native_name''' || optional || Name in the local language, if different from '''name''', and if not English. In this case "native" does not mean indigenous but is related to de facto language that is not English. This will display below the name/official name.
|- style="vertical-align:top;"
| '''native_name_lang''' || optional || Use [[List of ISO 639-1 codes|ISO 639-1 code]], e.g. "fr" for French. If there is more than one native name, in different languages, enter those names using {{tl|lang}}, instead.
|- style="vertical-align:top;"
| '''other_name''' || optional || For places with a former or more common name like Bombay or Saigon
|- style="vertical-align:top;"
| '''settlement_type''' || optional || Any type can be entered, such as City, Town, Village, Hamlet, Municipality, Reservation, etc. If set, will be displayed under the names. Might also be used as a label for total population/area (defaulting to ''City''), if needed to distinguish from ''Urban'', ''Rural'' or ''Metro'' (if urban, rural or metro figures are not present, the label is ''Total'' unless '''total_type''' is set).
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Transliteration(s)
|- style="vertical-align:top;"
| '''translit_lang1''' || optional || Will place the "entry" before the word "transliteration(s)". Can be used to specify a particular language like in [[Dêlêg]] or one may just enter "Other", like in [[Gaza City|Gaza]]'s article.
|- style="vertical-align:top;"
| '''translit_lang1_type'''<br />'''translit_lang1_type1'''<br />to<br />'''translit_lang1_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang1_info'''<br />'''translit_lang1_info1'''<br />to<br />'''translit_lang1_info6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2''' || optional || Will place a second transliteration. See [[Dêlêg]]
|- style="vertical-align:top;"
| '''translit_lang2_type'''<br />'''translit_lang2_type1'''<br />to<br />'''translit_lang2_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2_info'''<br />'''translit_lang2_info1'''<br />to<br />'''translit_lang2_info6''' || optional ||
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Images, nickname, motto===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Image
|- style="vertical-align:top;"
| '''image_skyline''' || optional || Primary image representing the settlement. Commonly a photo of the settlement’s skyline.
|- style="vertical-align:top;"
| '''imagesize''' || optional || Can be used to tweak the size of the image_skyline up or down. This can be helpful if an editor wants to make the infobox wider. If used, '''px''' must be specified; default size is 250px.
|- style="vertical-align:top;"
| '''image_alt''' || optional || [[Alt text]] for the image, used by visually impaired readers who cannot see the image. See [[WP:ALT]].
|- style="vertical-align:top;"
| '''image_caption''' || optional || Will place a caption under the image_skyline (if present)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Flag image
|- style="vertical-align:top;"
| '''image_flag''' || optional || Used for a flag.
|- style="vertical-align:top;"
| '''flag_size''' || optional || Can be used to tweak the size of the image_flag up or down from 100px as desired. If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''flag_alt''' || optional || Alt text for the flag.
|- style="vertical-align:top;"
| '''flag_border''' || optional || Set to 'no' to remove the border from the flag
|- style="vertical-align:top;"
| '''flag_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seal image
|- style="vertical-align:top;"
| '''image_seal''' || optional || If the place has an official seal.
|- style="vertical-align:top;"
| '''seal_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''seal_alt''' || optional || Alt text for the seal.
|- style="vertical-align:top;"
| '''seal_link'''<br />'''seal_type''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Coat of arms image
|- style="vertical-align:top;"
| '''image_shield''' || optional || Can be used for a place with a coat of arms.
|- style="vertical-align:top;"
| '''shield_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''shield_alt''' || optional || Alt text for the shield.
|- style="vertical-align:top;"
| '''shield_link''' || optional || Can be used if a wiki article if known but is not automatically linked by the template. See [[Coquitlam, British Columbia]]'s infobox for an example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Logo or emblem image
|- style="vertical-align:top;"
| '''image_blank_emblem''' || optional || Can be used if a place has an official logo, crest, emblem, etc.
|- style="vertical-align:top;"
| '''blank_emblem_type''' || optional || Caption beneath "image_blank_emblem" to specify what type of emblem it is.
|- style="vertical-align:top;"
| '''blank_emblem_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''blank_emblem_alt''' || optional || Alt text for blank emblem.
|- style="vertical-align:top;"
| '''blank_emblem_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Nickname, motto
|- style="vertical-align:top;"
| '''etymology''' || optional || origin of name
|- style="vertical-align:top;"
| '''nickname''' || optional || well-known nickname
|- style="vertical-align:top;"
| '''nicknames''' || optional || if more than one well-known nickname, use this
|- style="vertical-align:top;"
| '''motto''' || optional || Will place the motto under the nicknames
|- style="vertical-align:top;"
| '''mottoes''' || optional || if more than one motto, use this
|- style="vertical-align:top;"
| '''anthem''' || optional || Will place the anthem (song) under the nicknames
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Maps, coordinates===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Map images
|- style="vertical-align:top;"
| '''image_map''' || optional ||
|- style="vertical-align:top;"
| '''mapsize''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt''' || optional || Alt text for map.
|- style="vertical-align:top;"
| '''map_caption''' || optional ||
|- style="vertical-align:top;"
| '''image_map1''' || optional || A secondary map image. The field '''image_map''' must be filled in first. Example see: [[Bloomsburg, Pennsylvania]].
|- style="vertical-align:top;"
| '''mapsize1''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt1''' || optional || Alt text for secondary map.
|- style="vertical-align:top;"
| '''map_caption1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Pushpin map(s), coordinates
|- style="vertical-align:top;"
| '''pushpin_map''' || optional || The name of a location map as per [[Template:Location map]] (e.g. ''Indonesia'' or ''Russia''). The coordinate fields (from {{para|coordinates}}) position a pushpin coordinate marker and label on the map '''automatically'''. Example: [[Padang, Indonesia]]. To show multiple pushpin maps, provide a list of maps separated by #, e.g., ''California#USA''
|- style="vertical-align:top;"
| '''pushpin_mapsize''' || optional || Must be entered as only a number—'''do not use px'''. The default value is 250.<br/>''Equivalent to <code>width</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_alt''' || optional || Alt text for pushpin map; used by [[screen reader]]s, see [[WP:ALT]].<br/>''Equivalent to <code>alt</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_caption''' || optional || Fill out if a different caption from ''map_caption'' is desired.<br/>''Equivalent to <code>caption</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_caption_notsmall''' || optional || <!-- add documentation here -->
|- style="vertical-align:top;"
| '''pushpin_label''' || optional || The text of the label to display next to the identifying mark; a [[Wiki markup|wikilink]] can be used. If not specified, the label will be the text assigned to the ''name'' or ''official_name'' parameters (if {{para|pushpin_label_position|none}}, no label is displayed).<br/>''Equivalent to <code>label</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_label_position''' || optional || The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are {left, right, top, bottom, none}. If this field is not specified, the default value is ''right''.<br/>''Equivalent to <code>position</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_outside''' || optional || ''Equivalent to <code>outside</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_relief''' || optional || Set this to <code>y</code> or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available). <br/>''Equivalent to <code>relief</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_image''' || optional || Allows the use of an alternative map; the image must have the same edge coordinates as the location map template.<br/>''Equivalent to <code>AlternativeMap</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_overlay''' || optional || Can be used to specify an image to be superimposed on the regular pushpin map.<br/>''Equivalent to <code>overlay_image</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''coordinates''' || optional || Latitude and longitude. Use {{tl|Coord}}. See the documentation for {{tl|Coord}} for more details on usage.
|- style="vertical-align:top;"
| '''coor_pinpoint''' || optional || If needed, to specify more exactly where (or what) coordinates are given (e.g. ''Town Hall'') or a specific place in a larger area (e.g. a city in a county). Example: In the article [[Masovian Voivodeship]], <code>coor_pinpoint=Warsaw</code> specifies [[Warsaw]].
|- style="vertical-align:top;"
| '''coordinates_footnotes''' || optional || Reference(s) for coordinates, placed within <code><nowiki><ref> </ref></nowiki></code> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''grid_name'''<br />'''grid_position''' || optional || Name of a regional grid system and position on the regional grid
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Location, established, seat, subdivisions, government, leaders===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Location
|- style="vertical-align:top;"
| {{anchor|subdivision_type}}'''subdivision_type''' || optional || almost always <code><nowiki>Country</nowiki></code>
|- style="vertical-align:top;"
| '''subdivision_name''' || optional || Depends on the subdivision_type — use the name in text form, sample: <code>United States</code>. Per [[MOS:INFOBOXFLAG]], flag icons or flag templates may be used in this field
|- style="vertical-align:top;"
| '''subdivision_type1'''<br />to<br />'''subdivision_type6''' || optional || Can be State/Province, region, county. These labels are for subdivisions ''above'' the level of the settlement described in the article. For subdivisions ''below'' or ''within'' the place described in the article, use {{para|parts_type}}.
|- style="vertical-align:top;"
| '''subdivision_name1'''<br />to<br />'''subdivision_name6''' || optional || Use the name in text form, sample: <code>Florida</code> or <code><nowiki>[[Florida]]</nowiki></code>. Per [[MOS:INFOBOXFLAG]], flag icons or flag templates should '''not''' be used in these fields
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Established
|- style="vertical-align:top;"
| '''established_title''' || optional || Example: Founded
|- style="vertical-align:top;"
| '''established_date''' || optional || Requires established_title=
|- style="vertical-align:top;"
| '''established_title1''' || optional || Example: Incorporated (town) <br/>[Note that "established_title1" is distinct from "established_title"; you can think of "established_title" as behaving like "established_title0".]
|- style="vertical-align:top;"
| '''established_date1''' || optional || [See note for "established_title1".] Requires established_title1=
|- style="vertical-align:top;"
| '''established_title2''' || optional || Example: Incorporated (city)
|- style="vertical-align:top;"
| '''established_date2''' || optional || Requires established_title2=
|- style="vertical-align:top;"
| '''established_title3''' || optional ||
|- style="vertical-align:top;"
| '''established_date3''' || optional || Requires established_title3=
|- style="vertical-align:top;"
| '''established_title4''' || optional ||
|- style="vertical-align:top;"
| '''established_date4''' || optional || Requires established_title4=
|- style="vertical-align:top;"
| '''established_title5''' || optional ||
|- style="vertical-align:top;"
| '''established_date5''' || optional || Requires established_title5=
|- style="vertical-align:top;"
| '''established_title6''' || optional ||
|- style="vertical-align:top;"
| '''established_date6''' || optional || Requires established_title6=
|- style="vertical-align:top;"
| '''established_title7''' || optional ||
|- style="vertical-align:top;"
| '''established_date7''' || optional || Requires established_title7=
|- style="vertical-align:top;"
| '''extinct_title''' || optional || For when a settlement ceases to exist
|- style="vertical-align:top;"
| '''extinct_date''' || optional || Requires extinct_title=
|- style="vertical-align:top;"
| '''founder''' || optional || Who the settlement was founded by
|- style="vertical-align:top;"
| '''named_for''' || optional || The source of the name of the settlement (a person, a place, et cetera)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seat of government
|- style="vertical-align:top;"
| '''seat_type''' || optional || The label for the seat of government (defaults to ''Seat'').
|- style="vertical-align:top;"
| '''seat''' || optional || The seat of government.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Smaller parts (e.g. boroughs of a city)
|- style="vertical-align:top;"
| '''parts_type''' || optional || The label for the smaller subdivisions (defaults to ''Boroughs'').
|- style="vertical-align:top;"
| '''parts_style''' || optional || Set to ''list'' to display as a collapsible list, ''coll'' as a collapsed list, or ''para'' to use paragraph style. Default is ''list'' for up to 5 items, otherwise ''coll''.
|- style="vertical-align:top;"
| '''parts''' || optional || Text or header of the list of smaller subdivisions.
|- style="vertical-align:top;"
| '''p1'''<br />'''p2'''<br />to<br />'''p50''' || optional || The smaller subdivisions to be listed. Example: [[Warsaw]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Government type, leaders
|- style="vertical-align:top;"
| '''government_footnotes''' || optional || Reference(s) for government, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''government_type''' || optional || Examples: [[Mayor–council government]], [[Council–manager government]], [[City commission government]], ...
|- style="vertical-align:top;"
| '''governing_body''' || optional || Name of the place's governing body
|- style="vertical-align:top;"
| '''leader_party''' || optional || Political party of the place's leader
|- style="vertical-align:top;"
| '''leader_title''' || optional || First title of the place's leader, e.g. Mayor
|- style="vertical-align:top;"
| '''leader_name''' || optional || Name of the place's leader
|- style="vertical-align:top;"
| '''leader_title1'''<br />to<br />'''leader_title4''' || optional ||
|- style="vertical-align:top;"
| '''leader_name1'''<br />to<br />'''leader_name4''' || optional || For long lists use {{tl|Collapsible list}}. See [[Halifax Regional Municipality|Halifax]] for an example.
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Geographic information===
|- style="vertical-align:top;"
| colspan=3 | These fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they should enter both values in their respective fields.
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Display settings
|- style="vertical-align:top;"
| '''total_type''' || optional || Specifies what "total" area and population figure refer to, e.g. ''Greater London''. This overrides other labels for total population/area. To make the total area and population display on the same line as the words "Area" and "Population", with no "Total" or similar label, set the value of this parameter to '''&nbsp;'''.
|- style="vertical-align:top;"
| '''unit_pref''' || optional || To change the unit order to ''imperial (metric)'', enter '''imperial'''. The default display style is ''metric (imperial)''. However, the template will swap the order automatically if the '''subdivision_name''' equals some variation of the US or the UK.<br />For the middle east, a unit preference of [[dunam]] can be entered (only affects total area). <br /> All values must be entered in a '''raw format: no commas, spaces, or unit symbols'''. The template will format them automatically.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Area
|- style="vertical-align:top;"
| '''area_footnotes''' || optional || Reference(s) for area, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''dunam_link''' || optional || If dunams are used, the default is to link the word ''dunams'' in the total area section. This can be changed by setting <code>dunam_link</code> to another measure (e.g. <code>dunam_link=water</code>). Linking can also be turned off by setting the parameter to something else (e.g. <code>dunam_link=none</code> or <code>dunam_link=off</code>).
|- style="vertical-align:top;"
| '''area_total_km2''' || optional || Total area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_total_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_total_ha''' || optional || Total area in hectares—symbol: ha. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display acres if area_total_acre is empty.
|- style="vertical-align:top;"
| '''area_total_sq_mi''' || optional || Total area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_total_km2 is empty.
|- style="vertical-align:top;"
| '''area_total_acre''' || optional || Total area in acres. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display hectares if area_total_ha is empty.
|- style="vertical-align:top;"
| '''area_total_dunam''' || optional || Total area in dunams, which is wiki-linked. Used in middle eastern places like Israel, Gaza, and the West Bank. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers or hectares and square miles or acreds if area_total_km2, area_total_ha, area_total_sq_mi, and area_total_acre are empty. Examples: [[Gaza City|Gaza]] and [[Ramallah]]
|- style="vertical-align:top;"
| '''area_land_km2''' || optional || Land area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_land_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_land_sq_mi''' || optional || Land area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_land_km2 is empty.
|- style="vertical-align:top;"
| '''area_land_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_land_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_land_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_km2''' || optional || Water area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_water_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_water_sq_mi''' || optional || Water area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_water_km2 is empty.
|- style="vertical-align:top;"
| '''area_water_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_water_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_water_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_percent''' || optional || percent of water without the "%"
|- style="vertical-align:top;"
| '''area_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_urban_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_urban_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
|- style="vertical-align:top;"
| '''area_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_rural_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_rural_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_metro_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_metro_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_rank''' || optional || The settlement's area, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''area_blank1_title''' || optional || Example see London
|- style="vertical-align:top;"
| '''area_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank1_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank1_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank2_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank2_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_note''' || optional || A place for additional information such as the name of the source.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Dimensions
|- style="vertical-align:top;"
| '''dimensions_footnotes''' || optional || Reference(s) for dimensions, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''length_km''' || optional || Raw number entered in kilometers. Will automatically convert to display length in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''length_mi''' || optional || Raw number entered in miles. Will automatically convert to display length in kilometers if length_km is empty.
|- style="vertical-align:top;"
| '''width_km''' || optional || Raw number entered in kilometers. Will automatically convert to display width in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''width_mi''' || optional || Raw number entered in miles. Will automatically convert to display width in kilometers if length_km is empty.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Elevation
|- style="vertical-align:top;"
| '''elevation_footnotes''' || optional || Reference(s) for elevation, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''elevation_m''' || optional || Raw number entered in meters. Will automatically convert to display elevation in feet if elevation_ft is empty. However, if a range in elevation (i.e. 5–50 m ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_ft''' || optional || Raw number, entered in feet. Will automatically convert to display the average elevation in meters if '''elevation_m''' field is empty. However, if a range in elevation (e.g. 50–500 ft ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_max_footnotes'''<br />'''elevation_min_footnotes''' || optional || Same as above, but for the "max" and "min" elevations. See [[City of Leeds]].
|- style="vertical-align:top;"
| '''elevation_max_m'''<br />'''elevation_max_ft'''<br />'''elevation_max_rank'''<br />'''elevation_min_m'''<br />'''elevation_min_ft'''<br />'''elevation_min_rank''' || optional || Used to give highest & lowest elevations and rank, instead of just a single value. Example: [[Halifax Regional Municipality]].
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Population, demographics===
|- style="vertical-align:top;"
| colspan=3 | The density fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they can enter both values in their respective fields. '''To calculate density with respect to the total area automatically, type ''auto'' in place of any density value.'''
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Population
|- style="vertical-align:top;"
| '''population_total''' || optional || Actual population (see below for estimates) preferably consisting of digits only (without any commas)
|- style="vertical-align:top;"
| '''population_as_of''' || optional || The year for the population total (usually a census year)
|- style="vertical-align:top;"
| '''population_footnotes''' || optional || Reference(s) for population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_est''' || optional || Population estimate.
|- style="vertical-align:top;"
| '''pop_est_as_of''' || optional || The year or month & year of the population estimate
|- style="vertical-align:top;"
| '''pop_est_footnotes''' || optional || Reference(s) for population estimate, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_urban''' || optional ||
|- style="vertical-align:top;"
| '''population_urban_footnotes''' || optional || Reference(s) for urban population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rural''' || optional ||
|- style="vertical-align:top;"
| '''population_rural_footnotes''' || optional || Reference(s) for rural population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_metro''' || optional ||
|- style="vertical-align:top;"
| '''population_metro_footnotes''' || optional || Reference(s) for metro population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rank''' || optional || The settlement's population, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_density_rank''' || optional || The settlement's population density, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_blank1_title''' || optional || Can be used for estimates. Example: [[Windsor, Ontario]]
|- style="vertical-align:top;"
| '''population_blank1''' || optional || The population value for blank1_title
|- style="vertical-align:top;"
| '''population_density_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_demonym''' || optional || A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example, a citizen in [[Liverpool]] is known as a [[Liverpudlian]].
|- style="vertical-align:top;"
| '''population_demonyms''' || optional || If more than one demonym, use this
|- style="vertical-align:top;"
| '''population_note''' || optional || A place for additional information such as the name of the source. See [[Windsor, Ontario]] for example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 1)
|- style="vertical-align:top;"
| '''demographics_type1''' || optional || Section Header. For example: Ethnicity
|- style="vertical-align:top;"
| '''demographics1_footnotes''' || optional || Reference(s) for demographics section 1, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics1_title1'''<br />to<br />'''demographics1_title7''' || optional || Titles related to demographics_type1. For example: White, Black, Hispanic...
|- style="vertical-align:top;"
| '''demographics1_info1'''<br />to<br />'''demographics1_info7''' || optional || Information related to the "titles". For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 2)
|- style="vertical-align:top;"
| '''demographics_type2''' || optional || A second section header. For example: Languages
|- style="vertical-align:top;"
| '''demographics2_footnotes''' || optional || Reference(s) for demographics section 2, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics2_title1'''<br />to<br />'''demographics2_title10''' || optional || Titles related to '''demographics_type2'''. For example: English, French, Arabic...
|- style="vertical-align:top;"
| '''demographics2_info1'''<br />to<br />'''demographics2_info10''' || optional || Information related to the "titles" for type2. For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Other information===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Time zone(s)
|- style="vertical-align:top;"
| '''timezone1''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1''' || optional || Plain text, e.g. "+05:00" or "-08:00". Auto-linked, so do not include references or additional text.
|- style="vertical-align:top;"
| '''timezone1_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1_DST''' || optional ||
|- style="vertical-align:top;"
| '''timezone2''' || optional || A second timezone field for larger areas such as a Province.
|- style="vertical-align:top;"
| '''utc_offset2''' || optional ||
|- style="vertical-align:top;"
| '''timezone2_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset2_DST''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Postal code(s) & area code
|- style="vertical-align:top;"
| '''postal_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal_code''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code''' || optional ||
|- style="vertical-align:top;"
| '''area_code_type''' || optional || If left blank/not used template will default to "[[Telephone numbering plan|Area code(s)]]"
|- style="vertical-align:top;"
| '''area_code''' || optional || Refers to the telephone dialing code for the settlement, ''not'' a geographic area code.
|- style="vertical-align:top;"
| '''area_codes''' || optional || If more than one area code, use this
|- style="vertical-align:top;"
| '''geocode''' || optional || See [[Geocode]]
|- style="vertical-align:top;"
| '''iso_code''' || optional || See [[ISO 3166]]
|- style="vertical-align:top;"
| '''registration_plate_type''' || optional || If left blank/not used template will default to "[[Vehicle registration plate|Vehicle registration]]"
|- style="vertical-align:top;"
| '''registration_plate''' || optional || See [[Vehicle registration plate]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 1)
|- style="vertical-align:top;"
| '''blank_name_sec1''' || optional || Fields used to display other information. The name is displayed in bold on the left side of the infobox.
|- style="vertical-align:top;"
| '''blank_info_sec1''' || optional || The information associated with the ''blank_name'' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see: [[Warsaw]]
|- style="vertical-align:top;"
| '''blank1_name_sec1'''<br />to<br />'''blank7_name_sec1''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec1'''<br />to<br />'''blank7_info_sec1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 2)
|- style="vertical-align:top;"
| '''blank_name_sec2''' || optional || For a second section of blank fields
|- style="vertical-align:top;"
| '''blank_info_sec2''' || optional || Example: [[Beijing]]
|- style="vertical-align:top;"
| '''blank1_name_sec2'''<br />to<br />'''blank7_name_sec2''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec2'''<br />to<br />'''blank7_info_sec2''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Website, footnotes
|- style="vertical-align:top;"
| '''website''' || optional || External link to official website, Use {{Tl|URL}}, thus: <nowiki>{{URL|example.com}}</nowiki>
|- style="vertical-align:top;"
| '''module''' || optional || To embed infoboxes at the bottom of the infobox
|- style="vertical-align:top;"
| '''footnotes''' || optional || Text to be displayed at the bottom of the infobox
|- style="vertical-align:top;"
| '''short_description''' || optional || [[WP:SHORTDESC|specify custom short description]]; if not specified, one will be automatically generated, e.g. "Place in Israel".
|}
<!-- End of parameter name/description table -->
==Examples==
;Example 1:
<!-- NOTE: This differs from the actual Chicago infobox in order to provide examples. -->
{{Infobox settlement
| name = Chicago
| settlement_type = [[City (Illinois)|City]]
| image_skyline = Chicago montage.jpg
| imagesize = 275px <!--default is 250px-->
| image_caption = Clockwise from top: [[Downtown Chicago]], the [[Chicago Theatre]], the [[Chicago 'L']], [[Navy Pier]], [[Millennium Park]], the [[Field Museum]], and the [[Willis Tower|Willis (formerly Sears) Tower]]
| image_flag = Flag of Chicago, Illinois.svg
| image_seal = Seal of Chicago, Illinois.svg
| etymology = {{lang-mia|shikaakwa}} ("wild onion" or "wild garlic")
| nickname = [[Origin of Chicago's "Windy City" nickname|The Windy City]], The Second City, Chi-Town, Chi-City, Hog Butcher for the World, City of the Big Shoulders, The City That Works, and others found at [[List of nicknames for Chicago]]
| motto = {{lang-la|Urbs in Horto}} (City in a Garden), Make Big Plans (Make No Small Plans), I Will
| image_map = US-IL-Chicago.png
| map_caption = Location in the [[Chicago metropolitan area]] and Illinois
| pushpin_map = USA
| pushpin_map_caption = Location in the United States
| coordinates = {{coord|41|50|15|N|87|40|55|W}}
| coordinates_footnotes = <ref name="USCB Gazetteer 2010"/>
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = [[Illinois]]
| subdivision_type2 = [[List of counties in Illinois|Counties]]
| subdivision_name2 = [[Cook County, Illinois|Cook]], [[DuPage County, Illinois|DuPage]]
| established_title = Settled
| established_date = 1770s
| established_title2 = [[Municipal corporation|Incorporated]]
| established_date2 = March 4, 1837
| founder =
| named_for = {{lang-mia|shikaakwa}}<br /> ("Wild onion")
| government_type = [[Mayor–council government|Mayor–council]]
| leader_title = [[Mayor of Chicago|Mayor]]
| leader_name = [[Rahm Emanuel]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[City council|Council]]
| leader_name1 = [[Chicago City Council]]
| unit_pref = Imperial
| area_footnotes = <ref name="USCB Gazetteer 2010">{{cite web | url = https://www.census.gov/geo/www/gazetteer/files/Gaz_places_national.txt | title = 2010 United States Census Gazetteer for Places: January 1, 2010 | format = text | work = 2010 United States Census | publisher = [[United States Census Bureau]] | date = April 2010 | access-date = August 1, 2012}}</ref>
| area_total_sq_mi = 234.114
| area_land_sq_mi = 227.635
| area_water_sq_mi = 6.479
| area_water_percent = 3
| area_urban_sq_mi = 2123
| area_metro_sq_mi = 10874
| elevation_footnotes = <ref name="GNIS"/>
| elevation_ft = 594
| elevation_m = 181
| population_footnotes = <ref name="USCB PopEstCities 2011">{{cite web | url = https://www.census.gov/popest/data/cities/totals/2011/tables/SUB-EST2011-01.csv | title = Annual Estimates of the Resident Population for Incorporated Places Over 50,000, Ranked by July 1, 2011 Population | format = [[comma-separated values|CSV]] | work = 2011 Population Estimates | publisher = [[United States Census Bureau]], Population Division | date = June 2012 | access-date = August 1, 2012}}</ref><ref name="USCB Metro 2010">{{cite web | url=https://www.census.gov/prod/cen2010/briefs/c2010br-01.pdf | title = Population Change for the Ten Most Populous and Fastest Growing Metropolitan Statiscal Areas: 2000 to 2010 | date = March 2011 | publisher = [[U.S. Census Bureau]] | page = 6 |access-date = April 12, 2011}}</ref>
| population_as_of = [[2010 United States census|2010]]
| population_total = 2695598
| pop_est_footnotes =
| pop_est_as_of = 2011
| population_est = 2707120
| population_rank = [[List of United States cities by population|3rd US]]
| population_density_sq_mi = 11,892.4<!-- 2011 population_est / area_land_sq_mi -->
| population_urban = 8711000
| population_density_urban_sq_mi = auto
| population_metro = 9461105
| population_density_metro_sq_mi = auto
| population_demonym = Chicagoan
| timezone = [[Central Standard Time|CST]]
| utc_offset = −06:00
| timezone_DST = [[Central Daylight Time|CDT]]
| utc_offset_DST = −05:00
| area_code_type = [[North American Numbering Plan|Area codes]]
| area_codes = [[Area code 312|312]], [[Area code 773|773]], [[Area code 872|872]]
| blank_name = [[Federal Information Processing Standards|FIPS]] code
| blank_info = {{FIPS|17|14000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS 4|423587}}, {{GNIS 4|428803}}
| website = {{URL|www.cityofchicago.org}}
| footnotes = <ref name="GNIS">{{Cite gnis|428803|City of Chicago|April 12, 2011}}</ref>
}}
<syntaxhighlight lang="wikitext" style="overflow:auto; white-space: pre-wrap;">
<!-- NOTE: This differs from the actual Chicago infobox in order to provide examples. -->
{{Infobox settlement
| name = Chicago
| settlement_type = [[City (Illinois)|City]]
| image_skyline = Chicago montage.jpg
| imagesize = 275px <!--default is 250px-->
| image_caption = Clockwise from top: [[Downtown Chicago]], the [[Chicago Theatre]], the [[Chicago 'L']], [[Navy Pier]], [[Millennium Park]], the [[Field Museum]], and the [[Willis Tower|Willis (formerly Sears) Tower]]
| image_flag = Flag of Chicago, Illinois.svg
| image_seal = Seal of Chicago, Illinois.svg
| etymology = {{lang-mia|shikaakwa}} ("wild onion" or "wild garlic")
| nickname = [[Origin of Chicago's "Windy City" nickname|The Windy City]], The Second City, Chi-Town, Chi-City, Hog Butcher for the World, City of the Big Shoulders, The City That Works, and others found at [[List of nicknames for Chicago]]
| motto = {{lang-la|Urbs in Horto}} (City in a Garden), Make Big Plans (Make No Small Plans), I Will
| image_map = US-IL-Chicago.png
| map_caption = Location in the [[Chicago metropolitan area]] and Illinois
| pushpin_map = USA
| pushpin_map_caption = Location in the United States
| coordinates = {{coord|41|50|15|N|87|40|55|W}}
| coordinates_footnotes = <ref name="USCB Gazetteer 2010"/>
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = [[Illinois]]
| subdivision_type2 = [[List of counties in Illinois|Counties]]
| subdivision_name2 = [[Cook County, Illinois|Cook]], [[DuPage County, Illinois|DuPage]]
| established_title = Settled
| established_date = 1770s
| established_title2 = [[Municipal corporation|Incorporated]]
| established_date2 = March 4, 1837
| founder =
| named_for = {{lang-mia|shikaakwa}}<br /> ("Wild onion")
| government_type = [[Mayor–council government|Mayor–council]]
| leader_title = [[Mayor of Chicago|Mayor]]
| leader_name = [[Rahm Emanuel]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[City council|Council]]
| leader_name1 = [[Chicago City Council]]
| unit_pref = Imperial
| area_footnotes = <ref name="USCB Gazetteer 2010">{{cite web | url = https://www.census.gov/geo/www/gazetteer/files/Gaz_places_national.txt | title = 2010 United States Census Gazetteer for Places: January 1, 2010 | format = text | work = 2010 United States Census | publisher = [[United States Census Bureau]] | date = April 2010 | access-date = August 1, 2012}}</ref>
| area_total_sq_mi = 234.114
| area_land_sq_mi = 227.635
| area_water_sq_mi = 6.479
| area_water_percent = 3
| area_urban_sq_mi = 2123
| area_metro_sq_mi = 10874
| elevation_footnotes = <ref name="GNIS"/>
| elevation_ft = 594
| elevation_m = 181
| population_footnotes = <ref name="USCB PopEstCities 2011">{{cite web | url = https://www.census.gov/popest/data/cities/totals/2011/tables/SUB-EST2011-01.csv | title = Annual Estimates of the Resident Population for Incorporated Places Over 50,000, Ranked by July 1, 2011 Population | format = [[comma-separated values|CSV]] | work = 2011 Population Estimates | publisher = [[United States Census Bureau]], Population Division | date = June 2012 | access-date = August 1, 2012}}</ref><ref name="USCB Metro 2010">{{cite web | url=https://www.census.gov/prod/cen2010/briefs/c2010br-01.pdf | title = Population Change for the Ten Most Populous and Fastest Growing Metropolitan Statiscal Areas: 2000 to 2010 | date = March 2011 | publisher = [[U.S. Census Bureau]] | page = 6 |access-date = April 12, 2011}}</ref>
| population_as_of = [[2010 United States census|2010]]
| population_total = 2695598
| pop_est_footnotes =
| pop_est_as_of = 2011
| population_est = 2707120
| population_rank = [[List of United States cities by population|3rd US]]
| population_density_sq_mi = 11,892.4<!-- 2011 population_est / area_land_sq_mi -->
| population_urban = 8711000
| population_density_urban_sq_mi = auto
| population_metro = 9461105
| population_density_metro_sq_mi = auto
| population_demonym = Chicagoan
| timezone = [[Central Standard Time|CST]]
| utc_offset = −06:00
| timezone_DST = [[Central Daylight Time|CDT]]
| utc_offset_DST = −05:00
| area_code_type = [[North American Numbering Plan|Area codes]]
| area_codes = [[Area code 312|312]], [[Area code 773|773]], [[Area code 872|872]]
| blank_name = [[Federal Information Processing Standards|FIPS]] code
| blank_info = {{FIPS|17|14000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS 4|423587}}, {{GNIS 4|428803}}
| website = {{URL|www.cityofchicago.org}}
| footnotes = <ref name="GNIS">{{Cite gnis|428803|City of Chicago|April 12, 2011}}</ref>
}}
</syntaxhighlight>
'''References'''
{{reflist}}
{{clear}}
----
;Example 2:
{{Infobox settlement
| name = Detroit
| settlement_type = [[City (Michigan)|City]]
| image_skyline = Detroit Montage.jpg
| imagesize = 290px
| image_caption = Images from top to bottom, left to right: [[Downtown Detroit]] skyline, [[Spirit of Detroit]], [[Greektown Historic District|Greektown]], [[Ambassador Bridge]], [[Michigan Soldiers' and Sailors' Monument]], [[Fox Theatre (Detroit)|Fox Theatre]], and [[Comerica Park]].
| image_flag = Flag of Detroit.svg
| image_seal = Seal of Detroit.svg
| etymology = {{lang-fr|détroit}} ([[strait]])
| nickname = The Motor City, Motown, Renaissance City, The D, Hockeytown, The Automotive Capital of the World, Rock City, The 313
| motto = ''Speramus Meliora; Resurget Cineribus''<br /><small>([[Latin]]: We Hope For Better Things; It Shall Rise From the Ashes)</small>
| image_map = Wayne County Michigan Incorporated and Unincorporated areas Detroit highlighted.svg
| mapsize = 250x200px
| map_caption = Location within [[Wayne County, Michigan|Wayne County]] and the state of [[Michigan]]
| pushpin_map = USA
| pushpin_map_caption = Location within the [[contiguous United States]]
| coordinates = {{coord|42|19|53|N|83|2|45|W}}
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = [[Michigan]]
| subdivision_type2 = [[List of counties in Michigan|County]]
| subdivision_name2 = [[Wayne County, Michigan|Wayne]]
| established_title = Founded
| established_date = 1701
| established_title2 = Incorporated
| established_date2 = 1806
| government_footnotes = <!-- for references: use<ref> tags -->
| government_type = [[Mayor–council government|Mayor–council]]
| leader_title = [[List of mayors of Detroit|Mayor]]
| leader_name = [[Mike Duggan]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[Detroit City Council|City Council]]
| leader_name1 = {{collapsible list|bullets=yes
| title = Members
| 1 = [[Charles Pugh]] – Council President
| 2 = [[Gary Brown (Detroit politician)|Gary Brown]] – Council President Pro-Tem
| 3 = [[JoAnn Watson]]
| 4 = [[Kenneth Cockrel, Jr.]]
| 5 = [[Saunteel Jenkins]]
| 6 = [[Andre Spivey]]
| 7 = [[James Tate (Detroit politician)|James Tate]]
| 8 = [[Brenda Jones (Detroit politician)|Brenda Jones]]
| 9 = [[Kwame Kenyatta]]
}}
| unit_pref = Imperial
| area_footnotes =
| area_total_sq_mi = 142.87
| area_total_km2 = 370.03
| area_land_sq_mi = 138.75
| area_land_km2 = 359.36
| area_water_sq_mi = 4.12
| area_water_km2 = 10.67
| area_urban_sq_mi = 1295
| area_metro_sq_mi = 3913
| elevation_footnotes =
| elevation_ft = 600
| population_footnotes =
| population_as_of = 2011
| population_total = 706585
| population_rank = [[List of United States cities by population|18th in U.S.]]
| population_urban = 3863924
| population_metro = 4285832 (US: [[List of United States metropolitan statistical areas|13th]])
| population_blank1_title = [[Combined statistical area|CSA]]
| population_blank1 = 5207434 (US: [[List of United States combined statistical areas|11th]])
| population_density_sq_mi= {{#expr:713777/138.8 round 0}}
| population_demonym = Detroiter
| population_note =
| timezone = [[Eastern Time Zone (North America)|EST]]
| utc_offset = −5
| timezone_DST = [[Eastern Daylight Time|EDT]]
| utc_offset_DST = −4
| postal_code_type =
| postal_code =
| area_code = [[Area code 313|313]]
| blank_name = [[Federal Information Processing Standards|FIPS code]]
| blank_info = {{FIPS|26|22000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS 4|1617959}}, {{GNIS 4|1626181}}
| website = [http://www.detroitmi.gov/ DetroitMI.gov]
| footnotes =
}}
<syntaxhighlight lang="wikitext" style="overflow:auto; white-space: pre-wrap;">
{{Infobox settlement
| name = Detroit
| settlement_type = [[City (Michigan)|City]]
| official_name = City of Detroit
| image_skyline = Detroit Montage.jpg
| imagesize = 290px
| image_caption = Images from top to bottom, left to right: [[Downtown Detroit]] skyline, [[Spirit of Detroit]], [[Greektown Historic District|Greektown]], [[Ambassador Bridge]], [[Michigan Soldiers' and Sailors' Monument]], [[Fox Theatre (Detroit)|Fox Theatre]], and [[Comerica Park]].
| image_flag = Flag of Detroit, Michigan.svg
| image_seal = Seal of Detroit, Michigan.svg
| etymology = {{lang-fr|détroit}} ([[strait]])
| nickname = The Motor City, Motown, Renaissance City, The D, Hockeytown, The Automotive Capital of the World, Rock City, The 313
| motto = ''Speramus Meliora; Resurget Cineribus''<br /><small>([[Latin]]: We Hope For Better Things; It Shall Rise From the Ashes)</small>
| image_map = Wayne County Michigan Incorporated and Unincorporated areas Detroit highlighted.svg
| mapsize = 250x200px
| map_caption = Location within [[Wayne County, Michigan|Wayne County]] and the state of [[Michigan]]
| pushpin_map = USA
| pushpin_map_caption = Location within the [[contiguous United States]]
| coordinates = {{coord|42|19|53|N|83|2|45|W}}
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = Michigan
| subdivision_type2 = [[List of counties in Michigan|County]]
| subdivision_name2 = [[Wayne County, Michigan|Wayne]]
| established_title = Founded
| established_date = 1701
| established_title2 = Incorporated
| established_date2 = 1806
| government_footnotes = <!-- for references: use<ref> tags -->
| government_type = [[Mayor-council government|Mayor-Council]]
| leader_title = [[List of mayors of Detroit|Mayor]]
| leader_name = [[Mike Duggan]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[Detroit City Council|City Council]]
| leader_name1 = {{collapsible list|bullets=yes
| title = Members
| 1 = [[Charles Pugh]] – Council President
| 2 = [[Gary Brown (Detroit politician)|Gary Brown]] – Council President Pro-Tem
| 3 = [[JoAnn Watson]]
| 4 = [[Kenneth Cockrel, Jr.]]
| 5 = [[Saunteel Jenkins]]
| 6 = [[Andre Spivey]]
| 7 = [[James Tate (Detroit politician)|James Tate]]
| 8 = [[Brenda Jones (Detroit politician)|Brenda Jones]]
| 9 = [[Kwame Kenyatta]]
}}
| unit_pref = Imperial
| area_footnotes =
| area_total_sq_mi = 142.87
| area_total_km2 = 370.03
| area_land_sq_mi = 138.75
| area_land_km2 = 359.36
| area_water_sq_mi = 4.12
| area_water_km2 = 10.67
| area_urban_sq_mi = 1295
| area_metro_sq_mi = 3913
| elevation_footnotes =
| elevation_ft = 600
| population_footnotes =
| population_as_of = 2011
| population_total = 706585
| population_rank = [[List of United States cities by population|18th in U.S.]]
| population_urban = 3863924
| population_metro = 4285832 (US: [[List of United States metropolitan statistical areas|13th]])
| population_blank1_title = [[Combined statistical area|CSA]]
| population_blank1 = 5207434 (US: [[List of United States combined statistical areas|11th]])
| population_density_sq_mi= {{#expr:713777/138.8 round 0}}
| population_demonym = Detroiter
| population_note =
| timezone = [[Eastern Time Zone (North America)|EST]]
| utc_offset = −5
| timezone_DST = [[Eastern Daylight Time|EDT]]
| utc_offset_DST = −4
| postal_code_type =
| postal_code =
| area_code = [[Area code 313|313]]
| blank_name = [[Federal Information Processing Standards|FIPS code]]
| blank_info = {{FIPS|26|22000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS 4|1617959}}, {{GNIS 4|1626181}}
| website = [http://www.detroitmi.gov/ DetroitMI.gov]
| footnotes =
}}
</syntaxhighlight>
{{clear}}
==Supporting templates==
The following is a list of sub-templates used by Infobox settlement. See the [{{fullurl:Special:PrefixIndex|prefix=Infobox+settlement%2F&namespace=10&hideredirects=1}} current list of all sub-templates] for documentation, sandboxes, testcases, etc.
# {{tl|Infobox settlement/areadisp}}
# {{tl|Infobox settlement/densdisp}}
# {{tl|Infobox settlement/dunam}}
# {{tl|Infobox settlement/dunam/mag}}
# {{tl|Infobox settlement/impus}}
# {{tl|Infobox settlement/impus/mag}}
# {{tl|Infobox settlement/lengthdisp}}
# {{tl|Infobox settlement/link}}
# {{tl|Infobox settlement/metric}}
# {{tl|Infobox settlement/metric/mag}}
# {{tl|Infobox settlement/pref}}
==Microformat==
{{UF-hcard-geo}}
== TemplateData ==
{{TemplateData header}}
{{collapse top|title=TemplateData}}
<templatedata>
{
"description": "Infobox for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, etc.",
"format": "{{_\n| __________________ = _\n}}\n",
"params": {
"name": {
"label": "Common name",
"description": "This is the usual name in English. If it's not specified, the infobox will use the 'official_name' as a title unless this too is missing, in which case the page name will be used.",
"type": "string",
"suggested": true
},
"official_name": {
"label": "Official name",
"description": "The official name in English, if different from 'name'.",
"type": "string",
"suggested": true
},
"native_name": {
"label": "Native name",
"description": "This will display under the name/official name.",
"type": "string",
"example": "Distrito Federal de México"
},
"native_name_lang": {
"label": "Native name language",
"description": "Use ISO 639-1 code, e.g. 'fr' for French. If there is more than one native name in different languages, enter those names using {{lang}} instead.",
"type": "string",
"example": "zh"
},
"other_name": {
"label": "Other name",
"description": "For places with a former or more common name like Bombay or Saigon.",
"type": "string"
},
"settlement_type": {
"label": "Type of settlement",
"description": "Any type can be entered, such as 'City', 'Town', 'Village', 'Hamlet', 'Municipality', 'Reservation', etc. If set, will be displayed under the names, provided either 'name' or 'official_name' is filled in. Might also be used as a label for total population/area (defaulting to 'City'), if needed to distinguish from 'Urban', 'Rural' or 'Metro' (if urban, rural or metro figures are not present, the label is 'Total' unless 'total_type' is set).",
"type": "string",
"aliases": [
"type"
]
},
"translit_lang1": {
"label": "Transliteration from language 1",
"description": "Will place the entry before the word 'transliteration(s)'. Can be used to specify a particular language, like in Dêlêg, or one may just enter 'Other', like in Gaza's article.",
"type": "string"
},
"translit_lang1_type": {
"label": "Transliteration type for language 1",
"type": "line",
"example": "[[Hanyu pinyin]]",
"description": "The type of transliteration used for the first language."
},
"translit_lang1_info": {
"label": "Transliteration language 1 info",
"description": "Parameters 'translit_lang2_info1' ... 'translit_lang2_info6' are also available, but not documented here.",
"type": "string"
},
"translit_lang2": {
"label": "Transliteration language 2",
"description": "Will place a second transliteration. See Dêlêg.",
"type": "string"
},
"image_skyline": {
"label": "Image",
"description": "Primary image representing the settlement. Commonly a photo of the settlement’s skyline.",
"type": "wiki-file-name"
},
"imagesize": {
"label": "Image size",
"description": "Can be used to tweak the size of 'image_skyline' up or down. This can be helpful if an editor wants to make the infobox wider. If used, 'px' must be specified; default size is 250px.",
"type": "string"
},
"image_alt": {
"label": "Image alt text",
"description": "Alt (hover) text for the image, used by visually impaired readers who cannot see the image.",
"type": "string"
},
"image_caption": {
"label": "Image caption",
"description": "Will place a caption under 'image_skyline' (if present).",
"type": "content"
},
"image_flag": {
"label": "Flag image",
"description": "Used for a flag.",
"type": "wiki-file-name"
},
"flag_size": {
"label": "Flag size",
"description": "Can be used to tweak the size of 'image_flag' up or down from 100px as desired. If used, 'px' must be specified; default size is 100px.",
"type": "string"
},
"flag_alt": {
"label": "Flag alt text",
"description": "Alt text for the flag.",
"type": "string"
},
"flag_border": {
"label": "Flag border?",
"description": "Set to 'no' to remove the border from the flag.",
"type": "boolean",
"example": "no"
},
"flag_link": {
"label": "Flag link",
"type": "string",
"description": "Link to the flag."
},
"image_seal": {
"label": "Official seal image",
"description": "An image of an official seal, if the place has one.",
"type": "wiki-file-name"
},
"seal_size": {
"label": "Seal size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string"
},
"seal_alt": {
"label": "Seal alt text",
"description": "Alt (hover) text for the seal.",
"type": "string"
},
"seal_link": {
"label": "Seal link",
"type": "string",
"description": "Link to the seal."
},
"image_shield": {
"label": "Coat of arms/shield image",
"description": "Can be used for a place with a coat of arms.",
"type": "wiki-file-name"
},
"shield_size": {
"label": "Shield size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"example": "200px"
},
"shield_alt": {
"label": "Shield alt text",
"description": "Alternate text for the shield.",
"type": "string"
},
"shield_link": {
"label": "Shield link",
"description": "Can be used if a wiki article if known but is not automatically linked by the template. See Coquitlam, British Columbia's infobox for an example.",
"type": "string"
},
"image_blank_emblem": {
"label": "Blank emblem image",
"description": "Can be used if a place has an official logo, crest, emblem, etc.",
"type": "wiki-file-name"
},
"blank_emblem_type": {
"label": "Blank emblem type",
"description": "Caption beneath 'image_blank_emblem' to specify what type of emblem it is.",
"type": "string",
"example": "Logo"
},
"blank_emblem_size": {
"label": "Blank emblem size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"example": "200px"
},
"blank_emblem_alt": {
"label": "Blank emblem alt text",
"description": "Alt text for blank emblem.",
"type": "string"
},
"blank_emblem_link": {
"label": "Blank emblem link",
"type": "string",
"description": "A link to the emblem of custom type."
},
"nickname": {
"label": "Nickname",
"description": "Well-known nickname(s).",
"type": "string",
"example": "Sin City"
},
"motto": {
"label": "Motto",
"description": "Will place the motto under the nicknames.",
"type": "string"
},
"anthem": {
"label": "Anthem",
"description": "Will place the anthem (song) under the nicknames.",
"type": "string",
"example": "[[Hatikvah]]"
},
"image_map": {
"label": "Map image",
"description": "A map of the region, or a map with the region highlighted within a parent region.",
"type": "wiki-file-name"
},
"mapsize": {
"label": "Map size",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string"
},
"map_alt": {
"label": "Map alt text",
"description": "Alternate (hover) text for the map.",
"type": "string"
},
"map_caption": {
"label": "Map caption",
"type": "content",
"description": "Caption for the map displayed."
},
"image_map1": {
"label": "Map 2 image",
"description": "A secondary map image. The field 'image_map' must be filled in first. For an example, see [[Bloomsburg, Pennsylvania]].",
"example": "File:Columbia County Pennsylvania Incorporated and Unincorporated areas Bloomsburg Highlighted.svg",
"type": "wiki-file-name"
},
"mapsize1": {
"label": "Map 2 size",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string",
"example": "300px"
},
"map_alt1": {
"label": "Map 2 alt text",
"description": "Alt (hover) text for the second map.",
"type": "string"
},
"map_caption1": {
"label": "Map 2 caption",
"type": "content",
"description": "Caption of the second map."
},
"pushpin_map": {
"label": "Pushpin map",
"description": "The name of a location map (e.g. 'Indonesia' or 'Russia'). The coordinates information (from the coordinates parameter) positions a pushpin coordinate marker and label on the map automatically. For an example, see Padang, Indonesia.",
"type": "string",
"example": "Indonesia"
},
"pushpin_mapsize": {
"label": "Pushpin map size",
"description": "Must be entered as only a number—do not use 'px'. The default value is 250.",
"type": "number",
"example": "200"
},
"pushpin_map_alt": {
"label": "Pushpin map alt text",
"description": "Alt (hover) text for the pushpin map.",
"type": "string"
},
"pushpin_map_caption": {
"label": "Pushpin map caption",
"description": "Fill out if a different caption from 'map_caption' is desired.",
"type": "string",
"example": "Map showing Bloomsburg in Pennsylvania"
},
"pushpin_label": {
"label": "Pushpin label",
"type": "line",
"example": "Bloomsburg",
"description": "Label of the pushpin."
},
"pushpin_label_position": {
"label": "Pushpin label position",
"description": "The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are 'left', 'right', 'top', 'bottom', and 'none'. If this field is not specified, the default value is 'right'.",
"type": "string",
"example": "left",
"default": "right"
},
"pushpin_outside": {
"label": "Pushpin outside?",
"type": "line"
},
"pushpin_relief": {
"label": "Pushpin relief",
"description": "Set this to 'y' or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available).",
"type": "string",
"example": "y"
},
"pushpin_image": {
"label": "Pushpin image",
"type": "wiki-file-name",
"description": "Image to use for the pushpin."
},
"pushpin_overlay": {
"label": "Pushpin overlay",
"description": "Can be used to specify an image to be superimposed on the regular pushpin map.",
"type": "wiki-file-name"
},
"coordinates": {
"label": "Coordinates",
"description": "Latitude and longitude. Use {{Coord}}. See the documentation for {{Coord}} for more details on usage.",
"type": "wiki-template-name",
"example": "{{coord|41|50|15|N|87|40|55|W}}"
},
"coor_pinpoint": {
"label": "Coordinate pinpoint",
"description": "If needed, to specify more exactly where (or what) coordinates are given (e.g. 'Town Hall') or a specific place in a larger area (e.g. a city in a county). Example: Masovian Voivodeship.",
"type": "string"
},
"coordinates_footnotes": {
"label": "Coordinates footnotes",
"description": "Reference(s) for coordinates. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"subdivision_type": {
"label": "Subdivision type 1",
"description": "Almost always 'Country'.",
"type": "string",
"example": "[[List of sovereign states|Country]]"
},
"subdivision_name": {
"label": "Subdivision name 1",
"description": "Depends on 'subdivision_type'. Use the name in text form, e.g., 'United States'. Per MOS:INFOBOXFLAG, flag icons or flag templates may be used in this field.",
"type": "string"
},
"subdivision_type1": {
"label": "Subdivision type 2",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type2": {
"label": "Subdivision type 3",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type3": {
"label": "Subdivision type 4",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type4": {
"label": "Subdivision type 5",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type5": {
"label": "Subdivision type 6",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type6": {
"label": "Subdivision type 7",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_name1": {
"label": "Subdivision name 2",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Connecticut]]"
},
"subdivision_name2": {
"label": "Subdivision name 3",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Florida]]"
},
"subdivision_name3": {
"label": "Subdivision name 4",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Utah]]"
},
"subdivision_name4": {
"label": "Subdivision name 5",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[California]]"
},
"subdivision_name5": {
"label": "Subdivision name 6",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Vermont]]"
},
"subdivision_name6": {
"label": "Subdivision name 7",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Wyoming]]"
},
"established_title": {
"label": "First establishment event",
"description": "Title of the first establishment event.",
"type": "string",
"example": "First settled"
},
"established_date": {
"label": "First establishment date",
"type": "date",
"description": "Date of the first establishment event."
},
"established_title1": {
"label": "Second establishment event",
"description": "Title of the second establishment event.",
"type": "string",
"example": "Incorporated as a town"
},
"established_date1": {
"label": "Second establishment date",
"type": "date",
"description": "Date of the second establishment event."
},
"established_title2": {
"label": "Third establishment event",
"description": "Title of the third establishment event.",
"type": "string",
"example": "Incorporated as a city"
},
"established_date2": {
"label": "Third establishment date",
"type": "date",
"description": "Date of the third establishment event."
},
"established_title3": {
"label": "Fourth establishment event",
"type": "string",
"description": "Title of the fourth establishment event.",
"example": "Incorporated as a county"
},
"established_date3": {
"label": "Fourth establishment date",
"type": "date",
"description": "Date of the fourth establishment event."
},
"extinct_title": {
"label": "Extinction event title",
"description": "For when a settlement ceases to exist.",
"type": "string",
"example": "[[Sack of Rome]]"
},
"extinct_date": {
"label": "Extinction date",
"type": "string",
"description": "Date the settlement ceased to exist."
},
"founder": {
"label": "Founder",
"description": "Who the settlement was founded by.",
"type": "string"
},
"named_for": {
"label": "Named for",
"description": "The source of the name of the settlement (a person, a place, et cetera).",
"type": "string",
"example": "[[Ho Chi Minh]]"
},
"seat_type": {
"label": "Seat of government type",
"description": "The label for the seat of government (defaults to 'Seat').",
"type": "string",
"default": "Seat"
},
"seat": {
"label": "Seat of government",
"description": "The seat of government.",
"type": "string",
"example": "[[White House]]"
},
"parts_type": {
"label": "Type of smaller subdivisions",
"description": "The label for the smaller subdivisions (defaults to 'Boroughs').",
"type": "string",
"default": "Boroughs"
},
"parts_style": {
"label": "Parts style",
"description": "Set to 'list' to display as a collapsible list, 'coll' as a collapsed list, or 'para' to use paragraph style. Default is 'list' for up to 5 items, otherwise 'coll'.",
"type": "string",
"example": "list"
},
"parts": {
"label": "Smaller subdivisions",
"description": "Text or header of the list of smaller subdivisions.",
"type": "string"
},
"p1": {
"label": "Smaller subdivision 1",
"description": "The smaller subdivisions to be listed. Parameters 'p1' to 'p50' can also be used.",
"type": "string"
},
"government_footnotes": {
"label": "Government footnotes",
"description": "Reference(s) for government. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"government_type": {
"label": "Government type",
"description": "The place's type of government.",
"type": "string",
"example": "[[Mayor–council government]]"
},
"governing_body": {
"label": "Governing body",
"description": "Name of the place's governing body.",
"type": "wiki-page-name",
"example": "Legislative Council of Hong Kong"
},
"leader_party": {
"label": "Leader political party",
"description": "Political party of the place's leader.",
"type": "string"
},
"leader_title": {
"label": "Leader title",
"description": "First title of the place's leader, e.g. 'Mayor'.",
"type": "string",
"example": "[[Governor (United States)|Governor]]"
},
"leader_name": {
"label": "Leader's name",
"description": "Name of the place's leader.",
"type": "string",
"example": "[[Jay Inslee]]"
},
"leader_title1": {
"label": "Leader title 1",
"description": "First title of the place's leader, e.g. 'Mayor'.",
"type": "string",
"example": "Mayor"
},
"leader_name1": {
"label": "Leader name 1",
"description": "Additional names for leaders. Parameters 'leader_name1' .. 'leader_name4' are available. For long lists, use {{Collapsible list}}.",
"type": "string"
},
"total_type": {
"label": "Total type",
"description": "Specifies what total area and population figure refer to, e.g. 'Greater London'. This overrides other labels for total population/area. To make the total area and population display on the same line as the words ''Area'' and ''Population'', with no ''Total'' or similar label, set the value of this parameter to ' '.",
"type": "string"
},
"unit_pref": {
"label": "Unit preference",
"description": "To change the unit order to 'imperial (metric)', enter 'imperial'. The default display style is 'metric (imperial)'. However, the template will swap the order automatically if the 'subdivision_name' equals some variation of the US or the UK. For the Middle East, a unit preference of dunam can be entered (only affects total area). All values must be entered in a raw format (no commas, spaces, or unit symbols). The template will format them automatically.",
"type": "string",
"example": "imperial"
},
"area_footnotes": {
"label": "Area footnotes",
"description": "Reference(s) for area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"dunam_link": {
"label": "Link dunams?",
"description": "If dunams are used, the default is to link the word ''dunams'' in the total area section. This can be changed by setting 'dunam_link' to another measure (e.g. 'dunam_link=water'). Linking can also be turned off by setting the parameter to something else (e.g., 'dunam_link=none' or 'dunam_link=off').",
"type": "boolean",
"example": "none"
},
"area_total_km2": {
"label": "Total area (km2)",
"description": "Total area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_total_sq_mi' is empty.",
"type": "number"
},
"area_total_sq_mi": {
"label": "Total area (sq. mi)",
"description": "Total area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_total_km2' is empty.",
"type": "number"
},
"area_total_ha": {
"label": "Total area (hectares)",
"description": "Total area in hectares (symbol: ha). Value must be entered in raw format (no commas or spaces). Auto-converted to display acres if 'area_total_acre' is empty.",
"type": "number"
},
"area_total_acre": {
"label": "Total area (acres)",
"description": "Total area in acres. Value must be entered in raw format (no commas or spaces). Auto-converted to display hectares if 'area_total_ha' is empty.",
"type": "number"
},
"area_total_dunam": {
"label": "Total area (dunams)",
"description": "Total area in dunams, which is wikilinked. Used in Middle Eastern places like Israel, Gaza, and the West Bank. Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers or hectares and square miles or acres if 'area_total_km2', 'area_total_ha', 'area_total_sq_mi', and 'area_total_acre' are empty. Examples: Gaza and Ramallah.",
"type": "number"
},
"area_land_km2": {
"label": "Land area (sq. km)",
"description": "Land area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_land_sq_mi' is empty.",
"type": "number"
},
"area_land_sq_mi": {
"label": "Land area (sq. mi)",
"description": "Land area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_land_km2' is empty.",
"type": "number"
},
"area_land_ha": {
"label": "Land area (hectares)",
"description": "The place's land area in hectares.",
"type": "number"
},
"area_land_dunam": {
"label": "Land area (dunams)",
"description": "The place's land area in dunams.",
"type": "number"
},
"area_land_acre": {
"label": "Land area (acres)",
"description": "The place's land area in acres.",
"type": "number"
},
"area_water_km2": {
"label": "Water area (sq. km)",
"description": "Water area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_water_sq_mi' is empty.",
"type": "number"
},
"area_water_sq_mi": {
"label": "Water area (sq. mi)",
"description": "Water area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_water_km2' is empty.",
"type": "number"
},
"area_water_ha": {
"label": "Water area (hectares)",
"description": "The place's water area in hectares.",
"type": "number"
},
"area_water_dunam": {
"label": "Water area (dunams)",
"description": "The place's water area in dunams.",
"type": "number"
},
"area_water_acre": {
"label": "Water area (acres)",
"description": "The place's water area in acres.",
"type": "number"
},
"area_water_percent": {
"label": "Percent water area",
"description": "Percent of water without the %.",
"type": "number",
"example": "21"
},
"area_urban_km2": {
"label": "Urban area (sq. km)",
"type": "number",
"description": "Area of the place's urban area in square kilometers."
},
"area_urban_sq_mi": {
"label": "Urban area (sq. mi)",
"type": "number",
"description": "Area of the place's urban area in square miles."
},
"area_urban_ha": {
"label": "Urban area (hectares)",
"description": "Area of the place's urban area in hectares.",
"type": "number"
},
"area_urban_dunam": {
"label": "Urban area (dunams)",
"description": "Area of the place's urban area in dunams.",
"type": "number"
},
"area_urban_acre": {
"label": "Urban area (acres)",
"description": "Area of the place's urban area in acres.",
"type": "number"
},
"area_urban_footnotes": {
"label": "Urban area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_rural_km2": {
"label": "Rural area (sq. km)",
"type": "number",
"description": "Area of the place's rural area in square kilometers."
},
"area_rural_sq_mi": {
"label": "Rural area (sq. mi)",
"type": "number",
"description": "Area of the place's rural area in square miles."
},
"area_rural_ha": {
"label": "Rural area (hectares)",
"description": "Area of the place's rural area in hectares.",
"type": "number"
},
"area_rural_dunam": {
"label": "Rural area (dunams)",
"description": "Area of the place's rural area in dunams.",
"type": "number"
},
"area_rural_acre": {
"label": "Rural area (acres)",
"description": "Area of the place's rural area in acres.",
"type": "number"
},
"area_rural_footnotes": {
"label": "Rural area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_metro_km2": {
"label": "Metropolitan area (sq. km)",
"type": "number",
"description": "Area of the place's metropolitan area in square kilometers."
},
"area_metro_sq_mi": {
"label": "Metropolitan area (sq. mi)",
"type": "number",
"description": "Area of the place's metropolitan area in square miles."
},
"area_metro_ha": {
"label": "Metropolitan area (hectares)",
"description": "Area of the place's metropolitan area in hectares.",
"type": "number"
},
"area_metro_dunam": {
"label": "Metropolitan area (dunams)",
"description": "Area of the place's metropolitan area in dunams.",
"type": "number"
},
"area_metro_acre": {
"label": "Metropolitan area (acres)",
"description": "Area of the place's metropolitan area in acres.",
"type": "number"
},
"area_metro_footnotes": {
"label": "Metropolitan area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_rank": {
"label": "Area rank",
"description": "The settlement's area, as ranked within its parent sub-division.",
"type": "string"
},
"area_blank1_title": {
"label": "First blank area section title",
"description": "Title of the place's first custom area section.",
"type": "string",
"example": "see [[London]]"
},
"area_blank1_km2": {
"label": "Area blank 1 (sq. km)",
"type": "number",
"description": "Area of the place's first blank area section in square kilometers."
},
"area_blank1_sq_mi": {
"label": "Area blank 1 (sq. mi)",
"type": "number",
"description": "Area of the place's first blank area section in square miles."
},
"area_blank1_ha": {
"label": "Area blank 1 (hectares)",
"description": "Area of the place's first blank area section in hectares.",
"type": "number"
},
"area_blank1_dunam": {
"label": "Area blank 1 (dunams)",
"description": "Area of the place's first blank area section in dunams.",
"type": "number"
},
"area_blank1_acre": {
"label": "Area blank 1 (acres)",
"description": "Area of the place's first blank area section in acres.",
"type": "number"
},
"area_blank2_title": {
"label": "Second blank area section title",
"type": "string",
"description": "Title of the place's second custom area section."
},
"area_blank2_km2": {
"label": "Area blank 2 (sq. km)",
"type": "number",
"description": "Area of the place's second blank area section in square kilometers."
},
"area_blank2_sq_mi": {
"label": "Area blank 2 (sq. mi)",
"type": "number",
"description": "Area of the place's second blank area section in square miles."
},
"area_blank2_ha": {
"label": "Area blank 2 (hectares)",
"description": "Area of the place's third blank area section in hectares.",
"type": "number"
},
"area_blank2_dunam": {
"label": "Area blank 2 (dunams)",
"description": "Area of the place's third blank area section in dunams.",
"type": "number"
},
"area_blank2_acre": {
"label": "Area blank 2 (acres)",
"description": "Area of the place's third blank area section in acres.",
"type": "number"
},
"area_note": {
"label": "Area footnotes",
"description": "A place for additional information such as the name of the source.",
"type": "content",
"example": "<ref name=\"CenPopGazetteer2016\">{{cite web|title=2016 U.S. Gazetteer Files|url=https://www2.census.gov/geo/docs/maps-data/data/gazetteer/2016_Gazetteer/2016_gaz_place_42.txt|publisher=United States Census Bureau|access-date=August 13, 2017}}</ref>"
},
"dimensions_footnotes": {
"label": "Dimensions footnotes",
"description": "Reference(s) for dimensions. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"length_km": {
"label": "Length in km",
"description": "Raw number entered in kilometers. Will automatically convert to display length in miles if 'length_mi' is empty.",
"type": "number"
},
"length_mi": {
"label": "Length in miles",
"description": "Raw number entered in miles. Will automatically convert to display length in kilometers if 'length_km' is empty.",
"type": "number"
},
"width_km": {
"label": "Width in kilometers",
"description": "Raw number entered in kilometers. Will automatically convert to display width in miles if 'length_mi' is empty.",
"type": "number"
},
"width_mi": {
"label": "Width in miles",
"description": "Raw number entered in miles. Will automatically convert to display width in kilometers if 'length_km' is empty.",
"type": "number"
},
"elevation_m": {
"label": "Elevation in meters",
"description": "Raw number entered in meters. Will automatically convert to display elevation in feet if 'elevation_ft' is empty. However, if a range in elevation (i.e. 5–50 m) is desired, use the 'max' and 'min' fields below.",
"type": "number"
},
"elevation_ft": {
"label": "Elevation in feet",
"description": "Raw number, entered in feet. Will automatically convert to display the average elevation in meters if 'elevation_m' field is empty. However, if a range in elevation (i.e. 50–500 ft) is desired, use the 'max' and 'min' fields below.",
"type": "number"
},
"elevation_footnotes": {
"label": "Elevation footnotes",
"description": "Reference(s) for elevation. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"elevation_min_point": {
"type": "line",
"label": "Point of min elevation",
"description": "The name of the point of lowest elevation in the place.",
"example": "[[Death Valley]]"
},
"elevation_min_m": {
"label": "Minimum elevation (m)",
"type": "number",
"description": "The minimum elevation in meters."
},
"elevation_min_ft": {
"label": "Minimum elevation (ft)",
"type": "number",
"description": "The minimum elevation in feet."
},
"elevation_min_rank": {
"type": "line",
"label": "Minimum elevation rank",
"description": "The point of minimum elevation's rank in the parent region.",
"example": "1st"
},
"elevation_min_footnotes": {
"label": "Min elevation footnotes",
"type": "content",
"description": "Footnotes or citations for the minimum elevation."
},
"elevation_max_point": {
"type": "line",
"label": "Point of max elevation",
"description": "The name of the point of highest elevation in the place.",
"example": "[[Mount Everest]]"
},
"elevation_max_m": {
"label": "Maximum elevation (m)",
"type": "number",
"description": "The maximum elevation in meters."
},
"elevation_max_ft": {
"label": "Maximum elevation (ft)",
"type": "number",
"description": "The maximum elevation in feet."
},
"elevation_max_rank": {
"type": "line",
"label": "Maximum elevation rank",
"description": "The point of maximum elevation's rank in the parent region.",
"example": "2nd"
},
"elevation_max_footnotes": {
"label": "Max elevation footnotes",
"type": "content",
"description": "Footnotes or citations for the maximum elevation."
},
"population_total": {
"label": "Population total",
"description": "Actual population (see below for estimates) preferably consisting of digits only (without any commas).",
"type": "number"
},
"population_as_of": {
"label": "Population total figure's year",
"description": "The year for the population total (usually a census year).",
"type": "number"
},
"population_footnotes": {
"label": "Population footnotes",
"description": "Reference(s) for population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_km2": {
"label": "Population density (per square km)",
"type": "string",
"description": "The place's population density per square kilometer.",
"example": "auto"
},
"population_density_sq_mi": {
"label": "Population density (per square mi)",
"type": "string",
"description": "The place's population density per square mile.",
"example": "auto"
},
"population_est": {
"label": "Population estimate",
"description": "Population estimate, e.g. for growth projections 4 years after a census.",
"type": "number",
"example": "331000000"
},
"pop_est_as_of": {
"label": "Population estimate figure as of",
"description": "The year, or the month and year, of the population estimate.",
"type": "date"
},
"pop_est_footnotes": {
"label": "Population estimate footnotes",
"description": "Reference(s) for population estimate; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content",
"example": "<ref name=\"USCensusEst2016\"/>"
},
"population_urban": {
"label": "Urban population",
"type": "number",
"description": "The place's urban population."
},
"population_urban_footnotes": {
"label": "Urban population footnotes",
"description": "Reference(s) for urban population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_urban_km2": {
"label": "Urban population density (per square km)",
"type": "string",
"description": "The place's urban population density per square kilometer.",
"example": "auto"
},
"population_density_urban_sq_mi": {
"label": "Urban population density (per square mi)",
"type": "string",
"description": "The place's urban population density per square mile.",
"example": "auto"
},
"population_rural": {
"label": "Rural population",
"type": "number",
"description": "The place's rural population."
},
"population_rural_footnotes": {
"label": "Rural population footnotes",
"description": "Reference(s) for rural population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_rural_km2": {
"label": "Rural population density per sq. km",
"type": "line",
"description": "The place's rural population density per square kilometer.",
"example": "auto"
},
"population_density_rural_sq_mi": {
"label": "Rural population density per sq. mi",
"type": "line",
"description": "The place's rural population density per square mile.",
"example": "auto"
},
"population_metro": {
"label": "Metropolitan area population",
"type": "number",
"description": "Population of the place's metropolitan area."
},
"population_metro_footnotes": {
"label": "Metropolitan area population footnotes",
"description": "Reference(s) for metro population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "string"
},
"population_density_metro_km2": {
"label": "Metropolitan population density per sq. km",
"type": "number",
"description": "The place's metropolitan area's population density per square kilometer.",
"example": "auto"
},
"population_density_metro_sq_mi": {
"label": "Metropolitan population density per sq. mi",
"type": "number",
"description": "The place's metropolitan area's population density per square mile.",
"example": "auto"
},
"population_rank": {
"label": "Population rank",
"description": "The settlement's population, as ranked within its parent sub-division.",
"type": "string"
},
"population_density_rank": {
"label": "Population density rank",
"description": "The settlement's population density, as ranked within its parent sub-division.",
"type": "string"
},
"population_blank1_title": {
"label": "Custom population type 1 title",
"description": "Can be used for estimates. For an example, see Windsor, Ontario.",
"type": "string",
"example": "See: [[Windsor, Ontario]]"
},
"population_blank1": {
"label": "Custom population type 1",
"description": "The population value for 'blank1_title'.",
"type": "string"
},
"population_density_blank1_km2": {
"label": "Custom population type 1 density per sq. km",
"type": "string",
"description": "Population density per square kilometer, according to the 1st custom population type."
},
"population_density_blank1_sq_mi": {
"label": "Custom population type 1 density per sq. mi",
"type": "string",
"description": "Population density per square mile, according to the 1st custom population type."
},
"population_blank2_title": {
"label": "Custom population type 2 title",
"description": "Can be used for estimates. For an example, see Windsor, Ontario.",
"type": "string",
"example": "See: [[Windsor, Ontario]]"
},
"population_blank2": {
"label": "Custom population type 2",
"description": "The population value for 'blank2_title'.",
"type": "string"
},
"population_density_blank2_km2": {
"label": "Custom population type 2 density per sq. km",
"type": "string",
"description": "Population density per square kilometer, according to the 2nd custom population type."
},
"population_density_blank2_sq_mi": {
"label": "Custom population type 2 density per sq. mi",
"type": "string",
"description": "Population density per square mile, according to the 2nd custom population type."
},
"population_demonym": {
"label": "Demonym",
"description": "A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example, a citizen in Liverpool is known as a Liverpudlian.",
"type": "line",
"example": "Liverpudlian"
},
"population_note": {
"label": "Population note",
"description": "A place for additional information such as the name of the source. See Windsor, Ontario, for an example.",
"type": "content"
},
"demographics_type1": {
"label": "Demographics type 1",
"description": "A sub-section header.",
"type": "string",
"example": "Ethnicities"
},
"demographics1_footnotes": {
"label": "Demographics section 1 footnotes",
"description": "Reference(s) for demographics section 1. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"demographics1_title1": {
"label": "Demographics section 1 title 1",
"description": "Titles related to demographics_type1. For example: 'White', 'Black', 'Hispanic'... Additional rows 'demographics1_title1' to 'demographics1_title5' are also available.",
"type": "string"
},
"demographics_type2": {
"label": "Demographics type 2",
"description": "A second sub-section header.",
"type": "line",
"example": "Languages"
},
"demographics2_footnotes": {
"label": "Demographics section 2 footnotes",
"description": "Reference(s) for demographics section 2. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"demographics2_title1": {
"label": "Demographics section 2 title 1",
"description": "Titles related to 'demographics_type1'. For example: 'English', 'French', 'Arabic'... Additional rows 'demographics2_title2' to 'demographics1_title5' are also available.",
"type": "string"
},
"demographics2_info1": {
"label": "Demographics section 2 info 1",
"description": "Information related to the titles. For example: '50%', '25%', '10%'... Additional rows 'demographics2_info2' to 'demographics2_info5' are also available.",
"type": "content"
},
"timezone1": {
"label": "Timezone 1",
"type": "string",
"description": "The place's primary time-zone.",
"example": "[[Eastern Standard Time]]"
},
"utc_offset": {
"label": "UTC offset",
"type": "string",
"description": "The place's time-zone's offset from UTC.",
"example": "+8"
},
"timezone_DST": {
"label": "Timezone during DST",
"type": "string",
"description": "The place's time-zone during daylight savings time, if applicable.",
"example": "[[Eastern Daylight Time]]"
},
"utc_offset_DST": {
"label": "UTC offset during DST",
"type": "string",
"description": "The place's time-zone's UTC offset during daylight savings time, if applicable.",
"example": "+9"
},
"utc_offset1": {
"label": "UTC offset 1",
"type": "string",
"description": "The place's primary time-zone's offset from UTC.",
"example": "-5"
},
"timezone1_DST": {
"label": "Timezone 1 (during DST)",
"type": "string",
"description": "The place's primary time-zone during daylight savings time, if applicable.",
"example": "[[Eastern Daylight Time]]"
},
"utc_offset1_DST": {
"label": "UTC offset 1 (during DST)",
"type": "string",
"description": "The place's primary time-zone's UTC offset during daylight savings time, if applicable.",
"example": "-6"
},
"timezone2": {
"label": "Timezone 2",
"description": "A second timezone field for larger areas such as a province.",
"type": "string",
"example": "[[Central Standard Time]]"
},
"utc_offset2": {
"label": "UTC offset 2",
"type": "string",
"description": "The place's secondary time-zone's offset from UTC.",
"example": "-6"
},
"timezone2_DST": {
"label": "Timezone 2 during DST",
"type": "string",
"description": "The place's secondary time-zone during daylight savings time, if applicable.",
"example": "[[Central Daylight Time]]"
},
"utc_offset2_DST": {
"label": "UTC offset 2 during DST",
"type": "string",
"description": "The place's secondary time-zone's offset from UTC during daylight savings time, if applicable.",
"example": "-7"
},
"postal_code_type": {
"label": "Postal code type",
"description": "Label used for postal code info, e.g. 'ZIP Code'. Defaults to 'Postal code'.",
"example": "[[Postal code of China|Postal code]]",
"type": "string"
},
"postal_code": {
"label": "Postal code",
"description": "The place's postal code/zip code.",
"type": "string",
"example": "90210"
},
"postal2_code_type": {
"label": "Postal code 2 type",
"type": "string",
"description": "If applicable, the place's second postal code type."
},
"postal2_code": {
"label": "Postal code 2",
"type": "string",
"description": "A second postal code of the place, if applicable.",
"example": "90007"
},
"area_code": {
"label": "Area code",
"description": "The regions' telephone area code.",
"type": "string"
},
"area_code_type": {
"label": "Area code type",
"description": "If left blank/not used, template will default to 'Area code(s)'.",
"type": "string"
},
"geocode": {
"label": "Geocode",
"description": "See [[Geocode]].",
"type": "string"
},
"iso_code": {
"label": "ISO 3166 code",
"description": "See ISO 3166.",
"type": "string"
},
"registration_plate": {
"label": "Registration/license plate info",
"description": "See Vehicle registration plate.",
"type": "string"
},
"blank_name_sec1": {
"label": "Blank name section 1",
"description": "Fields used to display other information. The name is displayed in bold on the left side of the infobox.",
"type": "string"
},
"blank_info_sec1": {
"label": "Blank info section 1",
"description": "The information associated with the 'blank_name_sec1' heading. The info is displayed on the right side of the infobox in the same row as the name. For an example, see [[Warsaw]].",
"type": "content"
},
"blank1_name_sec1": {
"label": "Blank 1 name section 1",
"description": "Up to 7 additional fields 'blank1_name_sec1' ... 'blank7_name_sec1' can be specified.",
"type": "string"
},
"blank1_info_sec1": {
"label": "Blank 1 info section 1",
"description": "Up to 7 additional fields 'blank1_info_sec1' ... 'blank7_info_sec1' can be specified.",
"type": "content"
},
"blank_name_sec2": {
"label": "Blank name section 2",
"description": "For a second section of blank fields.",
"type": "string"
},
"blank_info_sec2": {
"label": "Blank info section 2",
"example": "Beijing",
"type": "content",
"description": "The information associated with the 'blank_name_sec2' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see [[Warsaw]]."
},
"blank1_name_sec2": {
"label": "Blank 1 name section 2",
"description": "Up to 7 additional fields 'blank1_name_sec2' ... 'blank7_name_sec2' can be specified.",
"type": "string"
},
"blank1_info_sec2": {
"label": "Blank 1 info section 2",
"description": "Up to 7 additional fields 'blank1_info_sec2' ... 'blank7_info_sec2' can be specified.",
"type": "content"
},
"website": {
"label": "Official website in English",
"description": "External link to official website. Use the {{URL}} template, thus: {{URL|example.com}}.",
"type": "string"
},
"footnotes": {
"label": "Footnotes",
"description": "Text to be displayed at the bottom of the infobox.",
"type": "content"
},
"translit_lang1_info1": {
"label": "Language 1 first transcription ",
"description": "Transcription of type 1 in the first other language.",
"example": "{{lang|zh|森美兰}}",
"type": "line"
},
"translit_lang1_type1": {
"label": "Language 1 first transcription type",
"description": "Type of transcription used in the first language's first transcription.",
"example": "[[Chinese Language|Chinese]]",
"type": "line"
},
"translit_lang1_info2": {
"label": "Language 1 second transcription ",
"description": "Transcription of type 1 in the first other language.",
"example": "{{lang|ta|நெகிரி செம்பிலான்}}",
"type": "line"
},
"translit_lang1_type2": {
"label": "Language 1 second transcription type",
"description": "Type of transcription used in the first language's first transcription.",
"example": "[[Tamil Language|Tamil]]",
"type": "line"
},
"demographics1_info1": {
"label": "Demographics section 1 info 1",
"description": "Information related to the titles. For example: '50%', '25%', '10%'... Additional rows 'demographics1_info1' to 'demographics1_info5' are also available.",
"type": "content"
}
}
}
</templatedata>
{{collapse bottom}}
==Calls and redirects ==
At least {{PAGESINCATEGORY:Templates calling Infobox settlement}} other [[:Category:Templates calling Infobox settlement|templates call this one]].
[{{fullurl:Special:WhatLinksHere/Template:Infobox_settlement|namespace=10&hidetrans=1&hidelinks=1}} Several templates redirect here].
== Tracking categories ==
# {{clc|Pages using infobox settlement with a dot map}}
# {{clc|Pages using infobox settlement with bad settlement type}}
# {{clc|Pages using infobox settlement with image map1 but not image map}}
# {{clc|Pages using infobox settlement with imprecise region codes}}
# {{clc|Pages using infobox settlement with missing country}}
# {{clc|Pages using infobox settlement with no map}}
# {{clc|Pages using infobox settlement with no coordinates}}
# {{clc|Pages using infobox settlement with possible area code list}}
# {{clc|Pages using infobox settlement with possible demonym list}}
# {{clc|Pages using infobox settlement with possible motto list}}
# {{clc|Pages using infobox settlement with possible nickname list}}
# {{clc|Pages using infobox settlement with the wikidata parameter}}
# {{clc|Pages using infobox settlement with unknown parameters}}
# {{clc|Pages using infobox settlement with conflicting parameters}}
# {{clc|Pages using infobox settlement with ignored type}}
# {{clc|Templates calling Infobox settlement}}
<includeonly>{{Sandbox other||
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Place infobox templates|Settlement]]
[[Category:Embeddable templates]]
[[Category:Infobox templates using Wikidata]]
[[Category:Templates that add a tracking category]]
}}</includeonly>
d26ab36ad94fd5e58039aee02d998fb73bb508e8
Template:Template display
10
285
684
2023-10-03T18:47:23Z
wikipedia>Jonesey95
0
rm redundant word
wikitext
text/x-wiki
<includeonly>{{#invoke:Message box|ombox|type=notice
|image={{#switch:{{{1}}}|adaptive=[[File:Different devices simple.svg|65x65px|link=|alt=]]|nomobile=[[File:Handheld devices no.svg|55px|link=|alt=]]|nodesktop=[[File:Desktop devices no.svg|55px|link=|alt=]]}}
|text={{#switch:{{{1}}}
| adaptive = This template is [[Adaptive web design|responsive]] and <strong>displays differently in mobile and desktop view</strong>. Read the documentation for an explanation of the differences and why they exist.
| nomobile = This template does ''not'' display in the mobile view of Wikipedia; it is <strong>desktop only</strong>. Read the documentation for an explanation.
| nodesktop = This template does ''not'' display in the desktop view of Wikipedia; it is <strong>mobile only</strong>. Read the documentation for an explanation.
| nomobilesidebar = This template does ''not'' display in the mobile view of Wikipedia; it is <strong>desktop only</strong>. Read the [[Template:Sidebar/doc|parent documentation]] for an explanation.
| badmobile = This template contains coding that is not compatible with [[Help:Mobile access|mobile versions of Wikipedia]], causing display and [[Wikipedia:Manual of Style/Accessibility|accessibility problems]]. Read the documentation for an explanation.
| vector2022 = This template does not work properly in the [[Wikipedia:Vector 2022|Vector 2022]] skin. Read the documentation for an explanation.
| #default = {{{1}}}
}}}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
64120ce3ee6e8e7eef9ec22c8910cc845ef2381b
Template:Distinguish/doc
10
111
317
2023-10-06T01:11:03Z
wikipedia>Discospinster
0
Reverted edits by [[Special:Contributions/105.242.226.95|105.242.226.95]] ([[User talk:105.242.226.95|talk]]) ([[WP:HG|HG]]) (3.4.12)
wikitext
text/x-wiki
{{Documentation subpage}}
{{tsh|dist}}
<!-- Please add categories at the bottom of this page, and interwikis at Wikidata (see Wikipedia:Wikidata) -->
{{High-use| 65005 }}
{{Lua|Module:distinguish}}
== Description ==
The "distinguish" template produces a [[WP:HAT|hatnote]] to point out to our readers the existence of one or more articles whose title(s) is, or are, similar to the page in question. It is used in cases where the distinction between the titles is generally obvious and does not need further explanation.
For those cases where an explanation is required, please use the templates {{tl|For}} and {{tl|About}}. For use on category pages, the corresponding template is {{Tl|Category distinguish}}.
== Usage ==
Here is an example of its standard usage (used, for purposes of this example, with the placeholder article "Foo"; the following could be placed on a theoretical article named "Foo (song)", or perhaps one named "Fou" or "Fu"):
{{tlx|distinguish|Foo}} → {{Distinguish|Foo}}
This hatnote can be used to distinguish the topic from multiple other topics:
{{tlx|distinguish|Foo|Bar}} → {{Distinguish|Foo|Bar}}
{{tlx|distinguish|Foo|Bar|Baz}} → {{Distinguish|Foo|Bar|Baz}}
The {{para|text}} parameter can be used to create customized text, in case context is required. An example is on the article [[Phobos (mythology)]], which contains a customized hatnote to distinguish it and "[[Phoebus]]" (a redirect of [[Apollo]]). Both links lead to topics about Greek gods, so the [[WP:NCDAB|parenthetical disambiguation]] in "Phobos (mythology)" is insufficient to disambiguate the two. Since it [[WP:HNR|is typically not preferable to link a redirect]] in a hatnote, the article "Apollo" is linked to directly and a short explanation fills in the necessary context:
{{tlx|distinguish|text {{=}} Phoebus, an epithet of the Greek god [[Apollo]]}} → {{Distinguish|text = Phoebus, an epithet of the Greek god [[Apollo]] }}
Note that a final period is automatically added at the end of the sentence, and that only one blue link is used per disambiguated topic (i.e, do not type <code><nowiki>...an [[epithet]] of the [[Greek]] god [[Apollo]].</nowiki></code>
When the target is a disambiguation page, display of the parentheses may be avoided by escaping the vertical bar using the [[Help:Magic words|magic word]] {{Tl|!}}:
{{Tick}}{{tlx|distinguish|Crossfire (disambiguation){{!}}Crossfire}} → {{Distinguish|Crossfire (disambiguation){{!}}Crossfire}}
The escape is necessary, otherwise the template will read the next text as another topic:
{{Cross}}{{tlx|distinguish|Crossfire (disambiguation)|Crossfire}} → {{Distinguish|Crossfire (disambiguation)|Crossfire}}
== When to use ==
This hatnote is generally used when readers have misspelled their desired title, and the error would be apparent by simply displaying the alternative term without further explanation. For example, consider a reader looking for the punctuation mark who instead ends up at [[coma]]:
: [[Coma]]
: {{Distinguish|Comma}}
Readers are presumed to recognize that they actually wanted ''comma'' by merely looking at the spelling, and this case generally requires no further explanation.
However, {{tlx|distinguish}} is not suitable when the difference is not readily apparent without additional details. Consider a reader looking for a game they believe is named Reversi:
: {{cross}} [[Reversi]]
: {{Distinguish|Reversis}}
In the above hatnote, it is not generally apparent how the suggested Reversis is different from Reversi, which is also a game.
In this case you should use {{tlx|about}} instead of {{tlc|distinguish}}. The difference is to provide explanation upfront without requiring the reader to click through and differentiate the terms on their own.
: {{tick}} [[Reversi]]
:: ''This article is about the board game. For the card game, see [[Reversis]].''
{{tlc|Distinguish}} should only be used when the ambiguity exists for a portion of the readership that is sufficient to warrant a hatnote. Care should be taken to [[WP:TRHAT|avoid trivial uses]].
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"params": {
"1": {
"label": "Name of article",
"description": "Name of article that you want to link to",
"type": "wiki-page-name",
"suggested": true
},
"2": {
"label": "Optional additional article to link (2)",
"description": "Optional additional article to link",
"type": "wiki-page-name"
},
"3": {
"label": "Optional additional article to link (3)",
"description": "Optional additional article to link",
"type": "wiki-page-name"
},
"4": {
"label": "Optional additional article to link (4)",
"description": "Optional additional article to link",
"type": "wiki-page-name"
},
"text": {
"label": "Custom text",
"description": "Custom message in wikitext; e.g. \"[[foo]] and [[Bar (computer science)|bar]]\" produces \"Not to be confused with [[foo]] and [[Bar (computer science)|bar]].\"",
"type": "string"
},
"selfref": {
"label": "Self reference",
"description": "If set, marks note as being a self reference, to not be shown when content is reused",
"type": "boolean"
}
},
"description": "A hatnote used when there is an ambiguity in an article's title.",
"paramOrder": [
"1",
"2",
"3",
"4",
"text",
"selfref"
],
"format": "inline"
}
</templatedata>
== Redirects ==
* {{tl|Confused}}
* {{tl|Confuse}}
* {{tl|Misspelling}}
* {{tl|Nottobeconfusedwith}}
* {{tl|Ntbcw}}
== See also ==
* {{tl|About}}
* {{tl|Category distinguish}}
* {{tl|For}}
* {{tl|Redirect}}
* {{tl|R from misspelling}}
{{Hatnote templates}}
<includeonly>{{sandbox other||
<!-- Add categories below this line, and interwikis at Wikidata -->
[[Category:Disambiguation and redirection templates]]
[[Category:Hatnote templates]]
}}</includeonly>
86c325ae7de845d5db3beba07711e598cc2c1092
Module:Lang/data
828
151
402
2023-10-06T12:06:36Z
wikipedia>Trappist the monk
0
+xsc-x-pontic;
Scribunto
text/plain
local lang_obj = mw.language.getContentLanguage();
local this_wiki_lang_tag = lang_obj.code; -- get this wiki's language tag
--[[--------------------------< L A N G _ N A M E _ T A B L E >------------------------------------------------
primary table of tables that decode:
lang -> language tags and names
script -> ISO 15924 script tags
region -> ISO 3166 region tags
variant -> iana registered variant tags
suppressed -> map of scripts tags and their associated language tags
all of these data come from separate modules that are derived from the IANA language-subtag-registry file
key_to_lower() avoids the metatable trap and sets all keys in the subtables to lowercase. Many language codes
have multiple associated names; Module:lang is only concerned with the first name so key_to_lower() only fetches
the first name.
]]
local function key_to_lower (module, src_type)
local out = {};
local source = (('var_sup' == src_type) and require (module)) or mw.loadData (module); -- fetch data from this module; require() avoids metatable trap for variant data
if 'var_sup' == src_type then
for k, v in pairs (source) do
out[k:lower()] = v; -- for variant and suppressed everything is needed
end
elseif 'lang' == src_type and source.active then -- for ~/iana_languages (active)
for k, v in pairs (source.active) do
out[k:lower()] = v[1]; -- ignore multiple names; take first name only
end
elseif 'lang_dep' == src_type and source.deprecated then -- for ~/iana_languages (deprecated)
for k, v in pairs (source.deprecated) do
out[k:lower()] = v[1]; -- ignore multiple names; take first name only
end
else -- here for all other sources
for k, v in pairs (source) do
out[k:lower()] = v[1]; -- ignore multiple names; take first name only
end
end
return out;
end
local lang_name_table_t = {
lang = key_to_lower ('Module:Language/data/iana languages', 'lang'),
lang_dep = key_to_lower ('Module:Language/data/iana languages', 'lang_dep'),
script = key_to_lower ('Module:Language/data/iana scripts'), -- script keys are capitalized; set to lower
region = key_to_lower ('Module:Language/data/iana regions'), -- region keys are uppercase; set to lower
variant = key_to_lower ('Module:Language/data/iana variants', 'var_sup'),
suppressed = key_to_lower ('Module:Language/data/iana suppressed scripts', 'var_sup'), -- script keys are capitalized; set to lower
}
--[[--------------------------< I 1 8 N M E D I A W I K I O V E R R I D E >--------------------------------
For internationalization; not used at en.wiki
The language names taken from the IANA language-subtag-registry file are given in English. That may not be ideal.
Translating ~8,000 language names is also not ideal. MediaWiki maintains (much) shorter lists of language names
in most languages for which there is a Wikipedia edition. When desired, Module:Lang can use the MediaWiki
language list for the local language.
Caveat lector: the list of MediaWiki language names for your language may not be complete or may not exist at all.
When incomplete, MediaWiki's list will 'fall back' to another language (typically English). When that happens
add an appropriate entry to the override table below.
Caveat lector: the list of MediaWiki language names for your language may not be correct. At en.wiki, the
MediaWiki language names do not agree with the IANA language names for these ISO 639-1 tags. Often it is simply
spelling differences:
bh: IANA: Bihari languages MW: Bhojpuri – the ISO 639-3 tag for Bhojpuri is bho
bn: IANA: Bengali MW: Bangla – Bengali is the exonym, Bangla is the endonym
dv: IANA: Dhivehi MW: Divehi
el: IANA: Modern Greek MW: Greek
ht: IANA: Haitian MW: Haitian Creole
ky: IANA: Kirghiz MW: Kyrgyz
li: IANA: Limburgan MW: Limburgish
or: IANA: Oriya MW: Odia
os: IANA: Ossetian MW: Ossetic
"pa: IANA: Panjabi MW: Punjabi
"ps: IANA: Pushto MW: Pashto
"to: IANA: Tonga MW: Tongan
"ug: IANA: Uighur MW: Uyghur
use the override table to override language names that are incorrect for your project
To see the list of names that MediaWiki has for your language, enter this in the Debug colsole:
=mw.dumpObject (mw.language.fetchLanguageNames ('<tag>', 'all'))
(replacing <tag> with the language tag for your language)
Use of the MediaWiki language names lists is enabled when media_wiki_override_enable is set to boolean true.
]]
local media_wiki_override_enable = false; -- set to true to override IANA names with MediaWiki names; always false at en.wiki
-- caveat lector: the list of MediaWiki language names for your language may not be complete or may not exist at all
if true == media_wiki_override_enable then
local mw_languages_by_tag_t = mw.language.fetchLanguageNames (this_wiki_lang_tag, 'all'); -- get a table of language tag/name pairs known to MediaWiki
for tag, name in pairs (mw_languages_by_tag_t) do -- loop through each tag/name pair in the MediaWiki list
if lang_name_table_t.lang[tag] then -- if the tag is in the main list
lang_name_table_t.lang[tag] = name; -- overwrite exisiting name with the name from MediaWiki
end
end
end
--[[--------------------------< O V E R R I D E >--------------------------------------------------------------
Language codes and names in this table override the BCP47 names in lang_name_table.
indexes in this table shall always be lower case
]]
local override = {
------------------------------< I S O _ 6 3 9 - 1 >------------------------------------------------------------
["ab"] = "Abkhaz", -- to match en.wiki article name
["ca-valencia"] = "Valencian",
["cu"] = "Church Slavonic", -- 2nd IANA name;
["de-at"] = "Austrian German", -- these code-region and code-variant tags to match en.wiki article names
["de-ch"] = "Swiss Standard German",
["en-au"] = "Australian English",
["en-ca"] = "Canadian English",
["en-emodeng"] = "Early Modern English",
["en-gb"] = "British English",
["en-ie"] = "Irish English",
["en-in"] = "Indian English",
["en-nz"] = "New Zealand English",
["en-us"] = "American English",
["en-za"] = "South African English",
["fy"] = "West Frisian", -- Western Frisian
["mo"] = "Moldovan", -- Moldavian (deprecated code); to match en.wiki article title
["nl-be"] = "Flemish", -- match MediaWiki
["oc-provenc"] = "Provençal",
["ps"] = "Pashto", -- Pushto
["pt-br"] = "Brazilian Portuguese", -- match MediaWiki
["tw-asante"] = "Asante Twi",
["ug"] = "Uyghur", -- 2nd IANA name; to match en.wiki article name
-- these ISO 639-1 language-name overrides imported from Module:Language/data/wp_languages
--<begin do-not-edit except to comment out>--
["av"] = "Avar", -- Avaric
["bo"] = "Standard Tibetan", -- Tibetan
["el"] = "Greek", -- Modern Greek
-- ["en-SA"] = "South African English", -- English; no; SA is not South Africa it Saudi Arabia; ZA is South Africa
["ff"] = "Fula", -- Fulah
["ht"] = "Haitian Creole", -- Haitian
["hz"] = "Otjiherero", -- Herero
["ii"] = "Yi", -- Sichuan Yi
["ki"] = "Gikuyu", -- Kikuyu
["kl"] = "Greenlandic", -- Kalaallisut
["ky"] = "Kyrgyz", -- Kirghiz
["lg"] = "Luganda", -- Ganda
["li"] = "Limburgish", -- Limburgan
["mi"] = "Māori", -- Maori
["na"] = "Nauruan", -- Nauru
["nb"] = "Bokmål", -- Norwegian Bokmål
["nd"] = "Northern Ndebele", -- North Ndebele
["nn"] = "Nynorsk", -- Norwegian Nynorsk
["nr"] = "Southern Ndebele", -- South Ndebele
["ny"] = "Chichewa", -- Nyanja
["oj"] = "Ojibwe", -- Ojibwa
["or"] = "Odia", -- Oriya
["pa"] = "Punjabi", -- Panjabi
["rn"] = "Kirundi", -- Rundi
["sl"] = "Slovene", -- Slovenian
["ss"] = "Swazi", -- Swati
["st"] = "Sotho", -- Southern Sotho
["to"] = "Tongan", -- Tonga
--<end do-not-edit except to comment out>--
------------------------------< I S O _ 6 3 9 - 2, - 3, - 5 >----------------------------------------------
["alv"] = "Atlantic–Congo languages", -- to match en.wiki article title (endash)
["arc"] = "Imperial Aramaic (700-300 BCE)", -- Official Aramaic (700-300 BCE), Imperial Aramaic (700-300 BCE); to match en.wiki article title uses ISO639-2 'preferred' name
["art"] = "constructed", -- to match en.wiki article; lowercase for category name
["bhd"] = "Bhadarwahi", -- Bhadrawahi; to match en.wiki article title
["bla"] = "Blackfoot", -- Siksika; to match en.wiki article title
["bua"] = "Buryat", -- Buriat; this is a macro language; these four use wp preferred transliteration;
["bxm"] = "Mongolian Buryat", -- Mongolia Buriat; these three all redirect to Buryat
["bxr"] = "Russian Buryat", -- Russia Buriat;
["bxu"] = "Chinese Buryat", -- China Buriat;
["byr"] = "Yipma", -- Baruya, Yipma
["egy"] = "Ancient Egyptian", -- Egyptian (Ancient); distinguish from contemporary arz: Egyptian Arabic
["ems"] = "Alutiiq", -- Pacific Gulf Yupik; to match en.wiki article title
["esx"] = "Eskimo–Aleut languages", -- to match en.wiki article title (endash)
["frr"] = "North Frisian", -- Northern Frisian
["frs"] = "East Frisian Low Saxon", -- Eastern Frisian
["gsw-fr"] = "Alsatian", -- match MediaWiki
["haa"] = "Hän", -- Han; to match en.wiki article title
["hmx"] = "Hmong–Mien languages", -- to match en.wiki article title (endash)
["ilo"] = "Ilocano", -- Iloko; to match en.wiki article title
["jam"] = "Jamaican Patois", -- Jamaican Creole English
["lij-mc"] = "Monégasque", -- Ligurian as spoken in Monaco
["luo"] = "Dholuo", -- IANA (primary) /ISO 639-3: Luo (Kenya and Tanzania); IANA (secondary): Dholuo
["mhr"] = "Meadow Mari", -- Eastern Mari
["mid"] = "Modern Mandaic", -- Mandaic
['mis'] = "uncoded", -- Uncoded languages; capitalization; special scope, not collective scope;
["mkh"] = "Mon–Khmer languages", -- to match en.wiki article title (endash)
["mla"] = "Tamambo", -- Malo
['mte'] = "Mono-Alu", -- Mono (Solomon Islands)
['mul'] = "multiple", -- Multiple languages; capitalization; special scope, not collective scope;
["nan-tw"] = "Taiwanese Hokkien", -- make room for IANA / 639-3 nan Min Nan Chinese; match en.wiki article title
["new"] = "Newar", -- Newari, Nepal Bhasa; to match en,wiki article title
["ngf"] = "Trans–New Guinea languages", -- to match en.wiki article title (endash)
["nic"] = "Niger–Congo languages", -- Niger-Kordofanian languages; to match en,wiki article title
["nrf"] = "Norman", -- not quite a collective - IANA name: Jèrriais + Guernésiais; categorizes to Norman-language text
["nrf-gg"] = "Guernésiais", -- match MediaWiki
["nrf-je"] = "Jèrriais", -- match MediaWiki
["nzi"] = "Nzema", -- Nzima; to match en.wiki article title
["oma"] = "Omaha–Ponca", -- to match en.wiki article title (endash)
["orv"] = "Old East Slavic", -- Old Russian
["pfl"] = "Palatine German", -- Pfaelzisch; to match en.wiki article
["pie"] = "Piro Pueblo", -- Piro; to match en.wiki article
["pms"] = "Piedmontese", -- Piemontese; to match en.wiki article title
["pnb"] = "Punjabi (Western)", -- Western Panjabi; dab added to override import from ~/wp languages and distinguish pnb from pa in reverse look up tag_from_name()
["rop"] = "Australian Kriol", -- Kriol; en.wiki article is a dab; point to correct en.wiki article
["sdo"] = "Bukar–Sadong", -- Bukar-Sadung Bidayuh; to match en.wiki article title
["stq"] = "Saterland Frisian", -- Saterfriesisch
["und"] = "undetermined", -- capitalization to match existing category
["wrg"] = "Warrongo", -- Warungu
["xal-ru"] = "Kalmyk", -- to match en.wiki article title
["xgf"] = "Tongva", -- ISO 639-3 is Gabrielino-Fernandeño
["yuf"] = "Havasupai–Hualapai", -- Havasupai-Walapai-Yavapai; to match en.wiki article title
["zxx"] = "no linguistic content", -- capitalization
-- these ISO 639-2, -3 language-name overrides imported from Module:Language/data/wp_languages
--<begin do-not-edit except to comment out>--
["ace"] = "Acehnese", -- Achinese
["aec"] = "Sa'idi Arabic", -- Saidi Arabic
["akl"] = "Aklan", -- Aklanon
["alt"] = "Altay", -- Southern Altai
["apm"] = "Mescalero-Chiricahua", -- Mescalero-Chiricahua Apache
["bal"] = "Balochi", -- Baluchi
-- ["bcl"] = "Central Bicolano", -- Central Bikol
["bin"] = "Edo", -- Bini
["bpy"] = "Bishnupriya Manipuri", -- Bishnupriya
["chg"] = "Chagatay", -- Chagatai
["ckb"] = "Sorani Kurdish", -- Central Kurdish
["cnu"] = "Shenwa", -- Chenoua
["coc"] = "Cocopah", -- Cocopa
["diq"] = "Zazaki", -- Dimli
["fit"] = "Meänkieli", -- Tornedalen Finnish
["fkv"] = "Kven", -- Kven Finnish
["frk"] = "Old Frankish", -- Frankish
["gez"] = "Ge'ez", -- Geez
["gju"] = "Gujari", -- Gujari
["gsw"] = "Alemannic German", -- Swiss German
["gul"] = "Gullah", -- Sea Island Creole English
["hak"] = "Hakka", -- Hakka Chinese
["hbo"] = "Biblical Hebrew", -- Ancient Hebrew
["hnd"] = "Hindko", -- Southern Hindko
-- ["ikt"] = "Inuvialuk", -- Inuinnaqtun
["kaa"] = "Karakalpak", -- Kara-Kalpak
["khb"] = "Tai Lü", -- Lü
["kmr"] = "Kurmanji Kurdish", -- Northern Kurdish
["kpo"] = "Kposo", -- Ikposo
["krj"] = "Kinaray-a", -- Kinaray-A
["ktz"] = "Juǀ'hoan", -- Juǀʼhoan
["lez"] = "Lezgian", -- Lezghian
["liv"] = "Livonian", -- Liv
["lng"] = "Lombardic", -- Langobardic
["mia"] = "Miami-Illinois", -- Miami
["miq"] = "Miskito", -- Mískito
["mix"] = "Mixtec", -- Mixtepec Mixtec
["mni"] = "Meitei", -- Manipuri
["mrj"] = "Hill Mari", -- Western Mari
["mww"] = "White Hmong", -- Hmong Daw
["nds-nl"] = "Dutch Low Saxon", -- Low German
-- ["new"] = "Nepal Bhasa", -- Newari
["nso"] = "Northern Sotho", -- Pedi
-- ["nwc"] = "Classical Nepal Bhasa", -- Classical Newari, Classical Nepal Bhasa, Old Newari
["ood"] = "O'odham", -- Tohono O'odham
["otk"] = "Old Turkic", -- Old Turkish
["pal"] = "Middle Persian", -- Pahlavi
["pam"] = "Kapampangan", -- Pampanga
["phr"] = "Potwari", -- Pahari-Potwari
["pka"] = "Jain Prakrit", -- Ardhamāgadhī Prākrit
-- ["pnb"] = "Punjabi", -- Western Panjabi
["psu"] = "Shauraseni", -- Sauraseni Prākrit
["rap"] = "Rapa Nui", -- Rapanui
["rar"] = "Cook Islands Māori", -- Rarotongan
["rmu"] = "Scandoromani", -- Tavringer Romani
["rom"] = "Romani", -- Romany
["rup"] = "Aromanian", -- Macedo-Romanian
["ryu"] = "Okinawan", -- Central Okinawan
["sdc"] = "Sassarese", -- Sassarese Sardinian
["sdn"] = "Gallurese", -- Gallurese Sardinian
["shp"] = "Shipibo", -- Shipibo-Conibo
["src"] = "Logudorese", -- Logudorese Sardinian
["sro"] = "Campidanese", -- Campidanese Sardinian
["tkl"] = "Tokelauan", -- Tokelau
["tvl"] = "Tuvaluan", -- Tuvalu
["tyv"] = "Tuvan", -- Tuvinian
["vls"] = "West Flemish", -- Vlaams
["wep"] = "Westphalian", -- Westphalien
["xal"] = "Oirat", -- Kalmyk
["xcl"] = "Old Armenian", -- Classical Armenian
["yua"] = "Yucatec Maya", -- Yucateco
--<end do-not-edit except to comment out>--
------------------------------< P R I V A T E _ U S E _ T A G S >----------------------------------------------
["akk-x-latbabyl"] = "Late Babylonian",
["akk-x-midassyr"] = "Middle Assyrian Akkadian",
["akk-x-midbabyl"] = "Middle Babylonian Akkadian",
["akk-x-neoassyr"] = "Neo-Assyrian Akkadian",
["akk-x-neobabyl"] = "Neo-Babylonian Akkadian",
["akk-x-old"] = "Old Akkadian",
["akk-x-oldassyr"] = "Old Assyrian Akkadian",
["akk-x-oldbabyl"] = "Old Babylonian Akkadian",
["alg-x-proto"] = "Proto-Algonquian", -- alg in IANA is Algonquian languages
["ca-x-old"] = "Old Catalan",
["cel-x-proto"] = "Proto-Celtic", -- cel in IANA is Celtic languages
["egy-x-demotic"] = "Demotic Egyptian",
["egy-x-late"] = "Late Egyptian",
["egy-x-middle"] = "Middle Egyptian",
["egy-x-old"] = "Old Egyptian",
["gem-x-proto"] = "Proto-Germanic", -- gem in IANA is Germanic languages
["gmw-x-ecg"] = "East Central German",
["grc-x-aeolic"] = "Aeolic Greek", -- these grc-x-... codes are preferred alternates to the non-standard catchall code grc-gre
["grc-x-attic"] = "Attic Greek",
["grc-x-biblical"] = "Biblical Greek",
["grc-x-byzant"] = "Byzantine Greek",
["grc-x-classic"] = "Classical Greek",
["grc-x-doric"] = "Doric Greek",
["grc-x-hellen"] = "Hellenistic Greek",
["grc-x-ionic"] = "Ionic Greek",
["grc-x-koine"] = "Koinē Greek",
["grc-x-medieval"] = "Medieval Greek",
["grc-x-patris"] = "Patristic Greek",
["grk-x-proto"] = "Proto-Greek", -- grk in IANA is Greek languages
["iir-x-proto"] = "Proto-Indo-Iranian", -- iir in IANA is Indo-Iranian Languages
["inc-x-mitanni"] = "Mitanni-Aryan", -- inc in IANA is Indic languages
["inc-x-proto"] = "Proto-Indo-Aryan",
["ine-x-proto"] = "Proto-Indo-European",
["ira-x-proto"] = "Proto-Iranian", -- ira in IANA is Iranian languages
["itc-x-proto"] = "Proto-Italic", -- itc in IANA is Italic languages
["ksh-x-colog"] = "Colognian", -- en.wiki article is Colognian; ksh (Kölsch) redirects there
["la-x-medieval"] = "Medieval Latin",
["la-x-new"] = "New Latin",
["lmo-x-milanese"] = "Milanese", -- lmo in IANA is Lombard; Milanese is a dialect
["mis-x-ripuar"] = "Ripuarian", -- replaces improper use of ksh in wp_languages
["prg-x-old"] = "Old Prussian",
["sem-x-ammonite"] = "Ammonite",
["sem-x-aramaic"] = "Aramaic",
["sem-x-canaan"] = "Canaanite languages",
["sem-x-dumaitic"] = "Dumaitic",
["sem-x-egurage"] = "Eastern Gurage",
["sem-x-hatran"] = "Hatran Aramaic",
["sem-x-oldsoara"] = "Old South Arabian",
["sem-x-palmyren"] = "Palmyrene Aramaic",
["sem-x-proto"] = "Proto-Semitic",
["sem-x-taymanit"] = "Taymanitic",
["sla-x-proto"] = "Proto-Slavic", -- sla in IANA is Slavic languages
["yuf-x-hav"] = "Havasupai", -- IANA name for these three is Havasupai-Walapai-Yavapai
["yuf-x-wal"] = "Walapai",
["yuf-x-yav"] = "Yavapai",
["xsc-x-pontic"] = "Pontic Scythian", -- xsc in IANA is Scythian
["xsc-x-saka"] = "Saka",
["xsc-x-sarmat"] = "Sarmatian",
}
--[[--------------------------< A R T I C L E _ L I N K >------------------------------------------------------
for those rare occasions when article titles don't fit with the normal '<language name>-language', this table
maps language code to article title. Use of this table should be avoided and the use of redirects preferred as
that is the long-standing method of handling article names that don't fit with the normal pattern
]]
local article_name = {
['kue'] = "Kuman language (New Guinea)", -- Kuman (Papua New Guinea); to avoid Kuman dab page
["lij"] = "Ligurian (Romance language)", -- Ligurian; see Template_talk:Lang#Ligurian_dab
['mbo'] = "Mbo language (Cameroon)", -- Mbo (Cameroon)
['mnh'] = "Mono language (Congo)", -- Mono (Democratic Republic of Congo); see Template_talk:Lang#Mono_languages
['mnr'] = "Mono language (California)", -- Mono (USA)
['mru'] = "Mono language (Cameroon)", -- Mono (Cameroon)
['qwm'] = "Kuman (Russia)", -- Kuman (Russia); to avoid Kuman dab page
["snq"] = "Sangu language (Gabon)", -- Sangu (Gabon)
["toi"] = "Tonga language (Zambia and Zimbabwe)", -- Tonga (Zambia and Zimbabwe); to avoid Tonga language dab page
["xlg"] = "Ligurian (ancient language)", -- see Template_talk:Lang#Ligurian_dab
["zmw"] = "Mbo language (Congo)", -- Mbo (Democratic Republic of Congo)
}
--[=[-------------------------< R T L _ S C R I P T S >--------------------------------------------------------
ISO 15924 scripts that are written right-to-left. Data in this table taken from [[ISO 15924#List of codes]]
last update to this list: 2017-12-24
]=]
local rtl_scripts = {
'adlm', 'arab', 'aran', 'armi', 'avst', 'cprt', 'egyd', 'egyh', 'hatr', 'hebr',
'hung', 'inds', 'khar', 'lydi', 'mand', 'mani', 'mend', 'merc', 'mero', 'narb',
'nbat', 'nkoo', 'orkh', 'palm', 'phli', 'phlp', 'phlv', 'phnx', 'prti', 'rohg',
'samr', 'sarb', 'sogd', 'sogo', 'syrc', 'syre', 'syrj', 'syrn', 'thaa', 'wole',
};
--[[--------------------------< T R A N S L I T _ T I T L E S >------------------------------------------------
This is a table of tables of transliteration standards and the language codes or language scripts that apply to
those standards. This table is used to create the tool-tip text associated with the transliterated text displayed
by some of the {{lang-??}} templates.
These tables are more-or-less copied directly from {{transl}}. The standard 'NO_STD' is a construct to allow for
the cases when no |std= parameter value is provided.
]]
local translit_title_table = {
['ahl'] = {
['default'] = 'Academy of the Hebrew Language transliteration',
},
['ala'] = {
['default'] = 'American Library Association – Library of Congress transliteration',
},
['ala-lc'] = {
['default'] = 'American Library Association – Library of Congress transliteration',
},
['batr'] = {
['default'] = 'Bikdash Arabic Transliteration Rules',
},
['bgn/pcgn'] = {
['default'] = 'Board on Geographic Names / Permanent Committee on Geographical Names transliteration',
},
['din'] = {
['ar'] = 'DIN 31635 Arabic',
['fa'] = 'DIN 31635 Arabic',
['ku'] = 'DIN 31635 Arabic',
['ps'] = 'DIN 31635 Arabic',
['tg'] = 'DIN 31635 Arabic',
['ug'] = 'DIN 31635 Arabic',
['ur'] = 'DIN 31635 Arabic',
['arab'] = 'DIN 31635 Arabic',
['default'] = 'DIN transliteration',
},
['eae'] = {
['default'] = 'Encyclopaedia Aethiopica transliteration',
},
['hepburn'] = {
['default'] = 'Hepburn transliteration',
},
['hunterian'] = {
['default'] = 'Hunterian transliteration',
},
['iast'] = {
['default'] = 'International Alphabet of Sanskrit transliteration',
},
['iso'] = { -- when a transliteration standard is supplied
['ab'] = 'ISO 9 Cyrillic',
['ba'] = 'ISO 9 Cyrillic',
['be'] = 'ISO 9 Cyrillic',
['bg'] = 'ISO 9 Cyrillic',
['kk'] = 'ISO 9 Cyrillic',
['ky'] = 'ISO 9 Cyrillic',
['mn'] = 'ISO 9 Cyrillic',
['ru'] = 'ISO 9 Cyrillic',
['tg'] = 'ISO 9 Cyrillic',
['uk'] = 'ISO 9 Cyrillic',
['bua'] = 'ISO 9 Cyrillic',
['sah'] = 'ISO 9 Cyrillic',
['tut'] = 'ISO 9 Cyrillic',
['xal'] = 'ISO 9 Cyrillic',
['cyrl'] = 'ISO 9 Cyrillic',
['ar'] = 'ISO 233 Arabic',
['ku'] = 'ISO 233 Arabic',
['ps'] = 'ISO 233 Arabic',
['ug'] = 'ISO 233 Arabic',
['ur'] = 'ISO 233 Arabic',
['arab'] = 'ISO 233 Arabic',
['he'] = 'ISO 259 Hebrew',
['yi'] = 'ISO 259 Hebrew',
['hebr'] = 'ISO 259 Hebrew',
['el'] = 'ISO 843 Greek',
['grc'] = 'ISO 843 Greek',
['ja'] = 'ISO 3602 Japanese',
['hira'] = 'ISO 3602 Japanese',
['hrkt'] = 'ISO 3602 Japanese',
['jpan'] = 'ISO 3602 Japanese',
['kana'] = 'ISO 3602 Japanese',
['zh'] = 'ISO 7098 Chinese',
['chi'] = 'ISO 7098 Chinese',
['pny'] = 'ISO 7098 Chinese',
['zho'] = 'ISO 7098 Chinese',
-- ['han'] = 'ISO 7098 Chinese', -- unicode alias of Hani? doesn't belong here? should be Hani?
['hans'] = 'ISO 7098 Chinese',
['hant'] = 'ISO 7098 Chinese',
['ka'] = 'ISO 9984 Georgian',
['kat'] = 'ISO 9984 Georgian',
['arm'] = 'ISO 9985 Armenian',
['hy'] = 'ISO 9985 Armenian',
['th'] = 'ISO 11940 Thai',
['tha'] = 'ISO 11940 Thai',
['ko'] = 'ISO 11941 Korean',
['kor'] = 'ISO 11941 Korean',
['awa'] = 'ISO 15919 Indic',
['bho'] = 'ISO 15919 Indic',
['bn'] = 'ISO 15919 Indic',
['bra'] = 'ISO 15919 Indic',
['doi'] = 'ISO 15919 Indic',
['dra'] = 'ISO 15919 Indic',
['gon'] = 'ISO 15919 Indic',
['gu'] = 'ISO 15919 Indic',
['hi'] = 'ISO 15919 Indic',
['hno'] = 'ISO 15919 Indic',
['inc'] = 'ISO 15919 Indic',
['kn'] = 'ISO 15919 Indic',
['kok'] = 'ISO 15919 Indic',
['ks'] = 'ISO 15919 Indic',
['mag'] = 'ISO 15919 Indic',
['mai'] = 'ISO 15919 Indic',
['ml'] = 'ISO 15919 Indic',
['mr'] = 'ISO 15919 Indic',
['ne'] = 'ISO 15919 Indic',
['new'] = 'ISO 15919 Indic',
['or'] = 'ISO 15919 Indic',
['pa'] = 'ISO 15919 Indic',
['pnb'] = 'ISO 15919 Indic',
['raj'] = 'ISO 15919 Indic',
['sa'] = 'ISO 15919 Indic',
['sat'] = 'ISO 15919 Indic',
['sd'] = 'ISO 15919 Indic',
['si'] = 'ISO 15919 Indic',
['skr'] = 'ISO 15919 Indic',
['ta'] = 'ISO 15919 Indic',
['tcy'] = 'ISO 15919 Indic',
['te'] = 'ISO 15919 Indic',
['beng'] = 'ISO 15919 Indic',
['brah'] = 'ISO 15919 Indic',
['deva'] = 'ISO 15919 Indic',
['gujr'] = 'ISO 15919 Indic',
['guru'] = 'ISO 15919 Indic',
['knda'] = 'ISO 15919 Indic',
['mlym'] = 'ISO 15919 Indic',
['orya'] = 'ISO 15919 Indic',
['sinh'] = 'ISO 15919 Indic',
['taml'] = 'ISO 15919 Indic',
['telu'] = 'ISO 15919 Indic',
['default'] = 'ISO transliteration',
},
['jyutping'] = {
['default'] = 'Jyutping transliteration',
},
['mlcts'] = {
['default'] = 'Myanmar Language Commission Transcription System',
},
['mr'] = {
['default'] = 'McCune–Reischauer transliteration',
},
['nihon-shiki'] = {
['default'] = 'Nihon-shiki transliteration',
},
['no_std'] = { -- when no transliteration standard is supplied
['akk'] = 'Semitic transliteration',
['sem'] = 'Semitic transliteration',
['phnx'] = 'Semitic transliteration',
['xsux'] = 'Cuneiform transliteration',
},
['pinyin'] = {
['default'] = 'Pinyin transliteration',
},
['rr'] = {
['default'] = 'Revised Romanization of Korean transliteration',
},
['rtgs'] = {
['default'] = 'Royal Thai General System of Transcription',
},
['satts'] = {
['default'] = 'Standard Arabic Technical Transliteration System transliteration',
},
['scientific'] = {
['default'] = 'scientific transliteration',
},
['ukrainian'] = {
['default'] = 'Ukrainian National system of romanization',
},
['ungegn'] = {
['default'] = 'United Nations Group of Experts on Geographical Names transliteration',
},
['wadegile'] = {
['default'] = 'Wade–Giles transliteration',
},
['wehr'] = {
['default'] = 'Hans Wehr transliteration',
},
};
return
{
this_wiki_lang_tag = this_wiki_lang_tag,
this_wiki_lang_dir = lang_obj:getDir(), -- wiki's language direction
article_name = article_name,
lang_name_table = lang_name_table_t,
override = override,
rtl_scripts = rtl_scripts,
special_tags_table = special_tags_table,
translit_title_table = translit_title_table,
};
120387552d6d88bcddb6260de37dcd404c28ccdf
Template:Uses Wikidata
10
229
562
2023-10-06T20:05:41Z
wikipedia>SWinxy
0
Wrap catting in <includeonly> instead of an ifeq
wikitext
text/x-wiki
{{Sister project
| position = {{{position|}}}
| project = data
| text = This {{module other|module|template}} uses {{#if:{{{section|}}} | one or more [[Wikidata]] properties; see {{Section link||{{{section}}}}} for details. | the [[Wikidata]] propert{{#if:{{{2|}}}|ies|y}}:
{{#invoke:Uses Wikidata|usesProperty}}
}}}}<includeonly>{{#switch:{{SUBPAGENAME}}
|sandbox |testcases |doc= <!--no category-->
|#default={{module other |[[Category:Modules using data from Wikidata]] |{{template other |[[Category:Templates using data from Wikidata]]}} }}
}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage -->
</noinclude>
dd057e93ccd4b8fe8d6acd82c6d1d3ee2589a36a
Template:Parameter names example
10
82
255
2023-10-08T00:30:05Z
wikipedia>Shkuru Afshar
0
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{documentation}}<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
256a11b9ae7ac7e492b3d9de86ade1ffa96bffd1
Module:Citation/CS1/Configuration
828
159
418
2023-10-09T13:08:46Z
wikipedia>Trappist the monk
0
bump oclc;
Scribunto
text/plain
local lang_obj = mw.language.getContentLanguage(); -- make a language object for the local language; used here for languages and dates
--[[--------------------------< S E T T I N G S >--------------------------------------------------------------
boolean settings used to control various things. these setting located here to make them easy to find
]]
-- these settings local to this module only
local local_digits_from_mediawiki = false; -- for i18n; when true, module fills date_names['local_digits'] from MediaWiki; manual fill required else; always false at en.wiki
local local_date_names_from_mediawiki = false; -- for i18n; when true, module fills date_names['local']['long'] and date_names['local']['short'] from MediaWiki;
-- manual translation required else; ; always false at en.wiki
-- these settings exported to other modules
local use_identifier_redirects = true; -- when true use redirect name for identifier label links; always true at en.wiki
local local_lang_cat_enable = false; -- when true categorizes pages where |language=<local wiki's language>; always false at en.wiki
local date_name_auto_xlate_enable = false; -- when true translates English month-names to the local-wiki's language month names; always false at en.wiki
local date_digit_auto_xlate_enable = false; -- when true translates Western date digit to the local-wiki's language digits (date_names['local_digits']); always false at en.wiki
--[[--------------------------< U N C A T E G O R I Z E D _ N A M E S P A C E S >------------------------------
List of namespaces identifiers for namespaces that will not be included in citation error categories.
Same as setting notracking = true by default.
For wikis that have a current version of Module:cs1 documentation support, this #invoke will return an unordered
list of namespace names and their associated identifiers:
{{#invoke:cs1 documentation support|uncategorized_namespace_lister|all=<anything>}}
]]
uncategorized_namespaces_t = {[2]=true}; -- init with user namespace id
for k, _ in pairs (mw.site.talkNamespaces) do -- add all talk namespace ids
uncategorized_namespaces_t[k] = true;
end
local uncategorized_subpages = {'/[Ss]andbox', '/[Tt]estcases', '/[^/]*[Ll]og', '/[Aa]rchive'}; -- list of Lua patterns found in page names of pages we should not categorize
--[[--------------------------< M E S S A G E S >--------------------------------------------------------------
Translation table
The following contains fixed text that may be output as part of a citation.
This is separated from the main body to aid in future translations of this
module.
]]
local messages = {
['agency'] = '$1 $2', -- $1 is sepc, $2 is agency
['archived-dead'] = 'Archived from $1 on $2',
['archived-live'] = '$1 from the original on $2',
['archived-unfit'] = 'Archived from the original on ',
['archived'] = 'Archived',
['by'] = 'By', -- contributions to authored works: introduction, foreword, afterword
['cartography'] = 'Cartography by $1',
['editor'] = 'ed.',
['editors'] = 'eds.',
['edition'] = '($1 ed.)',
['episode'] = 'Episode $1',
['et al'] = 'et al.',
['in'] = 'In', -- edited works
['inactive'] = 'inactive',
['inset'] = '$1 inset',
['interview'] = 'Interviewed by $1',
['mismatch'] = '<code class="cs1-code">|$1=</code> / <code class="cs1-code">|$2=</code> mismatch', -- $1 is year param name; $2 is date param name
['newsgroup'] = '[[Usenet newsgroup|Newsgroup]]: $1',
['notitle'] = 'No title', -- for |title=(()) and (in the future) |title=none
['original'] = 'the original',
['origdate'] = ' [$1]',
['published'] = ' (published $1)',
['retrieved'] = 'Retrieved $1',
['season'] = 'Season $1',
['section'] = '§ $1',
['sections'] = '§§ $1',
['series'] = '$1 $2', -- $1 is sepc, $2 is series
['seriesnum'] = 'Series $1',
['translated'] = 'Translated by $1',
['type'] = ' ($1)', -- for titletype
['written'] = 'Written at $1',
['vol'] = '$1 Vol. $2', -- $1 is sepc; bold journal style volume is in presentation{}
['vol-no'] = '$1 Vol. $2, no. $3', -- sepc, volume, issue (alternatively insert $1 after $2, but then we'd also have to change capitalization)
['issue'] = '$1 No. $2', -- $1 is sepc
['art'] = '$1 Art. $2', -- $1 is sepc; for {{cite conference}} only
['vol-art'] = '$1 Vol. $2, art. $3', -- sepc, volume, article-number; for {{cite conference}} only
['j-vol'] = '$1 $2', -- sepc, volume; bold journal volume is in presentation{}
['j-issue'] = ' ($1)',
['j-article-num'] = ' $1', -- TODO: any punctuation here? static text?
['nopp'] = '$1 $2'; -- page(s) without prefix; $1 is sepc
['p-prefix'] = "$1 p. $2", -- $1 is sepc
['pp-prefix'] = "$1 pp. $2", -- $1 is sepc
['j-page(s)'] = ': $1', -- same for page and pages
['sheet'] = '$1 Sheet $2', -- $1 is sepc
['sheets'] = '$1 Sheets $2', -- $1 is sepc
['j-sheet'] = ': Sheet $1',
['j-sheets'] = ': Sheets $1',
['language'] = '(in $1)',
['via'] = " – via $1",
['event'] = 'Event occurs at',
['minutes'] = 'minutes in',
-- Determines the location of the help page
['help page link'] = 'Help:CS1 errors',
['help page label'] = 'help',
-- categories
['cat wikilink'] = '[[Category:$1]]', -- $1 is the category name
[':cat wikilink'] = '[[:Category:$1|link]]', -- category name as maintenance message wikilink; $1 is the category name
-- Internal errors (should only occur if configuration is bad)
['undefined_error'] = 'Called with an undefined error condition',
['unknown_ID_key'] = 'Unrecognized ID key: ', -- an ID key in id_handlers not found in ~/Identifiers func_map{}
['unknown_ID_access'] = 'Unrecognized ID access keyword: ', -- an ID access keyword in id_handlers not found in keywords_lists['id-access']{}
['unknown_argument_map'] = 'Argument map not defined for this variable',
['bare_url_no_origin'] = 'Bare URL found but origin indicator is nil or empty',
['warning_msg_e'] = '<span style="color:#d33">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">{{$1}}</code> templates have errors</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
['warning_msg_m'] = '<span style="color:#3a3">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">{{$1}}</code> templates have maintenance messages</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
}
--[[--------------------------< C I T A T I O N _ C L A S S _ M A P >------------------------------------------
this table maps the value assigned to |CitationClass= in the cs1|2 templates to the canonical template name when
the value assigned to |CitationClass= is different from the canonical template name. |CitationClass= values are
used as class attributes in the <cite> tag that encloses the citation so these names may not contain spaces while
the canonical template name may. These names are used in warning_msg_e and warning_msg_m to create links to the
template's documentation when an article is displayed in preview mode.
Most cs1|2 template |CitationClass= values at en.wiki match their canonical template names so are not listed here.
]]
local citation_class_map_t = { -- TODO: if kept, these and all other config.CitationClass 'names' require some sort of i18n
['arxiv'] = 'arXiv',
['audio-visual'] = 'AV media',
['AV-media-notes'] = 'AV media notes',
['biorxiv'] = 'bioRxiv',
['citeseerx'] = 'CiteSeerX',
['encyclopaedia'] = 'encyclopedia',
['mailinglist'] = 'mailing list',
['medrxiv'] = 'medRxiv',
['pressrelease'] = 'press release',
['ssrn'] = 'SSRN',
['techreport'] = 'tech report',
}
--[=[-------------------------< E T _ A L _ P A T T E R N S >--------------------------------------------------
This table provides Lua patterns for the phrase "et al" and variants in name text
(author, editor, etc.). The main module uses these to identify and emit the 'etal' message.
]=]
local et_al_patterns = {
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][%.;,\"']*$", -- variations on the 'et al' theme
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][Ii][AaIi][Ee]?[%.;,\"']*$", -- variations on the 'et alia', 'et alii' and 'et aliae' themes (false positive 'et aliie' unlikely to match)
"[;,]? *%f[%a]and [Oo]thers", -- an alternative to et al.
"%[%[ *[Ee][Tt]%.? *[Aa][Ll]%.? *%]%]", -- a wikilinked form
"%(%( *[Ee][Tt]%.? *[Aa][Ll]%.? *%)%)", -- a double-bracketed form (to counter partial removal of ((...)) syntax)
"[%(%[] *[Ee][Tt]%.? *[Aa][Ll]%.? *[%)%]]", -- a bracketed form
}
--[[--------------------------< P R E S E N T A T I O N >------------------------
Fixed presentation markup. Originally part of citation_config.messages it has
been moved into its own, more semantically correct place.
]]
local presentation =
{
-- .citation-comment class is specified at Help:CS1_errors#Controlling_error_message_display
['hidden-error'] = '<span class="cs1-hidden-error citation-comment">$1</span>',
['visible-error'] = '<span class="cs1-visible-error citation-comment">$1</span>',
['hidden-maint'] = '<span class="cs1-maint citation-comment">$1</span>',
['accessdate'] = '<span class="reference-accessdate">$1$2</span>', -- to allow editors to hide accessdate using personal CSS
['bdi'] = '<bdi$1>$2</bdi>', -- bidirectional isolation used with |script-title= and the like
['cite'] = '<cite class="$1">$2</cite>'; -- for use when citation does not have a namelist and |ref= not set so no id="..." attribute
['cite-id'] = '<cite id="$1" class="$2">$3</cite>'; -- for use when when |ref= is set or when citation has a namelist
['format'] = ' <span class="cs1-format">($1)</span>', -- for |format=, |chapter-format=, etc.
['interwiki'] = ' <span class="cs1-format">[in $1]</span>', -- for interwiki-language-linked author, editor, etc
['interproj'] = ' <span class="cs1-format">[at $1]</span>', -- for interwiki-project-linked author, editor, etc (:d: and :s: supported; :w: ignored)
-- various access levels, for |access=, |doi-access=, |arxiv=, ...
-- narrow no-break space   may work better than nowrap CSS. Or not? Browser support?
['ext-link-access-signal'] = '<span class="$1" title="$2">$3</span>', -- external link with appropriate lock icon
['free'] = {class='cs1-lock-free', title='Freely accessible'}, -- classes defined in Module:Citation/CS1/styles.css
['registration'] = {class='cs1-lock-registration', title='Free registration required'},
['limited'] = {class='cs1-lock-limited', title='Free access subject to limited trial, subscription normally required'},
['subscription'] = {class='cs1-lock-subscription', title='Paid subscription required'},
['interwiki-icon'] = '<span class="$1" title="$2">$3</span>',
['class-wikisource'] = 'cs1-ws-icon',
['italic-title'] = "''$1''",
['kern-left'] = '<span class="cs1-kern-left"></span>$1', -- spacing to use when title contains leading single or double quote mark
['kern-right'] = '$1<span class="cs1-kern-right"></span>', -- spacing to use when title contains trailing single or double quote mark
['nowrap1'] = '<span class="nowrap">$1</span>', -- for nowrapping an item: <span ...>yyyy-mm-dd</span>
['nowrap2'] = '<span class="nowrap">$1</span> $2', -- for nowrapping portions of an item: <span ...>dd mmmm</span> yyyy (note white space)
['ocins'] = '<span title="$1" class="Z3988"></span>',
['parameter'] = '<code class="cs1-code">|$1=</code>',
['ps_cs1'] = '.'; -- CS1 style postscript (terminal) character
['ps_cs2'] = ''; -- CS2 style postscript (terminal) character (empty string)
['quoted-text'] = '<q>$1</q>', -- for wrapping |quote= content
['quoted-title'] = '"$1"',
['sep_cs1'] = '.', -- CS1 element separator
['sep_cs2'] = ',', -- CS2 separator
['sep_nl'] = ';', -- CS1|2 style name-list separator between names is a semicolon
['sep_nl_and'] = ' and ', -- used as last nl sep when |name-list-style=and and list has 2 items
['sep_nl_end'] = '; and ', -- used as last nl sep when |name-list-style=and and list has 3+ names
['sep_name'] = ', ', -- CS1|2 style last/first separator is <comma><space>
['sep_nl_vanc'] = ',', -- Vancouver style name-list separator between authors is a comma
['sep_name_vanc'] = ' ', -- Vancouver style last/first separator is a space
['sep_list'] = ', ', -- used for |language= when list has 3+ items except for last sep which uses sep_list_end
['sep_list_pair'] = ' and ', -- used for |language= when list has 2 items
['sep_list_end'] = ', and ', -- used as last list sep for |language= when list has 3+ items
['trans-italic-title'] = "[''$1'']",
['trans-quoted-title'] = "[$1]", -- for |trans-title= and |trans-quote=
['vol-bold'] = '$1 <b>$2</b>', -- sepc, volume; for bold journal cites; for other cites ['vol'] in messages{}
}
--[[--------------------------< A L I A S E S >---------------------------------
Aliases table for commonly passed parameters.
Parameter names on the right side in the assignments in this table must have been
defined in the Whitelist before they will be recognized as valid parameter names
]]
local aliases = {
['AccessDate'] = {'access-date', 'accessdate'}, -- Used by InternetArchiveBot
['Agency'] = 'agency',
['ArchiveDate'] = {'archive-date', 'archivedate'}, -- Used by InternetArchiveBot
['ArchiveFormat'] = 'archive-format',
['ArchiveURL'] = {'archive-url', 'archiveurl'}, -- Used by InternetArchiveBot
['ArticleNumber'] = 'article-number',
['ASINTLD'] = 'asin-tld',
['At'] = 'at', -- Used by InternetArchiveBot
['Authors'] = {'authors', 'people', 'credits'},
['BookTitle'] = {'book-title', 'booktitle'},
['Cartography'] = 'cartography',
['Chapter'] = {'chapter', 'contribution', 'entry', 'article', 'section'},
['ChapterFormat'] = {'chapter-format', 'contribution-format', 'entry-format',
'article-format', 'section-format'};
['ChapterURL'] = {'chapter-url', 'contribution-url', 'entry-url', 'article-url', 'section-url', 'chapterurl'}, -- Used by InternetArchiveBot
['ChapterUrlAccess'] = {'chapter-url-access', 'contribution-url-access',
'entry-url-access', 'article-url-access', 'section-url-access'}, -- Used by InternetArchiveBot
['Class'] = 'class', -- cite arxiv and arxiv identifier
['Collaboration'] = 'collaboration',
['Conference'] = {'conference', 'event'},
['ConferenceFormat'] = 'conference-format',
['ConferenceURL'] = 'conference-url', -- Used by InternetArchiveBot
['Date'] = {'date', 'air-date', 'airdate'}, -- air-date and airdate for cite episode and cite serial only
['Degree'] = 'degree',
['DF'] = 'df',
['DisplayAuthors'] = {'display-authors', 'display-subjects'},
['DisplayContributors'] = 'display-contributors',
['DisplayEditors'] = 'display-editors',
['DisplayInterviewers'] = 'display-interviewers',
['DisplayTranslators'] = 'display-translators',
['Docket'] = 'docket',
['DoiBroken'] = 'doi-broken-date',
['Edition'] = 'edition',
['Embargo'] = 'pmc-embargo-date',
['Encyclopedia'] = {'encyclopedia', 'encyclopaedia', 'dictionary'}, -- cite encyclopedia only
['Episode'] = 'episode', -- cite serial only TODO: make available to cite episode?
['Format'] = 'format',
['ID'] = {'id', 'ID'},
['Inset'] = 'inset',
['Issue'] = {'issue', 'number'},
['Language'] = {'language', 'lang'},
['MailingList'] = {'mailing-list', 'mailinglist'}, -- cite mailing list only
['Map'] = 'map', -- cite map only
['MapFormat'] = 'map-format', -- cite map only
['MapURL'] = {'map-url', 'mapurl'}, -- cite map only -- Used by InternetArchiveBot
['MapUrlAccess'] = 'map-url-access', -- cite map only -- Used by InternetArchiveBot
['Minutes'] = 'minutes',
['Mode'] = 'mode',
['NameListStyle'] = 'name-list-style',
['Network'] = 'network',
['Newsgroup'] = 'newsgroup', -- cite newsgroup only
['NoPP'] = {'no-pp', 'nopp'},
['NoTracking'] = {'no-tracking', 'template-doc-demo'},
['Number'] = 'number', -- this case only for cite techreport
['OrigDate'] = {'orig-date', 'orig-year', 'origyear'},
['Others'] = 'others',
['Page'] = {'page', 'p'}, -- Used by InternetArchiveBot
['Pages'] = {'pages', 'pp'}, -- Used by InternetArchiveBot
['Periodical'] = {'journal', 'magazine', 'newspaper', 'periodical', 'website', 'work'},
['Place'] = {'place', 'location'},
['PostScript'] = 'postscript',
['PublicationDate'] = {'publication-date', 'publicationdate'},
['PublicationPlace'] = {'publication-place', 'publicationplace'},
['PublisherName'] = {'publisher', 'institution'},
['Quote'] = {'quote', 'quotation'},
['QuotePage'] = 'quote-page',
['QuotePages'] = 'quote-pages',
['Ref'] = 'ref',
['Scale'] = 'scale',
['ScriptChapter'] = {'script-chapter', 'script-contribution', 'script-entry',
'script-article', 'script-section'},
['ScriptMap'] = 'script-map',
['ScriptPeriodical'] = {'script-journal', 'script-magazine', 'script-newspaper',
'script-periodical', 'script-website', 'script-work'},
['ScriptQuote'] = 'script-quote',
['ScriptTitle'] = 'script-title', -- Used by InternetArchiveBot
['Season'] = 'season',
['Sections'] = 'sections', -- cite map only
['Series'] = {'series', 'version'},
['SeriesLink'] = {'series-link', 'serieslink'},
['SeriesNumber'] = {'series-number', 'series-no'},
['Sheet'] = 'sheet', -- cite map only
['Sheets'] = 'sheets', -- cite map only
['Station'] = 'station',
['Time'] = 'time',
['TimeCaption'] = 'time-caption',
['Title'] = 'title', -- Used by InternetArchiveBot
['TitleLink'] = {'title-link', 'episode-link', 'episodelink'}, -- Used by InternetArchiveBot
['TitleNote'] = {'title-note', 'department'},
['TitleType'] = {'type', 'medium'},
['TransChapter'] = {'trans-article', 'trans-chapter', 'trans-contribution',
'trans-entry', 'trans-section'},
['Transcript'] = 'transcript',
['TranscriptFormat'] = 'transcript-format',
['TranscriptURL'] = 'transcript-url', -- Used by InternetArchiveBot
['TransMap'] = 'trans-map', -- cite map only
['TransPeriodical'] = {'trans-journal', 'trans-magazine', 'trans-newspaper',
'trans-periodical', 'trans-website', 'trans-work'},
['TransQuote'] = 'trans-quote',
['TransTitle'] = 'trans-title', -- Used by InternetArchiveBot
['URL'] = {'url', 'URL'}, -- Used by InternetArchiveBot
['UrlAccess'] = 'url-access', -- Used by InternetArchiveBot
['UrlStatus'] = 'url-status', -- Used by InternetArchiveBot
['Vauthors'] = 'vauthors',
['Veditors'] = 'veditors',
['Via'] = 'via',
['Volume'] = 'volume',
['Year'] = 'year',
['AuthorList-First'] = {"first#", "author-first#", "author#-first", "author-given#", "author#-given",
"subject-first#", "subject#-first", "subject-given#", "subject#-given",
"given#"},
['AuthorList-Last'] = {"last#", "author-last#", "author#-last", "author-surname#", "author#-surname",
"subject-last#", "subject#-last", "subject-surname#", "subject#-surname",
"author#", 'host#', "subject#", "surname#"},
['AuthorList-Link'] = {"author-link#", "author#-link", "subject-link#",
"subject#-link", "authorlink#", "author#link"},
['AuthorList-Mask'] = {"author-mask#", "author#-mask", "subject-mask#", "subject#-mask"},
['ContributorList-First'] = {'contributor-first#', 'contributor#-first',
'contributor-given#', 'contributor#-given'},
['ContributorList-Last'] = {'contributor-last#', 'contributor#-last',
'contributor-surname#', 'contributor#-surname', 'contributor#'},
['ContributorList-Link'] = {'contributor-link#', 'contributor#-link'},
['ContributorList-Mask'] = {'contributor-mask#', 'contributor#-mask'},
['EditorList-First'] = {"editor-first#", "editor#-first", "editor-given#", "editor#-given"},
['EditorList-Last'] = {"editor-last#", "editor#-last", "editor-surname#",
"editor#-surname", "editor#"},
['EditorList-Link'] = {"editor-link#", "editor#-link"},
['EditorList-Mask'] = {"editor-mask#", "editor#-mask"},
['InterviewerList-First'] = {'interviewer-first#', 'interviewer#-first',
'interviewer-given#', 'interviewer#-given'},
['InterviewerList-Last'] = {'interviewer-last#', 'interviewer#-last',
'interviewer-surname#', 'interviewer#-surname', 'interviewer#'},
['InterviewerList-Link'] = {'interviewer-link#', 'interviewer#-link'},
['InterviewerList-Mask'] = {'interviewer-mask#', 'interviewer#-mask'},
['TranslatorList-First'] = {'translator-first#', 'translator#-first',
'translator-given#', 'translator#-given'},
['TranslatorList-Last'] = {'translator-last#', 'translator#-last',
'translator-surname#', 'translator#-surname', 'translator#'},
['TranslatorList-Link'] = {'translator-link#', 'translator#-link'},
['TranslatorList-Mask'] = {'translator-mask#', 'translator#-mask'},
}
--[[--------------------------< P U N C T _ S K I P >---------------------------
builds a table of parameter names that the extraneous terminal punctuation check should not check.
]]
local punct_meta_params = { -- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value
'BookTitle', 'Chapter', 'ScriptChapter', 'ScriptTitle', 'Title', 'TransChapter', 'Transcript', 'TransMap', 'TransTitle', -- title-holding parameters
'AuthorList-Mask', 'ContributorList-Mask', 'EditorList-Mask', 'InterviewerList-Mask', 'TranslatorList-Mask', -- name-list mask may have name separators
'PostScript', 'Quote', 'ScriptQuote', 'TransQuote', 'Ref', -- miscellaneous
'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'MapURL', 'TranscriptURL', 'URL', -- URL-holding parameters
}
local url_meta_params = { -- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value
'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'ID', 'MapURL', 'TranscriptURL', 'URL', -- parameters allowed to hold urls
'Page', 'Pages', 'At', 'QuotePage', 'QuotePages', -- insource locators allowed to hold urls
}
local function build_skip_table (skip_t, meta_params)
for _, meta_param in ipairs (meta_params) do -- for each meta parameter key
local params = aliases[meta_param]; -- get the parameter or the table of parameters associated with the meta parameter name
if 'string' == type (params) then
skip_t[params] = 1; -- just a single parameter
else
for _, param in ipairs (params) do -- get the parameter name
skip_t[param] = 1; -- add the parameter name to the skip table
local count;
param, count = param:gsub ('#', ''); -- remove enumerator marker from enumerated parameters
if 0 ~= count then -- if removed
skip_t[param] = 1; -- add param name without enumerator marker
end
end
end
end
return skip_t;
end
local punct_skip = {};
local url_skip = {};
--[[--------------------------< S I N G L E - L E T T E R S E C O N D - L E V E L D O M A I N S >----------
this is a list of tlds that are known to have single-letter second-level domain names. This list does not include
ccTLDs which are accepted in is_domain_name().
]]
local single_letter_2nd_lvl_domains_t = {'cash', 'company', 'foundation', 'org', 'today'};
--[[-----------< S P E C I A L C A S E T R A N S L A T I O N S >------------
This table is primarily here to support internationalization. Translations in
this table are used, for example, when an error message, category name, etc.,
is extracted from the English alias key. There may be other cases where
this translation table may be useful.
]]
local is_Latn = 'A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143';
local special_case_translation = {
['AuthorList'] = 'authors list', -- used to assemble maintenance category names
['ContributorList'] = 'contributors list', -- translation of these names plus translation of the base maintenance category names in maint_cats{} table below
['EditorList'] = 'editors list', -- must match the names of the actual categories
['InterviewerList'] = 'interviewers list', -- this group or translations used by name_has_ed_markup() and name_has_mult_names()
['TranslatorList'] = 'translators list',
-- Lua patterns to match pseudo-titles used by InternetArchiveBot and others as placeholder for unknown |title= value
['archived_copy'] = { -- used with CS1 maint: Archive[d] copy as title
['en'] = '^archived?%s+copy$', -- for English; translators: keep this because templates imported from en.wiki
['local'] = nil, -- translators: replace ['local'] = nil with lowercase translation only when bots or tools create generic titles in your language
},
-- Lua patterns to match generic titles; usually created by bots or reference filling tools
-- translators: replace ['local'] = nil with lowercase translation only when bots or tools create generic titles in your language
-- generic titles and patterns in this table should be lowercase only
-- leave ['local'] nil except when there is a matching generic title in your language
-- boolean 'true' for plain-text searches; 'false' for pattern searches
['generic_titles'] = {
['accept'] = {
},
['reject'] = {
{['en'] = {'^wayback%s+machine$', false}, ['local'] = nil},
{['en'] = {'are you a robot', true}, ['local'] = nil},
{['en'] = {'hugedomains.com', true}, ['local'] = nil},
{['en'] = {'^[%(%[{<]?no +title[>}%]%)]?$', false}, ['local'] = nil},
{['en'] = {'page not found', true}, ['local'] = nil},
{['en'] = {'subscribe to read', true}, ['local'] = nil},
{['en'] = {'^[%(%[{<]?unknown[>}%]%)]?$', false}, ['local'] = nil},
{['en'] = {'website is for sale', true}, ['local'] = nil},
{['en'] = {'^404', false}, ['local'] = nil},
{['en'] = {'internet archive wayback machine', true}, ['local'] = nil},
{['en'] = {'log into facebook', true}, ['local'] = nil},
{['en'] = {'login • instagram', true}, ['local'] = nil},
{['en'] = {'redirecting...', true}, ['local'] = nil},
{['en'] = {'usurped title', true}, ['local'] = nil}, -- added by a GreenC bot
{['en'] = {'webcite query result', true}, ['local'] = nil},
{['en'] = {'wikiwix\'s cache', true}, ['local'] = nil},
}
},
-- boolean 'true' for plain-text searches, search string must be lowercase only
-- boolean 'false' for pattern searches
-- leave ['local'] nil except when there is a matching generic name in your language
['generic_names'] = {
['accept'] = {
{['en'] = {'%[%[[^|]*%(author%) *|[^%]]*%]%]', false}, ['local'] = nil},
},
['reject'] = {
{['en'] = {'about us', true}, ['local'] = nil},
{['en'] = {'%f[%a][Aa]dvisor%f[%A]', false}, ['local'] = nil},
{['en'] = {'allmusic', true}, ['local'] = nil},
{['en'] = {'%f[%a][Aa]uthor%f[%A]', false}, ['local'] = nil},
{['en'] = {'business', true}, ['local'] = nil},
{['en'] = {'cnn', true}, ['local'] = nil},
{['en'] = {'collaborator', true}, ['local'] = nil},
{['en'] = {'contributor', true}, ['local'] = nil},
{['en'] = {'contact us', true}, ['local'] = nil},
{['en'] = {'directory', true}, ['local'] = nil},
{['en'] = {'%f[%(%[][%(%[]%s*eds?%.?%s*[%)%]]?$', false}, ['local'] = nil},
{['en'] = {'[,%.%s]%f[e]eds?%.?$', false}, ['local'] = nil},
{['en'] = {'^eds?[%.,;]', false}, ['local'] = nil},
{['en'] = {'^[%(%[]%s*[Ee][Dd][Ss]?%.?%s*[%)%]]', false}, ['local'] = nil},
{['en'] = {'%f[%a][Ee]dited%f[%A]', false}, ['local'] = nil},
{['en'] = {'%f[%a][Ee]ditors?%f[%A]', false}, ['local'] = nil},
{['en'] = {'%f[%a]]Ee]mail%f[%A]', false}, ['local'] = nil},
{['en'] = {'facebook', true}, ['local'] = nil},
{['en'] = {'google', true}, ['local'] = nil},
{['en'] = {'home page', true}, ['local'] = nil},
{['en'] = {'^[Ii]nc%.?$', false}, ['local'] = nil},
{['en'] = {'instagram', true}, ['local'] = nil},
{['en'] = {'interviewer', true}, ['local'] = nil},
{['en'] = {'linkedIn', true}, ['local'] = nil},
{['en'] = {'^[Nn]ews$', false}, ['local'] = nil},
{['en'] = {'pinterest', true}, ['local'] = nil},
{['en'] = {'policy', true}, ['local'] = nil},
{['en'] = {'privacy', true}, ['local'] = nil},
{['en'] = {'reuters', true}, ['local'] = nil},
{['en'] = {'translator', true}, ['local'] = nil},
{['en'] = {'tumblr', true}, ['local'] = nil},
{['en'] = {'twitter', true}, ['local'] = nil},
{['en'] = {'site name', true}, ['local'] = nil},
{['en'] = {'statement', true}, ['local'] = nil},
{['en'] = {'submitted', true}, ['local'] = nil},
{['en'] = {'super.?user', false}, ['local'] = nil},
{['en'] = {'%f['..is_Latn..'][Uu]ser%f[^'..is_Latn..']', false}, ['local'] = nil},
{['en'] = {'verfasser', true}, ['local'] = nil},
}
}
}
--[[--------------------------< D A T E _ N A M E S >----------------------------------------------------------
This table of tables lists local language date names and fallback English date names.
The code in Date_validation will look first in the local table for valid date names.
If date names are not found in the local table, the code will look in the English table.
Because citations can be copied to the local wiki from en.wiki, the English is
required when the date-name translation function date_name_xlate() is used.
In these tables, season numbering is defined by
Extended Date/Time Format (EDTF) Specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard
defines various divisions using numbers 21-41. CS1|2 only supports generic seasons.
EDTF does support the distinction between north and south hemisphere seasons
but CS1|2 has no way to make that distinction.
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
The standard does not address 'named' dates so, for the purposes of CS1|2,
Easter and Christmas are defined here as 98 and 99, which should be out of the
ISO 8601 (EDTF) range of uses for a while.
local_date_names_from_mediawiki is a boolean. When set to:
true – module will fetch local month names from MediaWiki for both date_names['local']['long'] and date_names['local']['short']
false – module will *not* fetch local month names from MediaWiki
Caveat lector: There is no guarantee that MediaWiki will provide short month names. At your wiki you can test
the results of the MediaWiki fetch in the debug console with this command (the result is alpha sorted):
=mw.dumpObject (p.date_names['local'])
While the module can fetch month names from MediaWiki, it cannot fetch the quarter, season, and named date names
from MediaWiki. Those must be translated manually.
]]
local local_date_names_from_mediawiki = true; -- when false, manual translation required for date_names['local']['long'] and date_names['local']['short']
-- when true, module fetches long and short month names from MediaWiki
local date_names = {
['en'] = { -- English
['long'] = {['January'] = 1, ['February'] = 2, ['March'] = 3, ['April'] = 4, ['May'] = 5, ['June'] = 6, ['July'] = 7, ['August'] = 8, ['September'] = 9, ['October'] = 10, ['November'] = 11, ['December'] = 12},
['short'] = {['Jan'] = 1, ['Feb'] = 2, ['Mar'] = 3, ['Apr'] = 4, ['May'] = 5, ['Jun'] = 6, ['Jul'] = 7, ['Aug'] = 8, ['Sep'] = 9, ['Oct'] = 10, ['Nov'] = 11, ['Dec'] = 12},
['quarter'] = {['First Quarter'] = 33, ['Second Quarter'] = 34, ['Third Quarter'] = 35, ['Fourth Quarter'] = 36},
['season'] = {['Winter'] = 24, ['Spring'] = 21, ['Summer'] = 22, ['Fall'] = 23, ['Autumn'] = 23},
['named'] = {['Easter'] = 98, ['Christmas'] = 99},
},
-- when local_date_names_from_mediawiki = false
['local'] = { -- replace these English date names with the local language equivalents
['long'] = {['January'] = 1, ['February'] = 2, ['March'] = 3, ['April'] = 4, ['May'] = 5, ['June'] = 6, ['July'] = 7, ['August'] = 8, ['September'] = 9, ['October'] = 10, ['November'] = 11, ['December'] = 12},
['short'] = {['Jan'] = 1, ['Feb'] = 2, ['Mar'] = 3, ['Apr'] = 4, ['May'] = 5, ['Jun'] = 6, ['Jul'] = 7, ['Aug'] = 8, ['Sep'] = 9, ['Oct'] = 10, ['Nov'] = 11, ['Dec'] = 12},
['quarter'] = {['First Quarter'] = 33, ['Second Quarter'] = 34, ['Third Quarter'] = 35, ['Fourth Quarter'] = 36},
['season'] = {['Winter'] = 24, ['Spring'] = 21, ['Summer'] = 22, ['Fall'] = 23, ['Autumn'] = 23},
['named'] = {['Easter'] = 98, ['Christmas'] = 99},
},
['inv_local_long'] = {}, -- used in date reformatting & translation; copy of date_names['local'].long where k/v are inverted: [1]='<local name>' etc.
['inv_local_short'] = {}, -- used in date reformatting & translation; copy of date_names['local'].short where k/v are inverted: [1]='<local name>' etc.
['inv_local_quarter'] = {}, -- used in date translation; copy of date_names['local'].quarter where k/v are inverted: [1]='<local name>' etc.
['inv_local_season'] = {}, -- used in date translation; copy of date_names['local'].season where k/v are inverted: [1]='<local name>' etc.
['inv_local_named'] = {}, -- used in date translation; copy of date_names['local'].named where k/v are inverted: [1]='<local name>' etc.
['local_digits'] = {['0'] = '0', ['1'] = '1', ['2'] = '2', ['3'] = '3', ['4'] = '4', ['5'] = '5', ['6'] = '6', ['7'] = '7', ['8'] = '8', ['9'] = '9'}, -- used to convert local language digits to Western 0-9
['xlate_digits'] = {},
}
if local_date_names_from_mediawiki then -- if fetching local month names from MediaWiki is enabled
local long_t = {};
local short_t = {};
for i=1, 12 do -- loop 12x and
local name = lang_obj:formatDate('F', '2022-' .. i .. '-1'); -- get long month name for each i
long_t[name] = i; -- save it
name = lang_obj:formatDate('M', '2022-' .. i .. '-1'); -- get short month name for each i
short_t[name] = i; -- save it
end
date_names['local']['long'] = long_t; -- write the long table – overwrites manual translation
date_names['local']['short'] = short_t; -- write the short table – overwrites manual translation
end
-- create inverted date-name tables for reformatting and/or translation
for _, invert_t in pairs {{'long', 'inv_local_long'}, {'short', 'inv_local_short'}, {'quarter', 'inv_local_quarter'}, {'season', 'inv_local_season'}, {'named', 'inv_local_named'}} do
for name, i in pairs (date_names['local'][invert_t[1]]) do -- this table is ['name'] = i
date_names[invert_t[2]][i] = name; -- invert to get [i] = 'name' for conversions from ymd
end
end
if local_digits_from_mediawiki then -- if fetching local digits from MediaWiki is enabled
local digits_t = {};
for i=0, 9 do -- loop 10x and
digits_t [lang_obj:formatNum (i)] = tostring (i); -- format the loop indexer as local lang table index and assign loop indexer (a string) as the value
end
date_names['local_digits'] = digits_t;
end
for ld, ed in pairs (date_names.local_digits) do -- make a digit translation table for simple date translation from en to local language using local_digits table
date_names.xlate_digits [ed] = ld; -- en digit becomes index with local digit as the value
end
local df_template_patterns = { -- table of redirects to {{Use dmy dates}} and {{Use mdy dates}}
'{{ *[Uu]se +(dmy) +dates *[|}]', -- 1159k -- sorted by approximate transclusion count
'{{ *[Uu]se +(mdy) +dates *[|}]', -- 212k
'{{ *[Uu]se +(MDY) +dates *[|}]', -- 788
'{{ *[Uu]se +(DMY) +dates *[|}]', -- 343
'{{ *([Mm]dy) *[|}]', -- 176
'{{ *[Uu]se *(dmy) *[|}]', -- 156 + 18
'{{ *[Uu]se *(mdy) *[|}]', -- 149 + 11
'{{ *([Dd]my) *[|}]', -- 56
'{{ *[Uu]se +(MDY) *[|}]', -- 5
'{{ *([Dd]MY) *[|}]', -- 3
'{{ *[Uu]se(mdy)dates *[|}]', -- 1
'{{ *[Uu]se +(DMY) *[|}]', -- 0
'{{ *([Mm]DY) *[|}]', -- 0
}
local title_object = mw.title.getCurrentTitle();
local content; -- done this way so that unused templates appear in unused-template-reports; self-transcluded makes them look like they are used
if 10 ~= title_object.namespace then -- all namespaces except Template
content = title_object:getContent() or ''; -- get the content of the article or ''; new pages edited w/ve do not have 'content' until saved; ve does not preview; phab:T221625
end
local function get_date_format ()
-- if title_object.namespace == 10 then -- not in template space so that unused templates appear in unused-template-reports;
if not content then -- nil content when we're in template
return nil; -- auto-formatting does not work in Template space so don't set global_df
end
for _, pattern in ipairs (df_template_patterns) do -- loop through the patterns looking for {{Use dmy dates}} or {{Use mdy dates}} or any of their redirects
local start, _, match = content:find(pattern); -- match is the three letters indicating desired date format
if match then
local use_dates_template = content:match ('%b{}', start); -- get the whole template
if use_dates_template:match ('| *cs1%-dates *= *[lsy][sy]?') then -- look for |cs1-dates=publication date length access-/archive-date length
return match:lower() .. '-' .. use_dates_template:match ('| *cs1%-dates *= *([lsy][sy]?)');
else
return match:lower() .. '-all'; -- no |cs1-dates= k/v pair; return value appropriate for use in |df=
end
end
end
end
local global_df; -- TODO: add this to <global_cs1_config_t>?
--[[-----------------< V O L U M E , I S S U E , P A G E S >------------------
These tables hold cite class values (from the template invocation) and identify those templates that support
|volume=, |issue=, and |page(s)= parameters. Cite conference and cite map require further qualification which
is handled in the main module.
]]
local templates_using_volume = {'citation', 'audio-visual', 'book', 'conference', 'encyclopaedia', 'interview', 'journal', 'magazine', 'map', 'news', 'report', 'techreport', 'thesis'}
local templates_using_issue = {'citation', 'conference', 'episode', 'interview', 'journal', 'magazine', 'map', 'news', 'podcast'}
local templates_not_using_page = {'audio-visual', 'episode', 'mailinglist', 'newsgroup', 'podcast', 'serial', 'sign', 'speech'}
--[[
These tables control when it is appropriate for {{citation}} to render |volume= and/or |issue=. The parameter
names in the tables constrain {{citation}} so that its renderings match the renderings of the equivalent cs1
templates. For example, {{cite web}} does not support |volume= so the equivalent {{citation |website=...}} must
not support |volume=.
]]
local citation_no_volume_t = { -- {{citation}} does not render |volume= when these parameters are used
'website', 'mailinglist', 'script-website',
}
local citation_issue_t = { -- {{citation}} may render |issue= when these parameters are used
'journal', 'magazine', 'newspaper', 'periodical', 'work',
'script-journal', 'script-magazine', 'script-newspaper', 'script-periodical', 'script-work',
}
--[[
Patterns for finding extra text in |volume=, |issue=, |page=, |pages=
]]
local vol_iss_pg_patterns = {
good_ppattern = '^P[^%.PpGg]', -- OK to begin with uppercase P: P7 (page 7 of section P), but not p123 (page 123); TODO: this allows 'Pages' which it should not
bad_ppatterns = { -- patterns for |page= and |pages=
'^[Pp][PpGg]?%.?[ %d]',
'^[Pp][Pp]?%. ', -- from {{p.}} and {{pp.}} templates
'^[Pp]ages?',
'^[Pp]gs.?',
},
vpatterns = { -- patterns for |volume=
'^volumes?',
'^vols?[%.:=]?'
},
ipatterns = { -- patterns for |issue=
'^issues?',
'^iss[%.:=]?',
'^numbers?',
'^nos?%A', -- don't match 'november' or 'nostradamus'
'^nr[%.:=]?',
'^n[%.:= ]' -- might be a valid issue without separator (space char is sep char here)
}
}
--[[--------------------------< K E Y W O R D S >-------------------------------
These tables hold keywords for those parameters that have defined sets of acceptable keywords.
]]
--[[-------------------< K E Y W O R D S T A B L E >--------------------------
this is a list of keywords; each key in the list is associated with a table of
synonymous keywords possibly from different languages.
for I18N: add local-language keywords to value table; do not change the key.
For example, adding the German keyword 'ja':
['affirmative'] = {'yes', 'true', 'y', 'ja'},
Because CS1|2 templates from en.wiki articles are often copied to other local wikis,
it is recommended that the English keywords remain in these tables.
]]
local keywords = {
['amp'] = {'&', 'amp', 'ampersand'}, -- |name-list-style=
['and'] = {'and', 'serial'}, -- |name-list-style=
['affirmative'] = {'yes', 'true', 'y'}, -- |no-tracking=, |no-pp= -- Used by InternetArchiveBot
['afterword'] = {'afterword'}, -- |contribution=
['bot: unknown'] = {'bot: unknown'}, -- |url-status= -- Used by InternetArchiveBot
['cs1'] = {'cs1'}, -- |mode=
['cs2'] = {'cs2'}, -- |mode=
['dead'] = {'dead', 'deviated'}, -- |url-status= -- Used by InternetArchiveBot
['dmy'] = {'dmy'}, -- |df=
['dmy-all'] = {'dmy-all'}, -- |df=
['foreword'] = {'foreword'}, -- |contribution=
['free'] = {'free'}, -- |<id>-access= -- Used by InternetArchiveBot
['harv'] = {'harv'}, -- |ref=; this no longer supported; is_valid_parameter_value() called with <invert> = true
['introduction'] = {'introduction'}, -- |contribution=
['limited'] = {'limited'}, -- |url-access= -- Used by InternetArchiveBot
['live'] = {'live'}, -- |url-status= -- Used by InternetArchiveBot
['mdy'] = {'mdy'}, -- |df=
['mdy-all'] = {'mdy-all'}, -- |df=
['none'] = {'none'}, -- |postscript=, |ref=, |title=, |type= -- Used by InternetArchiveBot
['off'] = {'off'}, -- |title= (potentially also: |title-link=, |postscript=, |ref=, |type=)
['preface'] = {'preface'}, -- |contribution=
['registration'] = {'registration'}, -- |url-access= -- Used by InternetArchiveBot
['subscription'] = {'subscription'}, -- |url-access= -- Used by InternetArchiveBot
['unfit'] = {'unfit'}, -- |url-status= -- Used by InternetArchiveBot
['usurped'] = {'usurped'}, -- |url-status= -- Used by InternetArchiveBot
['vanc'] = {'vanc'}, -- |name-list-style=
['ymd'] = {'ymd'}, -- |df=
['ymd-all'] = {'ymd-all'}, -- |df=
-- ['yMd'] = {'yMd'}, -- |df=; not supported at en.wiki
-- ['yMd-all'] = {'yMd-all'}, -- |df=; not supported at en.wiki
}
--[[------------------------< X L A T E _ K E Y W O R D S >---------------------
this function builds a list, keywords_xlate{}, of the keywords found in keywords{} where the values from keywords{}
become the keys in keywords_xlate{} and the keys from keywords{} become the values in keywords_xlate{}:
['affirmative'] = {'yes', 'true', 'y'}, -- in keywords{}
becomes
['yes'] = 'affirmative', -- in keywords_xlate{}
['true'] = 'affirmative',
['y'] = 'affirmative',
the purpose of this function is to act as a translator between a non-English keyword and its English equivalent
that may be used in other modules of this suite
]]
local function xlate_keywords ()
local out_table = {}; -- output goes here
for k, keywords_t in pairs (keywords) do -- spin through the keywords table
for _, keyword in ipairs (keywords_t) do -- for each keyword
out_table[keyword] = k; -- create an entry in the output table where keyword is the key
end
end
return out_table;
end
local keywords_xlate = xlate_keywords (); -- the list of translated keywords
--[[----------------< M A K E _ K E Y W O R D S _ L I S T >---------------------
this function assembles, for parameter-value validation, the list of keywords appropriate to that parameter.
keywords_lists{}, is a table of tables from keywords{}
]]
local function make_keywords_list (keywords_lists)
local out_table = {}; -- output goes here
for _, keyword_list in ipairs (keywords_lists) do -- spin through keywords_lists{} and get a table of keywords
for _, keyword in ipairs (keyword_list) do -- spin through keyword_list{} and add each keyword, ...
table.insert (out_table, keyword); -- ... as plain text, to the output list
end
end
return out_table;
end
--[[----------------< K E Y W O R D S _ L I S T S >-----------------------------
this is a list of lists of valid keywords for the various parameters in [key].
Generally the keys in this table are the canonical en.wiki parameter names though
some are contrived because of use in multiple differently named parameters:
['yes_true_y'], ['id-access'].
The function make_keywords_list() extracts the individual keywords from the
appropriate list in keywords{}.
The lists in this table are used to validate the keyword assignment for the
parameters named in this table's keys.
]]
local keywords_lists = {
['yes_true_y'] = make_keywords_list ({keywords.affirmative}),
['contribution'] = make_keywords_list ({keywords.afterword, keywords.foreword, keywords.introduction, keywords.preface}),
['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all']}),
-- ['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all'], keywords.yMd, keywords['yMd-all']}), -- not supported at en.wiki
['mode'] = make_keywords_list ({keywords.cs1, keywords.cs2}),
['name-list-style'] = make_keywords_list ({keywords.amp, keywords['and'], keywords.vanc}),
['ref'] = make_keywords_list ({keywords.harv}), -- inverted check; |ref=harv no longer supported
['url-access'] = make_keywords_list ({keywords.subscription, keywords.limited, keywords.registration}),
['url-status'] = make_keywords_list ({keywords.dead, keywords.live, keywords.unfit, keywords.usurped, keywords['bot: unknown']}),
['id-access'] = make_keywords_list ({keywords.free}),
}
--[[--------------------------< C S 1 _ C O N F I G _ G E T >--------------------------------------------------
fetch and validate values from {{cs1 config}} template to fill <global_cs1_config_t>
no error messages; when errors are detected, the parameter value from {{cs1 config}} is blanked.
Supports all parameters and aliases associated with the metaparameters: DisplayAuthors, DisplayContributors,
DisplayEditors, DisplayInterviewers, DisplayTranslators, NameListStyle, and Mode. The DisplayWhatever metaparameters
accept numeric values only (|display-authors=etal and the like is not supported).
]]
local global_cs1_config_t = {}; -- TODO: add value returned from get_date_format() to this table?
local function get_cs1_config ()
-- if title_object.namespace == 10 then -- not in template space so that unused templates appear in unused-template-reports;
if not content then -- nil content when we're in template
return nil; -- auto-formatting does not work in Template space so don't set global_df
end
local start = content:find('{{ *[Cc][Ss]1 config *[|}]'); -- <start> is offset into <content> when {{cs1 config}} found; nil else
if start then
local cs1_config_template = content:match ('%b{}', start); -- get the whole template
if not cs1_config_template then
return nil;
end
local params_t = mw.text.split (cs1_config_template:gsub ('^{{%s*', ''):gsub ('%s*}}$', ''), '%s*|%s*'); -- remove '{{' and '}}'; make a sequence of parameter/value pairs (split on the pipe)
table.remove (params_t, 1); -- remove the template name because it isn't a parameter/value pair
local config_meta_params_t = {'DisplayAuthors', 'DisplayContributors', 'DisplayEditors', 'DisplayInterviewers', 'DisplayTranslators', 'NameListStyle', 'Mode'};
local meta_param_map_t = {}; -- list of accepted parameter names usable in {{cs1 config}} goes here
for _, meta_param in ipairs (config_meta_params_t) do -- for i18n using <config_meta_params_t>, map template parameter names to their metaparameter equivalents
if 'table' == type (aliases[meta_param]) then -- if <meta_param> is a sequence,
for _, param in ipairs (aliases[meta_param]) do -- extract its contents
meta_param_map_t[param] = meta_param; -- and add to <meta_param_map_t>
end
else
meta_param_map_t[aliases[meta_param]] = meta_param; -- not a sequence so just add the parameter to <meta_param_map_t>
end
end
local keywords_t = {}; -- map valid keywords to their associate metaparameter; reverse form of <keyword_lists[key] for these metaparameters
for _, metaparam_t in ipairs ({{'NameListStyle', 'name-list-style'}, {'Mode', 'mode'}}) do -- only these metaparameter / keywords_lists key pairs
for _, keyword in ipairs (keywords_lists[metaparam_t[2]]) do -- spin through the list of keywords
keywords_t[keyword] = metaparam_t[1]; -- add [keyword] = metaparameter to the map
end
end
for _, param in ipairs (params_t) do -- spin through the {{cs1 config}} parameters and fill <global_cs1_config_t>
local k, v = param:match ('([^=]-)%s*=%s*(.+)'); -- <k> is the parameter name; <v> is parameter's assigned value
if k then
if k:find ('^display') then -- if <k> is one of the |display-<namelist>= parameters
if v:match ('%d+') then -- the assigned value must be digits; doesn't accept 'etal'
global_cs1_config_t[meta_param_map_t[k]]=v; -- add the display param and its value to globals table
end
else
if keywords_t[v] == meta_param_map_t[k] then -- keywords_t[v] returns nil or the metaparam name; these must be the same
global_cs1_config_t[meta_param_map_t[k]]=v; -- add the parameter and its value to globals table
end
end
end
end
end
end
get_cs1_config (); -- fill <global_cs1_config_t>
--[[---------------------< S T R I P M A R K E R S >----------------------------
Common pattern definition location for stripmarkers so that we don't have to go
hunting for them if (when) MediaWiki changes their form.
]]
local stripmarkers = {
['any'] = '\127[^\127]*UNIQ%-%-(%a+)%-[%a%d]+%-QINU[^\127]*\127', -- capture returns name of stripmarker
['math'] = '\127[^\127]*UNIQ%-%-math%-[%a%d]+%-QINU[^\127]*\127' -- math stripmarkers used in coins_cleanup() and coins_replace_math_stripmarker()
}
--[[------------< I N V I S I B L E _ C H A R A C T E R S >---------------------
This table holds non-printing or invisible characters indexed either by name or
by Unicode group. Values are decimal representations of UTF-8 codes. The table
is organized as a table of tables because the Lua pairs keyword returns table
data in an arbitrary order. Here, we want to process the table from top to bottom
because the entries at the top of the table are also found in the ranges specified
by the entries at the bottom of the table.
Also here is a pattern that recognizes stripmarkers that begin and end with the
delete characters. The nowiki stripmarker is not an error but some others are
because the parameter values that include them become part of the template's
metadata before stripmarker replacement.
]]
local invisible_defs = {
del = '\127', -- used to distinguish between stripmarker and del char
zwj = '\226\128\141', -- used with capture because zwj may be allowed
}
local invisible_chars = {
{'replacement', '\239\191\189'}, -- U+FFFD, EF BF BD
{'zero width joiner', '('.. invisible_defs.zwj .. ')'}, -- U+200D, E2 80 8D; capture because zwj may be allowed
{'zero width space', '\226\128\139'}, -- U+200B, E2 80 8B
{'hair space', '\226\128\138'}, -- U+200A, E2 80 8A
{'soft hyphen', '\194\173'}, -- U+00AD, C2 AD
{'horizontal tab', '\009'}, -- U+0009 (HT), 09
{'line feed', '\010'}, -- U+000A (LF), 0A
{'no-break space', '\194\160'}, -- U+00A0 (NBSP), C2 A0
{'carriage return', '\013'}, -- U+000D (CR), 0D
{'stripmarker', stripmarkers.any}, -- stripmarker; may or may not be an error; capture returns the stripmaker type
{'delete', '('.. invisible_defs.del .. ')'}, -- U+007F (DEL), 7F; must be done after stripmarker test; capture to distinguish isolated del chars not part of stripmarker
{'C0 control', '[\000-\008\011\012\014-\031]'}, -- U+0000–U+001F (NULL–US), 00–1F (except HT, LF, CR (09, 0A, 0D))
{'C1 control', '[\194\128-\194\159]'}, -- U+0080–U+009F (XXX–APC), C2 80 – C2 9F
-- {'Specials', '[\239\191\185-\239\191\191]'}, -- U+FFF9-U+FFFF, EF BF B9 – EF BF BF
-- {'Private use area', '[\238\128\128-\239\163\191]'}, -- U+E000–U+F8FF, EE 80 80 – EF A3 BF
-- {'Supplementary Private Use Area-A', '[\243\176\128\128-\243\191\191\189]'}, -- U+F0000–U+FFFFD, F3 B0 80 80 – F3 BF BF BD
-- {'Supplementary Private Use Area-B', '[\244\128\128\128-\244\143\191\189]'}, -- U+100000–U+10FFFD, F4 80 80 80 – F4 8F BF BD
}
--[[
Indic script makes use of zero width joiner as a character modifier so zwj
characters must be left in. This pattern covers all of the unicode characters
for these languages:
Devanagari 0900–097F – https://unicode.org/charts/PDF/U0900.pdf
Devanagari extended A8E0–A8FF – https://unicode.org/charts/PDF/UA8E0.pdf
Bengali 0980–09FF – https://unicode.org/charts/PDF/U0980.pdf
Gurmukhi 0A00–0A7F – https://unicode.org/charts/PDF/U0A00.pdf
Gujarati 0A80–0AFF – https://unicode.org/charts/PDF/U0A80.pdf
Oriya 0B00–0B7F – https://unicode.org/charts/PDF/U0B00.pdf
Tamil 0B80–0BFF – https://unicode.org/charts/PDF/U0B80.pdf
Telugu 0C00–0C7F – https://unicode.org/charts/PDF/U0C00.pdf
Kannada 0C80–0CFF – https://unicode.org/charts/PDF/U0C80.pdf
Malayalam 0D00–0D7F – https://unicode.org/charts/PDF/U0D00.pdf
plus the not-necessarily Indic scripts for Sinhala and Burmese:
Sinhala 0D80-0DFF - https://unicode.org/charts/PDF/U0D80.pdf
Myanmar 1000-109F - https://unicode.org/charts/PDF/U1000.pdf
Myanmar extended A AA60-AA7F - https://unicode.org/charts/PDF/UAA60.pdf
Myanmar extended B A9E0-A9FF - https://unicode.org/charts/PDF/UA9E0.pdf
the pattern is used by has_invisible_chars() and coins_cleanup()
]]
local indic_script = '[\224\164\128-\224\181\191\224\163\160-\224\183\191\225\128\128-\225\130\159\234\167\160-\234\167\191\234\169\160-\234\169\191]';
-- list of emoji that use a zwj character (U+200D) to combine with another emoji
-- from: https://unicode.org/Public/emoji/15.0/emoji-zwj-sequences.txt; version: 15.0; 2022-05-06
-- table created by: [[:en:Module:Make emoji zwj table]]
local emoji_t = { -- indexes are decimal forms of the hex values in U+xxxx
[9760] = true, -- U+2620 ☠ skull and crossbones
[9792] = true, -- U+2640 ♀ female sign
[9794] = true, -- U+2642 ♂ male sign
[9877] = true, -- U+2695 ⚕ staff of aesculapius
[9878] = true, -- U+2696 ⚖ scales
[9895] = true, -- U+26A7 ⚧ male with stroke and male and female sign
[9992] = true, -- U+2708 ✈ airplane
[10052] = true, -- U+2744 ❄ snowflake
[10084] = true, -- U+2764 ❤ heavy black heart
[11035] = true, -- U+2B1B ⬛ black large square
[127752] = true, -- U+1F308 🌈 rainbow
[127787] = true, -- U+1F32B 🌫 fog
[127806] = true, -- U+1F33E 🌾 ear of rice
[127859] = true, -- U+1F373 🍳 cooking
[127868] = true, -- U+1F37C 🍼 baby bottle
[127876] = true, -- U+1F384 🎄 christmas tree
[127891] = true, -- U+1F393 🎓 graduation cap
[127908] = true, -- U+1F3A4 🎤 microphone
[127912] = true, -- U+1F3A8 🎨 artist palette
[127979] = true, -- U+1F3EB 🏫 school
[127981] = true, -- U+1F3ED 🏭 factory
[128102] = true, -- U+1F466 👦 boy
[128103] = true, -- U+1F467 👧 girl
[128104] = true, -- U+1F468 👨 man
[128105] = true, -- U+1F469 👩 woman
[128139] = true, -- U+1F48B 💋 kiss mark
[128168] = true, -- U+1F4A8 💨 dash symbol
[128171] = true, -- U+1F4AB 💫 dizzy symbol
[128187] = true, -- U+1F4BB 💻 personal computer
[128188] = true, -- U+1F4BC 💼 brief case
[128293] = true, -- U+1F525 🔥 fire
[128295] = true, -- U+1F527 🔧 wrench
[128300] = true, -- U+1F52C 🔬 microscope
[128488] = true, -- U+1F5E8 🗨 left speech bubble
[128640] = true, -- U+1F680 🚀 rocket
[128658] = true, -- U+1F692 🚒 fire engine
[129309] = true, -- U+1F91D 🤝 handshake
[129455] = true, -- U+1F9AF 🦯 probing cane
[129456] = true, -- U+1F9B0 🦰 emoji component red hair
[129457] = true, -- U+1F9B1 🦱 emoji component curly hair
[129458] = true, -- U+1F9B2 🦲 emoji component bald
[129459] = true, -- U+1F9B3 🦳 emoji component white hair
[129466] = true, -- U+1F9BA 🦺 safety vest
[129468] = true, -- U+1F9BC 🦼 motorized wheelchair
[129469] = true, -- U+1F9BD 🦽 manual wheelchair
[129489] = true, -- U+1F9D1 🧑 adult
[129657] = true, -- U+1FA79 🩹 adhesive bandage
[129778] = true, -- U+1FAF2 🫲 leftwards hand
}
--[[----------------------< L A N G U A G E S U P P O R T >-------------------
These tables and constants support various language-specific functionality.
]]
--local this_wiki_code = mw.getContentLanguage():getCode(); -- get this wiki's language code
local this_wiki_code = lang_obj:getCode(); -- get this wiki's language code
if string.match (mw.site.server, 'wikidata') then
this_wiki_code = mw.getCurrentFrame():callParserFunction('int', {'lang'}); -- on Wikidata so use interface language setting instead
end
local mw_languages_by_tag_t = mw.language.fetchLanguageNames (this_wiki_code, 'all'); -- get a table of language tag/name pairs known to Wikimedia; used for interwiki tests
local mw_languages_by_name_t = {};
for k, v in pairs (mw_languages_by_tag_t) do -- build a 'reversed' table name/tag language pairs know to MediaWiki; used for |language=
v = mw.ustring.lower (v); -- lowercase for tag fetch; get name's proper case from mw_languages_by_tag_t[<tag>]
if mw_languages_by_name_t[v] then -- when name already in the table
if 2 == #k or 3 == #k then -- if tag does not have subtags
mw_languages_by_name_t[v] = k; -- prefer the shortest tag for this name
end
else -- here when name not in the table
mw_languages_by_name_t[v] = k; -- so add name and matching tag
end
end
local inter_wiki_map = {}; -- map of interwiki prefixes that are language-code prefixes
for k, v in pairs (mw.site.interwikiMap ('local')) do -- spin through the base interwiki map (limited to local)
if mw_languages_by_tag_t[v["prefix"]] then -- if the prefix matches a known language tag
inter_wiki_map[v["prefix"]] = true; -- add it to our local map
end
end
--[[--------------------< S C R I P T _ L A N G _ C O D E S >-------------------
This table is used to hold ISO 639-1 two-character and ISO 639-3 three-character
language codes that apply only to |script-title= and |script-chapter=
]]
local script_lang_codes = {
'ab', 'am', 'ar', 'be', 'bg', 'bn', 'bo', 'bs', 'dv', 'dz', 'el', 'fa', 'gu', 'he',
'hi', 'hy', 'ja', 'ka', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'lo', 'mk', 'ml', 'mn',
'mni', 'mr', 'my', 'ne', 'or', 'ota', 'pa', 'ps', 'ru', 'sd', 'si', 'sr', 'syc', 'ta',
'te', 'tg', 'th', 'ti', 'tt', 'ug', 'uk', 'ur', 'uz', 'yi', 'yue', 'zh'
};
--[[---------------< L A N G U A G E R E M A P P I N G >----------------------
These tables hold language information that is different (correct) from MediaWiki's definitions
For each ['<tag>'] = 'language name' in lang_code_remap{} there must be a matching ['language name'] = {'language name', '<tag>'} in lang_name_remap{}
lang_tag_remap{}:
key is always lowercase ISO 639-1, -2, -3 language tag or a valid lowercase IETF language tag
value is properly spelled and capitalized language name associated with <tag>
only one language name per <tag>;
key/value pair must have matching entry in lang_name_remap{}
lang_name_remap{}:
key is always lowercase language name
value is a table the holds correctly spelled and capitalized language name [1] and associated tag [2] (tag must match a tag key in lang_tag_remap{})
may have multiple keys referring to a common preferred name and tag; For example:
['kolsch'] and ['kölsch'] both refer to 'Kölsch' and 'ksh'
]]
local lang_tag_remap = { -- used for |language= and |script-title= / |script-chapter=
['als'] = 'Tosk Albanian', -- MediaWiki returns Alemannisch
['bh'] = 'Bihari', -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org
['bla'] = 'Blackfoot', -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['bn'] = 'Bengali', -- MediaWiki returns Bangla
['ca-valencia'] = 'Valencian', -- IETF variant of Catalan
['fkv'] = 'Kven', -- MediaWiki returns Kvensk
['ilo'] = 'Ilocano', -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['ksh'] = 'Kölsch', -- MediaWiki: Colognian; use IANA/ISO 639 preferred name
['ksh-x-colog'] = 'Colognian', -- override MediaWiki ksh; no IANA/ISO 639 code for Colognian; IETF private code created at Module:Lang/data
['mis-x-ripuar'] = 'Ripuarian', -- override MediaWiki ksh; no IANA/ISO 639 code for Ripuarian; IETF private code created at Module:Lang/data
['nan-tw'] = 'Taiwanese Hokkien', -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese and support en.wiki preferred name
}
local lang_name_remap = { -- used for |language=; names require proper capitalization; tags must be lowercase
['alemannisch'] = {'Swiss German', 'gsw'}, -- not an ISO or IANA language name; MediaWiki uses 'als' as a subdomain name for Alemannic Wikipedia: als.wikipedia.org
['bangla'] = {'Bengali', 'bn'}, -- MediaWiki returns Bangla (the endonym) but we want Bengali (the exonym); here we remap
['bengali'] = {'Bengali', 'bn'}, -- MediaWiki doesn't use exonym so here we provide correct language name and 639-1 code
['bhojpuri'] = {'Bhojpuri', 'bho'}, -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org
['bihari'] = {'Bihari', 'bh'}, -- MediaWiki replaces 'Bihari' with 'Bhojpuri' so 'Bihari' cannot be found
['blackfoot'] = {'Blackfoot', 'bla'}, -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['colognian'] = {'Colognian', 'ksh-x-colog'}, -- MediaWiki preferred name for ksh
['ilocano'] = {'Ilocano', 'ilo'}, -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['kolsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name (use non-diacritical o instead of umlaut ö)
['kölsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name
['kven'] = {'Kven', 'fkv'}, -- Unicode CLDR have decided not to support English language name for these two...
['kvensk'] = {'Kven', 'fkv'}, -- ...they say to refer to IANA registry for English names
['ripuarian'] = {'Ripuarian', 'mis-x-ripuar'}, -- group of dialects; no code in MediaWiki or in IANA/ISO 639
['taiwanese hokkien'] = {'Taiwanese Hokkien', 'nan-tw'}, -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese
['tosk albanian'] = {'Tosk Albanian', 'als'}, -- MediaWiki replaces 'Tosk Albanian' with 'Alemannisch' so 'Tosk Albanian' cannot be found
['valencian'] = {'Valencian', 'ca-valencia'}, -- variant of Catalan; categorizes as Valencian
}
--[[---------------< P R O P E R T I E S _ C A T E G O R I E S >----------------
Properties categories. These are used for investigating qualities of citations.
]]
local prop_cats = {
['foreign-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is foreign-language name, $2 is ISO639-1 code
['foreign-lang-source-2'] = 'CS1 foreign language sources (ISO 639-2)|$1', -- |language= category; a cat for ISO639-2 languages; $1 is the ISO 639-2 code used as a sort key
['jul-greg-uncertainty'] = 'CS1: Julian–Gregorian uncertainty', -- probably temporary cat to identify scope of template with dates 1 October 1582 – 1 January 1926
['local-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is local-language name, $2 is ISO639-1 code; not emitted when local_lang_cat_enable is false
['location-test'] = 'CS1 location test',
['long-vol'] = 'CS1: long volume value', -- probably temporary cat to identify scope of |volume= values longer than 4 characters
['script'] = 'CS1 uses $1-language script ($2)', -- |script-title=xx: has matching category; $1 is language name, $2 is ISO639-1 code
['tracked-param'] = 'CS1 tracked parameter: $1', -- $1 is base (enumerators removed) parameter name
['year-range-abbreviated'] = 'CS1: abbreviated year range', -- probably temporary cat to identify scope of |date=, |year= values using YYYY–YY form
}
--[[-------------------< T I T L E _ T Y P E S >--------------------------------
Here we map a template's CitationClass to TitleType (default values for |type= parameter)
]]
local title_types = {
['AV-media-notes'] = 'Media notes',
['document'] = 'Document',
['interview'] = 'Interview',
['mailinglist'] = 'Mailing list',
['map'] = 'Map',
['podcast'] = 'Podcast',
['pressrelease'] = 'Press release',
['report'] = 'Report',
['speech'] = 'Speech',
['techreport'] = 'Technical report',
['thesis'] = 'Thesis',
}
--[[===================<< E R R O R M E S S A G I N G >>======================
]]
--[[----------< E R R O R M E S S A G E S U P P L I M E N T S >-------------
I18N for those messages that are supplemented with additional specific text that
describes the reason for the error
TODO: merge this with special_case_translations{}?
]]
local err_msg_supl = {
['char'] = 'invalid character', -- |isbn=, |sbn=
['check'] = 'checksum', -- |isbn=, |sbn=
['flag'] = 'flag', -- |archive-url=
['form'] = 'invalid form', -- |isbn=, |sbn=
['group'] = 'invalid group id', -- |isbn=
['initials'] = 'initials', -- Vancouver
['invalid language code'] = 'invalid language code', -- |script-<param>=
['journal'] = 'journal', -- |bibcode=
['length'] = 'length', -- |isbn=, |bibcode=, |sbn=
['liveweb'] = 'liveweb', -- |archive-url=
['missing comma'] = 'missing comma', -- Vancouver
['missing prefix'] = 'missing prefix', -- |script-<param>=
['missing title part'] = 'missing title part', -- |script-<param>=
['name'] = 'name', -- Vancouver
['non-Latin char'] = 'non-Latin character', -- Vancouver
['path'] = 'path', -- |archive-url=
['prefix'] = 'invalid prefix', -- |isbn=
['punctuation'] = 'punctuation', -- Vancouver
['save'] = 'save command', -- |archive-url=
['suffix'] = 'suffix', -- Vancouver
['timestamp'] = 'timestamp', -- |archive-url=
['unknown language code'] = 'unknown language code', -- |script-<param>=
['value'] = 'value', -- |bibcode=
['year'] = 'year', -- |bibcode=
}
--[[--------------< E R R O R _ C O N D I T I O N S >---------------------------
Error condition table. This table has two sections: errors at the top, maintenance
at the bottom. Maint 'messaging' does not have a 'message' (message=nil)
The following contains a list of IDs for various error conditions defined in the
code. For each ID, we specify a text message to display, an error category to
include, and whether the error message should be wrapped as a hidden comment.
Anchor changes require identical changes to matching anchor in Help:CS1 errors
TODO: rename error_conditions{} to something more generic; create separate error
and maint tables inside that?
]]
local error_conditions = {
err_accessdate_missing_url = {
message = '<code class="cs1-code">|access-date=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'accessdate_missing_url',
category = 'CS1 errors: access-date without URL',
hidden = false
},
err_apostrophe_markup = {
message = 'Italic or bold markup not allowed in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'apostrophe_markup',
category = 'CS1 errors: markup',
hidden = false
},
err_archive_date_missing_url = {
message = '<code class="cs1-code">|archive-date=</code> requires <code class="cs1-code">|archive-url=</code>',
anchor = 'archive_date_missing_url',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_date_url_ts_mismatch = {
message = '<code class="cs1-code">|archive-date=</code> / <code class="cs1-code">|archive-url=</code> timestamp mismatch',
anchor = 'archive_date_url_ts_mismatch',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_missing_date = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|archive-date=</code>',
anchor = 'archive_missing_date',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_missing_url = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'archive_missing_url',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_url = {
message = '<code class="cs1-code">|archive-url=</code> is malformed: $1', -- $1 is error message detail
anchor = 'archive_url',
category = 'CS1 errors: archive-url',
hidden = false
},
err_arxiv_missing = {
message = '<code class="cs1-code">|arxiv=</code> required',
anchor = 'arxiv_missing',
category = 'CS1 errors: arXiv', -- same as bad arxiv
hidden = false
},
err_asintld_missing_asin = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|asin=</code>', -- $1 is parameter name
anchor = 'asintld_missing_asin',
category = 'CS1 errors: ASIN TLD',
hidden = false
},
err_bad_arxiv = {
message = 'Check <code class="cs1-code">|arxiv=</code> value',
anchor = 'bad_arxiv',
category = 'CS1 errors: arXiv',
hidden = false
},
err_bad_asin = {
message = 'Check <code class="cs1-code">|asin=</code> value',
anchor = 'bad_asin',
category ='CS1 errors: ASIN',
hidden = false
},
err_bad_asin_tld = {
message = 'Check <code class="cs1-code">|asin-tld=</code> value',
anchor = 'bad_asin_tld',
category ='CS1 errors: ASIN TLD',
hidden = false
},
err_bad_bibcode = {
message = 'Check <code class="cs1-code">|bibcode=</code> $1', -- $1 is error message detail
anchor = 'bad_bibcode',
category = 'CS1 errors: bibcode',
hidden = false
},
err_bad_biorxiv = {
message = 'Check <code class="cs1-code">|biorxiv=</code> value',
anchor = 'bad_biorxiv',
category = 'CS1 errors: bioRxiv',
hidden = false
},
err_bad_citeseerx = {
message = 'Check <code class="cs1-code">|citeseerx=</code> value',
anchor = 'bad_citeseerx',
category = 'CS1 errors: citeseerx',
hidden = false
},
err_bad_date = {
message = 'Check date values in: $1', -- $1 is a parameter name list
anchor = 'bad_date',
category = 'CS1 errors: dates',
hidden = false
},
err_bad_doi = {
message = 'Check <code class="cs1-code">|doi=</code> value',
anchor = 'bad_doi',
category = 'CS1 errors: DOI',
hidden = false
},
err_bad_hdl = {
message = 'Check <code class="cs1-code">|hdl=</code> value',
anchor = 'bad_hdl',
category = 'CS1 errors: HDL',
hidden = false
},
err_bad_isbn = {
message = 'Check <code class="cs1-code">|isbn=</code> value: $1', -- $1 is error message detail
anchor = 'bad_isbn',
category = 'CS1 errors: ISBN',
hidden = false
},
err_bad_ismn = {
message = 'Check <code class="cs1-code">|ismn=</code> value',
anchor = 'bad_ismn',
category = 'CS1 errors: ISMN',
hidden = false
},
err_bad_issn = {
message = 'Check <code class="cs1-code">|$1issn=</code> value', -- $1 is 'e' or '' for eissn or issn
anchor = 'bad_issn',
category = 'CS1 errors: ISSN',
hidden = false
},
err_bad_jfm = {
message = 'Check <code class="cs1-code">|jfm=</code> value',
anchor = 'bad_jfm',
category = 'CS1 errors: JFM',
hidden = false
},
err_bad_jstor = {
message = 'Check <code class="cs1-code">|jstor=</code> value',
anchor = 'bad_jstor',
category = 'CS1 errors: JSTOR',
hidden = false
},
err_bad_lccn = {
message = 'Check <code class="cs1-code">|lccn=</code> value',
anchor = 'bad_lccn',
category = 'CS1 errors: LCCN',
hidden = false
},
err_bad_medrxiv = {
message = 'Check <code class="cs1-code">|medrxiv=</code> value',
anchor = 'bad_medrxiv',
category = 'CS1 errors: medRxiv',
hidden = false
},
err_bad_mr = {
message = 'Check <code class="cs1-code">|mr=</code> value',
anchor = 'bad_mr',
category = 'CS1 errors: MR',
hidden = false
},
err_bad_oclc = {
message = 'Check <code class="cs1-code">|oclc=</code> value',
anchor = 'bad_oclc',
category = 'CS1 errors: OCLC',
hidden = false
},
err_bad_ol = {
message = 'Check <code class="cs1-code">|ol=</code> value',
anchor = 'bad_ol',
category = 'CS1 errors: OL',
hidden = false
},
err_bad_osti = {
message = 'Check <code class="cs1-code">|osti=</code> value',
anchor = 'bad_osti',
category = 'CS1 errors: OSTI',
hidden = false
},
err_bad_paramlink = { -- for |title-link=, |author/editor/translator-link=, |series-link=, |episode-link=
message = 'Check <code class="cs1-code">|$1=</code> value', -- $1 is parameter name
anchor = 'bad_paramlink',
category = 'CS1 errors: parameter link',
hidden = false
},
err_bad_pmc = {
message = 'Check <code class="cs1-code">|pmc=</code> value',
anchor = 'bad_pmc',
category = 'CS1 errors: PMC',
hidden = false
},
err_bad_pmid = {
message = 'Check <code class="cs1-code">|pmid=</code> value',
anchor = 'bad_pmid',
category = 'CS1 errors: PMID',
hidden = false
},
err_bad_rfc = {
message = 'Check <code class="cs1-code">|rfc=</code> value',
anchor = 'bad_rfc',
category = 'CS1 errors: RFC',
hidden = false
},
err_bad_s2cid = {
message = 'Check <code class="cs1-code">|s2cid=</code> value',
anchor = 'bad_s2cid',
category = 'CS1 errors: S2CID',
hidden = false
},
err_bad_sbn = {
message = 'Check <code class="cs1-code">|sbn=</code> value: $1', -- $1 is error message detail
anchor = 'bad_sbn',
category = 'CS1 errors: SBN',
hidden = false
},
err_bad_ssrn = {
message = 'Check <code class="cs1-code">|ssrn=</code> value',
anchor = 'bad_ssrn',
category = 'CS1 errors: SSRN',
hidden = false
},
err_bad_url = {
message = 'Check $1 value', -- $1 is parameter name
anchor = 'bad_url',
category = 'CS1 errors: URL',
hidden = false
},
err_bad_usenet_id = {
message = 'Check <code class="cs1-code">|message-id=</code> value',
anchor = 'bad_message_id',
category = 'CS1 errors: message-id',
hidden = false
},
err_bad_zbl = {
message = 'Check <code class="cs1-code">|zbl=</code> value',
anchor = 'bad_zbl',
category = 'CS1 errors: Zbl',
hidden = false
},
err_bare_url_missing_title = {
message = '$1 missing title', -- $1 is parameter name
anchor = 'bare_url_missing_title',
category = 'CS1 errors: bare URL',
hidden = false
},
err_biorxiv_missing = {
message = '<code class="cs1-code">|biorxiv=</code> required',
anchor = 'biorxiv_missing',
category = 'CS1 errors: bioRxiv', -- same as bad bioRxiv
hidden = false
},
err_chapter_ignored = {
message = '<code class="cs1-code">|$1=</code> ignored', -- $1 is parameter name
anchor = 'chapter_ignored',
category = 'CS1 errors: chapter ignored',
hidden = false
},
err_citation_missing_title = {
message = 'Missing or empty <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'citation_missing_title',
category = 'CS1 errors: missing title',
hidden = false
},
err_citeseerx_missing = {
message = '<code class="cs1-code">|citeseerx=</code> required',
anchor = 'citeseerx_missing',
category = 'CS1 errors: citeseerx', -- same as bad citeseerx
hidden = false
},
err_cite_web_url = { -- this error applies to cite web and to cite podcast
message = 'Missing or empty <code class="cs1-code">|url=</code>',
anchor = 'cite_web_url',
category = 'CS1 errors: requires URL',
hidden = false
},
err_class_ignored = {
message = '<code class="cs1-code">|class=</code> ignored',
anchor = 'class_ignored',
category = 'CS1 errors: class',
hidden = false
},
err_contributor_ignored = {
message = '<code class="cs1-code">|contributor=</code> ignored',
anchor = 'contributor_ignored',
category = 'CS1 errors: contributor',
hidden = false
},
err_contributor_missing_required_param = {
message = '<code class="cs1-code">|contributor=</code> requires <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'contributor_missing_required_param',
category = 'CS1 errors: contributor',
hidden = false
},
err_deprecated_params = {
message = 'Cite uses deprecated parameter <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'deprecated_params',
category = 'CS1 errors: deprecated parameters',
hidden = false
},
err_disp_name = {
message = 'Invalid <code class="cs1-code">|$1=$2</code>', -- $1 is parameter name; $2 is the assigned value
anchor = 'disp_name',
category = 'CS1 errors: display-names',
hidden = false,
},
err_doibroken_missing_doi = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|doi=</code>', -- $1 is parameter name
anchor = 'doibroken_missing_doi',
category = 'CS1 errors: DOI',
hidden = false
},
err_embargo_missing_pmc = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|pmc=</code>', -- $1 is parameter name
anchor = 'embargo_missing_pmc',
category = 'CS1 errors: PMC embargo',
hidden = false
},
err_empty_citation = {
message = 'Empty citation',
anchor = 'empty_citation',
category = 'CS1 errors: empty citation',
hidden = false
},
err_etal = {
message = 'Explicit use of et al. in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'explicit_et_al',
category = 'CS1 errors: explicit use of et al.',
hidden = false
},
err_extra_text_edition = {
message = '<code class="cs1-code">|edition=</code> has extra text',
anchor = 'extra_text_edition',
category = 'CS1 errors: extra text: edition',
hidden = false,
},
err_extra_text_issue = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_issue',
category = 'CS1 errors: extra text: issue',
hidden = false,
},
err_extra_text_pages = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_pages',
category = 'CS1 errors: extra text: pages',
hidden = false,
},
err_extra_text_volume = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_volume',
category = 'CS1 errors: extra text: volume',
hidden = true,
},
err_first_missing_last = {
message = '<code class="cs1-code">|$1=</code> missing <code class="cs1-code">|$2=</code>', -- $1 is first alias, $2 is matching last alias
anchor = 'first_missing_last',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
err_format_missing_url = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|$2=</code>', -- $1 is format parameter $2 is url parameter
anchor = 'format_missing_url',
category = 'CS1 errors: format without URL',
hidden = false
},
err_generic_name = {
message = '<code class="cs1-code">|$1=</code> has generic name', -- $1 is parameter name
anchor = 'generic_name',
category = 'CS1 errors: generic name',
hidden = false,
},
err_generic_title = {
message = 'Cite uses generic title',
anchor = 'generic_title',
category = 'CS1 errors: generic title',
hidden = false,
},
err_invalid_param_val = {
message = 'Invalid <code class="cs1-code">|$1=$2</code>', -- $1 is parameter name $2 is parameter value
anchor = 'invalid_param_val',
category = 'CS1 errors: invalid parameter value',
hidden = false
},
err_invisible_char = {
message = '$1 in $2 at position $3', -- $1 is invisible char $2 is parameter name $3 is position number
anchor = 'invisible_char',
category = 'CS1 errors: invisible characters',
hidden = false
},
err_medrxiv_missing = {
message = '<code class="cs1-code">|medrxiv=</code> required',
anchor = 'medrxiv_missing',
category = 'CS1 errors: medRxiv', -- same as bad medRxiv
hidden = false
},
err_missing_name = {
message = 'Missing <code class="cs1-code">|$1$2=</code>', -- $1 is modified NameList; $2 is enumerator
anchor = 'missing_name',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
err_missing_periodical = {
message = 'Cite $1 requires <code class="cs1-code">|$2=</code>', -- $1 is cs1 template name; $2 is canonical periodical parameter name for cite $1
anchor = 'missing_periodical',
category = 'CS1 errors: missing periodical',
hidden = true
},
err_missing_pipe = {
message = 'Missing pipe in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'missing_pipe',
category = 'CS1 errors: missing pipe',
hidden = false
},
err_missing_publisher = {
message = 'Cite $1 requires <code class="cs1-code">|$2=</code>', -- $1 is cs1 template name; $2 is canonical publisher parameter name for cite $1
anchor = 'missing_publisher',
category = 'CS1 errors: missing publisher',
hidden = false
},
err_param_access_requires_param = {
message = '<code class="cs1-code">|$1-access=</code> requires <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'param_access_requires_param',
category = 'CS1 errors: param-access',
hidden = false
},
err_param_has_ext_link = {
message = 'External link in <code class="cs1-code">$1</code>', -- $1 is parameter name
anchor = 'param_has_ext_link',
category = 'CS1 errors: external links',
hidden = false
},
err_parameter_ignored = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored', -- $1 is parameter name
anchor = 'parameter_ignored',
category = 'CS1 errors: unsupported parameter',
hidden = false
},
err_parameter_ignored_suggest = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored (<code class="cs1-code">|$2=</code> suggested)', -- $1 is unknown parameter $2 is suggested parameter name
anchor = 'parameter_ignored_suggest',
category = 'CS1 errors: unsupported parameter',
hidden = false
},
err_periodical_ignored = {
message = '<code class="cs1-code">|$1=</code> ignored', -- $1 is parameter name
anchor = 'periodical_ignored',
category = 'CS1 errors: periodical ignored',
hidden = false
},
err_redundant_parameters = {
message = 'More than one of $1 specified', -- $1 is error message detail
anchor = 'redundant_parameters',
category = 'CS1 errors: redundant parameter',
hidden = false
},
err_script_parameter = {
message = 'Invalid <code class="cs1-code">|$1=</code>: $2', -- $1 is parameter name $2 is script language code or error detail
anchor = 'script_parameter',
category = 'CS1 errors: script parameters',
hidden = false
},
err_ssrn_missing = {
message = '<code class="cs1-code">|ssrn=</code> required',
anchor = 'ssrn_missing',
category = 'CS1 errors: SSRN',
hidden = false
},
err_text_ignored = {
message = 'Text "$1" ignored', -- $1 is ignored text
anchor = 'text_ignored',
category = 'CS1 errors: unrecognized parameter',
hidden = false
},
err_trans_missing_title = {
message = '<code class="cs1-code">|trans-$1=</code> requires <code class="cs1-code">|$1=</code> or <code class="cs1-code">|script-$1=</code>', -- $1 is base parameter name
anchor = 'trans_missing_title',
category = 'CS1 errors: translated title',
hidden = false
},
err_param_unknown_empty = {
message = 'Cite has empty unknown parameter$1: $2', -- $1 is 's' or empty space; $2 is emty unknown param list
anchor = 'param_unknown_empty',
category = 'CS1 errors: empty unknown parameters',
hidden = false
},
err_vancouver = {
message = 'Vancouver style error: $1 in name $2', -- $1 is error detail, $2 is the nth name
anchor = 'vancouver',
category = 'CS1 errors: Vancouver style',
hidden = false
},
err_wikilink_in_url = {
message = 'URL–wikilink conflict', -- uses ndash
anchor = 'wikilink_in_url',
category = 'CS1 errors: URL–wikilink conflict', -- uses ndash
hidden = false
},
--[[--------------------------< M A I N T >-------------------------------------
maint messages do not have a message (message = nil); otherwise the structure
is the same as error messages
]]
maint_archived_copy = {
message = nil,
anchor = 'archived_copy',
category = 'CS1 maint: archived copy as title',
hidden = true,
},
maint_authors = {
message = nil,
anchor = 'authors',
category = 'CS1 maint: uses authors parameter',
hidden = true,
},
maint_bibcode = {
message = nil,
anchor = 'bibcode',
category = 'CS1 maint: bibcode',
hidden = true,
},
maint_location_no_publisher = { -- cite book, conference, encyclopedia; citation as book cite or encyclopedia cite
message = nil,
anchor = 'location_no_publisher',
category = 'CS1 maint: location missing publisher',
hidden = true,
},
maint_bot_unknown = {
message = nil,
anchor = 'bot:_unknown',
category = 'CS1 maint: bot: original URL status unknown',
hidden = true,
},
maint_date_auto_xlated = { -- date auto-translation not supported by en.wiki
message = nil,
anchor = 'date_auto_xlated',
category = 'CS1 maint: date auto-translated',
hidden = true,
},
maint_date_format = {
message = nil,
anchor = 'date_format',
category = 'CS1 maint: date format',
hidden = true,
},
maint_date_year = {
message = nil,
anchor = 'date_year',
category = 'CS1 maint: date and year',
hidden = true,
},
maint_doi_ignore = {
message = nil,
anchor = 'doi_ignore',
category = 'CS1 maint: ignored DOI errors',
hidden = true,
},
maint_doi_inactive = {
message = nil,
anchor = 'doi_inactive',
category = 'CS1 maint: DOI inactive',
hidden = true,
},
maint_doi_inactive_dated = {
message = nil,
anchor = 'doi_inactive_dated',
category = 'CS1 maint: DOI inactive as of $2$3$1', -- $1 is year, $2 is month-name or empty string, $3 is space or empty string
hidden = true,
},
maint_extra_punct = {
message = nil,
anchor = 'extra_punct',
category = 'CS1 maint: extra punctuation',
hidden = true,
},
maint_isbn_ignore = {
message = nil,
anchor = 'ignore_isbn_err',
category = 'CS1 maint: ignored ISBN errors',
hidden = true,
},
maint_issn_ignore = {
message = nil,
anchor = 'ignore_issn',
category = 'CS1 maint: ignored ISSN errors',
hidden = true,
},
maint_jfm_format = {
message = nil,
anchor = 'jfm_format',
category = 'CS1 maint: JFM format',
hidden = true,
},
maint_location = {
message = nil,
anchor = 'location',
category = 'CS1 maint: location',
hidden = true,
},
maint_mr_format = {
message = nil,
anchor = 'mr_format',
category = 'CS1 maint: MR format',
hidden = true,
},
maint_mult_names = {
message = nil,
anchor = 'mult_names',
category = 'CS1 maint: multiple names: $1', -- $1 is '<name>s list'; gets value from special_case_translation table
hidden = true,
},
maint_numeric_names = {
message = nil,
anchor = 'numeric_names',
category = 'CS1 maint: numeric names: $1', -- $1 is '<name>s list'; gets value from special_case_translation table
hidden = true,
},
maint_others = {
message = nil,
anchor = 'others',
category = 'CS1 maint: others',
hidden = true,
},
maint_others_avm = {
message = nil,
anchor = 'others_avm',
category = 'CS1 maint: others in cite AV media (notes)',
hidden = true,
},
maint_overridden_setting = {
message = nil,
anchor = 'overridden',
category = 'CS1 maint: overridden setting',
hidden = true,
},
maint_pmc_embargo = {
message = nil,
anchor = 'embargo',
category = 'CS1 maint: PMC embargo expired',
hidden = true,
},
maint_pmc_format = {
message = nil,
anchor = 'pmc_format',
category = 'CS1 maint: PMC format',
hidden = true,
},
maint_postscript = {
message = nil,
anchor = 'postscript',
category = 'CS1 maint: postscript',
hidden = true,
},
maint_ref_duplicates_default = {
message = nil,
anchor = 'ref_default',
category = 'CS1 maint: ref duplicates default',
hidden = true,
},
maint_unfit = {
message = nil,
anchor = 'unfit',
category = 'CS1 maint: unfit URL',
hidden = true,
},
maint_unknown_lang = {
message = nil,
anchor = 'unknown_lang',
category = 'CS1 maint: unrecognized language',
hidden = true,
},
maint_untitled = {
message = nil,
anchor = 'untitled',
category = 'CS1 maint: untitled periodical',
hidden = true,
},
maint_url_status = {
message = nil,
anchor = 'url_status',
category = 'CS1 maint: url-status',
hidden = true,
},
maint_zbl = {
message = nil,
anchor = 'zbl',
category = 'CS1 maint: Zbl',
hidden = true,
},
}
--[[--------------------------< I D _ H A N D L E R S >--------------------------------------------------------
The following contains a list of values for various defined identifiers. For each
identifier we specify a variety of information necessary to properly render the
identifier in the citation.
parameters: a list of parameter aliases for this identifier; first in the list is the canonical form
link: Wikipedia article name
redirect: a local redirect to a local Wikipedia article name; at en.wiki, 'ISBN (identifier)' is a redirect to 'International Standard Book Number'
q: Wikidata q number for the identifier
label: the label preceding the identifier; label is linked to a Wikipedia article (in this order):
redirect from id_handlers['<id>'].redirect when use_identifier_redirects is true
Wikidata-supplied article name for the local wiki from id_handlers['<id>'].q
local article name from id_handlers['<id>'].link
prefix: the first part of a URL that will be concatenated with a second part which usually contains the identifier
suffix: optional third part to be added after the identifier
encode: true if URI should be percent-encoded; otherwise false
COinS: identifier link or keyword for use in COinS:
for identifiers registered at info-uri.info use: info:.... where '...' is the appropriate identifier label
for identifiers that have COinS keywords, use the keyword: rft.isbn, rft.issn, rft.eissn
for |asin= and |ol=, which require assembly, use the keyword: url
for others make a URL using the value in prefix/suffix and #label, use the keyword: pre (not checked; any text other than 'info', 'rft', or 'url' works here)
set to nil to leave the identifier out of the COinS
separator: character or text between label and the identifier in the rendered citation
id_limit: for those identifiers with established limits, this property holds the upper limit
access: use this parameter to set the access level for all instances of this identifier.
the value must be a valid access level for an identifier (see ['id-access'] in this file).
custom_access: to enable custom access level for an identifier, set this parameter
to the parameter that should control it (normally 'id-access')
]]
local id_handlers = {
['ARXIV'] = {
parameters = {'arxiv', 'eprint'},
link = 'arXiv',
redirect = 'arXiv (identifier)',
q = 'Q118398',
label = 'arXiv',
prefix = 'https://arxiv.org/abs/',
encode = false,
COinS = 'info:arxiv',
separator = ':',
access = 'free', -- free to read
},
['ASIN'] = {
parameters = { 'asin', 'ASIN' },
link = 'Amazon Standard Identification Number',
redirect = 'ASIN (identifier)',
q = 'Q1753278',
label = 'ASIN',
prefix = 'https://www.amazon.',
COinS = 'url',
separator = ' ',
encode = false;
},
['BIBCODE'] = {
parameters = {'bibcode'},
link = 'Bibcode',
redirect = 'Bibcode (identifier)',
q = 'Q25754',
label = 'Bibcode',
prefix = 'https://ui.adsabs.harvard.edu/abs/',
encode = false,
COinS = 'info:bibcode',
separator = ':',
custom_access = 'bibcode-access',
},
['BIORXIV'] = {
parameters = {'biorxiv'},
link = 'bioRxiv',
redirect = 'bioRxiv (identifier)',
q = 'Q19835482',
label = 'bioRxiv',
prefix = 'https://doi.org/',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['CITESEERX'] = {
parameters = {'citeseerx'},
link = 'CiteSeerX',
redirect = 'CiteSeerX (identifier)',
q = 'Q2715061',
label = 'CiteSeerX',
prefix = 'https://citeseerx.ist.psu.edu/viewdoc/summary?doi=',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['DOI'] = { -- Used by InternetArchiveBot
parameters = { 'doi', 'DOI'},
link = 'Digital object identifier',
redirect = 'doi (identifier)',
q = 'Q25670',
label = 'doi',
prefix = 'https://doi.org/',
COinS = 'info:doi',
separator = ':',
encode = true,
custom_access = 'doi-access',
},
['EISSN'] = {
parameters = {'eissn', 'EISSN'},
link = 'International Standard Serial Number#Electronic ISSN',
redirect = 'eISSN (identifier)',
q = 'Q46339674',
label = 'eISSN',
prefix = 'https://www.worldcat.org/issn/',
COinS = 'rft.eissn',
encode = false,
separator = ' ',
},
['HDL'] = {
parameters = { 'hdl', 'HDL' },
link = 'Handle System',
redirect = 'hdl (identifier)',
q = 'Q3126718',
label = 'hdl',
prefix = 'https://hdl.handle.net/',
COinS = 'info:hdl',
separator = ':',
encode = true,
custom_access = 'hdl-access',
},
['ISBN'] = { -- Used by InternetArchiveBot
parameters = {'isbn', 'ISBN'},
link = 'International Standard Book Number',
redirect = 'ISBN (identifier)',
q = 'Q33057',
label = 'ISBN',
prefix = 'Special:BookSources/',
COinS = 'rft.isbn',
separator = ' ',
},
['ISMN'] = {
parameters = {'ismn', 'ISMN'},
link = 'International Standard Music Number',
redirect = 'ISMN (identifier)',
q = 'Q1666938',
label = 'ISMN',
prefix = '', -- not currently used;
COinS = nil, -- nil because we can't use pre or rft or info:
separator = ' ',
},
['ISSN'] = {
parameters = {'issn', 'ISSN'},
link = 'International Standard Serial Number',
redirect = 'ISSN (identifier)',
q = 'Q131276',
label = 'ISSN',
prefix = 'https://www.worldcat.org/issn/',
COinS = 'rft.issn',
encode = false,
separator = ' ',
},
['JFM'] = {
parameters = {'jfm', 'JFM'},
link = 'Jahrbuch über die Fortschritte der Mathematik',
redirect = 'JFM (identifier)',
q = '',
label = 'JFM',
prefix = 'https://zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['JSTOR'] = {
parameters = {'jstor', 'JSTOR'},
link = 'JSTOR',
redirect = 'JSTOR (identifier)',
q = 'Q1420342',
label = 'JSTOR',
prefix = 'https://www.jstor.org/stable/',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
custom_access = 'jstor-access',
},
['LCCN'] = {
parameters = {'lccn', 'LCCN'},
link = 'Library of Congress Control Number',
redirect = 'LCCN (identifier)',
q = 'Q620946',
label = 'LCCN',
prefix = 'https://lccn.loc.gov/',
COinS = 'info:lccn',
encode = false,
separator = ' ',
},
['MEDRXIV'] = {
parameters = {'medrxiv'},
link = 'medRxiv',
redirect = 'medRxiv (identifier)',
q = 'Q58465838',
label = 'medRxiv',
prefix = 'https://www.medrxiv.org/content/',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = false,
separator = ' ',
},
['MR'] = {
parameters = {'mr', 'MR'},
link = 'Mathematical Reviews',
redirect = 'MR (identifier)',
q = 'Q211172',
label = 'MR',
prefix = 'https://mathscinet.ams.org/mathscinet-getitem?mr=',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['OCLC'] = {
parameters = {'oclc', 'OCLC'},
link = 'OCLC',
redirect = 'OCLC (identifier)',
q = 'Q190593',
label = 'OCLC',
prefix = 'https://www.worldcat.org/oclc/',
COinS = 'info:oclcnum',
encode = true,
separator = ' ',
id_limit = 10030000000,
},
['OL'] = {
parameters = { 'ol', 'OL' },
link = 'Open Library',
redirect = 'OL (identifier)',
q = 'Q1201876',
label = 'OL',
prefix = 'https://openlibrary.org/',
COinS = 'url',
separator = ' ',
encode = true,
custom_access = 'ol-access',
},
['OSTI'] = {
parameters = {'osti', 'OSTI'},
link = 'Office of Scientific and Technical Information',
redirect = 'OSTI (identifier)',
q = 'Q2015776',
label = 'OSTI',
prefix = 'https://www.osti.gov/biblio/',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 23010000,
custom_access = 'osti-access',
},
['PMC'] = {
parameters = {'pmc', 'PMC'},
link = 'PubMed Central',
redirect = 'PMC (identifier)',
q = 'Q229883',
label = 'PMC',
prefix = 'https://www.ncbi.nlm.nih.gov/pmc/articles/PMC',
suffix = '',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 10700000,
access = 'free', -- free to read
},
['PMID'] = {
parameters = {'pmid', 'PMID'},
link = 'PubMed Identifier',
redirect = 'PMID (identifier)',
q = 'Q2082879',
label = 'PMID',
prefix = 'https://pubmed.ncbi.nlm.nih.gov/',
COinS = 'info:pmid',
encode = false,
separator = ' ',
id_limit = 37900000,
},
['RFC'] = {
parameters = {'rfc', 'RFC'},
link = 'Request for Comments',
redirect = 'RFC (identifier)',
q = 'Q212971',
label = 'RFC',
prefix = 'https://tools.ietf.org/html/rfc',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
id_limit = 9300,
access = 'free', -- free to read
},
['SBN'] = {
parameters = {'sbn', 'SBN'},
link = 'Standard Book Number', -- redirect to International_Standard_Book_Number#History
redirect = 'SBN (identifier)',
label = 'SBN',
prefix = 'Special:BookSources/0-', -- prefix has leading zero necessary to make 9-digit sbn a 10-digit isbn
COinS = nil, -- nil because we can't use pre or rft or info:
separator = ' ',
},
['SSRN'] = {
parameters = {'ssrn', 'SSRN'},
link = 'Social Science Research Network',
redirect = 'SSRN (identifier)',
q = 'Q7550801',
label = 'SSRN',
prefix = 'https://papers.ssrn.com/sol3/papers.cfm?abstract_id=',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 4600000,
custom_access = 'ssrn-access',
},
['S2CID'] = {
parameters = {'s2cid', 'S2CID'},
link = 'Semantic Scholar',
redirect = 'S2CID (identifier)',
q = 'Q22908627',
label = 'S2CID',
prefix = 'https://api.semanticscholar.org/CorpusID:',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
id_limit = 264000000,
custom_access = 's2cid-access',
},
['USENETID'] = {
parameters = {'message-id'},
link = 'Usenet',
redirect = 'Usenet (identifier)',
q = 'Q193162',
label = 'Usenet:',
prefix = 'news:',
encode = false,
COinS = 'pre', -- use prefix value
separator = ' ',
},
['ZBL'] = {
parameters = {'zbl', 'ZBL' },
link = 'Zentralblatt MATH',
redirect = 'Zbl (identifier)',
q = 'Q190269',
label = 'Zbl',
prefix = 'https://zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
}
--[[--------------------------< E X P O R T S >---------------------------------
]]
return {
use_identifier_redirects = use_identifier_redirects, -- booleans defined in the settings at the top of this module
local_lang_cat_enable = local_lang_cat_enable,
date_name_auto_xlate_enable = date_name_auto_xlate_enable,
date_digit_auto_xlate_enable = date_digit_auto_xlate_enable,
-- tables and variables created when this module is loaded
global_df = get_date_format (), -- this line can be replaced with "global_df = 'dmy-all'," to have all dates auto translated to dmy format.
global_cs1_config_t = global_cs1_config_t, -- global settings from {{cs1 config}}
punct_skip = build_skip_table (punct_skip, punct_meta_params),
url_skip = build_skip_table (url_skip, url_meta_params),
aliases = aliases,
special_case_translation = special_case_translation,
date_names = date_names,
err_msg_supl = err_msg_supl,
error_conditions = error_conditions,
editor_markup_patterns = editor_markup_patterns,
et_al_patterns = et_al_patterns,
id_handlers = id_handlers,
keywords_lists = keywords_lists,
keywords_xlate = keywords_xlate,
stripmarkers = stripmarkers,
invisible_chars = invisible_chars,
invisible_defs = invisible_defs,
indic_script = indic_script,
emoji_t = emoji_t,
maint_cats = maint_cats,
messages = messages,
presentation = presentation,
prop_cats = prop_cats,
script_lang_codes = script_lang_codes,
lang_tag_remap = lang_tag_remap,
lang_name_remap = lang_name_remap,
this_wiki_code = this_wiki_code,
title_types = title_types,
uncategorized_namespaces = uncategorized_namespaces_t,
uncategorized_subpages = uncategorized_subpages,
templates_using_volume = templates_using_volume,
templates_using_issue = templates_using_issue,
templates_not_using_page = templates_not_using_page,
vol_iss_pg_patterns = vol_iss_pg_patterns,
single_letter_2nd_lvl_domains_t = single_letter_2nd_lvl_domains_t,
inter_wiki_map = inter_wiki_map,
mw_languages_by_tag_t = mw_languages_by_tag_t,
mw_languages_by_name_t = mw_languages_by_name_t,
citation_class_map_t = citation_class_map_t,
citation_issue_t = citation_issue_t,
citation_no_volume_t = citation_no_volume_t,
}
f53fd0e92d88e50b26351a0835c634107a57fa76
Module:Disambiguation/templates
828
244
595
2023-10-10T22:31:17Z
wikipedia>Pppery
0
Update from sandbox
Scribunto
text/plain
-- This page contains a table of all disambiguation templates and their
-- redirects. Templates names are capitalized, and the Template: prefix is
-- removed. Templates are grouped with the main template first, followed by
-- its redirects.
return {
["Disambiguation"] = true,
["Begriffsklärung"] = true,
["DAB"] = true,
["Dab"] = true,
["Dabpage"] = true,
["Dbig"] = true,
["Dis"] = true,
["Disam"] = true,
["Disamb"] = true,
["Disambig"] = true,
["Disambig misspelling"] = true,
["Disambig-plants"] = true,
["Disambiguation page"] = true,
["Meta disambig"] = true,
["Project disambiguation"] = true,
["Shortcut disambig"] = true,
["WP disambig"] = true,
["WP-disambig"] = true,
["Wikipedia disambiguation"] = true,
["Airport disambiguation"] = true,
["Airport disambig"] = true,
["Biology disambiguation"] = true,
["Call sign disambiguation"] = true,
["Callsigndis"] = true,
["Caselaw disambiguation"] = true,
["Case law disambiguation"] = true,
["Chinese title disambiguation"] = true,
["CJKVdab"] = true,
["Chinese title disambig"] = true,
["Disambig-Chinese-char-title"] = true,
["Disambiguation cleanup"] = true,
["Cleanup disambig"] = true,
["Cleanup disambiguation"] = true,
["CleanupDisambig"] = true,
["Dab cleanup"] = true,
["Dab-cleanup"] = true,
["Dabclean"] = true,
["Disamb-cleanup"] = true,
["Disambcleanup"] = true,
["Disambig cleanup"] = true,
["Disambig-CU"] = true,
["Disambig-cleanup"] = true,
["Disambig-cu"] = true,
["Disambigcleanup"] = true,
["Disambiguate-cleanup"] = true,
["Disambiguation-cleanup"] = true,
["Geodis-cleanup"] = true,
["Genus disambiguation"] = true,
["Genus disambig"] = true,
["Hangul title disambiguation"] = true,
["Hospital disambiguation"] = true,
["Hospitaldis"] = true,
["Human name disambiguation"] = true,
["Bio-dab"] = true,
["HNDIS"] = true,
["HnDis"] = true,
["Hndab"] = true,
["Hndis"] = true,
["Hndisambig"] = true,
["Human name dab"] = true,
["Personal name"] = true,
["Personal name disambiguation"] = true,
["Human name disambiguation cleanup"] = true,
["Hndis-cleanup"] = true,
["Personal name disambiguation cleanup"] = true,
["Letter–number combination disambiguation"] = true,
["LNCD"] = true,
["Letter-Number Combination Disambiguation"] = true,
["Letter-Number combination disambiguation"] = true,
["Letter-NumberCombDisambig"] = true,
["Letter-NumberCombdisambig"] = true,
["Letter-NumberCombinationDisambiguation"] = true,
["Letter-number combination disambiguation"] = true,
["Mathematical disambiguation"] = true,
["Math dab"] = true,
["Math disambiguation"] = true,
["Mathdab"] = true,
["Mathematics disambiguation"] = true,
["Maths disambiguation"] = true,
["Military unit disambiguation"] = true,
["Mil-unit-dis"] = true,
["Mil-unit-disambig"] = true,
["Music disambiguation"] = true,
["Music disambig"] = true,
["Number disambiguation"] = true,
["Numberdis"] = true,
["Numdab"] = true,
["Numdisambig"] = true,
["Opus number disambiguation"] = true,
["Phonetics disambiguation"] = true,
["Place name disambiguation"] = true,
["DisambigG"] = true,
["DisambigGeo"] = true,
["Disambiggeo"] = true,
["Geo-dis"] = true,
["Geodab"] = true,
["Geodis"] = true,
["Geodisambig"] = true,
["Geographic disambiguation"] = true,
["Portal disambiguation"] = true,
["Portal disambig"] = true,
["Road disambiguation"] = true,
["Roaddis"] = true,
["School disambiguation"] = true,
["School disambig"] = true,
["Schooldab"] = true,
["Schooldis"] = true,
["Species Latin name abbreviation disambiguation"] = true,
["Species Latin name disambiguation"] = true,
["LatinNameDisambig"] = true,
["SpeciesLatinNameDisambig"] = true,
["Station disambiguation"] = true,
["Station dab"] = true,
["Synagogue disambiguation"] = true,
["Taxonomic authority disambiguation"] = true,
["Taxonomic authorities disambiguation"] = true,
["Taxonomy disambiguation"] = true,
["Species disambiguation"] = true,
["Template disambiguation"] = true,
["Template ambiguous"] = true,
["Template dab"] = true,
["Template disambig"] = true,
["WoO number disambiguation"] = true,
}
98d5e2735cd3ddcadf551a10294cfd2c6a550be8
Module:Navbar
828
4
197
39
2023-10-10T22:34:57Z
wikipedia>Pppery
0
Per edit request on talk
Scribunto
text/plain
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local function get_title_arg(is_collapsible, template)
local title_arg = 1
if is_collapsible then title_arg = 2 end
if template then title_arg = 'template' end
return title_arg
end
local function choose_links(template, args)
-- The show table indicates the default displayed items.
-- view, talk, edit, hist, move, watch
-- TODO: Move to configuration.
local show = {true, true, true, false, false, false}
if template then
show[2] = false
show[3] = false
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6,
talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
-- TODO: Consider removing TableTools dependency.
for _, v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
local remove_edit_link = args.noedit
if remove_edit_link then show[3] = false end
return show
end
local function add_link(link_description, ul, is_mini, font_style)
local l
if link_description.url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-' .. link_description.full)
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:attr('title', link_description.html_title)
:cssText(font_style)
:wikitext(is_mini and link_description.mini or link_description.full)
:done()
:wikitext(l[3])
:done()
end
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
if not title then
error(cfg.invalid_title .. title_text)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- TODO: Get link_descriptions and show into the configuration module.
-- link_descriptions should be easier...
local link_descriptions = {
{ ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template',
['link'] = title.fullText, ['url'] = false },
{ ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template',
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = 'Special:EditPage/' .. title.fullText, ['url'] = false },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = 'Special:PageHistory/' .. title.fullText, ['url'] = false },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template',
['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
local ul = mw.html.create('ul')
if has_brackets then
ul:addClass(cfg.classes.brackets)
:cssText(font_style)
end
for i, _ in ipairs(displayed_links) do
if displayed_links[i] then add_link(link_descriptions[i], ul, is_mini, font_style) end
end
return ul:done()
end
function p._navbar(args)
-- TODO: We probably don't need both fontstyle and fontcolor...
local font_style = args.fontstyle
local font_color = args.fontcolor
local is_collapsible = args.collapsible
local is_mini = args.mini
local is_plain = args.plain
local collapsible_class = nil
if is_collapsible then
collapsible_class = cfg.classes.collapsible
if not is_plain then is_mini = 1 end
if font_color then
font_style = (font_style or '') .. '; color: ' .. font_color .. ';'
end
end
local navbar_style = args.style
local div = mw.html.create():tag('div')
div
:addClass(cfg.classes.navbar)
:addClass(cfg.classes.plainlinks)
:addClass(cfg.classes.horizontal_list)
:addClass(collapsible_class) -- we made the determination earlier
:cssText(navbar_style)
if is_mini then div:addClass(cfg.classes.mini) end
local box_text = (args.text or cfg.box_text) .. ' '
-- the concatenated space guarantees the box text is separated
if not (is_mini or is_plain) then
div
:tag('span')
:addClass(cfg.classes.box_text)
:cssText(font_style)
:wikitext(box_text)
end
local template = args.template
local displayed_links = choose_links(template, args)
local has_brackets = args.brackets
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local list = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(list)
if is_collapsible then
local title_text_class
if is_mini then
title_text_class = cfg.classes.collapsible_title_mini
else
title_text_class = cfg.classes.collapsible_title_full
end
div:done()
:tag('div')
:addClass(title_text_class)
:cssText(font_style)
:wikitext(args[1])
end
local frame = mw.getCurrentFrame()
-- hlist -> navbar is best-effort to preserve old Common.css ordering.
return frame:extensionTag{
name = 'templatestyles', args = { src = cfg.hlist_templatestyles }
} .. frame:extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())
end
function p.navbar(frame)
return p._navbar(require('Module:Arguments').getArgs(frame))
end
return p
047f307758c878eb3e99ed1768cc40920a6ec5fa
5
2023-10-17T15:30:30Z
LamayII
2
Created page with "local p = {} local cfg = mw.loadData('Module:Navbar/configuration') local function get_title_arg(is_collapsible, template) local title_arg = 1 if is_collapsible then title_arg = 2 end if template then title_arg = 'template' end return title_arg end local function choose_links(template, args) -- The show table indicates the default displayed items. -- view, talk, edit, hist, move, watch -- TODO: Move to configuration. local show = {true, true, true, false, false..."
Scribunto
text/plain
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local function get_title_arg(is_collapsible, template)
local title_arg = 1
if is_collapsible then title_arg = 2 end
if template then title_arg = 'template' end
return title_arg
end
local function choose_links(template, args)
-- The show table indicates the default displayed items.
-- view, talk, edit, hist, move, watch
-- TODO: Move to configuration.
local show = {true, true, true, false, false, false}
if template then
show[2] = false
show[3] = false
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6,
talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
-- TODO: Consider removing TableTools dependency.
for _, v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
local remove_edit_link = args.noedit
if remove_edit_link then show[3] = false end
return show
end
local function add_link(link_description, ul, is_mini, font_style)
local l
if link_description.url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-' .. link_description.full)
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:attr('title', link_description.html_title)
:cssText(font_style)
:wikitext(is_mini and link_description.mini or link_description.full)
:done()
:wikitext(l[3])
:done()
end
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
if not title then
error(cfg.invalid_title .. title_text)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- TODO: Get link_descriptions and show into the configuration module.
-- link_descriptions should be easier...
local link_descriptions = {
{ ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template',
['link'] = title.fullText, ['url'] = false },
{ ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template',
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = title:fullUrl('action=edit'), ['url'] = true },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = title:fullUrl('action=history'), ['url'] = true },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template',
['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
local ul = mw.html.create('ul')
if has_brackets then
ul:addClass(cfg.classes.brackets)
:cssText(font_style)
end
for i, _ in ipairs(displayed_links) do
if displayed_links[i] then add_link(link_descriptions[i], ul, is_mini, font_style) end
end
return ul:done()
end
function p._navbar(args)
-- TODO: We probably don't need both fontstyle and fontcolor...
local font_style = args.fontstyle
local font_color = args.fontcolor
local is_collapsible = args.collapsible
local is_mini = args.mini
local is_plain = args.plain
local collapsible_class = nil
if is_collapsible then
collapsible_class = cfg.classes.collapsible
if not is_plain then is_mini = 1 end
if font_color then
font_style = (font_style or '') .. '; color: ' .. font_color .. ';'
end
end
local navbar_style = args.style
local div = mw.html.create():tag('div')
div
:addClass(cfg.classes.navbar)
:addClass(cfg.classes.plainlinks)
:addClass(cfg.classes.horizontal_list)
:addClass(collapsible_class) -- we made the determination earlier
:cssText(navbar_style)
if is_mini then div:addClass(cfg.classes.mini) end
local box_text = (args.text or cfg.box_text) .. ' '
-- the concatenated space guarantees the box text is separated
if not (is_mini or is_plain) then
div
:tag('span')
:addClass(cfg.classes.box_text)
:cssText(font_style)
:wikitext(box_text)
end
local template = args.template
local displayed_links = choose_links(template, args)
local has_brackets = args.brackets
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local list = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(list)
if is_collapsible then
local title_text_class
if is_mini then
title_text_class = cfg.classes.collapsible_title_mini
else
title_text_class = cfg.classes.collapsible_title_full
end
div:done()
:tag('div')
:addClass(title_text_class)
:cssText(font_style)
:wikitext(args[1])
end
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())
end
function p.navbar(frame)
return p._navbar(require('Module:Arguments').getArgs(frame))
end
return p
a5c8d3a8f8beb18984ea7f145ddbdf88a065d23e
40
5
2023-10-17T16:37:20Z
LamayII
2
1 revision imported from [[:meta:Module:Navbar]]
Scribunto
text/plain
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local function get_title_arg(is_collapsible, template)
local title_arg = 1
if is_collapsible then title_arg = 2 end
if template then title_arg = 'template' end
return title_arg
end
local function choose_links(template, args)
-- The show table indicates the default displayed items.
-- view, talk, edit, hist, move, watch
-- TODO: Move to configuration.
local show = {true, true, true, false, false, false}
if template then
show[2] = false
show[3] = false
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6,
talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
-- TODO: Consider removing TableTools dependency.
for _, v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
local remove_edit_link = args.noedit
if remove_edit_link then show[3] = false end
return show
end
local function add_link(link_description, ul, is_mini, font_style)
local l
if link_description.url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-' .. link_description.full)
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:attr('title', link_description.html_title)
:cssText(font_style)
:wikitext(is_mini and link_description.mini or link_description.full)
:done()
:wikitext(l[3])
:done()
end
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
if not title then
error(cfg.invalid_title .. title_text)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- TODO: Get link_descriptions and show into the configuration module.
-- link_descriptions should be easier...
local link_descriptions = {
{ ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template',
['link'] = title.fullText, ['url'] = false },
{ ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template',
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = title:fullUrl('action=edit'), ['url'] = true },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = title:fullUrl('action=history'), ['url'] = true },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template',
['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
local ul = mw.html.create('ul')
if has_brackets then
ul:addClass(cfg.classes.brackets)
:cssText(font_style)
end
for i, _ in ipairs(displayed_links) do
if displayed_links[i] then add_link(link_descriptions[i], ul, is_mini, font_style) end
end
return ul:done()
end
function p._navbar(args)
-- TODO: We probably don't need both fontstyle and fontcolor...
local font_style = args.fontstyle
local font_color = args.fontcolor
local is_collapsible = args.collapsible
local is_mini = args.mini
local is_plain = args.plain
local collapsible_class = nil
if is_collapsible then
collapsible_class = cfg.classes.collapsible
if not is_plain then is_mini = 1 end
if font_color then
font_style = (font_style or '') .. '; color: ' .. font_color .. ';'
end
end
local navbar_style = args.style
local div = mw.html.create():tag('div')
div
:addClass(cfg.classes.navbar)
:addClass(cfg.classes.plainlinks)
:addClass(cfg.classes.horizontal_list)
:addClass(collapsible_class) -- we made the determination earlier
:cssText(navbar_style)
if is_mini then div:addClass(cfg.classes.mini) end
local box_text = (args.text or cfg.box_text) .. ' '
-- the concatenated space guarantees the box text is separated
if not (is_mini or is_plain) then
div
:tag('span')
:addClass(cfg.classes.box_text)
:cssText(font_style)
:wikitext(box_text)
end
local template = args.template
local displayed_links = choose_links(template, args)
local has_brackets = args.brackets
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local list = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(list)
if is_collapsible then
local title_text_class
if is_mini then
title_text_class = cfg.classes.collapsible_title_mini
else
title_text_class = cfg.classes.collapsible_title_full
end
div:done()
:tag('div')
:addClass(title_text_class)
:cssText(font_style)
:wikitext(args[1])
end
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())
end
function p.navbar(frame)
return p._navbar(require('Module:Arguments').getArgs(frame))
end
return p
a5c8d3a8f8beb18984ea7f145ddbdf88a065d23e
Template:Infobox military unit/doc
10
272
653
2023-10-14T11:12:56Z
wikipedia>Paine Ellsworth
0
High-use template + fmt
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) -->
{{High-use}}
{{auto short description}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
== Usage ==
=== Military unit infobox ===
A military unit infobox may be used to summarize information about an individual military unit or formation, such as a regiment or division.
The infobox should be added using the {{tlx|Infobox military unit}} template, as shown below:
{{Parameter names example
| unit_name
| native_name
| image
| image_size
| alt
| caption
| dates = {{unbulleted list|{{{dates}}}|''or:'' {{{start_date}}}–{{{end_date}}}}}
| <!-- start_date -->
| <!-- end_date -->
| disbanded
| country = {{unbulleted list|{{{country}}}|''or:'' {{{countries}}}}}
| <!-- countries -->
| allegiance
| branch
| type
| role
| specialization
| size
| command_structure
| garrison
| <!-- garrison_label -->
| nickname
| patron
| motto
| colors
| <!-- colors_label -->
| march
| mascot
| anniversaries
| equipment
| <!-- equipment_label -->
| battles
| <!-- battles_label -->
| decorations
| battle_honours
| <!-- battle_honours_label -->
| flying_hours
| website
|
| current_commander
| commander1 = {{unbulleted list|{{{current_commander}}}|''or:'' {{{commander1}}}}}
| <!-- commander1_label -->
| <!-- current_commander_label -->
|
| ceremonial_chief
| commander2 = {{unbulleted list|{{{ceremonial_chief}}}|''or:'' {{{commander2}}}}}
| <!-- commander2_label -->
| <!-- ceremonial_chief_label -->
|
| commander3 = {{unbulleted list|{{{colonel_of_the_regiment}}}|''or:'' {{{commander3}}}}}
| <!-- commander3_label -->
| <!-- colonel_of_the_regiment_label -->
|
| commander4 = {{unbulleted list|{{{command_sergeant_major}}}|''or:'' {{{commander4}}}}}
| command_sergeant_major
| <!-- commander4_label -->
| <!-- command_sergeant_major_label -->
|
| commander5
| <!-- commander5_label -->
| commander6
| <!-- commander6_label -->
| commander7
| <!-- commander7_label -->
| commander8
| <!-- commander8_label -->
| commander9
| <!-- commander9_label -->
| notable_commanders
|
| identification_symbol
| <!-- identification_symbol_label -->
| identification_symbol_2
| <!-- identification_symbol_2_label -->
| identification_symbol_3
| <!-- identification_symbol_3_label -->
| identification_symbol_4
| <!-- identification_symbol_4_label -->
| identification_symbol_5
| <!-- identification_symbol_5_label -->
| identification_symbol_6
| <!-- identification_symbol_6_label -->
|
| aircraft_attack
| aircraft_bomber
| aircraft_electronic
| aircraft_fighter
| aircraft_helicopter
| aircraft_helicopter_attack
| aircraft_helicopter_cargo
| aircraft_helicopter_multirole
| aircraft_helicopter_observation
| aircraft_helicopter_trainer
| aircraft_helicopter_utility
| aircraft_interceptor
| aircraft_patrol
| aircraft_recon
| aircraft_trainer
| aircraft_transport
| aircraft_tanker
| aircraft_general
}}
<div style="width:400px;background:#dddddd;border: 1px solid black;"><syntaxhighlight lang="wikitext" style="overflow:auto; margin:0.5em">
{{Infobox military unit
| unit_name =
| native_name =
| image =
| image_size =
| alt =
| caption =
| dates = <!-- or | start_date = | end_date = -->
| disbanded =
| country = <!-- or | countries = -->
| allegiance =
| branch =
| type =
| role = <!-- or | specialization = -->
| size =
| command_structure =
| garrison =
| garrison_label =
| nickname =
| patron =
| motto =
| colors = <!-- or | colours = -->
| colors_label = <!-- or | colours_label = -->
| march =
| mascot =
| anniversaries =
| equipment =
| equipment_label =
| battles =
| battles_label =
| decorations =
| battle_honours =
| battle_honours_label =
| flying_hours =
| website =
<!-- Commanders -->
| current_commander =
| commander1 =
| commander1_label =
| commander2 =
| commander2_label =
| commander3 =
| commander3_label =
| commander4 =
| commander4_label =
| commander5 =
| commander5_label =
| commander6 =
| commander6_label =
| commander7 =
| commander7_label =
| commander8 =
| commander8_label =
| commander9 =
| commander9_label =
| notable_commanders =
<!-- Insignia -->
| identification_symbol =
| identification_symbol_label =
| identification_symbol_2 =
| identification_symbol_2_label =
| identification_symbol_3 =
| identification_symbol_3_label =
| identification_symbol_4 =
| identification_symbol_4_label =
| identification_symbol_5 =
| identification_symbol_5_label =
| identification_symbol_6 =
| identification_symbol_6_label =
<!-- Aircraft -->
| aircraft_attack =
| aircraft_bomber =
| aircraft_electronic =
| aircraft_fighter =
| aircraft_helicopter =
| aircraft_helicopter_attack =
| aircraft_helicopter_cargo =
| aircraft_helicopter_multirole =
| aircraft_helicopter_observation =
| aircraft_helicopter_trainer =
| aircraft_helicopter_utility =
| aircraft_interceptor =
| aircraft_patrol =
| aircraft_recon =
| aircraft_trainer =
| aircraft_transport =
| aircraft_tanker =
| aircraft_general =
}}
</syntaxhighlight></div>
{{clear}}
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
* '''unit_name''' – The formal name of the unit in English.
* '''native_name''' – ''optional'' – The formal name of the unit in the local language, if different from '''unit_name''', and if not English. This will display under the unit_name.
* '''image''' – ''optional'' – An image of the unit insignia ([[cap badge]]s, [[tartan]] or [[Colours, standards and guidons|colours]]), if available; other images may be used if this cannot be obtained. The image should be given in the form <code>Example.jpg</code>.
* '''image_size''' – ''optional'' – Used to override the default image width of 200 pixels. It should be written as <code>200px</code>.
* '''alt''' – ''optional'' – Alternative text for visually impaired users, see [[WP:ALT]].
* '''caption''' – ''optional'' – The text to be placed below the image.
* '''dates''' – The period (usually in years) when the unit was active; alternately, the dates may be indicated by using one—or both—of the separate '''start_date''' and '''end_date''' parameters.
* '''country''' – ''optional'' – If the unit is part of the armed forces of a sovereign state, the name of that state.
* '''allegiance''' – ''optional'' – Used to indicate the allegiance of units which are not part of the regular armed forces of a sovereign state; can usually be omitted otherwise. In the case of National Guard or Naval Militia units, the State of origin should be indicated.
* '''branch''' – ''optional'' – The service branch, in militaries that have them; typically army, navy, air force, etc.
* '''type''' – ''optional'' – The general type of unit, e.g., cavalry, infantry, artillery, etc. More specific types (airborne infantry, light cavalry, etc.) may be given as appropriate.
* '''role''' – ''optional'' – Typical strategic or tactical use of unit, e.g., shock troop, special operations, mechanized infantry, ceremonial guard, etc.
* '''size''' – ''optional'' – The size of the unit; this may include both average and lifetime figures, and should indicate equipment (planes, tanks, cannon, etc.) where applicable. For U.S. units, this should only include Organic elements, not Assigned or Attached elements.
* '''command_structure''' – ''optional'' – The larger unit(s) of which the unit is a part. This should not be used to provide an exhaustive history of the unit, which is more appropriate in the article itself, for units existing over a long period. For complicated cases, using the [[#Command structure box|auxiliary command structure box]] may be appropriate.
* '''garrison''' – ''optional'' – Location of the unit's home base; this is generally applicable only to units in existence.
* '''garrison_label''' – ''optional'' – The label to use for the garrison field (above).
* '''nickname''' – ''optional'' – Any commonly-used nicknames for the unit.
* '''patron''' – ''optional'' – The patron the unit was named after; this is only applicable in armed forces where units are named after individuals.
* '''motto''' – ''optional'' – The official unit motto (with translation, if necessary).
* '''colors''' – ''optional'' – The unit colors; this may refer to either the actual colors used on the uniform, or to the [[Colours, standards and guidons|colours]] of the unit.
* '''colors_label''' – ''optional'' – the label to use for the colors field (above).
* '''march''' – ''optional'' – The tune(s) commonly or officially played when the unit ceremonially marches; there may be several.
* '''mascot''' – ''optional'' – Any official or unofficial animal or character maintained by the unit.
* '''equipment''' – ''optional'' – For units strongly associated with specific equipment or vehicles, such as tanks, artillery, or aircraft, a ''brief'' list of the notable types used by the unit; if the number of entries is large, it is recommended that this field not be used, and that the full list be given in the article text instead.
* '''equipment_label''' – ''optional'' – The label to use for the equipment field (above).
* '''battles''' – ''optional'' – Any notable engagements in which the unit participated. The decision of what constitutes a notable engagement is left to the editors of the specific article.
* '''battles_label''' – ''optional'' – The label to use for the battles field (above); this defaults to "Engagements" if left blank.
* '''anniversaries''' – ''optional'' – Any anniversaries that a unit celebrates.
* '''decorations''' – ''optional'' – Any decorations (such as the [[Presidential Unit Citation (United States)|Presidential Unit Citation]]) that the unit as a whole has received.
* '''battle_honours''' – ''optional'' – For units in countries that award some type of formal [[battle honour]]s, the battle honours that the unit has received; while this may have some overlap with the ''battles'' field above, the two are not necessarily equivalent.
* '''battle_honours_label''' – ''optional'' – The label to use for the battle_honours field (above); this defaults to "[[Battle honour]]s" if left blank.
* '''disbanded''' – ''optional'' – For units that have been disbanded, the dates and any other relevant notes regarding the disbanding.
* '''flying_hours''' – ''optional'' – If the formation is an aerial one, the total hours flown.
* '''website''' – ''optional'' – The official website of the formation, if any.
Commander parameters:
The infobox allows for up to three current commanders to be specified; the exact roles or titles of these individuals should be specified via the corresponding label parameters.
* '''commander1''' – ''optional'' – A current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander1_label''' – ''optional'' – The label to use for the field above; for historical reasons, this defaults to "Current commander" if left blank.
* '''commander2''' – ''optional'' – A second current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander2_label''' – ''optional'' – The label to use for the field above; for historical reasons, this defaults to "Ceremonial chief" if left blank.
* '''commander3''' – ''optional'' – A third current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander3_label''' – ''optional'' – The label to use for the field above; for historical reasons, this defaults to "Colonel of the Regiment" if left blank.
* '''commander4''' – ''optional'' – A fourth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander4_label''' – ''optional'' – The label to use for the field above; for historical reasons, this defaults to "Command Sergeant Major" if left blank.
* '''commander5''' – ''optional'' – A fifth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander5_label''' – ''optional'' – The label to use for the field above; defaults to "Commander".
* '''commander6''' – ''optional'' – A sixth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander6_label''' – ''optional'' – The label to use for the field above; defaults to "Commander".
* '''commander7''' – ''optional'' – A seventh current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander7_label''' – ''optional'' – The label to use for the field above; defaults to "Commander".
* '''commander8''' – ''optional'' – An eighth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander8_label''' – ''optional'' – The label to use for the field above; defaults to "Commander".
* '''commander9''' – ''optional'' – A ninth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander9_label''' – ''optional'' – The label to use for the field above; defaults to "Commander".
* '''notable_commanders''' – ''optional'' – Any notable former commanders of the unit; judgement of notability is left to individual article editors.
Insignia parameters:
* '''identification_symbol''' – ''optional'' – The unit's identification symbol (such as a [[tartan]], tactical identification patch or [[morale patch]]).
* '''identification_symbol_label''' – ''optional'' – The label to use for the identification symbol field (above).
* '''identification_symbol_2''' – ''optional'' – Another identification symbol.
* '''identification_symbol_2_label''' – ''optional'' – The label to use for the second identification symbol field (above).
* '''identification_symbol_3''' – ''optional'' – Another identification symbol.
* '''identification_symbol_3_label''' – ''optional'' – The label to use for the third identification symbol field (above).
* '''identification_symbol_4''' – ''optional'' – Another identification symbol.
* '''identification_symbol_4_label''' – ''optional'' – The label to use for the fourth identification symbol field (above).
* '''identification_symbol_5''' – ''optional'' – Another identification symbol.
* '''identification_symbol_5_label''' – ''optional'' – The label to use for the fifth identification symbol field (above).
* '''identification_symbol_6''' – ''optional'' – Another identification symbol.
* '''identification_symbol_6_label''' – ''optional'' – The label to use for the sixth identification symbol field (above).
Aircraft parameters:
* '''aircraft_attack''' – ''optional'' – For aviation units, the attack aircraft flown by the unit.
* '''aircraft_bomber''' – ''optional'' – For aviation units, the bomber aircraft flown by the unit.
* '''aircraft_electronic''' – ''optional'' – For aviation units, the electronic warfare aircraft flown by the unit.
* '''aircraft_fighter''' – ''optional'' – For aviation units, the fighter aircraft flown by the unit.
* '''aircraft_helicopter''' – ''optional'' – For aviation units, the helicopter aircraft flown by the unit.
* '''aircraft_helicopter_attack''' – ''optional'' – For aviation units, the attack helicopter aircraft flown by the unit.
* '''aircraft_helicopter_cargo''' – ''optional'' – For aviation units, the cargo helicopter aircraft flown by the unit.
* '''aircraft_helicopter_multirole''' – ''optional'' – For aviation units, the multirole helicopter aircraft flown by the unit.
* '''aircraft_helicopter_observation''' – ''optional'' – For aviation units, the observation helicopter aircraft flown by the unit.
* '''aircraft_helicopter_trainer''' – ''optional'' – For aviation units, the trainer helicopter aircraft flown by the unit.
* '''aircraft_helicopter_utility''' – ''optional'' – For aviation units, the utility helicopter aircraft flown by the unit.
* '''aircraft_interceptor''' – ''optional'' – For aviation units, the interceptor aircraft flown by the unit.
* '''aircraft_patrol''' – ''optional'' – For aviation units, the patrol aircraft flown by the unit.
* '''aircraft_recon''' – ''optional'' – For aviation units, the reconnaissance aircraft flown by the unit.
* '''aircraft_trainer''' – ''optional'' – For aviation units, the trainer aircraft flown by the unit.
* '''aircraft_transport''' – ''optional'' – For aviation units, the transport aircraft flown by the unit.
* '''aircraft_tanker''' – ''optional'' – For aviation units, the aerial refueling aircraft flown by the unit.
* '''aircraft_general''' – ''optional'' – For aviation units, where aircraft used do not fit well into the above categories.
Note that the various <code>xyz_label</code> fields above are intended for overriding the default labels on these fields as needed for particular countries or services; in most cases, however, the default value is sufficient, and the fields need not be included.
{{Command structure/doc|noheader=yes}}
{{Service record/doc|noheader=yes}}
== Example ==
{{Infobox military unit
| unit_name = 502nd Parachute Infantry Regiment
| image = 502 Parachute Infantry Regiment COA.PNG
| caption = 502d PIR Coat of Arms
| nickname = "Five-Oh-Deuce" or "The Deuce"
| motto = ''Strike''
| colors =
| march =
| ceremonial_chief =
| type = [[Parachute infantry]]
| branch = [[United States Army|Army]]
| dates = 1942–present
| country = United States
| allegiance =
| command_structure = [[101st Airborne Division]]
| size =
| specialization =
| current_commander =
| garrison = [[Fort Campbell]]
| garrison_label =
| battles = World War II
*[[Western Front (World War II)|European War]]
*[[Invasion of Normandy|Battle of Normandy]]
*[[Operation Market Garden]]
*[[Battle of the Bulge]]
[[War on Terrorism]]
*[[Iraq War]]
**[[Operation Iraqi Freedom]]
| notable_commanders = {{unbulleted list|[[George V. H. Moseley, Jr.]]|[[John H. Michaelis]]}}
| anniversaries =
| decorations = {{unbulleted list|[[Presidential Unit Citation (United States)|Presidential Unit Citation]] (5)|[[Valorous Unit Award]] (5)|[[Croix de Guerre]]}}
}}
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Infobox military unit
| unit_name = 502nd Parachute Infantry Regiment
| image = 502 Parachute Infantry Regiment COA.PNG
| caption = 502d PIR Coat of Arms
| nickname = "Five-Oh-Deuce" or "The Deuce"
| motto = ''Strike''
| colors =
| march =
| ceremonial_chief =
| type = [[Parachute infantry]]
| branch = [[United States Army|Army]]
| dates = 1942–present
| country = United States
| allegiance =
| command_structure = [[101st Airborne Division]]
| size =
| specialization =
| current_commander =
| garrison = [[Fort Campbell]]
| garrison_label =
| battles = World War II
*[[Western Front (World War II)|European War]]
*[[Invasion of Normandy|Battle of Normandy]]
*[[Operation Market Garden]]
*[[Battle of the Bulge]]
[[War on Terrorism]]
*[[Iraq War]]
**[[Operation Iraqi Freedom]]
| notable_commanders = {{unbulleted list|[[George V. H. Moseley, Jr.]]|[[John H. Michaelis]]}}
| anniversaries =
| decorations = {{unbulleted list|[[Presidential Unit Citation (United States)|Presidential Unit Citation]] (5)|[[Valorous Unit Award]] (5)|[[Croix de Guerre]]}}
}}
</syntaxhighlight>
{{clear}}
== Microformat ==
{{UF-hcard-org}}
== TemplateData ==
{{collapse top|[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": "A military unit infobox may be used to summarize information about an individual military unit or formation, such as a regiment or division.",
"format": "{{_\n| _____________________________ = _\n}}\n",
"params": {
"unit_name": {
"type": "line",
"required": true,
"label": "Unit Name",
"description": "The formal name of the unit."
},
"image": {
"type": "wiki-file-name",
"label": "Unit Insignia Image",
"description": "An image of the unit insignia (cap badges, tartan or colours), if available; other images may be used if this cannot be obtained. The image must be given in the form Example.jpg."
},
"image_size": {
"type": "string",
"label": "Image size",
"description": "Used to override the default image width of 200 pixels. It should be written as 200px."
},
"alt": {
"type": "string",
"label": "Alternative text for image",
"description": "Alternative text for visually impaired users, see WP:ALT."
},
"caption": {
"type": "string",
"label": "Caption",
"description": "The text to be placed below the image."
},
"dates": {
"type": "string",
"required": true,
"label": "Time Period Active",
"description": "The period (usually in years) when the unit was active; alternately, the dates may be indicated by using one—or both—of the separate Start Date and End Date parameters.",
"aliases": [
"start_date",
"end_date"
]
},
"country": {
"type": "string/line",
"label": "Country",
"description": "If the unit is part of the armed forces of a sovereign state, the name of that state."
},
"allegiance": {
"type": "string/line",
"label": "Allegiance",
"description": "Used to indicate the allegiance of units which are not part of the regular armed forces of a sovereign state; can usually be omitted otherwise. In the case of National Guard or Naval Militia units, the State of origin should be indicated."
},
"branch": {
"type": "string/line",
"label": "Branch",
"description": "The service branch, in militaries that have them; typically army, navy, air force, etc."
},
"type": {
"type": "string",
"label": "Type",
"description": "The general type of unit, e.g., cavalry, infantry, artillery, etc. More specific types (airborne infantry, light cavalry, etc.) may be given as appropriate."
},
"role": {
"type": "string",
"label": "Role",
"description": "Typical strategic or tactical use of unit, e.g., shock troop, special operations, mechanized infantry, ceremonial guard, etc.",
"aliases": [
"specialization"
]
},
"size": {
"type": "string",
"label": "Size",
"description": "The size of the unit; this may include both average and lifetime figures, and should indicate equipment (planes, tanks, cannon, etc.) where applicable. For U.S. units, this should only include Organic elements, not Assigned or Attached elements."
},
"command_structure": {
"type": "string",
"label": "Command Structure",
"description": "The larger unit(s) of which the unit is a part. This should not be used to provide an exhaustive history of the unit, which is more appropriate in the article itself, for units existing over a long period. For complicated cases, using the auxiliary command structure box may be appropriate."
},
"garrison": {
"type": "string/line",
"label": "Garrison",
"description": "Location of the unit's home base; this is generally applicable only to units in existence."
},
"garrison_label": {
"type": "line",
"label": "Garrison Label",
"description": "The label to use for the Garrison field."
},
"nickname": {
"type": "string",
"label": "Nickname(s)",
"description": "Any commonly-used nicknames for the unit."
},
"patron": {
"type": "line",
"label": "Patron",
"description": "The patron the unit was named after; this is only applicable in armed forces where units are named after individuals."
},
"motto": {
"type": "content",
"label": "Motto",
"description": "The official unit motto (with translation, if necessary)."
},
"colors": {
"type": "string",
"label": "Colors",
"description": "The unit colors; this may refer to either the actual colors used on the uniform, or to the colours of the unit.",
"aliases": [
"colours"
]
},
"colors_label": {
"type": "line",
"label": "Colors Label",
"description": "The label to use for the Colors field.",
"aliases": [
"colours_label"
]
},
"march": {
"type": "string",
"label": "March(es)",
"description": "The tune(s) commonly or officially played when the unit ceremonially marches; there may be several."
},
"mascot": {
"type": "string",
"label": "Mascot",
"description": "Any official or unofficial animal or character maintained by the unit."
},
"equipment": {
"type": "string",
"label": "Equipment",
"description": "For units strongly associated with specific equipment or vehicles, such as tanks, artillery, or aircraft, a brief list of the notable types used by the unit; if the number of entries is large, it is recommended that this field not be used, and that the full list be given in the article text instead."
},
"equipment_label": {
"type": "line",
"label": "Equipment Label",
"description": "The label to use for the Equipment field."
},
"battles": {
"type": "string",
"label": "Battles",
"description": "Any notable engagements in which the unit participated. The decision of what constitutes a notable engagement is left to the editors of the specific article."
},
"battles_label": {
"type": "line",
"label": "Battles Label",
"description": "The label to use for the Battles field; this defaults to \"Engagements\" if left blank."
},
"anniversaries": {
"type": "string",
"label": "Anniversaries",
"description": "Any anniversaries that a unit celebrates."
},
"decorations": {
"type": "string",
"label": "Decorations",
"description": "Any decorations (such as the Presidential Unit Citation) that the unit as a whole has received."
},
"battle_honours": {
"type": "string",
"label": "Battle Honours",
"description": "For units in countries that award some type of formal battle honours, the battle honours that the unit has received; while this may have some overlap with the battles field above, the two are not necessarily equivalent."
},
"battle_honours_label": {
"type": "line",
"label": "Battle Honours Label",
"description": "The label to use for the Battle Honours field; this defaults to \"Battle honours\" if left blank.",
"example": "Accolades"
},
"disbanded": {
"type": "date",
"label": "Disbanded Date",
"description": "For units that have been disbanded, the dates and any other relevant notes regarding the disbanding."
},
"flying_hours": {
"type": "line",
"label": "Flying Hours",
"description": "If the formation is an aerial one, the total hours flown."
},
"website": {
"type": "url",
"label": "Website",
"description": "The official website of the formation, if any."
},
"commander1": {
"type": "string",
"label": "Commander 1",
"description": "A current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.",
"aliases": [
"current_commander"
]
},
"commander1_label": {
"type": "line",
"label": "Commander 1 Label",
"description": "The label to use for the Commander 1 field; for historical reasons, this defaults to \"Current commander\" if left blank.",
"default": "Current commander",
"aliases": [
"current_commander_label"
]
},
"commander2": {
"type": "string",
"label": "Commander 2",
"description": "A current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.",
"aliases": [
"ceremonial_chief"
]
},
"commander2_label": {
"type": "line",
"label": "Commander 2 Label",
"description": "The label to use for the Commander 2 field; for historical reasons, this defaults to \"Ceremonial chief\" if left blank.",
"default": "Ceremonial chief",
"aliases": [
"ceremonial_chief_label"
]
},
"commander3": {
"type": "string",
"label": "Commander 3",
"description": "A third current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.",
"aliases": [
"colonel_of_the_regiment"
]
},
"commander3_label": {
"type": "line",
"label": "Commander 3 Label",
"description": "The label to use for the Commander 3 field; for historical reasons, this defaults to \"Colonel of the Regiment\" if left blank.",
"default": "Colonel of the Regiment",
"aliases": [
"colonel_of_the_regiment_label"
]
},
"commander4": {
"type": "string",
"label": "Commander 4",
"description": "A fourth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.",
"aliases": [
"command_sergeant_major"
]
},
"commander4_label": {
"type": "line",
"label": "Commander 4 Label",
"description": "The label to use for the Commander 4 field; for historical reasons, this defaults to \"Command Sergeant Major\" if left blank.",
"default": "Command Sergeant Major",
"aliases": [
"command_sergeant_major_label"
]
},
"commander5": {
"type": "string",
"label": "Commander 5",
"description": "A fifth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader."
},
"commander5_label": {
"type": "line",
"label": "Commander 5 Label",
"description": "The label to use for the Commander 5 field",
"default": "Commander"
},
"commander6": {
"type": "string",
"label": "Commander 6",
"description": "A sixth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader."
},
"commander6_label": {
"type": "line",
"label": "Commander 6 Label",
"description": "The label to use for the Commander 6 field",
"default": "Commander"
},
"commander7": {
"type": "string",
"label": "Commander 7",
"description": "A seventh current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader."
},
"commander7_label": {
"type": "line",
"label": "Commander 7 Label",
"description": "The label to use for the Commander 7 field",
"default": "Commander"
},
"commander8": {
"type": "string",
"label": "Commander 8",
"description": "A eighth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader."
},
"commander8_label": {
"type": "line",
"label": "Commander 8 Label",
"description": "The label to use for the Commander 8 field",
"default": "Commander"
},
"commander9": {
"type": "string",
"label": "Commander 9",
"description": "A ninth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader."
},
"commander9_label": {
"type": "line",
"label": "Commander 9 Label",
"description": "The label to use for the Commander 9 field",
"default": "Commander"
},
"notable_commanders": {
"type": "string",
"label": "Notable Commanders",
"description": "Any notable former commanders of the unit; judgement of notability is left to individual article editors."
},
"identification_symbol": {
"type": "string",
"label": "Identification Symbol",
"description": "The unit's identification symbol (such as a patch, tartan, or tactical identification flash). Use [[File:Example.jpg|200px]] format."
},
"identification_symbol_label": {
"type": "line",
"label": "Identification Symbol Label",
"description": "The label to use for the Identification Symbol field."
},
"identification_symbol_2": {
"type": "string",
"label": "Identification Symbol 2",
"description": "Another identification symbol. Use [[File:Example.jpg|200px]] format."
},
"identification_symbol_3": {
"type": "string",
"label": "Identification Symbol 3",
"description": "Another identification symbol. Use [[File:Example.jpg|200px]] format."
},
"identification_symbol_4": {
"type": "string",
"label": "Identification Symbol 4",
"description": "Another identification symbol. Use [[File:Example.jpg|200px]] format."
},
"identification_symbol_2_label": {
"type": "line",
"label": "Identification Symbol 2 Label",
"description": "The label to use for the Identification Symbol 2 field."
},
"identification_symbol_3_label": {
"type": "line",
"label": "Identification Symbol 3 Label",
"description": "The label to use for the Identification Symbol 3 field."
},
"identification_symbol_4_label": {
"type": "line",
"label": "Identification Symbol 4 Label",
"description": "The label to use for the Identification Symbol 4 field."
},
"aircraft_attack": {
"type": "string",
"label": "Attack Aircraft",
"description": "For aviation units, the attack aircraft flown by the unit."
},
"aircraft_bomber": {
"type": "string",
"label": "Bomber Aircraft",
"description": "For aviation units, the bomber aircraft flown by the unit."
},
"aircraft_electronic": {
"type": "string",
"label": "Electronic Warfare Aircraft",
"description": "For aviation units, the electronic warfare aircraft flown by the unit."
},
"aircraft_fighter": {
"type": "string",
"label": "Fighter Aircraft",
"description": "For aviation units, the fighter aircraft flown by the unit."
},
"aircraft_helicopter": {
"type": "string",
"label": "Helicopter Aircraft",
"description": "For aviation units, the helicopter aircraft flown by the unit."
},
"aircraft_helicopter_attack": {
"type": "string",
"label": "Attack Helicopter Aircraft",
"description": "For aviation units, the attack helicopter aircraft flown by the unit."
},
"aircraft_helicopter_cargo": {
"type": "string",
"label": "Cargo Helicopter Aircraft",
"description": "For aviation units, the cargo helicopter aircraft flown by the unit."
},
"aircraft_helicopter_multirole": {
"type": "string",
"label": "Multirole Helicopter Aircraft",
"description": "For aviation units, the multirole helicopter aircraft flown by the unit."
},
"aircraft_helicopter_observation": {
"type": "string",
"label": "Observation Helicopter Aircraft",
"description": "For aviation units, the observation helicopter aircraft flown by the unit."
},
"aircraft_helicopter_trainer": {
"type": "string",
"label": "Trainer Helicopter Aircraft",
"description": "For aviation units, the trainer helicopter aircraft flown by the unit."
},
"aircraft_helicopter_utility": {
"type": "string",
"label": "Utility Helicopter Aircraft",
"description": "For aviation units, the utility helicopter aircraft flown by the unit."
},
"aircraft_interceptor": {
"type": "string",
"label": "Interceptor Aircraft",
"description": "For aviation units, the interceptor aircraft flown by the unit."
},
"aircraft_patrol": {
"type": "string",
"label": "Patrol Aircraft",
"description": "For aviation units, the patrol aircraft flown by the unit."
},
"aircraft_recon": {
"type": "string",
"label": "Recon Aircraft",
"description": "For aviation units, the reconnaissance aircraft flown by the unit."
},
"aircraft_trainer": {
"type": "string",
"label": "Trainer Aircraft",
"description": "For aviation units, the trainer aircraft flown by the unit."
},
"aircraft_transport": {
"type": "string",
"label": "Transport Aircraft",
"description": "For aviation units, the transport aircraft flown by the unit."
},
"aircraft_tanker": {
"type": "string",
"label": "Tanker Aircraft",
"description": "For aviation units, the aerial refueling aircraft flown by the unit."
},
"aircraft_general": {
"type": "string",
"description": "For aviation units, where aircraft used do not fit well into the above categories.",
"label": "Other aircraft"
},
"countries": {
"label": "Countries drawn from",
"description": "For multinational forces, the countries the unit is drawn from. {{Flag|<country>}} format is preferred.",
"type": "string"
},
"native_name": {},
"identification_symbol_5": {},
"identification_symbol_5_label": {},
"identification_symbol_6": {},
"identification_symbol_6_label": {}
},
"paramOrder": [
"unit_name",
"native_name",
"image",
"image_size",
"alt",
"caption",
"dates",
"disbanded",
"country",
"countries",
"allegiance",
"branch",
"type",
"role",
"size",
"command_structure",
"garrison",
"garrison_label",
"nickname",
"patron",
"motto",
"colors",
"colors_label",
"march",
"mascot",
"anniversaries",
"equipment",
"equipment_label",
"battles",
"battles_label",
"decorations",
"battle_honours",
"battle_honours_label",
"flying_hours",
"website",
"commander1",
"commander1_label",
"commander2",
"commander2_label",
"commander3",
"commander3_label",
"commander4",
"commander4_label",
"commander5",
"commander5_label",
"commander6",
"commander6_label",
"commander7",
"commander7_label",
"commander8",
"commander8_label",
"commander9",
"commander9_label",
"notable_commanders",
"identification_symbol",
"identification_symbol_label",
"identification_symbol_2",
"identification_symbol_3",
"identification_symbol_4",
"identification_symbol_2_label",
"identification_symbol_3_label",
"identification_symbol_4_label",
"identification_symbol_5",
"identification_symbol_5_label",
"identification_symbol_6",
"identification_symbol_6_label",
"aircraft_attack",
"aircraft_bomber",
"aircraft_electronic",
"aircraft_fighter",
"aircraft_helicopter",
"aircraft_helicopter_attack",
"aircraft_helicopter_cargo",
"aircraft_helicopter_multirole",
"aircraft_helicopter_observation",
"aircraft_helicopter_trainer",
"aircraft_helicopter_utility",
"aircraft_interceptor",
"aircraft_patrol",
"aircraft_recon",
"aircraft_trainer",
"aircraft_transport",
"aircraft_tanker",
"aircraft_general"
]
}
</templatedata>
{{collapse bottom}}
==Tracking cats==
* {{Category link with count|Pages using infobox military unit with unknown parameters}}
<noinclude>
[[Category:WikiProject Military history template instructions|Military unit infobox]]
</noinclude><includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Military infobox templates|Unit]]
}}</includeonly>
7f319f83305114b5b97fbd23643d5593dbc4ad3f
Module:Transclusion count/data/D
828
110
315
2023-10-15T05:09:05Z
wikipedia>Ahechtbot
0
[[Wikipedia:BOT|Bot]]: Updated page.
Scribunto
text/plain
return {
["D&D"] = 3900,
["D&D_to-do"] = 5600,
["D-da"] = 2600,
["DANFS"] = 8400,
["DC-Comics-trademark-copyright"] = 2100,
["DCS_Sri_Lanka"] = 2100,
["DDR"] = 2800,
["DEC"] = 8700,
["DECADE"] = 283000,
["DEN"] = 6800,
["DEU"] = 17000,
["DMC"] = 60000,
["DMCA"] = 2360000,
["DNB"] = 8800,
["DNB-Portal"] = 2100,
["DNB_portal"] = 3800,
["DNK"] = 7800,
["DNZB"] = 3600,
["DOM"] = 2100,
["DOWs"] = 2700,
["DRV_links"] = 3600,
["DWT"] = 2300,
["DYKC"] = 6700,
["DYKF"] = 2100,
["DYK_blue"] = 3400,
["DYK_checklist"] = 14000,
["DYK_conditions"] = 67000,
["DYK_files"] = 2100,
["DYK_header"] = 35000,
["DYK_nompage_links"] = 79000,
["DYK_talk"] = 103000,
["DYK_talk/date"] = 103000,
["DYK_tools"] = 52000,
["DYK_tools/styles.css"] = 52000,
["DYKfile"] = 12000,
["DZA"] = 2800,
["Dab"] = 18000,
["Dagger"] = 18000,
["Dark_red"] = 2000,
["Dashboard.wikiedu.org_assignment"] = 15000,
["Dashboard.wikiedu.org_bibliography/guide"] = 7100,
["Dashboard.wikiedu.org_course_header"] = 6200,
["Dashboard.wikiedu.org_course_header/edit-note"] = 6200,
["Dashboard.wikiedu.org_draft_template/about_this_sandbox"] = 11000,
["Dashboard.wikiedu.org_evaluate_article/guide"] = 8500,
["Dashboard.wikiedu.org_peer_review/guide"] = 12000,
["Dashboard.wikiedu.org_sandbox"] = 97000,
["Dashboard.wikiedu.org_student_editor"] = 85000,
["Dashboard.wikiedu.org_student_program_sandbox"] = 96000,
["Dashboard.wikiedu.org_talk_course_link"] = 86000,
["Dashboard.wikiedu.org_user_talk"] = 2200,
["Date"] = 43000,
["Date-mf"] = 39000,
["Date_table_sorting"] = 39000,
["Dated_maintenance_category"] = 2410000,
["Dated_maintenance_category_(articles)"] = 2360000,
["Dated_maintenance_category_by_type_(articles)"] = 22000,
["Davis_Cup_player"] = 2500,
["Day+1"] = 6900,
["Day-1"] = 8300,
["Dbox"] = 3000,
["Dda"] = 5200,
["Dead_YouTube_link"] = 2700,
["Dead_Youtube_links"] = 2200,
["Dead_link"] = 288000,
["Deadlink"] = 3100,
["Death-date"] = 11000,
["Death-date_and_age"] = 10000,
["Death_date"] = 9200,
["Death_date_and_age"] = 390000,
["Death_date_and_given_age"] = 2800,
["Death_date_text"] = 11000,
["Death_year_and_age"] = 16000,
["Death_year_category_header"] = 2000,
["Decade"] = 2100,
["Decade_link"] = 32000,
["Decimals"] = 3100,
["Decline"] = 2500,
["Declined"] = 3200,
["Decrease"] = 35000,
["Define"] = 4400,
["Deg2DMS"] = 3400,
["Deletion_review_log_header"] = 5700,
["Deletion_review_log_header/Core"] = 5700,
["Delink"] = 1990000,
["Delink_question_hyphen-minus"] = 295000,
["Delrevxfd"] = 3600,
["Democratic_Party_(US)/meta/shading"] = 15000,
["Description_missing"] = 7000,
["Designation/abbreviation"] = 8300,
["Designation/color"] = 76000,
["Designation/colour"] = 79000,
["Designation/colour2"] = 18000,
["Designation/divbox"] = 30000,
["Designation/text"] = 42000,
["Designation_list"] = 5500,
["Details"] = 4500,
["DetailsLink"] = 5900,
["Detect_singular"] = 202000,
["Deutsche_Bahn_station_codes"] = 2200,
["DfE_performance_tables"] = 4500,
["Diff"] = 31000,
["Diff2"] = 12000,
["Digits"] = 22000,
["Directories_box"] = 3200,
["Disamb"] = 2200,
["Disambig"] = 63000,
["Disambig-Class"] = 12000,
["DisambigProj"] = 12000,
["DisambigProject"] = 150000,
["Disambigproject"] = 5800,
["Disambiguation"] = 219000,
["Disambiguation/cat"] = 218000,
["Disambiguation_page_short_description"] = 354000,
["Discogs_artist"] = 17000,
["Discogs_master"] = 12000,
["Discogs_release"] = 3100,
["Discussion_bottom"] = 12000,
["Discussion_top"] = 13000,
["DisestcatCountry"] = 9500,
["DisestcatCountry/core"] = 9500,
["DisestcatCountryDecade"] = 2600,
["DisestcatUSstate"] = 4900,
["DisestcatUSstate/core"] = 4900,
["Disputed"] = 2200,
["Distinguish"] = 98000,
["Disused_Rail_Start"] = 3900,
["Disused_rail_start"] = 4300,
["Disused_style"] = 4700,
["Div_col"] = 400000,
["Div_col/styles.css"] = 402000,
["Div_col_end"] = 302000,
["Div_end"] = 2700,
["Divbox"] = 349000,
["Divbox/styles.css"] = 372000,
["Dividing_line"] = 4000,
["Dmbox"] = 462000,
["Dmbox/styles.css"] = 462000,
["Do_not_move_to_Commons"] = 16000,
["Doc"] = 3600,
["Documentation"] = 121000,
["Documentation_subpage"] = 95000,
["Dog_opentask"] = 3500,
["Doi"] = 26000,
["Doing"] = 3600,
["Don't_edit_this_line"] = 108000,
["Don't_edit_this_line_always_display"] = 481000,
["Don't_edit_this_line_extinct"] = 481000,
["Don't_edit_this_line_link_target"] = 481000,
["Don't_edit_this_line_link_text"] = 481000,
["Don't_edit_this_line_parent"] = 481000,
["Don't_edit_this_line_rank"] = 481000,
["Don't_edit_this_line_refs"] = 108000,
["Don't_edit_this_line_same_as"] = 481000,
["Done"] = 103000,
["Doppelganger"] = 2800,
["Double+single"] = 2900,
["Double-dagger"] = 20000,
["Dr"] = 3400,
["Dr-logno"] = 3400,
["Dr-make"] = 3500,
["Dr-yr"] = 3400,
["Draft"] = 4300,
["Draft_article"] = 6400,
["Draft_article_check"] = 6500,
["Draft_categories"] = 8400,
["Draft_other"] = 111000,
["Draft_topics"] = 24000,
["Drafts_moved_from_mainspace"] = 8700,
["Draw"] = 3900,
["Draw_key"] = 18000,
["Draw_links"] = 13000,
["Drep"] = 3500,
["DriverDB_driver"] = 2200,
["Drugbankcite"] = 4300,
["Drugbox"] = 7600,
["Drugs.com"] = 3800,
["Ds/talk_notice"] = 6400,
["Dts"] = 38000,
["Dubious"] = 8200,
["Duck"] = 2900,
["Dummytab"] = 5000,
["Duration"] = 38000,
["Dutch_municipality"] = 2700,
["Dyktalk"] = 42000,
["Dynamic_list"] = 10000,
["Module:DYK_checklist"] = 14000,
["Module:DYK_checklist/data"] = 14000,
["Module:DYK_nompage_links"] = 79000,
["Module:Data"] = 149000,
["Module:Date"] = 1380000,
["Module:DateI18n"] = 66000,
["Module:Date_table_sorting"] = 39000,
["Module:DecodeEncode"] = 117000,
["Module:Delink"] = 2090000,
["Module:Detect_singular"] = 1530000,
["Module:Disambiguation"] = 15900000,
["Module:Disambiguation/templates"] = 15800000,
["Module:Distinguish"] = 98000,
["Module:Documentation"] = 168000,
["Module:Documentation/config"] = 168000,
["Module:Documentation/styles.css"] = 167000,
["Module:Draft_topics"] = 24000,
["Module:Duration"] = 239000,
}
ac0a990e962d53ead1be53dc1d121ce12083c33a
Module:Transclusion count/data/I
828
86
263
2023-10-15T05:09:55Z
wikipedia>Ahechtbot
0
[[Wikipedia:BOT|Bot]]: Updated page.
Scribunto
text/plain
return {
["IAAF_name"] = 2100,
["IAST"] = 6400,
["IBDB_name"] = 9100,
["ICD10"] = 4700,
["ICD9"] = 4400,
["ICS"] = 2900,
["IDN"] = 3400,
["IMDb_episode"] = 10000,
["IMDb_episodes"] = 2700,
["IMDb_name"] = 154000,
["IMDb_title"] = 190000,
["IMO_Number"] = 4100,
["IMSLP"] = 8300,
["INA"] = 2200,
["IND"] = 7700,
["INR"] = 6600,
["INRConvert"] = 5700,
["INRConvert/CurrentRate"] = 5600,
["INRConvert/USD"] = 5600,
["INRConvert/out"] = 5600,
["IOC_profile"] = 5100,
["IP"] = 2600,
["IPA"] = 143000,
["IPA-de"] = 8100,
["IPA-es"] = 7900,
["IPA-fr"] = 44000,
["IPA-it"] = 6000,
["IPA-nl"] = 3900,
["IPA-pl"] = 4100,
["IPA-pt"] = 3300,
["IPA-ru"] = 2700,
["IPA-sl"] = 6900,
["IPA-th"] = 3000,
["IPA_audio_link"] = 3500,
["IPA_link"] = 3500,
["IPAc-cmn"] = 2300,
["IPAc-en"] = 48000,
["IPAc-pl"] = 51000,
["IPC_athlete"] = 2800,
["IPSummary"] = 78000,
["IP_summary"] = 79000,
["IPtalk"] = 18000,
["IPuser"] = 7100,
["IPvandal"] = 2900,
["IRC"] = 7300,
["IRI"] = 2300,
["IRL"] = 5500,
["IRN"] = 3600,
["ISBN"] = 462000,
["ISBN?"] = 2100,
["ISBNT"] = 39000,
["ISBN_missing"] = 2600,
["ISFDB_name"] = 4100,
["ISFDB_title"] = 4600,
["ISL"] = 2100,
["ISO_15924/script-example-character"] = 2800,
["ISO_15924/wp-article"] = 2800,
["ISO_15924/wp-article/format"] = 2800,
["ISO_15924/wp-article/label"] = 2700,
["ISO_3166_code"] = 520000,
["ISO_3166_name"] = 16000,
["ISO_639_name"] = 8100,
["ISP"] = 5300,
["ISR"] = 4900,
["ISSN"] = 12000,
["ISSN_link"] = 30000,
["ISTAT"] = 8100,
["ISU_figure_skater"] = 2500,
["ITA"] = 17000,
["ITF"] = 6300,
["ITF_profile"] = 9100,
["ITIS"] = 4400,
["ITN_talk"] = 10000,
["ITN_talk/date"] = 10000,
["IUCN_banner"] = 15000,
["I_sup"] = 4600,
["Iaaf_name"] = 7200,
["Ice_hockey"] = 19000,
["Ice_hockey_stats"] = 19000,
["Icehockeystats"] = 12000,
["Icon"] = 582000,
["If"] = 275000,
["If_all"] = 6400,
["If_between"] = 3800,
["If_both"] = 155000,
["If_empty"] = 3670000,
["If_first_display_both"] = 73000,
["If_in_page"] = 10000,
["If_last_display_both"] = 30000,
["If_preview"] = 58000,
["If_then_show"] = 291000,
["Ifempty"] = 4000,
["Ifeq"] = 17000,
["Iferror_then_show"] = 3300,
["Ifexist_not_redirect"] = 1300000,
["Ifnotempty"] = 14000,
["Ifnumber"] = 36000,
["Ifsubst"] = 448000,
["Ih"] = 7500,
["Ill"] = 118000,
["Illm"] = 6700,
["Image_frame"] = 4900,
["Image_label"] = 4500,
["Image_label_begin"] = 3900,
["Image_label_end"] = 3800,
["Image_label_small"] = 2600,
["Image_needed"] = 4500,
["Image_other"] = 272000,
["Image_requested"] = 168000,
["Image_requested/Category_helper"] = 159000,
["Imbox"] = 919000,
["Imdb_name"] = 5300,
["Imdb_title"] = 4000,
["Import_style"] = 11000,
["Import_style/inputbox.css"] = 11000,
["Importance"] = 5650000,
["Importance/colour"] = 5660000,
["Importance_mask"] = 10400000,
["Improve_categories"] = 7100,
["Improve_documentation"] = 2500,
["In_class"] = 5900,
["In_lang"] = 357000,
["In_progress"] = 3200,
["In_string"] = 75000,
["In_title"] = 19000,
["Inactive_WikiProject_banner"] = 200000,
["Inactive_userpage_blanked"] = 4900,
["Include-USGov"] = 29000,
["Incomplete_list"] = 23000,
["Inconclusive"] = 2100,
["Increase"] = 43000,
["Incumbent_pope"] = 4300,
["Indent"] = 4400,
["IndexFungorum"] = 2200,
["Indian_English"] = 4300,
["Indian_Rupee"] = 10000,
["Indian_railway_code"] = 3200,
["Inflation"] = 21000,
["Inflation-fn"] = 5400,
["Inflation-year"] = 4500,
["Inflation/IN/startyear"] = 5600,
["Inflation/UK"] = 4400,
["Inflation/UK/dataset"] = 4400,
["Inflation/UK/startyear"] = 4400,
["Inflation/US"] = 12000,
["Inflation/US-GDP"] = 2400,
["Inflation/US-GDP/dataset"] = 2400,
["Inflation/US-GDP/startyear"] = 2400,
["Inflation/US/dataset"] = 12000,
["Inflation/US/startyear"] = 12000,
["Inflation/fn"] = 6200,
["Inflation/year"] = 25000,
["Info"] = 7300,
["Infobox"] = 3240000,
["Infobox/Columns"] = 2400,
["Infobox/mobileviewfix.css"] = 147000,
["Infobox3cols"] = 17000,
["Infobox_AFL_biography"] = 14000,
["Infobox_Aircraft_Begin"] = 5300,
["Infobox_Aircraft_Type"] = 4700,
["Infobox_Athletics_Championships"] = 2700,
["Infobox_Australian_place"] = 15000,
["Infobox_CFL_biography"] = 2200,
["Infobox_COA_wide"] = 3200,
["Infobox_Canada_electoral_district"] = 2500,
["Infobox_Canadian_Football_League_biography"] = 5700,
["Infobox_Canadian_Football_League_biography/position"] = 5700,
["Infobox_Chinese"] = 20000,
["Infobox_Chinese/Chinese"] = 2700,
["Infobox_Chinese/Footer"] = 8700,
["Infobox_Chinese/Header"] = 8700,
["Infobox_Chinese/Korean"] = 17000,
["Infobox_Christian_leader"] = 18000,
["Infobox_French_commune"] = 38000,
["Infobox_GAA_player"] = 2700,
["Infobox_Gaelic_games_player"] = 5000,
["Infobox_German_location"] = 13000,
["Infobox_German_place"] = 14000,
["Infobox_Grand_Prix_race_report"] = 2000,
["Infobox_Greece_place"] = 2800,
["Infobox_Greek_Dimos"] = 2800,
["Infobox_Hindu_temple"] = 2400,
["Infobox_Indian_constituency"] = 4700,
["Infobox_Indian_constituency/defaultdata"] = 4700,
["Infobox_Italian_comune"] = 8100,
["Infobox_Korean_name"] = 15000,
["Infobox_Korean_name/categories"] = 15000,
["Infobox_MLB_yearly"] = 3100,
["Infobox_NASCAR_race_report"] = 2200,
["Infobox_NCAA_team_season"] = 17000,
["Infobox_NFL_biography"] = 28000,
["Infobox_NFL_player"] = 7600,
["Infobox_NFL_team_season"] = 3900,
["Infobox_NRHP"] = 72000,
["Infobox_NRHP/conv"] = 18000,
["Infobox_NRHP/locmapin2region"] = 66000,
["Infobox_Officeholder"] = 4800,
["Infobox_Olympic_event"] = 7300,
["Infobox_Olympic_event/games_text"] = 7300,
["Infobox_Paralympic_event"] = 2600,
["Infobox_Paralympic_event/games_text"] = 2600,
["Infobox_Politician"] = 2200,
["Infobox_Romanian_subdivision"] = 3200,
["Infobox_Russian_district"] = 2000,
["Infobox_Russian_inhabited_locality"] = 4500,
["Infobox_SCOTUS_case"] = 3700,
["Infobox_Site_of_Special_Scientific_Interest"] = 2000,
["Infobox_Swiss_town"] = 2800,
["Infobox_Switzerland_municipality"] = 2900,
["Infobox_Turkey_place"] = 19000,
["Infobox_U.S._county"] = 3000,
["Infobox_U.S._county/district"] = 3000,
["Infobox_UK_constituency"] = 2100,
["Infobox_UK_constituency/year"] = 2100,
["Infobox_UK_legislation"] = 3300,
["Infobox_UK_place"] = 26000,
["Infobox_UK_place/NoDialCode"] = 8000,
["Infobox_UK_place/NoPostCode"] = 3200,
["Infobox_UK_place/area"] = 2400,
["Infobox_UK_place/dist"] = 2500,
["Infobox_UK_place/local"] = 26000,
["Infobox_UK_place/styles.css"] = 26000,
["Infobox_UN_resolution"] = 2300,
["Infobox_US_Supreme_Court_case"] = 3800,
["Infobox_US_Supreme_Court_case/courts"] = 3800,
["Infobox_Wikipedia_user"] = 9800,
["Infobox_YouTube_personality"] = 2700,
["Infobox_YouTube_personality/styles.css"] = 2700,
["Infobox_academic"] = 14000,
["Infobox_aircraft_begin"] = 14000,
["Infobox_aircraft_occurrence"] = 2300,
["Infobox_aircraft_type"] = 13000,
["Infobox_airline"] = 4600,
["Infobox_airport"] = 15000,
["Infobox_airport/datatable"] = 15000,
["Infobox_album"] = 162000,
["Infobox_album/color"] = 192000,
["Infobox_album/link"] = 162000,
["Infobox_anatomy"] = 4500,
["Infobox_ancient_site"] = 5400,
["Infobox_animanga/Footer"] = 6800,
["Infobox_animanga/Header"] = 6800,
["Infobox_animanga/Print"] = 5500,
["Infobox_animanga/Video"] = 4700,
["Infobox_architect"] = 3700,
["Infobox_artist"] = 29000,
["Infobox_artist_discography"] = 5900,
["Infobox_artwork"] = 11000,
["Infobox_athlete"] = 2800,
["Infobox_automobile"] = 8400,
["Infobox_award"] = 13000,
["Infobox_badminton_player"] = 3200,
["Infobox_baseball_biography"] = 28000,
["Infobox_baseball_biography/style"] = 28000,
["Infobox_baseball_biography/styles.css"] = 28000,
["Infobox_basketball_biography"] = 21000,
["Infobox_basketball_biography/style"] = 21000,
["Infobox_basketball_club"] = 3000,
["Infobox_beauty_pageant"] = 2400,
["Infobox_bilateral_relations"] = 4400,
["Infobox_body_of_water"] = 18000,
["Infobox_book"] = 52000,
["Infobox_boxer"] = 5700,
["Infobox_bridge"] = 6000,
["Infobox_building"] = 27000,
["Infobox_character"] = 7500,
["Infobox_chess_biography"] = 3900,
["Infobox_chess_player"] = 3200,
["Infobox_church"] = 15000,
["Infobox_church/denomination"] = 15000,
["Infobox_church/font_color"] = 15000,
["Infobox_civil_conflict"] = 2400,
["Infobox_civilian_attack"] = 5500,
["Infobox_college_coach"] = 12000,
["Infobox_college_football_game"] = 2100,
["Infobox_college_football_player"] = 2000,
["Infobox_college_sports_team_season"] = 40000,
["Infobox_college_sports_team_season/link"] = 40000,
["Infobox_college_sports_team_season/name"] = 40000,
["Infobox_college_sports_team_season/succession"] = 40000,
["Infobox_college_sports_team_season/team"] = 40000,
["Infobox_comic_book_title"] = 3000,
["Infobox_comics_character"] = 3600,
["Infobox_comics_creator"] = 3500,
["Infobox_comics_creator/styles.css"] = 3500,
["Infobox_company"] = 83000,
["Infobox_computing_device"] = 2400,
["Infobox_concert"] = 3300,
["Infobox_constituency"] = 5400,
["Infobox_country"] = 6400,
["Infobox_country/formernext"] = 6000,
["Infobox_country/imagetable"] = 5200,
["Infobox_country/multirow"] = 8300,
["Infobox_country/status_text"] = 2800,
["Infobox_country/styles.css"] = 6400,
["Infobox_country_at_games"] = 15000,
["Infobox_country_at_games/core"] = 15000,
["Infobox_country_at_games/see_also"] = 12000,
["Infobox_court_case"] = 4700,
["Infobox_court_case/images"] = 2400,
["Infobox_cricket_tournament"] = 2300,
["Infobox_cricketer"] = 32000,
["Infobox_cricketer/career"] = 32000,
["Infobox_cricketer/national_side"] = 7500,
["Infobox_criminal"] = 6400,
["Infobox_curler"] = 2600,
["Infobox_cycling_race_report"] = 4500,
["Infobox_cyclist"] = 16000,
["Infobox_dam"] = 5700,
["Infobox_designation_list"] = 20000,
["Infobox_designation_list/entry"] = 17000,
["Infobox_dim"] = 7000,
["Infobox_dim/core"] = 7000,
["Infobox_diocese"] = 3800,
["Infobox_drug"] = 9800,
["Infobox_drug/chemical_formula"] = 9800,
["Infobox_drug/data_page_link"] = 9800,
["Infobox_drug/formatATC"] = 9700,
["Infobox_drug/formatCASnumber"] = 9800,
["Infobox_drug/formatChEBI"] = 9800,
["Infobox_drug/formatChEMBL"] = 9800,
["Infobox_drug/formatChemDBNIAID"] = 9800,
["Infobox_drug/formatChemSpider"] = 9800,
["Infobox_drug/formatCompTox"] = 9800,
["Infobox_drug/formatDrugBank"] = 9800,
["Infobox_drug/formatIUPHARBPS"] = 9800,
["Infobox_drug/formatJmol"] = 9800,
["Infobox_drug/formatKEGG"] = 9800,
["Infobox_drug/formatPDBligand"] = 9100,
["Infobox_drug/formatPubChemCID"] = 9800,
["Infobox_drug/formatPubChemSID"] = 9800,
["Infobox_drug/formatUNII"] = 9800,
["Infobox_drug/legal_status"] = 10000,
["Infobox_drug/licence"] = 9800,
["Infobox_drug/maintenance_categories"] = 9800,
["Infobox_drug/non-ref-space"] = 4300,
["Infobox_drug/pregnancy_category"] = 9800,
["Infobox_drug/title"] = 9800,
["Infobox_election"] = 30000,
["Infobox_election/row"] = 30000,
["Infobox_election/shortname"] = 28000,
["Infobox_enzyme"] = 5100,
["Infobox_ethnic_group"] = 7300,
["Infobox_event"] = 5400,
["Infobox_family"] = 2100,
["Infobox_figure_skater"] = 4200,
["Infobox_film"] = 157000,
["Infobox_film/short_description"] = 153000,
["Infobox_film_awards"] = 2600,
["Infobox_film_awards/link"] = 2600,
["Infobox_film_awards/style"] = 2600,
["Infobox_food"] = 6900,
["Infobox_football_biography"] = 207000,
["Infobox_football_club"] = 27000,
["Infobox_football_club_season"] = 20000,
["Infobox_football_league"] = 2600,
["Infobox_football_league_season"] = 20000,
["Infobox_football_match"] = 5900,
["Infobox_football_tournament_season"] = 8000,
["Infobox_former_subdivision"] = 3300,
["Infobox_former_subdivision/styles.css"] = 3300,
["Infobox_galaxy"] = 2100,
["Infobox_game"] = 2600,
["Infobox_game_score"] = 3400,
["Infobox_gene"] = 13000,
["Infobox_given_name"] = 4100,
["Infobox_golfer"] = 4400,
["Infobox_golfer/highest_ranking"] = 4400,
["Infobox_government_agency"] = 10000,
["Infobox_government_cabinet"] = 2600,
["Infobox_gridiron_football_person"] = 2400,
["Infobox_gridiron_football_person/position"] = 5700,
["Infobox_gymnast"] = 3400,
["Infobox_handball_biography"] = 4900,
["Infobox_historic_site"] = 11000,
["Infobox_horseraces"] = 2600,
["Infobox_hospital"] = 6300,
["Infobox_hospital/care_system"] = 6300,
["Infobox_hospital/lists"] = 6300,
["Infobox_ice_hockey_biography"] = 20000,
["Infobox_ice_hockey_player"] = 19000,
["Infobox_ice_hockey_team"] = 3000,
["Infobox_ice_hockey_team_season"] = 2000,
["Infobox_international_football_competition"] = 5800,
["Infobox_islands"] = 8900,
["Infobox_islands/area"] = 9300,
["Infobox_islands/density"] = 9300,
["Infobox_islands/length"] = 8900,
["Infobox_islands/styles.css"] = 8900,
["Infobox_journal"] = 9700,
["Infobox_journal/Abbreviation_search"] = 9600,
["Infobox_journal/Bluebook_check"] = 9400,
["Infobox_journal/Former_check"] = 9400,
["Infobox_journal/ISO_4_check"] = 9400,
["Infobox_journal/ISSN-eISSN"] = 9500,
["Infobox_journal/Indexing_search"] = 9500,
["Infobox_journal/MathSciNet_check"] = 9400,
["Infobox_journal/NLM_check"] = 9400,
["Infobox_journal/frequency"] = 8600,
["Infobox_lake"] = 4200,
["Infobox_language"] = 9500,
["Infobox_language/family-color"] = 11000,
["Infobox_language/genetic"] = 6600,
["Infobox_language/linguistlist"] = 9500,
["Infobox_language/ref"] = 7100,
["Infobox_legislature"] = 3700,
["Infobox_library"] = 2200,
["Infobox_lighthouse"] = 2600,
["Infobox_lighthouse/light"] = 2600,
["Infobox_locomotive"] = 4900,
["Infobox_magazine"] = 7600,
["Infobox_manner_of_address"] = 3300,
["Infobox_mapframe"] = 81000,
["Infobox_martial_artist"] = 5700,
["Infobox_martial_artist/record"] = 5700,
["Infobox_medal_templates"] = 424000,
["Infobox_medical_condition"] = 10000,
["Infobox_medical_condition_(new)"] = 8200,
["Infobox_medical_details"] = 2000,
["Infobox_military_conflict"] = 22000,
["Infobox_military_installation"] = 9800,
["Infobox_military_person"] = 45000,
["Infobox_military_unit"] = 26000,
["Infobox_mine"] = 2100,
["Infobox_model"] = 2300,
["Infobox_monument"] = 2000,
["Infobox_mountain"] = 28000,
["Infobox_multi-sport_competition_event"] = 2400,
["Infobox_museum"] = 10000,
["Infobox_musical_artist"] = 121000,
["Infobox_musical_artist/color"] = 122000,
["Infobox_musical_artist/hCard_class"] = 313000,
["Infobox_musical_composition"] = 2900,
["Infobox_name"] = 7500,
["Infobox_name_module"] = 7000,
["Infobox_newspaper"] = 9700,
["Infobox_nobility"] = 2500,
["Infobox_noble"] = 7400,
["Infobox_officeholder"] = 220000,
["Infobox_officeholder/office"] = 225000,
["Infobox_official_post"] = 8100,
["Infobox_organization"] = 36000,
["Infobox_pageant_titleholder"] = 2900,
["Infobox_park"] = 7500,
["Infobox_person"] = 475000,
["Infobox_person/Wikidata"] = 4700,
["Infobox_person/height"] = 103000,
["Infobox_person/length"] = 7000,
["Infobox_person/weight"] = 66000,
["Infobox_philosopher"] = 3400,
["Infobox_planet"] = 4700,
["Infobox_play"] = 3900,
["Infobox_political_party"] = 14000,
["Infobox_power_station"] = 3000,
["Infobox_prepared_food"] = 3100,
["Infobox_professional_wrestler"] = 4300,
["Infobox_professional_wrestling_event"] = 2700,
["Infobox_protected_area"] = 14000,
["Infobox_protein_family"] = 2100,
["Infobox_publisher"] = 2400,
["Infobox_racehorse"] = 5500,
["Infobox_racing_driver"] = 3900,
["Infobox_racing_driver_series_section"] = 2000,
["Infobox_radio_station"] = 22000,
["Infobox_rail"] = 2900,
["Infobox_rail_line"] = 7300,
["Infobox_rail_service"] = 2900,
["Infobox_rail_service/doc"] = 2900,
["Infobox_reality_competition_season"] = 3500,
["Infobox_record_label"] = 4000,
["Infobox_recurring_event"] = 6400,
["Infobox_religious_biography"] = 5300,
["Infobox_religious_building"] = 12000,
["Infobox_religious_building/color"] = 17000,
["Infobox_restaurant"] = 2900,
["Infobox_river"] = 30000,
["Infobox_river/calcunit"] = 30000,
["Infobox_river/discharge"] = 30000,
["Infobox_river/row-style"] = 30000,
["Infobox_river/source"] = 30000,
["Infobox_road"] = 24000,
["Infobox_road/meta/mask/category"] = 24000,
["Infobox_road/meta/mask/country"] = 24000,
["Infobox_road/styles.css"] = 25000,
["Infobox_road_small"] = 2300,
["Infobox_rockunit"] = 6500,
["Infobox_royalty"] = 22000,
["Infobox_royalty/short_description"] = 12000,
["Infobox_rugby_biography"] = 16000,
["Infobox_rugby_biography/correct_date"] = 16000,
["Infobox_rugby_biography/depcheck"] = 16000,
["Infobox_rugby_league_biography"] = 9900,
["Infobox_rugby_league_biography/PLAYER"] = 9800,
["Infobox_rugby_team"] = 2600,
["Infobox_sailboat_specifications"] = 2300,
["Infobox_saint"] = 5000,
["Infobox_school"] = 38000,
["Infobox_school/short_description"] = 38000,
["Infobox_school_district"] = 5700,
["Infobox_school_district/styles.css"] = 5700,
["Infobox_scientist"] = 48000,
["Infobox_service_record"] = 2600,
["Infobox_settlement"] = 562000,
["Infobox_settlement/areadisp"] = 238000,
["Infobox_settlement/columns"] = 95000,
["Infobox_settlement/columns/styles.css"] = 95000,
["Infobox_settlement/densdisp"] = 437000,
["Infobox_settlement/impus"] = 82000,
["Infobox_settlement/lengthdisp"] = 169000,
["Infobox_settlement/link"] = 94000,
["Infobox_settlement/metric"] = 211000,
["Infobox_settlement/pref"] = 293000,
["Infobox_settlement/styles.css"] = 562000,
["Infobox_ship_begin"] = 41000,
["Infobox_ship_career"] = 37000,
["Infobox_ship_characteristics"] = 41000,
["Infobox_ship_class_overview"] = 4100,
["Infobox_ship_image"] = 40000,
["Infobox_shopping_mall"] = 3500,
["Infobox_short_story"] = 2400,
["Infobox_skier"] = 2500,
["Infobox_soap_character"] = 2900,
["Infobox_software"] = 14000,
["Infobox_software/simple"] = 14000,
["Infobox_song"] = 76000,
["Infobox_song/color"] = 76000,
["Infobox_song/link"] = 76000,
["Infobox_spaceflight"] = 3600,
["Infobox_spaceflight/styles.css"] = 3600,
["Infobox_sport_event"] = 2200,
["Infobox_sports_competition_event"] = 17000,
["Infobox_sports_competition_event/medalrow"] = 12000,
["Infobox_sports_league"] = 5000,
["Infobox_sports_season"] = 5400,
["Infobox_sports_team"] = 2200,
["Infobox_sportsperson"] = 106000,
["Infobox_stadium"] = 3500,
["Infobox_station"] = 55000,
["Infobox_station/doc"] = 55000,
["Infobox_station/services"] = 55000,
["Infobox_station/styles.css"] = 55000,
["Infobox_street"] = 3400,
["Infobox_swimmer"] = 9400,
["Infobox_television"] = 57000,
["Infobox_television/Short_description"] = 54000,
["Infobox_television_channel"] = 6200,
["Infobox_television_episode"] = 12000,
["Infobox_television_episode/styles.css"] = 12000,
["Infobox_television_season"] = 9500,
["Infobox_television_station"] = 3700,
["Infobox_tennis_biography"] = 10000,
["Infobox_tennis_event"] = 2500,
["Infobox_tennis_tournament_event"] = 19000,
["Infobox_tennis_tournament_year"] = 9200,
["Infobox_tennis_tournament_year/color"] = 28000,
["Infobox_tennis_tournament_year/footer"] = 28000,
["Infobox_train"] = 2300,
["Infobox_union"] = 2100,
["Infobox_university"] = 26000,
["Infobox_user"] = 2700,
["Infobox_venue"] = 18000,
["Infobox_video_game"] = 28000,
["Infobox_video_game/styles.css"] = 28000,
["Infobox_volleyball_biography"] = 5400,
["Infobox_weapon"] = 7300,
["Infobox_website"] = 7700,
["Infobox_writer"] = 39000,
["Information"] = 101000,
["Information/styles.css"] = 101000,
["Inline_block"] = 4600,
["Inprogress"] = 2400,
["Input_link"] = 32000,
["Instagram"] = 11000,
["Interlanguage_link"] = 156000,
["Interlanguage_link_multi"] = 19000,
["Internet_Archive_author"] = 19000,
["Internet_Archive_film"] = 2500,
["Intitle"] = 12000,
["Invalid_SVG"] = 3600,
["Invalid_SVG/styles.css"] = 3600,
["Iptalk"] = 17000,
["IranCensus2006"] = 46000,
["IranNCSGN"] = 3200,
["Iran_Census_2006"] = 46000,
["Irc"] = 2100,
["Irish_place_name"] = 2700,
["IsIPAddress"] = 38000,
["IsValidPageName"] = 142000,
["Is_country_in_Central_America"] = 13000,
["Is_country_in_the_Caribbean"] = 14000,
["Is_interwiki_link"] = 6100,
["Is_italic_taxon"] = 481000,
["Is_redirect"] = 27000,
["Isbn"] = 7600,
["Isfdb_name"] = 3700,
["Isfdb_title"] = 4400,
["Isnumeric"] = 212000,
["Iso2continent"] = 35000,
["Iso2country"] = 23000,
["Iso2country/article"] = 22000,
["Iso2country/data"] = 23000,
["Iso2nationality"] = 227000,
["Issubst"] = 72000,
["Isu_name"] = 2200,
["Italic_dab2"] = 5300,
["Italic_title"] = 284000,
["Italic_title_prefixed"] = 8700,
["Italics_colon"] = 3800,
["Italictitle"] = 4200,
["Ivm"] = 5700,
["Ivm/styles.css"] = 5700,
["Ivmbox"] = 123000,
["Ivory_messagebox"] = 143000,
["Module:I18n/complex_date"] = 66000,
["Module:IP"] = 131000,
["Module:IPA"] = 143000,
["Module:IPA/data"] = 128000,
["Module:IPA/styles.css"] = 114000,
["Module:IPA_symbol"] = 4800,
["Module:IPA_symbol/data"] = 4800,
["Module:IPAc-en"] = 48000,
["Module:IPAc-en/data"] = 48000,
["Module:IPAc-en/phonemes"] = 48000,
["Module:IPAc-en/pronunciation"] = 48000,
["Module:IPAddress"] = 188000,
["Module:ISO_3166"] = 1040000,
["Module:ISO_3166/data/AT"] = 2500,
["Module:ISO_3166/data/BA"] = 3400,
["Module:ISO_3166/data/CA"] = 2500,
["Module:ISO_3166/data/CN"] = 2100,
["Module:ISO_3166/data/DE"] = 14000,
["Module:ISO_3166/data/ES"] = 3600,
["Module:ISO_3166/data/FR"] = 38000,
["Module:ISO_3166/data/GB"] = 6400,
["Module:ISO_3166/data/GR"] = 3100,
["Module:ISO_3166/data/IN"] = 29000,
["Module:ISO_3166/data/IR"] = 8800,
["Module:ISO_3166/data/National"] = 1040000,
["Module:ISO_3166/data/PL"] = 6700,
["Module:ISO_3166/data/RS"] = 3200,
["Module:ISO_3166/data/RU"] = 25000,
["Module:ISO_3166/data/US"] = 85000,
["Module:ISO_639_name"] = 20000,
["Module:ISOdate"] = 66000,
["Module:Icon"] = 582000,
["Module:Icon/data"] = 582000,
["Module:If_empty"] = 3670000,
["Module:If_in_page"] = 10000,
["Module:If_preview"] = 296000,
["Module:If_preview/configuration"] = 296000,
["Module:If_preview/styles.css"] = 296000,
["Module:Import_style"] = 11000,
["Module:In_lang"] = 357000,
["Module:Indent"] = 4400,
["Module:Infobox"] = 4110000,
["Module:Infobox/dates"] = 69000,
["Module:Infobox/styles.css"] = 4370000,
["Module:Infobox3cols"] = 297000,
["Module:InfoboxImage"] = 4430000,
["Module:Infobox_body_of_water_tracking"] = 18000,
["Module:Infobox_cyclist_tracking"] = 16000,
["Module:Infobox_gene"] = 13000,
["Module:Infobox_mapframe"] = 406000,
["Module:Infobox_military_conflict"] = 22000,
["Module:Infobox_military_conflict/styles.css"] = 22000,
["Module:Infobox_multi-lingual_name"] = 20000,
["Module:Infobox_multi-lingual_name/data"] = 20000,
["Module:Infobox_power_station"] = 3100,
["Module:Infobox_road"] = 25000,
["Module:Infobox_road/browselinks"] = 25000,
["Module:Infobox_road/errors"] = 24000,
["Module:Infobox_road/length"] = 25000,
["Module:Infobox_road/locations"] = 24000,
["Module:Infobox_road/map"] = 25000,
["Module:Infobox_road/route"] = 25000,
["Module:Infobox_road/sections"] = 24000,
["Module:Infobox_television"] = 57000,
["Module:Infobox_television_disambiguation_check"] = 63000,
["Module:Infobox_television_episode"] = 12000,
["Module:Infobox_television_season_disambiguation_check"] = 9000,
["Module:Infobox_television_season_name"] = 9500,
["Module:Internet_Archive"] = 19000,
["Module:IrelandByCountyCatNav"] = 3300,
["Module:Is_infobox_in_lead"] = 377000,
["Module:Is_instance"] = 336000,
["Module:Italic_title"] = 1120000,
["Module:Italic_title2"] = 5300,
}
d316bc1ba95abf959ff5706924dd1220d6b1987d
Module:Transclusion count/data/S
828
286
686
2023-10-15T05:11:35Z
wikipedia>Ahechtbot
0
[[Wikipedia:BOT|Bot]]: Updated page.
Scribunto
text/plain
return {
["S"] = 3500,
["S-aca"] = 6400,
["S-ach"] = 16000,
["S-aft"] = 218000,
["S-aft/check"] = 218000,
["S-aft/filter"] = 218000,
["S-bef"] = 223000,
["S-bef/check"] = 223000,
["S-bef/filter"] = 223000,
["S-break"] = 5100,
["S-civ"] = 2600,
["S-dip"] = 5300,
["S-end"] = 246000,
["S-gov"] = 7900,
["S-hon"] = 3800,
["S-hou"] = 9500,
["S-inc"] = 13000,
["S-legal"] = 9400,
["S-mil"] = 12000,
["S-new"] = 16000,
["S-non"] = 10000,
["S-npo"] = 4100,
["S-off"] = 41000,
["S-par"] = 50000,
["S-par/en"] = 3300,
["S-par/gb"] = 3300,
["S-par/uk"] = 12000,
["S-par/us-hs"] = 11000,
["S-par/us-sen"] = 2000,
["S-ppo"] = 13000,
["S-prec"] = 3200,
["S-rail"] = 6400,
["S-rail-start"] = 6200,
["S-rail/lines"] = 6400,
["S-reg"] = 20000,
["S-rel"] = 18000,
["S-roy"] = 2700,
["S-s"] = 3600,
["S-sports"] = 10000,
["S-start"] = 240000,
["S-ttl"] = 230000,
["S-ttl/check"] = 230000,
["S-vac"] = 6500,
["SCO"] = 3700,
["SDcat"] = 5480000,
["SECOND"] = 2300,
["SGP"] = 2600,
["SIA"] = 2600,
["SIPA"] = 2600,
["SLO"] = 4300,
["SMS"] = 7200,
["SMU"] = 2100,
["SPI_archive_notice"] = 71000,
["SPIarchive_notice"] = 71000,
["SPIcat"] = 3800,
["SPIclose"] = 3300,
["SPIpriorcases"] = 66000,
["SR/Olympics_profile"] = 3100,
["SRB"] = 3700,
["SS"] = 20000,
["SSPa"] = 2600,
["STN"] = 13000,
["SUBJECTSPACE_formatted"] = 43000,
["SUI"] = 8500,
["SVG"] = 3200,
["SVG-Logo"] = 17000,
["SVG-Res"] = 15000,
["SVG-logo"] = 3000,
["SVG_logo"] = 2000,
["SVK"] = 5900,
["SVN"] = 5200,
["SWE"] = 12000,
["Sandbox_other"] = 237000,
["Saturday"] = 2700,
["Saved_book"] = 52000,
["Sc"] = 3300,
["Scholia"] = 2800,
["School_block"] = 13000,
["School_disambiguation"] = 3400,
["Schoolblock"] = 6700,
["Schooldis"] = 2700,
["Schoolip"] = 10000,
["Scientist_icon"] = 15000,
["Scientist_icon2"] = 15000,
["Sclass"] = 31000,
["Sclass2"] = 10000,
["Screen_reader-only"] = 61000,
["Screen_reader-only/styles.css"] = 61000,
["Script"] = 6000,
["Script/Arabic"] = 2400,
["Script/Hebrew"] = 4700,
["Script/Nastaliq"] = 14000,
["Script/doc/id-unk"] = 3000,
["Script/doc/id-unk/core"] = 3000,
["Script/doc/id-unk/is-iso-alpha4"] = 2800,
["Script/doc/id-unk/name-to-alpha4"] = 3000,
["Script/styles.css"] = 3100,
["Script/styles_arabic.css"] = 2400,
["Script/styles_hebrew.css"] = 4700,
["Sdash"] = 3100,
["Search_box"] = 52000,
["Search_link"] = 16000,
["Section_link"] = 59000,
["Section_sizes"] = 2500,
["See"] = 10000,
["See_also"] = 184000,
["Seealso"] = 6600,
["Select_skin"] = 4300,
["Selected_article"] = 2700,
["Selected_picture"] = 2500,
["Self"] = 48000,
["Self-published_inline"] = 3900,
["Self-published_source"] = 6600,
["Self-reference"] = 2400,
["Self-reference_tool"] = 5400,
["Self/migration"] = 33000,
["Self2"] = 2100,
["Sent_off"] = 13000,
["Sentoff"] = 4400,
["Separated_entries"] = 182000,
["Sequence"] = 3500,
["Serial_killer_opentask"] = 3600,
["Series_overview"] = 7900,
["Serif"] = 2800,
["Set_category"] = 35000,
["Set_index_article"] = 5800,
["Sets_taxobox_colour"] = 89000,
["Sfn"] = 155000,
["SfnRef"] = 134000,
["Sfnm"] = 3600,
["Sfnp"] = 18000,
["Sfnref"] = 11000,
["Sfrac"] = 4200,
["Sfrac/styles.css"] = 4300,
["SharedIPEDU"] = 3200,
["Shared_IP"] = 11000,
["Shared_IP_advice"] = 16000,
["Shared_IP_corp"] = 5100,
["Shared_IP_edu"] = 133000,
["Shared_IP_gov"] = 3000,
["Sharedip"] = 3300,
["Sharedipedu"] = 3600,
["Sherdog"] = 2600,
["Ship"] = 85000,
["Ship/maintenancecategory"] = 85000,
["Ship_index"] = 7000,
["Shipboxflag"] = 20000,
["Shipboxflag/core"] = 20000,
["Shipwrecks_navbox_footer"] = 10000,
["Shipwrecks_navbox_footer/link"] = 10000,
["Short_description"] = 5590000,
["Short_description/lowercasecheck"] = 5590000,
["Short_pages_monitor"] = 10000,
["Short_pages_monitor/maximum_length"] = 10000,
["Shortcut"] = 20000,
["Should_be_SVG"] = 9000,
["Show_button"] = 2150000,
["Sic"] = 33000,
["Sica"] = 3100,
["Side_box"] = 1130000,
["Sidebar"] = 257000,
["Sidebar_games_events"] = 37000,
["Sidebar_person"] = 2300,
["Sidebar_person/styles.css"] = 2300,
["Sidebar_with_collapsible_lists"] = 93000,
["Sigfig"] = 3800,
["Significant_figures"] = 5100,
["Significant_figures/rnd"] = 4700,
["Signpost-subscription"] = 2100,
["Sildb_prim"] = 2000,
["Silver02"] = 16000,
["Silver2"] = 49000,
["Silver_medal"] = 5600,
["Similar_names"] = 2200,
["Single+double"] = 6900,
["Single+space"] = 14000,
["Single-innings_cricket_match"] = 3300,
["Single_chart"] = 37000,
["Single_chart/chartnote"] = 37000,
["Single_namespace"] = 204000,
["Singlechart"] = 19000,
["Singles"] = 42000,
["Sister-inline"] = 190000,
["Sister_project"] = 1040000,
["Sister_project_links"] = 11000,
["Sisterlinks"] = 2400,
["Skip_to_talk"] = 12000,
["Skip_to_talk/styles.css"] = 12000,
["Sky"] = 2700,
["Sky/styles.css"] = 2700,
["Slink"] = 14000,
["Small"] = 602000,
["Small_Solar_System_bodies"] = 3600,
["Smallcaps"] = 17000,
["Smallcaps/styles.css"] = 17000,
["Smallcaps_all"] = 3400,
["Smalldiv"] = 22000,
["Smaller"] = 73000,
["Smallsup"] = 21000,
["Smiley"] = 44000,
["Snd"] = 169000,
["Snds"] = 6400,
["Soccer_icon"] = 130000,
["Soccer_icon2"] = 130000,
["Soccer_icon4"] = 5100,
["Soccerbase"] = 13000,
["Soccerbase_season"] = 6800,
["Soccerway"] = 76000,
["Sock"] = 47000,
["Sock_list"] = 4400,
["Sockcat"] = 2000,
["Sockmaster"] = 9400,
["Sockpuppet"] = 240000,
["Sockpuppet/altmaster"] = 2200,
["Sockpuppet/categorise"] = 240000,
["SockpuppetCheckuser"] = 5500,
["Sockpuppet_category"] = 46000,
["Sockpuppet_category/confirmed"] = 24000,
["Sockpuppet_category/suspected"] = 22000,
["Sockpuppetcheckuser"] = 3600,
["Sockpuppeteer"] = 25000,
["Soft_redirect"] = 6100,
["Soft_redirect_protection"] = 8200,
["Softredirect"] = 3200,
["Solar_luminosity"] = 4500,
["Solar_mass"] = 5300,
["Solar_radius"] = 4300,
["Soldier_icon"] = 3900,
["Soldier_icon2"] = 3900,
["Song"] = 8300,
["Songs"] = 19000,
["Songs_category"] = 8400,
["Songs_category/core"] = 8400,
["Sort"] = 118000,
["Sortname"] = 53000,
["Source-attribution"] = 28000,
["Source_check"] = 964000,
["Sourcecheck"] = 964000,
["Sources"] = 2600,
["South_America_topic"] = 2500,
["Sp"] = 169000,
["Space"] = 55000,
["Space+double"] = 18000,
["Space+single"] = 13000,
["Spaced_en_dash"] = 201000,
["Spaced_en_dash_space"] = 6400,
["Spaced_ndash"] = 23000,
["Spaces"] = 2720000,
["Spain_metadata_Wikidata"] = 7500,
["Spamlink"] = 13000,
["Species_Latin_name_abbreviation_disambiguation"] = 2200,
["Species_list"] = 15000,
["Speciesbox"] = 293000,
["Speciesbox/getGenus"] = 293000,
["Speciesbox/getSpecies"] = 293000,
["Speciesbox/name"] = 293000,
["Speciesbox/parameterCheck"] = 293000,
["Speciesbox/trim"] = 293000,
["Specieslist"] = 5800,
["Split_article"] = 3600,
["Spnd"] = 4100,
["Spoken_Wikipedia"] = 2200,
["Sport_icon"] = 14000,
["Sport_icon2"] = 15000,
["SportsYearCatUSstate"] = 6500,
["SportsYearCatUSstate/core"] = 6500,
["Sports_links"] = 66000,
["Sports_reference"] = 7200,
["Squad_maintenance"] = 3500,
["Sronly"] = 59000,
["Srt"] = 5300,
["Stack"] = 25000,
["Stack/styles.css"] = 34000,
["Stack_begin"] = 9100,
["Stack_end"] = 9000,
["StaleIP"] = 3200,
["Standings_table_end"] = 54000,
["Standings_table_entry"] = 54000,
["Standings_table_entry/record"] = 54000,
["Standings_table_start"] = 54000,
["Standings_table_start/colheader"] = 54000,
["Standings_table_start/colspan"] = 54000,
["Standings_table_start/styles.css"] = 54000,
["Starbox_astrometry"] = 5100,
["Starbox_begin"] = 5300,
["Starbox_catalog"] = 5200,
["Starbox_character"] = 5100,
["Starbox_detail"] = 5000,
["Starbox_end"] = 5300,
["Starbox_image"] = 2900,
["Starbox_observe"] = 5100,
["Starbox_reference"] = 5200,
["Start-Class"] = 18000,
["Start-date"] = 3700,
["Start_and_end_dates"] = 3800,
["Start_box"] = 8000,
["Start_date"] = 437000,
["Start_date_and_age"] = 142000,
["Start_date_and_years_ago"] = 6500,
["Start_date_text"] = 3800,
["Start_of_course_timeline"] = 6200,
["Start_of_course_week"] = 6300,
["Start_tab"] = 5000,
["Startflatlist"] = 144000,
["Static_IP"] = 6000,
["Station"] = 7800,
["Station_link"] = 16000,
["Stdinchicite"] = 11000,
["Steady"] = 14000,
["Stl"] = 14000,
["Stn"] = 7300,
["Stn_art_lnk"] = 2000,
["Stnlnk"] = 30000,
["Storm_colour"] = 5200,
["Storm_path"] = 2100,
["StoryTeleplay"] = 3500,
["Str_endswith"] = 201000,
["Str_find"] = 115000,
["Str_index"] = 13000,
["Str_left"] = 910000,
["Str_len"] = 19000,
["Str_letter"] = 176000,
["Str_letter/trim"] = 20000,
["Str_number"] = 8000,
["Str_number/trim"] = 170000,
["Str_rep"] = 314000,
["Str_trim"] = 5300,
["Str_≠_len"] = 35000,
["Str_≥_len"] = 73000,
["Strfind_short"] = 226000,
["Strikethrough"] = 16000,
["String_split"] = 2900,
["Strip_tags"] = 38000,
["Strong"] = 866000,
["Structurae"] = 2100,
["Stub-Class"] = 17000,
["Stub_Category"] = 13000,
["Stub_category"] = 18000,
["Stub_documentation"] = 36000,
["Student_editor"] = 27000,
["Student_sandbox"] = 4500,
["Student_table_row"] = 5400,
["Students_table"] = 5400,
["Su"] = 9800,
["Su-census1989"] = 4500,
["Sub"] = 4200,
["Subinfobox_bodystyle"] = 36000,
["Subject_bar"] = 19000,
["Suboff"] = 6200,
["Subon"] = 6300,
["Subpage_other"] = 292000,
["Subscription"] = 4200,
["Subscription_required"] = 34000,
["Subsidebar_bodystyle"] = 6400,
["Subst_only"] = 4600,
["Substituted_comment"] = 19000,
["Succession_box"] = 118000,
["Succession_box/check"] = 118000,
["Succession_links"] = 164000,
["Summer_Olympics_by_year_category_navigation"] = 2400,
["Summer_Olympics_by_year_category_navigation/core"] = 2400,
["Sunday"] = 2700,
["Sup"] = 59000,
["Suppress_categories"] = 5300,
["Surname"] = 66000,
["Swiss_populations"] = 2400,
["Swiss_populations_NC"] = 3000,
["Swiss_populations_YM"] = 2300,
["Swiss_populations_ref"] = 2400,
["Switcher"] = 3100,
["Module:SDcat"] = 5480000,
["Module:SPI_archive_notice"] = 33000,
["Module:Science_redirect"] = 258000,
["Module:Science_redirect/conf"] = 258000,
["Module:Section_link"] = 59000,
["Module:Section_sizes"] = 3600,
["Module:See_also_if_exists"] = 73000,
["Module:Separated_entries"] = 2300000,
["Module:Series_overview"] = 7900,
["Module:Settlement_short_description"] = 712000,
["Module:Shortcut"] = 24000,
["Module:Shortcut/config"] = 24000,
["Module:Shortcut/styles.css"] = 24000,
["Module:Side_box"] = 1170000,
["Module:Side_box/styles.css"] = 1160000,
["Module:Sidebar"] = 340000,
["Module:Sidebar/configuration"] = 340000,
["Module:Sidebar/styles.css"] = 346000,
["Module:Sidebar_games_events"] = 37000,
["Module:Sidebar_games_events/styles.css"] = 37000,
["Module:Singles"] = 42000,
["Module:Sister_project_links"] = 15000,
["Module:Sister_project_links/bar/styles.css"] = 3500,
["Module:Sister_project_links/styles.css"] = 11000,
["Module:Sock_list"] = 4400,
["Module:Sort_title"] = 18000,
["Module:Sortkey"] = 200000,
["Module:Split_article"] = 3600,
["Module:Spoken_Wikipedia"] = 2200,
["Module:Spoken_Wikipedia/configuration"] = 2200,
["Module:Spoken_Wikipedia/styles.css"] = 2200,
["Module:Sports_career"] = 19000,
["Module:Sports_color"] = 68000,
["Module:Sports_color/baseball"] = 34000,
["Module:Sports_color/basketball"] = 22000,
["Module:Sports_color/ice_hockey"] = 3100,
["Module:Sports_rbr_table"] = 12000,
["Module:Sports_rbr_table/styles.css"] = 12000,
["Module:Sports_reference"] = 7200,
["Module:Sports_results"] = 15000,
["Module:Sports_results/styles.css"] = 9500,
["Module:Sports_table"] = 58000,
["Module:Sports_table/WDL"] = 51000,
["Module:Sports_table/WDL_OT"] = 2700,
["Module:Sports_table/WL"] = 4000,
["Module:Sports_table/WL_OT"] = 2000,
["Module:Sports_table/argcheck"] = 58000,
["Module:Sports_table/styles.css"] = 58000,
["Module:Sports_table/sub"] = 59000,
["Module:Sports_table/totalscheck"] = 42000,
["Module:Stock_tickers/NYSE"] = 2100,
["Module:Storm_categories"] = 5200,
["Module:Storm_categories/categories"] = 5200,
["Module:Storm_categories/colors"] = 5200,
["Module:Storm_categories/icons"] = 5200,
["Module:String"] = 11400000,
["Module:String2"] = 2300000,
["Module:Su"] = 12000,
["Module:Subject_bar"] = 19000,
["Module:Suppress_categories"] = 5300,
}
d06bcd4fb165f8dc98283433a02d1f8aa79aacc3
Module:Transclusion count/data/U
828
125
347
2023-10-15T05:11:55Z
wikipedia>Ahechtbot
0
[[Wikipedia:BOT|Bot]]: Updated page.
Scribunto
text/plain
return {
["U"] = 234000,
["U.S._Roads_WikiProject"] = 11000,
["UAF_player"] = 2500,
["UEFA_player"] = 5100,
["UK"] = 4400,
["UKR"] = 12000,
["UK_legislation"] = 2300,
["URL"] = 380000,
["URL2"] = 10000,
["URS"] = 7100,
["URY"] = 2100,
["US$"] = 11000,
["US50_Invite"] = 3700,
["USA"] = 41000,
["USBill"] = 2300,
["USCGC"] = 2600,
["USCongRep-end"] = 5000,
["USCongRep-row"] = 5500,
["USCongRep-start"] = 5000,
["USCongressOrdinal"] = 6000,
["USCongressOrdinal/code"] = 6000,
["USD"] = 5100,
["USGS_gazetteer"] = 11000,
["USNS"] = 2800,
["USN_flag"] = 10000,
["USPL"] = 2000,
["USRD"] = 5000,
["USS"] = 36000,
["USSR"] = 2200,
["USStat"] = 2300,
["US_Census_population"] = 38000,
["US_Census_population/styles.css"] = 38000,
["US_House_succession_box"] = 8700,
["US_State_Abbrev"] = 16000,
["US_county_navigation_box"] = 99000,
["US_government_sources"] = 2500,
["US_patent"] = 2700,
["US_state_navigation_box"] = 16000,
["UTRS"] = 8000,
["UTRS-unblock-user"] = 4900,
["UTZ"] = 2600,
["UZB"] = 2400,
["Ubl"] = 137000,
["Ublist"] = 4900,
["Ubx"] = 12000,
["Ucat"] = 38000,
["Ucfirstletter"] = 5100,
["Uir"] = 28000,
["Ukrainian_oblast"] = 2100,
["Ul"] = 5500,
["Ulist"] = 6500,
["Umbox"] = 78000,
["Unassessed-Class"] = 12000,
["Unblock-auto_reviewed"] = 5300,
["Unblock-spamun_reviewed"] = 2900,
["Unblock-un_reviewed"] = 16000,
["Unblock_reviewed"] = 68000,
["Unbulleted_list"] = 1230000,
["Uncategorized"] = 2800,
["Under_construction"] = 2400,
["Underline"] = 3600,
["Undisclosed_paid"] = 2900,
["Unindent"] = 4300,
["UnitedStatesCode"] = 3400,
["United_States_presidential_election_results_table_footer"] = 2900,
["United_States_presidential_election_results_table_header"] = 3300,
["United_States_presidential_election_results_table_row"] = 3300,
["United_States_topic"] = 6000,
["Unknown"] = 2700,
["Unknown-Class"] = 9900,
["Unlink"] = 21000,
["Unreferenced"] = 162000,
["Unreferenced_section"] = 36000,
["Unreferenced_stub"] = 2100,
["Unrelated"] = 5500,
["Unreliable_source?"] = 11000,
["Unreliable_sources"] = 8100,
["Unsourced"] = 5000,
["Update"] = 30000,
["Update_after"] = 5100,
["Update_inline"] = 5900,
["Update_inline_span"] = 2500,
["Update_section"] = 3900,
["Update_span"] = 2500,
["Updated"] = 57000,
["UploadCampaignLink"] = 2100,
["Uploader_information"] = 222000,
["Url"] = 83000,
["Use_American_English"] = 74000,
["Use_Australian_English"] = 125000,
["Use_Bangladeshi_English"] = 3000,
["Use_British_English"] = 258000,
["Use_Canadian_English"] = 37000,
["Use_Ghanaian_English"] = 2400,
["Use_Hiberno-English"] = 32000,
["Use_Hong_Kong_English"] = 4000,
["Use_Indian_English"] = 158000,
["Use_Irish_English"] = 17000,
["Use_Kenyan_English"] = 2400,
["Use_New_Zealand_English"] = 21000,
["Use_Nigerian_English"] = 4800,
["Use_Oxford_spelling"] = 2400,
["Use_Pakistani_English"] = 5600,
["Use_Philippine_English"] = 9500,
["Use_South_African_English"] = 9100,
["Use_dmy_dates"] = 1670000,
["Use_first_nonempty"] = 16000,
["Use_list-defined_references"] = 4000,
["Use_mdy_dates"] = 554000,
["Use_shortened_footnotes"] = 2300,
["User"] = 559000,
["User-generated_source"] = 5600,
["User-multi"] = 336000,
["User0"] = 18000,
["User19"] = 11000,
["User2"] = 3900,
["User21"] = 53000,
["User3"] = 242000,
["User4"] = 3200,
["User5"] = 7000,
["UserSummary"] = 115000,
["User_American"] = 2400,
["User_COI"] = 28000,
["User_Copy_Edit"] = 2200,
["User_Firefox"] = 5900,
["User_HTML"] = 3000,
["User_OS:Dos/style.css"] = 2100,
["User_QAIbox"] = 5700,
["User_QAIbox/auto"] = 3800,
["User_Translator"] = 2400,
["User_UN"] = 2400,
["User_WP"] = 19000,
["User_WP/switch"] = 19000,
["User_Wikipedia"] = 2300,
["User_Wikipedia_reference"] = 2900,
["User_Wikipedian_For"] = 10000,
["User_Wikipedian_for"] = 15000,
["User_Wikipediholic"] = 2200,
["User_category_header"] = 2200,
["User_committed_identity"] = 2400,
["User_contrib"] = 5100,
["User_current_age"] = 2500,
["User_current_age/days"] = 2500,
["User_current_age/months"] = 2500,
["User_current_age/years"] = 2500,
["User_de"] = 5600,
["User_de-1"] = 7700,
["User_de-2"] = 4400,
["User_de-3"] = 2300,
["User_en"] = 39000,
["User_en-1"] = 2500,
["User_en-2"] = 7700,
["User_en-3"] = 16000,
["User_en-4"] = 8900,
["User_en-5"] = 6600,
["User_en-N"] = 4900,
["User_es"] = 3800,
["User_es-1"] = 7200,
["User_es-2"] = 4700,
["User_es-3"] = 2600,
["User_fr"] = 4000,
["User_fr-1"] = 9100,
["User_fr-2"] = 6500,
["User_fr-3"] = 3800,
["User_html"] = 2700,
["User_in_region"] = 28000,
["User_in_the_United_Kingdom"] = 2000,
["User_in_the_United_States"] = 4200,
["User_infobox"] = 3000,
["User_instrument"] = 2800,
["User_invitation"] = 5800,
["User_iso15924"] = 2300,
["User_iso15924/level-text"] = 2800,
["User_iso15924/user_script_catlink"] = 2700,
["User_it-1"] = 2800,
["User_ja-1"] = 2900,
["User_la-1"] = 2800,
["User_link"] = 239000,
["User_lives_in"] = 7000,
["User_male"] = 2300,
["User_oops"] = 2100,
["User_other"] = 592000,
["User_page"] = 44000,
["User_proud"] = 5100,
["User_rights"] = 5000,
["User_ru"] = 3000,
["User_ru-1"] = 2100,
["User_sandbox"] = 293000,
["User_summary"] = 116000,
["User_talk_other"] = 68000,
["User_time_zone"] = 4100,
["User_visited"] = 6400,
["User_wikipedia"] = 2000,
["User_wikipedia/RC_Patrol"] = 3700,
["User_wikipedia/Rollback"] = 2300,
["User_wikipedia/WikiGnome"] = 2700,
["User_wishes_to_visit"] = 6000,
["User_zh"] = 2200,
["Userbox"] = 302000,
["Userbox-2"] = 34000,
["Userbox-level"] = 102000,
["Userbox-r"] = 6100,
["UserboxCOI"] = 28000,
["Userbox_table_bottom"] = 11000,
["Userbox_table_category"] = 2400,
["Userbox_table_top"] = 11000,
["Userbox_table_userbox"] = 11000,
["Userboxbottom"] = 52000,
["Userboxtop"] = 57000,
["Usercheck-short"] = 3600,
["Userlinks"] = 29000,
["Userpage"] = 30000,
["Userpage_blanked"] = 8400,
["Userspace_draft"] = 41000,
["Usgs-gazetteer"] = 11000,
["Ushr"] = 15000,
["Ussc"] = 5200,
["Usurped"] = 5300,
["Utrs"] = 5200,
["Module:URL"] = 578000,
["Module:Unicode_data"] = 1470000,
["Module:Unicode_data/scripts"] = 487000,
["Module:Unstrip"] = 45000,
["Module:Unsubst"] = 11800000,
["Module:Unsubst-infobox"] = 191000,
["Module:Urldecode"] = 4400,
["Module:User"] = 559000,
["Module:UserLinks"] = 878000,
["Module:UserLinks/config"] = 878000,
["Module:UserLinks/extra"] = 23000,
["Module:UserLinks/shared"] = 878000,
["Module:User_contrib"] = 5100,
["Module:Userbox"] = 307000,
["Module:Uses_Wikidata"] = 3200,
["Module:Ustring"] = 743000,
}
06f5148a1affefe308e74a456445bf5b6d799987
Main Page
0
1
1
2023-10-17T12:26:58Z
MediaWiki default
1
Create main page
wikitext
text/x-wiki
__NOTOC__
== Welcome to {{SITENAME}}! ==
This Main Page was created automatically and it seems it hasn't been replaced yet.
=== For the bureaucrat(s) of this wiki ===
Hello, and welcome to your new wiki! Thank you for choosing Miraheze for the hosting of your wiki, we hope you will enjoy our hosting.
You can immediately start working on your wiki or whenever you want.
Need help? No problem! We will help you with your wiki as needed. To start, try checking out these helpful links:
* [[mw:Special:MyLanguage/Help:Contents|MediaWiki guide]] (e.g. navigation, editing, deleting pages, blocking users)
* [[meta:Special:MyLanguage/FAQ|Miraheze FAQ]]
* [[meta:Special:MyLanguage/Request features|Request settings changes on your wiki]]. (Extensions, Skin and Logo/Favicon changes should be done through [[Special:ManageWiki]] on your wiki, see [[meta:Special:MyLanguage/ManageWiki|ManageWiki]] for more information.)
==== I still don't understand X! ====
Well, that's no problem. Even if something isn't explained in the documentation/FAQ, we are still happy to help you. You can find us here:
* [[meta:Special:MyLanguage/Help center|On our own Miraheze wiki]]
* On [[phab:|Phabricator]]
* On [https://miraheze.org/discord Discord]
* On IRC in #miraheze on irc.libera.chat ([irc://irc.libera.chat/%23miraheze direct link]; [https://web.libera.chat/?channel=#miraheze webchat])
=== For visitors of this wiki ===
Hello, the default Main Page of this wiki (this page) has not yet been replaced by the bureaucrat(s) of this wiki. The bureaucrat(s) might still be working on a Main Page, so please check again later!
21236ac3f8d65e5563b6da6b70815ca6bf1e6616
2
1
2023-10-17T14:43:54Z
LamayII
2
Protected "[[Main Page]]": High traffic page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
__NOTOC__
== Welcome to {{SITENAME}}! ==
This Main Page was created automatically and it seems it hasn't been replaced yet.
=== For the bureaucrat(s) of this wiki ===
Hello, and welcome to your new wiki! Thank you for choosing Miraheze for the hosting of your wiki, we hope you will enjoy our hosting.
You can immediately start working on your wiki or whenever you want.
Need help? No problem! We will help you with your wiki as needed. To start, try checking out these helpful links:
* [[mw:Special:MyLanguage/Help:Contents|MediaWiki guide]] (e.g. navigation, editing, deleting pages, blocking users)
* [[meta:Special:MyLanguage/FAQ|Miraheze FAQ]]
* [[meta:Special:MyLanguage/Request features|Request settings changes on your wiki]]. (Extensions, Skin and Logo/Favicon changes should be done through [[Special:ManageWiki]] on your wiki, see [[meta:Special:MyLanguage/ManageWiki|ManageWiki]] for more information.)
==== I still don't understand X! ====
Well, that's no problem. Even if something isn't explained in the documentation/FAQ, we are still happy to help you. You can find us here:
* [[meta:Special:MyLanguage/Help center|On our own Miraheze wiki]]
* On [[phab:|Phabricator]]
* On [https://miraheze.org/discord Discord]
* On IRC in #miraheze on irc.libera.chat ([irc://irc.libera.chat/%23miraheze direct link]; [https://web.libera.chat/?channel=#miraheze webchat])
=== For visitors of this wiki ===
Hello, the default Main Page of this wiki (this page) has not yet been replaced by the bureaucrat(s) of this wiki. The bureaucrat(s) might still be working on a Main Page, so please check again later!
21236ac3f8d65e5563b6da6b70815ca6bf1e6616
Template:Infobox law enforcement agency
10
2
3
2023-10-17T14:55:15Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
{{tlc|{{BASEPAGENAME}}}} is an infobox template for use in articles on individual [[Law enforcement agency|law enforcement agencies]]. See also: [[Wikipedia:Naming conventions (law enforcement agency categories)|Naming conventions (law enforcement agency categories)]].
== Usage ==
{{Parameter names example | agencyname | nativename | nativenamea | nativenamer | fictional | patch | patchcaption | logo | logocaption | badge | badgecaption | flag | flagcaption | image_size | commonname | abbreviation | motto | mottotranslated | formed | preceding1 | preceding2 | preceding3 | preceding4 | preceding5 | preceding6 | dissolved | superseding | employees | volunteers | budget | legalpersonality | legaljuris | national | country | countryabbr | federal | international | divname | subdivname | map | mapcaption | dmap | sizearea | sizepopulation | governingbody | governingbodyscnd | constitution1 | constitution2 | constitution3 | constitution4 | constitution5 | constitution6 | gendarmerie | provost | military | police | local | secret | religious | speciality1 | speciality2 | speciality3 | speciality4 | speciality5 | speciality6 | overviewtype | overviewbody | headquarters | hqlocmap | hqlocmapsize | hqlocmappoptitle | sworntype | sworn | unsworntype | unsworn | multinational | electeetype | minister1name | minister1pfo | minister2name | minister2pfo | minister3name | minister3pfo | minister4name | minister4pfo | minister5name | minister5pfo | minister6name | minister6pfo | chief1name | chief1position | chief2name | chief2position | chief3name | chief3position | chief4name | chief4position | chief5name | chief5position | chief6name | chief6position | parentagency | child1agency | child2agency | child3agency | child4agency | child5agency | child6agency | child7agency | unittype | unitname | officetype | officename | provideragency | uniformedas | stationtype | stations | airbases | lockuptype | lockups | vehicle1type | vehicles1 | vehicle2type | vehicles2 | vehicle3type | vehicles3 | boat1type | boats1 | boat2type | boats2 | boat3type | boats3 | aircraft1type | aircraft1 | aircraft2type | aircraft2 | aircraft3type | aircraft3 | animal1type | animals1 | animal2type | animals2 | animal3type | animals3 | person1name | person1reason | person1type | person2name | person2reason | person2type | person3name | person3reason | person3type | person4name | person4reason | person4type | person5name | person5reason | person5type | person6name | person6reason | person6type | programme1 | programme2 | programme3 | programme4 | programme5 | programme6 | activitytype| activity1name | activity2name | activity3name | activity4name | activity5name | activity6name | anniversary1 | anniversary2 | anniversary3 | anniversary4 | anniversary5 | anniversary6 | award1 | award2 | award3 | award4 | award5 | award6 | website | footnotes }}
<syntaxhighlight lang="wikitext" style="overflow: hidden; background: unset;">
{{Infobox law enforcement agency
| agencyname =
| nativename =
| nativenamea =
| nativenamer =
| fictional =
| patch =
| patchcaption =
| logo =
| logocaption =
| badge =
| badgecaption =
| flag =
| flagcaption =
| image_size =
| commonname =
| abbreviation =
| motto =
| mottotranslated =
| formed =
| preceding1 = <!-- up to | preceding6 = -->
| dissolved =
| superseding =
| employees =
| volunteers =
| budget =
| legalpersonality =
| legaljuris =
| national =
| country =
| countryabbr =
| federal =
| international = <!-- NNN or {{collapsible list |title=NNN |[[country1]] . . |[[countryNNN]]}} -->
| divname =
| subdivname =
| map =
| mapcaption =
| dmap =
| sizearea =
| sizepopulation =
| governingbody =
| governingbodyscnd =
| constitution1 = <!-- up to | constitution6 = -->
| gendarmerie =
| provost =
| military =
| police =
| local =
| secret =
| religious =
| speciality1 = <!-- up to | speciality6 = -->
| overviewtype =
| overviewbody =
| headquarters =
| hqlocmap =
| hqlocmapsize =
| hqlocmappoptitle =
| sworntype =
| sworn =
| unsworntype =
| unsworn =
| multinational = <!-- NNN or {{collapsible list |title=NNN |[[country1]] . . |[[countryNNN]]}} -->
| electeetype =
| minister1name = <!-- up to | minister6name = -->
| minister1pfo = <!-- up to | minister6pfo = -->
| chief1name = <!-- up to | chief6name = -->
| chief1position = <!-- up to | chief6position = -->
| parentagency =
| child1agency = <!-- up to | child7agency = -->
| unittype =
| unitname = <!-- NNN or {{collapsible list |title=NNN |[[Unit1]] . . |[[UnitNNN]]}} -->
| officetype =
| officename = <!-- NNN or {{collapsible list |title=NNN |[[Office1]] . . |[[OfficeNNN]]}} -->
| provideragency =
| uniformedas =
| stationtype =
| stations = <!-- NNN or {{collapsible list |title=NNN |[[Station1]] . . |[[StationNNN]]}} -->
| airbases = <!-- NNN or {{collapsible list |title=NNN |[[Airbase1]] . . |[[AirbaseNNN]]}} -->
| lockuptype =
| lockups = <!-- NNN or {{collapsible list |title=NNN |[[Lockup1]] . . |[[LockupNNN]]}} -->
| vehicle1type = <!-- up to | vehicle3type = -->
| vehicles1 = <!-- NNN or {{collapsible list |title=NNN |[[Vehicle1]] . . |[[VehicleNNN]]}} --><!-- up to | vehicles3 = -->
| boat1type = <!-- up to | boat3type = -->
| boats1 = <!-- NNN or {{collapsible list |title=NNN |[[Boat1]] . . |[[BoatNNN]]}} --><!-- up to | boats3 = -->
| aircraft1type = <!-- up to | aircraft3type = -->
| aircraft1 = <!-- NNN or {{collapsible list |title=NNN |[[Aircraft1]] . . |[[AircraftNNN]]}} --><!-- up to | aircraft3 = -->
| animal1type = <!-- up to | animal3type = -->
| animals1 = <!-- NNN or {{collapsible list |title=NNN |[[Animal1]] . . |[[AnimalNNN]]}} --><!-- up to | animals3 = -->
| person1name = <!-- up to | person6name = -->
| person1reason = <!-- up to | person6reason = -->
| person1type = <!-- up to |person6type = -->
| programme1 = <!-- or | program1 = --><!-- up to | programme6 = or | program6 = -->
| activitytype =
| activity1name = <!-- up to | activity6name = -->
| anniversary1 = <!-- up to | anniversary6 = -->
| award1 = <!-- up to | award6 = -->
| website =
| footnotes =
}}
</syntaxhighlight>
{{Clear}}
== Parameter names and description ==
{| class="wikitable" style="background-color:white"
! Parameter name
! Required
! Description
! Values
|- style="background-color:#ddd"
| '''Agency header''' || yes || agencyname is provided automatically based on PAGENAME if not provided. ||
|-
| agencyname || no || Name of the agency. Defaults to the name of the current page. || Text. Do not link.
|-
| nativename || no || Agency name in a native language using Western characters (French, German, Spanish, etc.), such as Port Lotniczy im. Fryderyka Chopina. Can also be used for two different names in the same language. || Text.
|-
| nativenamea || no || Agency name in a native language with non-Western characters (Chinese, Japanese, Korean, Arabic, etc.), such as 北京首都国际机场. || Text.
|-
| nativenamer || no || Use in conjunction with nativenamea for Romanized name of the agency, such as Běijīng Shǒudū Guójì Jīcháng. || Text.
|-
| fictional || no || 'Yes' if the agency is a fictional agency || Text == Yes.
|-
| patch || no || Patch for the agency. || Image file name.
|-
| patchcaption || no || Caption for the agency patch. || Optionally linked text.
|-
| logo || no || Logo for the agency. || Image file name.
|-
| logocaption || no || Caption for the agency logo. || Optionally linked text.
|-
| badge || no || Badge for the agency. || Image file name.
|-
| badgecaption || no || Caption for the agency badge. || Optionally linked text.
|-
| flag || no || Flag for the agency. || Image file name.
|-
| flagcaption || no || Caption for the agency flag. || Optionally linked text.
|-
| image_size || no || Size in px of the images for patch, logo, badge, flag. Defaults to 140. || Single number.
|-
| commonname || no || Common name for the agency. || Text. Do not link.
|-
| abbreviation || no || Abbreviation of the agency name. || Text.
|-
| motto || no || The motto of the agency. || Optionally linked text.
|-
| mottotranslated || no || The English translation of the motto of the agency. || Optionally linked text.
|- style="background-color:#ddd"
| '''Agency overview''' || yes || At least one parameter should be provided. ||
|-
| formed || no || Date of formation of the agency. || Linked text, for example, 25 July 2005, or 1876..
|-
| <s>formedmonthday</s> || no || The month and day of month the agency was formed. Ignored if formedyear not set. This parameter has been deprecated by formed. || Month name followed by day of month number. [[Wikipedia:Manual of Style (dates and numbers)#Date autoformatting|Do not link]].
|-
| <s>formedyear</s> || no || The year the agency was formed. This parameter has been deprecated by formed. || yyyy. [[Wikipedia:Manual of Style (dates and numbers)#Date autoformatting|Do not link]]
|-
| preceding1 || no || Name of preceding agency. Can be repeated up to preceding6.<br>'''Note:''' Title of box will automatically pluralise upon use of preceding2. || Text. Do not link. The template will link.
|-
| dissolved || no || Date of dissolution of the agency. || Text, for example, 25 July 2005, or 1876].
|-
| superseding || no || Name of superseding agency. || Optionally linked text.
|-
| employees || no || Number of employees of the agency. || Number with optional citation or comment.
|-
| volunteers || no || Number of volunteers to the agency. || Number with optional citation or comment.
|-
| budget || no || Annual budget of the agency || Linked and referenced text, for example, <nowiki>$95M [[USD]] (2006)</nowiki>.
|-
| legalpersonality || no || The legal personality of the agency either Governmental or Non-governmental. Governmental examples: [[government agency]]; [[government-owned corporation]]; [[government ministry]]. Non-governmental examples: [[partnership]]; [[privately-held company]]; [[cooperative]]; [[body corporate]].|| Text. Do not link. The template will link.
|- style="background-color:#ddd"
| '''Jurisdictional structure''' || yes || At least one parameter should be provided. ||
|-
| legaljuris || no || Name of area in which the agency is legally empowered to act. If the same as the operational area then set value to 'opsjuris'. || Optionally linked text, or Text == opsjuris.
|-
| country || yes || Name of the country or name of the group of countries the agency operates in or across. || Text. Do not link. The template will link.
|-
| countryabbr || no || Abbreviation for the country. || Text. Do not link. The template will link.
|-
| [[Law enforcement agency#natlea|national]] || no || 'Yes' if the agency services a single national jurisdiction. || Text == Yes.
|-
| [[Law enforcement agency#fedlea|federal]] || no || 'Yes' if the agency services a jurisdiction established by a [[Federation]]. || Text == Yes.
|-
| [[Law enforcement agency#internat|international]] || no || Number of, or optionally linked list of, the countries the agency has jurisdiction in or across. || Number or template reference with parameters.
|-
| divname|| no || Name of a division of a country, for example, [[Queensland]], [[Pennsylvania]], etc. The template will attempt to [[#Automatic disambiguation|disambiguate]] if required. || Text. Do not link. The template will link.
|-
| subdivname || no || Name of a sub-division of a country, for example, [[Sydney]], [[Buckinghamshire|Bucks]], etc. The template will attempt to [[#Automatic disambiguation|disambiguate]] if required. || Text. Do not link. The template will link.
|-
| map || no || Map of jurisdiction of the agency. || Image file name.
|-
| mapcaption || no || Caption for the agency map. Linking is recommended to a more detailed description of the geography of the jurisdiction. Defaults to 'Map of the agencyname's jurisdiction.'. It is recommended that this parameter and its corresponding image file name NOT be overridden to another image type. || Optionally linked text.
|-
| dmap || no || Location Map of jurisdiction of the agency. || Use [[Template:Location map]] to get image.
|-
| sizearea || no || Size of geographic area covered by the jurisdiction. || Number and area unit, preferably metric.
|-
| sizepopulation || no || Size of the population covered by the jurisdiction. || Number.
|-
| governingbody || no || Name of the governing body which is responsible for the agency, the law making body. Do not confuse with the overviewbody parameter below. The title will change from 'Governing body' to 'Primary governing body' if the governingbodyscnd parameter is set. || Text, for example, Government of Western Australia or United States Government. Do not link. The template will link.
|-
| governingbodyscnd || no || Name of a secondary governing body which is responsible for the agency, for example, a local or state government versus as state of federal government respectively, and a law making body. Do not confuse with the overviewbody or overview_body parameter below. || Text. Do not link. The template will link.
|-
| constitution1 || no || Titles and references to the instruments of the governing body which constitute and create the agency. Can be repeated up to constitution6.<br>'''Note:''' Title of box will automatically pluralise upon use of constitution2. || Text, linked and-or referenced.
|-
| [[Gendarmerie|gendarmerie]] || no || 'Yes' if the agency is a [[gendarmerie]]. Forces military parameter to 'Yes'. || Text == Yes.
|-
| [[Law enforcement agency#provost|provost]] || no || 'Yes' if the agency is a [[Provost (military police)|military provost]]. Forces military parameter to 'Yes'. || Text == Yes.
|-
| [[Law enforcement agency#milpol|military]] || no || 'Yes' if the agency is a [[military police]] agency. || Text == Yes.
|-
| [[Law enforcement agency#police|police]] || no || 'Yes' if the agency also provides services related to general social order and public safety. Displays "Civilian police" in infobox. '''Note:''' if used in combination with {{para|local}} changes to "Local civilian police". 'footnote' if qualified provision and use footnotes below.|| Text == Yes, or Text == footnote.
|-
| [[Law enforcement agency#locpol|local]] || no || 'Yes' if the agency is [[police]] and for the type of services provided is a local or territorial police. '''Note:''' For use in combination with {{para|police}}.'footnote' if qualified provision and use footnoes below. || Text == Yes, or Text == footnote.
|-
| [[Secret police|secret]] || no || A (robust) source reference for the fact that the organisation is known as a [[secret police]] organisation. || Optionally templated and-or linked text.
|-
| [[Law enforcement agency#relpol|religious]] || no || 'Yes' if the agency is involved in enforcing religious law. || Text == Yes, or Text == footnote.
|-
| [[Specialist law enforcement agency|speciality1]] || no || Identifies the specialist roles of the agency. The [[Template:Specialist lea type descr|Specialist roles template]] has a table of specialist role descriptions with corresponding codes. Entering a code, for example "institution", will display the description in the infobox. Can be repeated up to speciality6.
|| Enumerated text value, one of: institution, education, primary, secondary, nontertiary, tertiary, water, envher, postal, property, road, customs, corruption, rail, vehicle, protection, specops, fraud, paramilitary, diplomatic, border, coast.
|- style="background-color:#ddd"
| '''Operational structure''' || yes || At least one parameter value should be provided. ||
|-
| overviewtype || no || Type of overview authority for the operations of and community engagement by the agency. Defaults to 'Overviewed by', and becomes 'Overviewed by overviewtype'. || Optionally linked text.
|-
| overviewbody || no || Name of the overview body. || Optionally linked text.
|-
| headquarters || no || Location of the agencies's headquarters. || Text, for example, <nowiki>[[Sydney, New South Wales]], [[Australia]]</nowiki>
|-
| hqlocmap || no || Map containing location of the headquarters. || Image file name.
|-
| hqlocmappoptitle || no || Pop up title on mouse over map. Defaults to 'Map indicating the location of the headquarters'. || Text.
|-
| hqlocmapsize || no || Size of headquarters map. || Number.
|-
| sworntype || no || Type or title of sworn members, for example 'Police officer', 'Federal agent'. Defaults to 'Sworn member'. The 's' is added by the template. || Optionally linked text.
|-
| sworn || no || Number of sworn members of the agency. || Number with optional citation or comment.
|-
| unsworntype || no || Type or title of unsworn members, for example 'Staff member', 'Civilian'. Defaults to 'Unsworn member'. The 's' is added by the template. || Optionally linked text.
|-
| unsworn || no || Number of unsworn members of the agency. || Number with optional citation or comment.
|-
| [[Law enforcement agency#multinat|multinational]] || no || Number of, or optionally linked list of, the countries the agency draws personnel from. Note that an international agency does not necessarily draw personnel from all countries in its jurisdiction. || Number or template reference with parameters.
|-
| electeetype || no || Type of governing body official overseeing the agency, example is 'Minister' for "Minister responsible". Defaults to "Elected officer responsible". '''Note:''' will automatically pluralise governing body official type with an 's' upon use of minister2name.|| Optionally linked text.
|-
| minister1name || no || Elected or overseeing governing body member. For [[Westminster system]]s: Name of current minister responsible for the agency. Can be repeated up to minister6name.<br/> || Optionally linked text.
|-
| minister1pfo || no || Elected or overseeing governing body member. For Westminster systems: Portfolio title of responsible minister. Can be repeated up to minister6pfo. || Optionally linked text.
|-
| chief1name || no || Name of current agency chief/director/executive director. Can be repeated up to chief6name.<br>'''Note:''' Title of box will automatically pluralise upon use of chief2name. || Text.
|-
| chief1position || no || Position title of current agency chief/director/executive director. Can be repeated up to chief6position. || Optionally linked text.
|-
| parentagency || no || Parent agency of this agency || Optionally linked text.
|-
| child1agency || no || List of current child agencies reporting to this agency. Can be repeated up to child7agency.<br>'''Note:''' Title of box will automatically pluralise upon use of child2agency. || Optionally linked text.
|-
| unittype || no || Generic name or title of a unit if the agency, for example, Function, Division, Command. Defaults to 'Unit'. || Optionally linked text.
|-
| unitname || no || Optionally linked list of the units in the agency, for example, Crime Stoppers, Counter Terrorism. The intent here is to list operations, and operations support units, for example Crimes Scenes, Forensics, and not administration units. || Number or template reference with parameters.
|-
| officetype || no || Generic name or title of the operation area of the agency, for example, Office, Precinct, District. Defaults to 'Command'. || Text.
|-
| officename || no || Optionally linked list of the operation areas of the agency. || Number or template reference with parameters.
|-
| provideragency || no || Name of the agency to which the services are outsourced to. || Optionally linked text.
|-
| uniformedas || no || Name of agency if not uniformed as the 'agencyname'. Defaults to agencyname || Optionally linked text.
|- style="background-color:#ddd"
| '''Facilities''' || no || Each of the following facilities can be "type" overridden but will still display in the set order. For example, lockuptype/lockups can be used as vehicle0type/vehicle0s, boat1type/boats1 can be used as vehicle4type/vehicles4, boat2type/boats2 can be used vehicle5type/vehicles5, etc. There are up to 14 facilities which can be typed as required. ||
|-
| stationtype || no || Generic name or title of a work location of the agency, for example, Station, Office, Precinct. Defaults to 'Station'. || Optionally linked text.
|-
| stations || no || Number of or optionally linked list of the work locations of the agency. || Number or template reference with parameters.
|-
| airbases || no || Number of or optionally linked list of the airbases of the agency. || Number or template reference with parameters.
|-
| lockuptype || no || Generic name or title of a temporary detention centre of the agency, for example, Lockup, Watch house, Remand centre. Defaults to 'Lockup'. || Optionally linked text.
|-
| lockups || no || Number of or optionally linked list of the temporary detention centres of the agency. || Number or template reference with parameters.
|-
| vehicle1type || no || Generic name or title of a vehicle of the agency, for example, Patrol car, Forward command vehicle, Tactical vehicle. Defaults to 'Patrol car'. Can be repeated up to vehicle3type. || Optionally linked text.
|-
| vehicles1 || no || Number of or optionally linked list of the vehicles of the agency. Can be repeated up to vehicles3. || Number or template reference with parameters.
|-
| boat1type || no || Generic name or title of a water craft of the agency, for example, Boat, Patrol craft. Defaults to 'Boat'. Can be repeated up to boat3type. || Optionally linked text.
|-
| boats1 || no || Number of or optionally linked list of the water craft of the agency. Can be repeated up to boats3. || Number or template reference with parameters.
|-
| aircraft1type || no || Generic name or title of an air craft of the agency, for example, Plane, Helicopter. Defaults to 'Plane'. Can be repeated up to aircraft3type. || Optionally linked text.
|-
| aircraft1 || no || Number of or optionally linked list of the air craft of the agency. Can be repeated up to aircraft3. || Number or template reference with parameters.
|-
| animal1type || no || Generic name or title of an animal of the agency, for example, Dog, Horse. Defaults to 'Dog'. Can be repeated up to animal3type. || Optionally linked text.
|-
| animal1 || no || Number of or optionally linked list of the animals of the agency. Can be repeated up to animal3. || Number or template reference with parameters.
|- style="background-color:#ddd"
| '''Notables''' || no || Key significant notables for the agency. These and other, more numerous, notables should appear in article sections or even separate supporting articles. || Show / Hide collapsible only if more than one item.
|-
| person1name || no || Name of agency member notable for special reason. Can be repeated up to person6name. || Optionally linked text.
|-
| person1type || no || Type of peson, for example 'Inspector', 'Federal agent', 'Director', 'Commissioner'. Can be repeated up to person6type. || Optionally linked text.
|-
| person1reason || no || Reason the agency is notable, for example, bravery, reform, corruption (yes the bad too). Can be repeated up to person6reason. || Optionally linked text.
|-
| programme1 || no || Name of a key agency programme, or campaign, for example, [[most wanted]]. Can be repeated up to programme6. For American English spelling, use <code>program1</code>, <code>program2</code>, ...|| Optionally linked text.
|-
| activitytype || no || Type of 'Significant' activity or event, example is 'investigation' for "Significant investigation". Default is 'operation' for "Significant operation". '''Note:''' will automatically pluralise with an 's' upon use of activity2name. || Optionally linked text.
|-
| activity1name || no || Name of an activity or event which is notable. Can be repeated up to activity6name. || Optionally linked text.
|-
| anniversary1 || no || Name of notable event to be commemorated. Can be repeated up to anniversary6. || Optionally linked text. Recommended format: <nowiki>[[optionally piped text]] ([[Year]], [[dd Month]])</nowiki>
|-
| award1 || no || Name of award, decoration, honour, or other significant recognition. Can be repeated up to award6. || Optionally linked text. Recommended format: <nowiki>[[optionally piped text]] ([[Year]], [[dd Month]])</nowiki>
|- style="background-color:#ddd"
| '''Website and footnotes''' || no || ||
|-
| website || no || Web address for agency website || WWW address. Use <nowiki>{{URL|example.com}}</nowiki>
|-
| footnotes || no || Footnotes or references for included information || Text.
|}
==TemplateData==
{{collapse top|[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": "Infobox law enforcement agency is an infobox template for use in articles on individual law enforcement agencies.",
"format": "{{_\n| _________________ = _\n}}\n",
"params": {
"agencyname": {
"label": "Agency name",
"description": "Name of the agency defaults to {{PAGENAME}} if not provided.",
"type": "string",
"required": false
},
"nativename": {
"label": "Native name",
"description": "Agency name in a native language using Western characters (French, German, Spanish, etc.), such as Port Lotniczy im. Fryderyka Chopina. Can also be used for two different names in the same language.",
"example": "{{lang|pl|Port Lotniczy im}}",
"type": "string",
"required": false
},
"nativenamea": {
"label": "Direct native name",
"description": "Agency name in a native language with non-Western characters (Chinese, Japanese, Korean, Arabic, etc.)",
"example": "{{lang|zh|北京首都国际机场}}",
"type": "string",
"required": false
},
"nativenamer": {
"label": "Romanised native name",
"description": "Use in conjunction with nativenamea or native_name_a for Romanized name of the agency.",
"example": "{{lang|zh-p|Běijīng Shǒudū Guójì Jīcháng}}",
"type": "string",
"required": false
},
"fictional": {
"label": "Fictional",
"description": "'Yes' if the agency is a fictional agency",
"type": "string",
"required": false
},
"patch": {
"label": "Patch",
"description": "Patch for the agency.",
"type": "wiki-file-name",
"required": false
},
"patchcaption": {
"label": "Patch caption",
"description": "Caption for the agency patch.",
"type": "string",
"default": "Patch of the agencyname",
"example": "coat of arms",
"required": false
},
"logo": {
"label": "Logo",
"description": "Logo for the agency.",
"type": "wiki-file-name",
"required": false
},
"logocaption": {
"label": "Logo caption",
"description": "Caption for the agency logo.",
"type": "string",
"default": "Logo of the agencyname",
"example": "coat of arms",
"required": false
},
"badge": {
"label": "Badge",
"description": "Badge for the agency.",
"type": "wiki-file-name",
"required": false
},
"badgecaption": {
"label": "Badge Caption",
"description": "Caption for the agency badge.",
"type": "string",
"default": "Badge of the agencyname",
"example": "coat of arms",
"required": false
},
"flag": {
"label": "Flag",
"description": "Flag for the agency.",
"type": "wiki-file-name",
"required": false
},
"flagcaption": {
"label": "Flag caption",
"description": "Caption for the agency flag.",
"type": "string",
"default": "Flag of the agencyname",
"example": "coat of arms",
"required": false
},
"image_size": {
"label": "Image sizes",
"description": "Size in px of the images for patch, logo, badge, flag.",
"type": "number",
"default": "140",
"required": false
},
"commonname": {
"label": "Common Name",
"description": "Common name for the agency.",
"type": "string",
"required": false
},
"abbreviation": {
"label": "Abbreviation",
"description": "Abbreviation of the agency name.",
"type": "string",
"required": false
},
"motto": {
"label": "Motto",
"description": "The motto of the agency.",
"type": "string",
"required": false
},
"mottotranslated": {
"label": "Motto translated",
"description": "The English translation of the motto of the agency.",
"type": "string",
"required": false
},
"formed": {
"label": "Formed",
"description": "Date of formation of the agency.",
"type": "string",
"example": "25 July 2005, or 1876.",
"required": false
},
"formedmonthday": {
"label": "Formed",
"description": "The month and day of month the agency was formed. Ignored if formedyear not set. This parameter has been deprecated by formed.",
"type": "string",
"example": "Month name followed by day of month number.",
"deprecated": true,
"required": false
},
"formedyear": {
"label": "Formed",
"description": "The year the agency was formed. This parameter has been deprecated by formed.",
"type": "string",
"example": "yyyy.",
"deprecated": true,
"required": false
},
"preceding1": {
"label": "Preceding agency 1",
"description": "Name of a preceding agency. Title of box will automatically pluralise upon use of more than one.",
"type": "string"
},
"preceding2": {
"label": "Preceding agency 2",
"inherits": "preceding1"
},
"preceding3": {
"label": "Preceding agency 3",
"inherits": "preceding1"
},
"preceding4": {
"label": "Preceding agency 4",
"inherits": "preceding1"
},
"preceding5": {
"label": "Preceding agency 5",
"inherits": "preceding1"
},
"preceding6": {
"label": "Preceding agency 6",
"inherits": "preceding1"
},
"dissolved": {
"label": "Date dissolved",
"description": "Date of dissolution of the agency.",
"type": "string",
"example": "{{end date|1782}}",
"required": false
},
"superseding": {
"label": "Superseding agency",
"description": "Name of superseding agency.",
"type": "string",
"required": false
},
"employees": {
"label": "Employees",
"description": "Number of employees of the agency.",
"type": "number",
"required": false
},
"volunteers": {
"label": "Volunteers",
"description": "Number of volunteers to the agency.",
"type": "number",
"required": false
},
"budget": {
"label": "Annual budget",
"description": "Annual budget of the agency.",
"type": "string",
"example": "$95 m [[United States dollar|USD]] (2006)",
"required": false
},
"legalpersonality": {
"label": "Legal personality",
"description": "The legal personality of the agency.",
"type": "string",
"example": "government agency; government-owned corporation; government ministry; partnership; privately-held company; cooperative; body corporate; or, the full legal name of organisation if the type of organisation is not known.",
"required": false
},
"country": {
"label": "Country",
"description": "Name of the country or name of the group of countries the agency operates in or across.",
"type": "string",
"required": true
},
"countryabbr": {
"label": "Country Abbreviation",
"description": "Abbreviation for the country.",
"type": "string",
"required": false
},
"national": {
"label": "National",
"description": "'Yes' if the agency services a single national jurisdiction.",
"type": "string",
"required": false
},
"federal": {
"label": "Federal",
"description": "'Yes' if the agency services a jurisdiction established by a Federation.",
"type": "string",
"required": false
},
"international": {
"label": "International",
"description": "Number of, or optionally linked list of, the countries the agency has jurisdiction in or across.",
"type": "string",
"required": false
},
"divtype": {
"label": "divtype",
"description": "Title of a division of a country.",
"type": "string",
"example": "State, Territory, etc., or 'Police area' if the jurisdiction is specifically constructed.",
"required": false,
"deprecated": true
},
"divname": {
"label": "divname",
"description": "Name of a division of a country.",
"type": "string",
"example": "Queensland, Pennsylvania",
"required": false
},
"subdivtype": {
"label": "subdivtype",
"description": "Title of a sub-division of a country.",
"type": "string",
"example": "City, County, etc., or 'Police area' if the jurisdiction is specifically constructed.",
"required": false,
"deprecated": true
},
"subdivname": {
"label": "subdivname",
"description": "Name of a sub-division of a country.",
"type": "string",
"example": "Sydney, Bucks",
"required": false
},
"map": {
"label": "map",
"description": "Map of jurisdiction of the agency.",
"type": "wiki-file-name",
"required": false
},
"dmap": {
"label": "dmap",
"description": "Location Map of jurisdiction of the agency. Use Template:Location map to get image.",
"type": "unknown",
"required": false
},
"mapcaption": {
"label": "mapcaption",
"description": "Caption for the agency map.",
"type": "string",
"default": "Map of the agencyname's jurisdiction",
"required": false
},
"sizearea": {
"label": "sizearea",
"description": "Size of geographic area covered by the jurisdiction.",
"type": "string",
"required": false
},
"sizepopulation": {
"label": "sizepopulation",
"description": "Size of the population covered by the jurisdiction.",
"type": "number",
"required": false
},
"legaljuris": {
"label": "Legal Jurisdiction",
"description": "Name of area in which the agency is legally empowered to act. If the same as the operational area then set value to 'opsjuris'.",
"type": "string",
"required": false
},
"governingbody": {
"label": "Governing Body",
"description": "Name of the governing body which is responsible for the agency, the law making body. Do not confuse with the overviewbody parameter below. The title will change from 'Governing body' to 'Primary governing body' if the governingbodyscnd parameter is set.",
"type": "string",
"example": "Government of Western Australia, United States Government",
"required": false
},
"governingbodyscnd": {
"label": "Secondary Governing Body",
"description": "Name of a secondary governing body which is responsible for the agency. Do not confuse with the overviewbody parameter below.",
"type": "string",
"example": "Local or state government versus as state of federal government respectively, and a law making body.",
"required": false
},
"constitution1": {
"label": "constitution1",
"description": "Titles and references to the instruments of the governing body which constitute and create the agency.",
"type": "string",
"required": false
},
"constitution2": {
"label": "constitution2",
"inherits": "constitution1"
},
"constitution3": {
"label": "constitution3",
"inherits": "constitution1"
},
"constitution4": {
"label": "constitution4",
"inherits": "constitution1"
},
"constitution5": {
"label": "constitution5",
"inherits": "constitution1"
},
"constitution6": {
"label": "constitution6",
"inherits": "constitution1"
},
"gendarmerie": {
"label": "Gendarmerie",
"description": "'Yes' if the agency is a gendarmerie. Forces military parameter to 'Yes'.",
"type": "string",
"required": false
},
"provost": {
"label": "Provost",
"description": "'Yes' if the agency is a military provost. Forces military parameter to 'Yes'.",
"type": "string",
"required": false
},
"police": {
"label": "Police",
"description": "'Yes' if the agency also provides services related to general social order and public safety.",
"type": "string",
"required": false
},
"local": {
"label": "Local",
"description": "'Yes' if the agency is the local or territorial agency for the type of services provided.",
"type": "string",
"required": false
},
"military": {
"label": "Military",
"description": "'Yes' if the agency is a military police agency.",
"type": "string",
"required": false
},
"secret": {
"label": "Secret",
"description": "Yes' if the agency is known as a secret police organisation.",
"type": "string",
"required": false
},
"religious": {
"label": "Religious",
"description": "Yes' if the agency is involved in enforcing religious law.",
"type": "string",
"required": false
},
"speciality1": {
"label": "speciality1",
"description": "Identifies the agency as having a specialist jurisdiction of particular types of geography, property, etc.",
"type": "string",
"required": false
},
"speciality2": {
"label": "speciality2",
"inherits": "speciality1"
},
"speciality3": {
"label": "speciality3",
"inherits": "speciality1"
},
"speciality4": {
"label": "speciality4",
"inherits": "speciality1"
},
"speciality5": {
"label": "speciality5",
"inherits": "speciality1"
},
"speciality6": {
"label": "speciality6",
"inherits": "speciality1"
},
"overviewtype": {
"label": "Overview Type",
"description": "Type of overview authority for the operations of and community engagement by the agency.",
"type": "string",
"default": "Overviewed by', and becomes 'Overviewed by overview type'.",
"required": false
},
"overviewbody": {
"label": "Overview Body",
"description": "Name of the overview body.",
"type": "string",
"required": false
},
"headquarters": {
"label": "Headquarters",
"description": "Location of the agencies's headquarters.",
"type": "string",
"example": "[[Sydney, New South Wales]], [[Australia]]",
"required": false
},
"hqlocmap": {
"label": "hqlocmap",
"description": "Map containing location of the headquarters.",
"type": "wiki-file-name",
"required": false
},
"hqlocmapsize": {
"label": "hqlocmapsize",
"description": "Size of the map.",
"type": "number",
"required": false
},
"hqlocmappoptitle": {
"label": "hqlocmappoptitle",
"description": "Pop up title on mouse over map.",
"type": "string",
"default": "Map indicating the location of the headquarters",
"required": false
},
"sworntype": {
"label": "Sworn Type",
"description": "Type or title of sworn members.",
"type": "string",
"default": "Sworn member",
"example": "Police officer, Federal agent",
"required": false
},
"sworn": {
"label": "Sworn",
"description": "Number of sworn members of the agency.",
"type": "string",
"required": false
},
"unsworntype": {
"label": "Unsworn Type",
"description": "Type or title of unsworn members.",
"type": "string",
"default": "Unsworn member",
"example": "Staff member, Civilian",
"required": false
},
"unsworn": {
"label": "Unsworn",
"description": "Number of unsworn members of the agency.",
"type": "string",
"required": false
},
"multinational": {
"label": "multinational",
"description": "Number of, or optionally linked list of, the countries the agency draws personnel from. Note that an international agency does not necessarily draw personnel from all countries in its jurisdiction.",
"type": "string",
"required": false
},
"electeetype": {
"label": "Electee Type",
"description": "Generic type of governing body officials overseeing the agency.",
"type": "string",
"default": "Elected officer",
"required": false
},
"minister1name": {
"label": "minister1name",
"description": "Elected or overseeing governing body member.",
"type": "string",
"example": "For Westminster systems: Name of current minister responsible for the agency",
"required": false
},
"minister1pfo": {
"label": "minister1pfo",
"description": "Elected or overseeing governing body member.",
"type": "string",
"example": "For Westminster systems: Portfolio title of responsible minister.",
"required": false
},
"minister2name": {
"label": "minister2name",
"inherits": "minister1name"
},
"minister2pfo": {
"label": "minister2pfo",
"inherits": "minister1pfo"
},
"minister3name": {
"label": "minister3name",
"inherits": "minister1name"
},
"minister3pfo": {
"label": "minister3pfo",
"inherits": "minister1pfo"
},
"minister4name": {
"label": "minister4name",
"inherits": "minister1name"
},
"minister4pfo": {
"label": "minister4pfo",
"inherits": "minister1pfo"
},
"minister5name": {
"label": "minister5name",
"inherits": "minister1name"
},
"minister5pfo": {
"label": "minister5pfo",
"inherits": "minister1pfo"
},
"minister6name": {
"label": "minister6name",
"inherits": "minister1name"
},
"minister6pfo": {
"label": "minister6pfo",
"inherits": "minister1pfo"
},
"chief1name": {
"label": "chief1name",
"description": "Name of current agency chief/director/executive director.",
"type": "string",
"required": false
},
"chief1position": {
"label": "chief1position",
"description": "Position title of current agency chief/director/executive director.",
"type": "string",
"required": false
},
"chief2name": {
"label": "chief2name",
"inherits": "chief1name"
},
"chief2position": {
"label": "chief2position",
"inherits": "chief1position"
},
"chief3name": {
"label": "chief3name",
"inherits": "chief1name"
},
"chief3position": {
"label": "chief3position",
"inherits": "chief1position"
},
"chief4name": {
"label": "chief4name",
"inherits": "chief1name"
},
"chief4position": {
"label": "chief4position",
"inherits": "chief1position"
},
"chief5name": {
"label": "chief5name",
"inherits": "chief1name"
},
"chief5position": {
"label": "chief5position",
"inherits": "chief1position"
},
"chief6name": {
"label": "chief6name",
"inherits": "chief1name"
},
"chief6position": {
"label": "chief6position",
"inherits": "chief1position"
},
"parentagency": {
"label": "Parent Agency",
"description": "Parent agency of this agency.",
"type": "string",
"required": false
},
"child1agency": {
"label": "child1agency",
"description": "List of current child agencies reporting to this agency.",
"type": "string",
"required": false
},
"child2agency": {
"label": "child2agency",
"inherits": "child1agency"
},
"child3agency": {
"label": "child3agency",
"inherits": "child1agency"
},
"child4agency": {
"label": "child4agency",
"inherits": "child1agency"
},
"child5agency": {
"label": "child5agency",
"inherits": "child1agency"
},
"child6agency": {
"label": "child6agency",
"inherits": "child1agency"
},
"child7agency": {
"label": "child7agency",
"inherits": "child1agency"
},
"unittype": {
"label": "Unit Type",
"description": "Generic name or title of a unit if the agency.",
"type": "string",
"default": "Unit",
"example": "Function, Division, Command",
"required": false
},
"unitname": {
"label": "Unit Name",
"description": "Optionally linked list of the units in the agency.",
"type": "string",
"example": "Crime Stoppers, Counter Terrorism. The intent here is to list operations, and operations support units, for example Crimes Scenes, Forensics, and not administration units.",
"required": false
},
"officetype": {
"label": "Office Type",
"description": "Generic name or title of the operation area of the agency.",
"type": "string",
"default": "Command",
"example": "Office, Precinct, District",
"required": false
},
"officename": {
"label": "Office Name",
"description": "Optionally linked list of the operation areas of the agency.",
"type": "string",
"required": false
},
"provideragency": {
"label": "Provider Agency",
"description": "Name of the agency to which the services are outsourced to.",
"type": "string",
"required": false
},
"uniformedas": {
"label": "Uniformed as",
"description": "Name of agency if not uniformed as the Agency Name.",
"type": "string",
"default": "Agency Name",
"required": false
},
"stationtype": {
"label": "Station Type",
"description": "Generic name or title of a work location of the agency.",
"type": "string",
"example": "Station, Office, Precinct.",
"default": "Station",
"required": false
},
"stations": {
"label": "Stations",
"description": "Number of or optionally linked list of the work locations of the agency.",
"type": "string",
"required": false
},
"airbases": {
"label": "Airbases",
"description": "Number of or optionally linked list of the airbases of the agency.",
"type": "string",
"required": false
},
"lockuptype": {
"label": "Lockup Type",
"description": "Generic name or title of a temporary detention centre of the agency.",
"type": "string",
"example": "Lockup, Watch house, Remand centre.",
"default": "Lockup",
"required": false
},
"lockups": {
"label": "Lockups",
"description": "Number of or optionally linked list of the temporary detention centres of the agency.",
"type": "string",
"required": false
},
"vehicle1type": {
"label": "vehicle1type",
"description": "Generic name or title of a vehicle of the agency.",
"type": "string",
"example": "Patrol car, Forward command vehicle, Tactical vehicle.",
"default": "Patrol car",
"required": false
},
"vehicles1": {
"label": "vehicles1",
"description": "Number of or optionally linked list of the vehicles of the agency.",
"type": "string",
"required": false
},
"vehicle2type": {
"label": "vehicle2type",
"inherits": "vehicle1type"
},
"vehicles2": {
"label": "vehicles2",
"inherits": "vehicles1"
},
"vehicle3type": {
"label": "vehicle3type",
"inherits": "vehicle1type"
},
"vehicles3": {
"label": "vehicles3",
"inherits": "vehicles1"
},
"boat1type": {
"label": "boat1type",
"description": "Generic name or title of a water craft of the agency.",
"type": "string",
"example": "Boat, Patrol craft.",
"default": "Boat",
"required": false
},
"boats1": {
"label": "boats1",
"description": "Number of or optionally linked list of the water craft of the agency.",
"type": "string",
"required": false
},
"boat2type": {
"label": "boat2type",
"inherits": "boat1type"
},
"boats2": {
"label": "boats2",
"inherits": "boats1"
},
"boat3type": {
"label": "boat3type",
"inherits": "boat1type"
},
"boats3": {
"label": "boats3",
"inherits": "boats1"
},
"aircraft1type": {
"label": "aircraft1type",
"description": "Generic name or title of an air craft of the agency, for example.",
"type": "string",
"example": "Plane, helicopter.",
"default": "Plane",
"required": false
},
"aircraft1": {
"label": "aircraft1",
"description": "Number of or optionally linked list of the air craft of the agency.",
"type": "string",
"required": false
},
"aircraft2type": {
"label": "aircraft2type",
"inherits": "aircraft1type"
},
"aircraft2": {
"label": "aircraft2",
"inherits": "aircraft1"
},
"aircraft3type": {
"label": "aircraft3type",
"inherits": "aircraft1type"
},
"aircraft3": {
"label": "aircraft3",
"inherits": "aircraft1"
},
"animal1type": {
"label": "animal1type",
"description": "Generic name or title of an animal of the agency.",
"type": "string",
"example": "Dog, Horse.",
"default": "Dog",
"required": false
},
"animals1": {
"label": "animals1",
"description": "Number of or optionally linked list of the animals of the agency.",
"type": "string",
"required": false
},
"animal2type": {
"label": "animal2type",
"inherits": "animal1type"
},
"animals2": {
"label": "animals2",
"inherits": "animals1"
},
"animal3type": {
"label": "animal3type",
"inherits": "animal1type"
},
"animals3": {
"label": "animals3",
"inherits": "animals1"
},
"person1name": {
"label": "person1name",
"description": "Name of agency person notable for special reason.",
"type": "string",
"required": false
},
"person1type": {
"label": "person1type",
"description": "Type of person.",
"type": "string",
"example": "Inspector, Federal agent, Director, Commissioner",
"required": false
},
"person1reason": {
"label": "person1reason",
"description": "Reason the agency person is notable.",
"type": "string",
"example": "Bravery, reform, corruption (yes the bad too)",
"required": false
},
"person2name": {
"label": "person2name",
"inherits": "person1name"
},
"person2type": {
"label": "person2type",
"inherits": "person1type"
},
"person2reason": {
"label": "person2reason",
"inherits": "person1reason"
},
"person3name": {
"label": "person3name",
"inherits": "person1name"
},
"person3type": {
"label": "person3type",
"inherits": "person1type"
},
"person3reason": {
"label": "person3reason",
"inherits": "person1reason"
},
"person4name": {
"label": "person4name",
"inherits": "person1name"
},
"person4type": {
"label": "person4type",
"inherits": "person1type"
},
"person4reason": {
"label": "person4reason",
"inherits": "person1reason"
},
"person5name": {
"label": "person5name",
"inherits": "person1name"
},
"person5type": {
"label": "person5type",
"inherits": "person1type"
},
"person5reason": {
"label": "person5reason",
"inherits": "person1reason"
},
"person6name": {
"label": "person6name",
"inherits": "person1name"
},
"person6type": {
"label": "person6type",
"inherits": "person1type"
},
"person6reason": {
"label": "person6reason",
"inherits": "person1reason"
},
"programme1": {
"label": "programme1",
"description": "Name of a key agency programme, or campaign.",
"type": "string",
"example": "Most wanted",
"required": false,
"aliases": [
"program1"
]
},
"programme2": {
"label": "programme2",
"inherits": "programme1",
"aliases": [
"program2"
]
},
"programme3": {
"label": "programme3",
"inherits": "programme1",
"aliases": [
"program3"
]
},
"programme4": {
"label": "programme4",
"inherits": "programme1",
"aliases": [
"program4"
]
},
"programme5": {
"label": "programme5",
"inherits": "programme1",
"aliases": [
"program5"
]
},
"programme6": {
"label": "programme6",
"inherits": "programme1",
"aliases": [
"program6"
]
},
"activitytype": {
"label": "activitytype",
"description": "Type of activity or event.",
"type": "string",
"default": "Operation",
"example": "Investigation",
"required": false
},
"activity1name": {
"label": "activity1name",
"description": "Name of an activity or event which is notable.",
"type": "string",
"required": false
},
"activity2name": {
"label": "activity2name",
"inherits": "activity1name"
},
"activity3name": {
"label": "activity3name",
"inherits": "activity1name"
},
"activity4name": {
"label": "activity4name",
"inherits": "activity1name"
},
"activity5name": {
"label": "activity5name",
"inherits": "activity1name"
},
"activity6name": {
"label": "activity6name",
"inherits": "activity1name"
},
"anniversary1": {
"label": "anniversary1",
"description": "Name of notable event to be commemorated.",
"type": "string",
"example": "[[optionally piped text]] ([[Year]], [[dd Month]])",
"required": false
},
"anniversary2": {
"label": "anniversary2",
"inherits": "anniversary1"
},
"anniversary3": {
"label": "anniversary3",
"inherits": "anniversary1"
},
"anniversary4": {
"label": "anniversary4",
"inherits": "anniversary1"
},
"anniversary5": {
"label": "anniversary5",
"inherits": "anniversary1"
},
"anniversary6": {
"label": "anniversary6",
"inherits": "anniversary1"
},
"award1": {
"label": "award1",
"description": "Name of award, decoration, honour, or other significant recognition.",
"type": "string",
"example": "[[optionally piped text]] ([[Year]], [[dd Month]])",
"required": false
},
"award2": {
"label": "award2",
"inherits": "award1"
},
"award3": {
"label": "award3",
"inherits": "award1"
},
"award4": {
"label": "award4",
"inherits": "award1"
},
"award5": {
"label": "award5",
"inherits": "award1"
},
"award6": {
"label": "award6",
"inherits": "award1"
},
"website": {
"label": "Website",
"description": "Web address for agency website.",
"type": "url",
"example": "WWW address",
"required": false
},
"footnotes": {
"label": "Footnotes",
"description": "Footnotes or references for included information.",
"type": "string",
"required": false
},
"embed": {},
"paramilitary": {
"deprecated": true
}
},
"paramOrder": [
"agencyname",
"nativename",
"nativenamea",
"nativenamer",
"fictional",
"patch",
"patchcaption",
"logo",
"logocaption",
"badge",
"badgecaption",
"flag",
"flagcaption",
"image_size",
"commonname",
"abbreviation",
"motto",
"mottotranslated",
"formed",
"formedmonthday",
"formedyear",
"preceding1",
"preceding2",
"preceding3",
"preceding4",
"preceding5",
"preceding6",
"dissolved",
"superseding",
"employees",
"volunteers",
"budget",
"legalpersonality",
"country",
"countryabbr",
"national",
"federal",
"international",
"divtype",
"divname",
"subdivtype",
"subdivname",
"map",
"dmap",
"mapcaption",
"sizearea",
"sizepopulation",
"legaljuris",
"governingbody",
"governingbodyscnd",
"constitution1",
"constitution2",
"constitution3",
"constitution4",
"constitution5",
"constitution6",
"gendarmerie",
"provost",
"police",
"local",
"military",
"secret",
"religious",
"speciality1",
"speciality2",
"speciality3",
"speciality4",
"speciality5",
"speciality6",
"overviewtype",
"overviewbody",
"headquarters",
"hqlocmap",
"hqlocmapsize",
"hqlocmappoptitle",
"sworntype",
"sworn",
"unsworntype",
"unsworn",
"multinational",
"electeetype",
"minister1name",
"minister1pfo",
"minister2name",
"minister2pfo",
"minister3name",
"minister3pfo",
"minister4name",
"minister4pfo",
"minister5name",
"minister5pfo",
"minister6name",
"minister6pfo",
"chief1name",
"chief1position",
"chief2name",
"chief2position",
"chief3name",
"chief3position",
"chief4name",
"chief4position",
"chief5name",
"chief5position",
"chief6name",
"chief6position",
"parentagency",
"child1agency",
"child2agency",
"child3agency",
"child4agency",
"child5agency",
"child6agency",
"child7agency",
"unittype",
"unitname",
"officetype",
"officename",
"provideragency",
"uniformedas",
"stationtype",
"stations",
"airbases",
"lockuptype",
"lockups",
"vehicle1type",
"vehicles1",
"vehicle2type",
"vehicles2",
"vehicle3type",
"vehicles3",
"boat1type",
"boats1",
"boat2type",
"boats2",
"boat3type",
"boats3",
"aircraft1type",
"aircraft1",
"aircraft2type",
"aircraft2",
"aircraft3type",
"aircraft3",
"animal1type",
"animals1",
"animal2type",
"animals2",
"animal3type",
"animals3",
"person1name",
"person1type",
"person1reason",
"person2name",
"person2type",
"person2reason",
"person3name",
"person3type",
"person3reason",
"person4name",
"person4type",
"person4reason",
"person5name",
"person5type",
"person5reason",
"person6name",
"person6type",
"person6reason",
"programme1",
"programme2",
"programme3",
"programme4",
"programme5",
"programme6",
"activitytype",
"activity1name",
"activity2name",
"activity3name",
"activity4name",
"activity5name",
"activity6name",
"anniversary1",
"anniversary2",
"anniversary3",
"anniversary4",
"anniversary5",
"anniversary6",
"award1",
"award2",
"award3",
"award4",
"award5",
"award6",
"website",
"footnotes",
"embed",
"paramilitary"
]
}
</templatedata>
{{collapse bottom}}
== Tracking categories ==
* {{clc|Pages using law enforcement agency with local civilian police general nature}}
* {{clc|Pages using law enforcement agency with civilian police general nature}}
* {{Category link with count|Pages using infobox law enforcement agency with unknown parameters}}
* {{clc|Pages using infobox law enforcement agency with paramilitary parameter}}
== See also ==
{{Organization infoboxes}}
<includeonly>{{Sandbox other||
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Law enforcement infobox templates|Law Enforcement Agency]]
[[Category:Organization infobox templates|Law Enforcement Agency]]
[[Category:Politics and government infobox templates|Law Enforcement Agency]]
[[Category:Embeddable templates]]
}}</includeonly>
57fd62e2a5d1ae90f274a57c083507399108dfa0
Module:Infobox
828
3
4
2023-10-17T15:29:41Z
LamayII
2
Initial Commit
Scribunto
text/plain
--
-- This module implements {{Infobox}}
--
local p = {}
local navbar = require('Module:Navbar')._navbar
local args = {}
local origArgs
local root
local function notempty( s ) return s and s:match( '%S' ) end
local function fixChildBoxes(sval, tt)
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' .. subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' .. subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
return s
else
return sval
end
end
local function union(t1, t2)
-- Returns the union of the values of two tables, as a sequence.
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
local function getArgNums(prefix)
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
local function addRow(rowArgs)
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
if rowArgs.header then
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:attr('id', rowArgs.rowid)
:tag('th')
:attr('colspan', 2)
:attr('id', rowArgs.headerid)
:addClass(rowArgs.class)
:addClass(args.headerclass)
:css('text-align', 'center')
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
elseif rowArgs.data then
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
row:attr('id', rowArgs.rowid)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:attr('id', rowArgs.labelid)
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
if not rowArgs.label then
dataCell
:attr('colspan', 2)
:css('text-align', 'center')
end
dataCell
:attr('id', rowArgs.dataid)
:addClass(rowArgs.class)
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:newline()
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
end
end
local function renderTitle()
if not args.title then return end
root
:tag('caption')
:addClass(args.titleclass)
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
root
:tag('tr')
:tag('th')
:attr('colspan', 2)
:addClass(args.aboveclass)
:css('text-align', 'center')
:css('font-size', '125%')
:css('font-weight', 'bold')
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass(args.belowclass)
:css('text-align', 'center')
:cssText(args.belowstyle)
:newline()
:wikitext(fixChildBoxes(args.below,'td'))
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addRow({
data = args['subheader' .. tostring(num)],
datastyle = args.subheaderstyle or args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:cssText(args.captionstyle)
:wikitext(caption)
end
addRow({
data = tostring(data),
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
local function renderRows()
-- Gets the union of the header and data argument numbers,
-- and renders them all in order using addRow.
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)],
dataid = args['dataid' .. tostring(num)],
labelid = args['labelid' .. tostring(num)],
headerid = args['headerid' .. tostring(num)],
rowid = args['rowid' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:css('text-align', 'right')
:wikitext(navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
local function renderTrackingCategories()
if args.decat ~= 'yes' then
if #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
end
if args.child == 'yes' and args.title then
root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]')
end
end
end
local function _infobox()
-- Specify the overall layout of the infobox, with special settings
-- if the infobox is used as a 'child' inside another infobox.
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass('infobox')
:addClass(args.bodyclass)
if args.subbox == 'yes' then
root
:css('padding', '0')
:css('border', 'none')
:css('margin', '-3px')
:css('width', 'auto')
:css('min-width', '100%')
:css('font-size', '100%')
:css('clear', 'none')
:css('float', 'none')
:css('background-color', 'transparent')
else
root
:css('width', '22em')
end
root
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
renderSubheaders()
renderImages()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderTrackingCategories()
return tostring(root)
end
local function preprocessSingleArg(argName)
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
local function preprocessArgs(prefixTable, step)
-- Assign the parameters with the given prefixes to the args table, in order, in batches
-- of the step size specified. This is to prevent references etc. from appearing in the
-- wrong order. The prefixTable should be an array containing tables, each of which has
-- two possible fields, a "prefix" string and a "depend" table. The function always parses
-- parameters containing the "prefix" string, but only parses parameters in the "depend"
-- table if the prefix parameter is present and non-blank.
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or (v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
moreArgumentsExist = true -- Do another loop if any arguments are found, even blank ones.
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present and not blank, or
-- we are processing "prefix1" and "prefix" is present and not blank, and
-- if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
function p.infobox(frame)
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so that
-- references etc. will display in the expected places. Parameters that depend on
-- another parameter are only processed if that parameter is present, to avoid
-- phantom references appearing in article reference lists.
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'},
{prefix = 'dataid'},
{prefix = 'labelid'},
{prefix = 'headerid'},
{prefix = 'rowid'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent
preprocessSingleArg('decat')
return frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
} .. _infobox()
end
return p
eccecf7ea52ce105242adb57836ea74e04395312
38
4
2023-10-17T16:37:19Z
LamayII
2
1 revision imported from [[:meta:Module:Infobox]]
Scribunto
text/plain
--
-- This module implements {{Infobox}}
--
local p = {}
local navbar = require('Module:Navbar')._navbar
local args = {}
local origArgs
local root
local function notempty( s ) return s and s:match( '%S' ) end
local function fixChildBoxes(sval, tt)
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' .. subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' .. subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
return s
else
return sval
end
end
local function union(t1, t2)
-- Returns the union of the values of two tables, as a sequence.
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
local function getArgNums(prefix)
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
local function addRow(rowArgs)
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
if rowArgs.header then
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:attr('id', rowArgs.rowid)
:tag('th')
:attr('colspan', 2)
:attr('id', rowArgs.headerid)
:addClass(rowArgs.class)
:addClass(args.headerclass)
:css('text-align', 'center')
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
elseif rowArgs.data then
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
row:attr('id', rowArgs.rowid)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:attr('id', rowArgs.labelid)
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
if not rowArgs.label then
dataCell
:attr('colspan', 2)
:css('text-align', 'center')
end
dataCell
:attr('id', rowArgs.dataid)
:addClass(rowArgs.class)
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:newline()
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
end
end
local function renderTitle()
if not args.title then return end
root
:tag('caption')
:addClass(args.titleclass)
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
root
:tag('tr')
:tag('th')
:attr('colspan', 2)
:addClass(args.aboveclass)
:css('text-align', 'center')
:css('font-size', '125%')
:css('font-weight', 'bold')
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass(args.belowclass)
:css('text-align', 'center')
:cssText(args.belowstyle)
:newline()
:wikitext(fixChildBoxes(args.below,'td'))
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addRow({
data = args['subheader' .. tostring(num)],
datastyle = args.subheaderstyle or args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:cssText(args.captionstyle)
:wikitext(caption)
end
addRow({
data = tostring(data),
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
local function renderRows()
-- Gets the union of the header and data argument numbers,
-- and renders them all in order using addRow.
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)],
dataid = args['dataid' .. tostring(num)],
labelid = args['labelid' .. tostring(num)],
headerid = args['headerid' .. tostring(num)],
rowid = args['rowid' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:css('text-align', 'right')
:wikitext(navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
local function renderTrackingCategories()
if args.decat ~= 'yes' then
if #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
end
if args.child == 'yes' and args.title then
root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]')
end
end
end
local function _infobox()
-- Specify the overall layout of the infobox, with special settings
-- if the infobox is used as a 'child' inside another infobox.
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass('infobox')
:addClass(args.bodyclass)
if args.subbox == 'yes' then
root
:css('padding', '0')
:css('border', 'none')
:css('margin', '-3px')
:css('width', 'auto')
:css('min-width', '100%')
:css('font-size', '100%')
:css('clear', 'none')
:css('float', 'none')
:css('background-color', 'transparent')
else
root
:css('width', '22em')
end
root
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
renderSubheaders()
renderImages()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderTrackingCategories()
return tostring(root)
end
local function preprocessSingleArg(argName)
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
local function preprocessArgs(prefixTable, step)
-- Assign the parameters with the given prefixes to the args table, in order, in batches
-- of the step size specified. This is to prevent references etc. from appearing in the
-- wrong order. The prefixTable should be an array containing tables, each of which has
-- two possible fields, a "prefix" string and a "depend" table. The function always parses
-- parameters containing the "prefix" string, but only parses parameters in the "depend"
-- table if the prefix parameter is present and non-blank.
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or (v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
moreArgumentsExist = true -- Do another loop if any arguments are found, even blank ones.
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present and not blank, or
-- we are processing "prefix1" and "prefix" is present and not blank, and
-- if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
function p.infobox(frame)
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so that
-- references etc. will display in the expected places. Parameters that depend on
-- another parameter are only processed if that parameter is present, to avoid
-- phantom references appearing in article reference lists.
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'},
{prefix = 'dataid'},
{prefix = 'labelid'},
{prefix = 'headerid'},
{prefix = 'rowid'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent
preprocessSingleArg('decat')
return frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
} .. _infobox()
end
return p
eccecf7ea52ce105242adb57836ea74e04395312
Module:Navbar/configuration
828
5
6
2023-10-17T15:41:48Z
LamayII
2
Created page with "local configuration = { ['templatestyles'] = 'Module:Navbar/styles.css', ['box_text'] = 'This box: ', -- default text box when not plain or mini ['title_namespace'] = 'Template', -- namespace to default to for title ['invalid_title'] = 'Invalid title ', ['classes'] = { -- set a line to nil if you don't want it ['navbar'] = 'navbar', ['plainlinks'] = 'plainlinks', -- plainlinks ['horizontal_list'] = 'hlist', -- horizontal list class ['mini'] = 'navbar-mini..."
Scribunto
text/plain
local configuration = {
['templatestyles'] = 'Module:Navbar/styles.css',
['box_text'] = 'This box: ', -- default text box when not plain or mini
['title_namespace'] = 'Template', -- namespace to default to for title
['invalid_title'] = 'Invalid title ',
['classes'] = { -- set a line to nil if you don't want it
['navbar'] = 'navbar',
['plainlinks'] = 'plainlinks', -- plainlinks
['horizontal_list'] = 'hlist', -- horizontal list class
['mini'] = 'navbar-mini', -- class indicating small links in the navbar
['this_box'] = 'navbar-boxtext',
['brackets'] = 'navbar-brackets',
-- 'collapsible' is the key for a class to indicate the navbar is
-- setting up the collapsible element in addition to the normal
-- navbar.
['collapsible'] = 'navbar-collapse',
['collapsible_title_mini'] = 'navbar-ct-mini',
['collapsible_title_full'] = 'navbar-ct-full'
}
}
return configuration
7f1b6300bc4a690ecfb1c83b582f36c603bd1dff
42
6
2023-10-17T16:37:20Z
LamayII
2
1 revision imported from [[:meta:Module:Navbar/configuration]]
Scribunto
text/plain
local configuration = {
['templatestyles'] = 'Module:Navbar/styles.css',
['box_text'] = 'This box: ', -- default text box when not plain or mini
['title_namespace'] = 'Template', -- namespace to default to for title
['invalid_title'] = 'Invalid title ',
['classes'] = { -- set a line to nil if you don't want it
['navbar'] = 'navbar',
['plainlinks'] = 'plainlinks', -- plainlinks
['horizontal_list'] = 'hlist', -- horizontal list class
['mini'] = 'navbar-mini', -- class indicating small links in the navbar
['this_box'] = 'navbar-boxtext',
['brackets'] = 'navbar-brackets',
-- 'collapsible' is the key for a class to indicate the navbar is
-- setting up the collapsible element in addition to the normal
-- navbar.
['collapsible'] = 'navbar-collapse',
['collapsible_title_mini'] = 'navbar-ct-mini',
['collapsible_title_full'] = 'navbar-ct-full'
}
}
return configuration
7f1b6300bc4a690ecfb1c83b582f36c603bd1dff
Module:TableTools
828
6
7
2023-10-17T15:43:33Z
LamayII
2
Created page with "--[[ ------------------------------------------------------------------------------------ -- TableTools -- -- -- -- This module includes a number of functions for dealing with Lua tables. -- -- It is a meta-module, meant to be called from other Lua modules, and should -- -- not be called directly from #invoke...."
Scribunto
text/plain
--[[
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should --
-- not be called directly from #invoke. --
------------------------------------------------------------------------------------
--]]
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
--[[
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
--]]
function p.isPositiveInteger(v)
return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end
--[[
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a value can be a valid table key. Lua will
-- generate an error if a NaN is used as a table key.
------------------------------------------------------------------------------------
--]]
function p.isNan(v)
return type(v) == 'number' and tostring(v) == '-nan'
end
--[[
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
--]]
function p.shallowClone(t)
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
--]]
function p.removeDuplicates(t)
checkType('removeDuplicates', 1, t, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for i, v in ipairs(t) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
--]]
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k, v in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
-- return {1, 3, 6}.
------------------------------------------------------------------------------------
--]]
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k, v in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
-- of subtables in the format
-- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
-- Keys that don't end with an integer are stored in a subtable named "other".
-- The compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
--]]
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
--[[
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
--]]
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for k in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
else -- This will fail with table, boolean, function.
return item1 < item2
end
end
--[[
Returns a list of the keys in a table, sorted using either a default
comparison function or a custom keySort function.
]]
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, { 'function', 'boolean', 'nil' })
end
local list = {}
local index = 1
for key, value in pairs(t) do
list[index] = key
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(list, keySort)
end
return list
end
--[[
Iterates through a table, with the keys sorted using the keysToList function.
If there are only numerical keys, sparseIpairs is probably more efficient.
]]
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local list = p.keysToList(t, keySort, true)
local i = 0
return function()
i = i + 1
local key = list[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
--[[
Returns true if all keys in the table are consecutive integers starting at 1.
--]]
function p.isArray(t)
checkType("isArray", 1, t, "table")
local i = 0
for k, v in pairs(t) do
i = i + 1
if t[i] == nil then
return false
end
end
return true
end
-- { "a", "b", "c" } -> { a = 1, b = 2, c = 3 }
function p.invert(array)
checkType("invert", 1, array, "table")
local map = {}
for i, v in ipairs(array) do
map[v] = i
end
return map
end
--[[
{ "a", "b", "c" } -> { ["a"] = true, ["b"] = true, ["c"] = true }
--]]
function p.listToSet(t)
checkType("listToSet", 1, t, "table")
local set = {}
for _, item in ipairs(t) do
set[item] = true
end
return set
end
--[[
Recursive deep copy function.
Preserves identities of subtables.
]]
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[deepcopy(orig_key, includeMetatable, already_seen)] = deepcopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = deepcopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
--[[
Concatenates all values in the table that are indexed by a number, in order.
sparseConcat{ a, nil, c, d } => "acd"
sparseConcat{ nil, b, c, d } => "bcd"
]]
function p.sparseConcat(t, sep, i, j)
local list = {}
local list_i = 0
for _, v in p.sparseIpairs(t) do
list_i = list_i + 1
list[list_i] = v
end
return table.concat(list, sep, i, j)
end
--[[
-- Finds the length of an array, or of a quasi-array with keys such
-- as "data1", "data2", etc., using an exponential search algorithm.
-- It is similar to the operator #, but may return
-- a different value when there are gaps in the array portion of the table.
-- Intended to be used on data loaded with mw.loadData. For other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of
-- the number of unnamed template parameters, so use this function for
-- frame.args.
--]]
function p.length(t, prefix)
-- requiring module inline so that [[Module:Exponential search]]
-- which is only needed by this one function
-- doesn't get millions of transclusions
local expSearch = require("Module:Exponential search")
checkType('length', 1, t, 'table')
checkType('length', 2, prefix, 'string', true)
return expSearch(function(i)
local key
if prefix then
key = prefix .. tostring(i)
else
key = i
end
return t[key] ~= nil
end) or 0
end
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
ad3062fee63cdfb979a1543abf96236cf7bf609d
36
7
2023-10-17T16:37:19Z
LamayII
2
1 revision imported from [[:meta:Module:TableTools]]
Scribunto
text/plain
--[[
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should --
-- not be called directly from #invoke. --
------------------------------------------------------------------------------------
--]]
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
--[[
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
--]]
function p.isPositiveInteger(v)
return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end
--[[
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a value can be a valid table key. Lua will
-- generate an error if a NaN is used as a table key.
------------------------------------------------------------------------------------
--]]
function p.isNan(v)
return type(v) == 'number' and tostring(v) == '-nan'
end
--[[
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
--]]
function p.shallowClone(t)
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
--]]
function p.removeDuplicates(t)
checkType('removeDuplicates', 1, t, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for i, v in ipairs(t) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
--]]
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k, v in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
-- return {1, 3, 6}.
------------------------------------------------------------------------------------
--]]
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k, v in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
-- of subtables in the format
-- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
-- Keys that don't end with an integer are stored in a subtable named "other".
-- The compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
--]]
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
--[[
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
--]]
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for k in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
else -- This will fail with table, boolean, function.
return item1 < item2
end
end
--[[
Returns a list of the keys in a table, sorted using either a default
comparison function or a custom keySort function.
]]
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, { 'function', 'boolean', 'nil' })
end
local list = {}
local index = 1
for key, value in pairs(t) do
list[index] = key
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(list, keySort)
end
return list
end
--[[
Iterates through a table, with the keys sorted using the keysToList function.
If there are only numerical keys, sparseIpairs is probably more efficient.
]]
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local list = p.keysToList(t, keySort, true)
local i = 0
return function()
i = i + 1
local key = list[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
--[[
Returns true if all keys in the table are consecutive integers starting at 1.
--]]
function p.isArray(t)
checkType("isArray", 1, t, "table")
local i = 0
for k, v in pairs(t) do
i = i + 1
if t[i] == nil then
return false
end
end
return true
end
-- { "a", "b", "c" } -> { a = 1, b = 2, c = 3 }
function p.invert(array)
checkType("invert", 1, array, "table")
local map = {}
for i, v in ipairs(array) do
map[v] = i
end
return map
end
--[[
{ "a", "b", "c" } -> { ["a"] = true, ["b"] = true, ["c"] = true }
--]]
function p.listToSet(t)
checkType("listToSet", 1, t, "table")
local set = {}
for _, item in ipairs(t) do
set[item] = true
end
return set
end
--[[
Recursive deep copy function.
Preserves identities of subtables.
]]
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[deepcopy(orig_key, includeMetatable, already_seen)] = deepcopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = deepcopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
--[[
Concatenates all values in the table that are indexed by a number, in order.
sparseConcat{ a, nil, c, d } => "acd"
sparseConcat{ nil, b, c, d } => "bcd"
]]
function p.sparseConcat(t, sep, i, j)
local list = {}
local list_i = 0
for _, v in p.sparseIpairs(t) do
list_i = list_i + 1
list[list_i] = v
end
return table.concat(list, sep, i, j)
end
--[[
-- Finds the length of an array, or of a quasi-array with keys such
-- as "data1", "data2", etc., using an exponential search algorithm.
-- It is similar to the operator #, but may return
-- a different value when there are gaps in the array portion of the table.
-- Intended to be used on data loaded with mw.loadData. For other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of
-- the number of unnamed template parameters, so use this function for
-- frame.args.
--]]
function p.length(t, prefix)
-- requiring module inline so that [[Module:Exponential search]]
-- which is only needed by this one function
-- doesn't get millions of transclusions
local expSearch = require("Module:Exponential search")
checkType('length', 1, t, 'table')
checkType('length', 2, prefix, 'string', true)
return expSearch(function(i)
local key
if prefix then
key = prefix .. tostring(i)
else
key = i
end
return t[key] ~= nil
end) or 0
end
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
ad3062fee63cdfb979a1543abf96236cf7bf609d
Module:Navbar/styles.css
828
7
9
8
2023-10-17T15:47:34Z
LamayII
2
1 revision imported from [[:meta:Module:Navbar/styles.css]]
text
text/plain
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar-collapse {
float: left;
text-align: left;
}
.navbar-boxtext {
word-spacing: 0;
}
.navbar ul {
display: inline-block;
white-space: nowrap;
line-height: inherit;
}
.navbar-brackets::before {
margin-right: -0.125em;
content: '[ ';
}
.navbar-brackets::after {
margin-left: -0.125em;
content: ' ]';
}
.navbar li {
word-spacing: -0.125em;
}
.navbar a > span,
.navbar a > abbr {
text-decoration: inherit;
}
.navbar-mini abbr {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
.navbar-ct-full {
font-size: 114%;
margin: 0 7em;
}
.navbar-ct-mini {
font-size: 114%;
margin: 0 4em;
}
ffa40f872281063642a36504ff608aa4c75ecf55
Los Alameda County Sheriff's Department
0
8
10
2023-10-17T15:59:12Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
The '''Los Alameda County Sheriff's Department (LASD)''', officially the '''County of Los Alameda Sheriff's Department''' is a law enforcement agency within the State of Santa Modesta serving Los Alameda County. LASD is the largest law enforcement agency in the state. Since the department’s formation in 1850, the County of Los Alameda Sheriff’s Department has taken the responsibilities of providing contracted municipal police services within unincorporated communities of Los Alameda County, provide courthouse security for the Superior Court of Los Alameda County, and regulate the housing and transportation services of inmates within the county jail system.
== History ==
b352d4ddb41f8078c47e5519b0f22c5fb166fc3f
11
10
2023-10-17T15:59:33Z
LamayII
2
Protected "[[Los Alameda County Sheriff's Department]]": High traffic page ([Edit=Allow only logged in users] (indefinite) [Move=Allow only logged in users] (indefinite))
wikitext
text/x-wiki
The '''Los Alameda County Sheriff's Department (LASD)''', officially the '''County of Los Alameda Sheriff's Department''' is a law enforcement agency within the State of Santa Modesta serving Los Alameda County. LASD is the largest law enforcement agency in the state. Since the department’s formation in 1850, the County of Los Alameda Sheriff’s Department has taken the responsibilities of providing contracted municipal police services within unincorporated communities of Los Alameda County, provide courthouse security for the Superior Court of Los Alameda County, and regulate the housing and transportation services of inmates within the county jail system.
== History ==
b352d4ddb41f8078c47e5519b0f22c5fb166fc3f
Template:Infobox
10
9
12
2023-10-17T16:09:50Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{Documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
{{En-WP attribution notice|Template:Infobox}}
</noinclude>
9e34306414672f80e601e13674f4524ccd7b70ec
22
12
2023-10-17T16:37:16Z
LamayII
2
1 revision imported from [[:meta:Template:Infobox]]
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{Documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
{{En-WP attribution notice|Template:Infobox}}
</noinclude>
9e34306414672f80e601e13674f4524ccd7b70ec
Template:Law Enforcement Agency
10
10
13
2023-10-17T16:18:41Z
LamayII
2
Infobox created with infobox builder.
wikitext
text/x-wiki
<infobox>
<title source="agencyname">
<default>{{PAGENAME}}</default>
</title>
<image source="departmentlogo"/>
<data source="agencyname">
<label>Agency Name</label>
</data>
<data source="commonname">
<label>Common Name</label>
</data>
<data source="abbreviation">
<label>Abbreviation</label>
</data>
<data source="motto">
<label>Motto</label>
</data>
<data source="data5">
<label>Label</label>
</data>
<title source="overview">
<default>Agency Overview</default>
</title>
<data source="formed">
<label>Formed</label>
</data>
<data source="budget">
<label>Budget</label>
</data>
<title source="structure">
<default>Operational Structure</default>
</title>
<data source="headquarters">
<label>Headquarters</label>
</data>
<data source="command">
<label>Agency Executives</label>
</data>
<data source="website">
<label>Website</label>
</data>
</infobox>
30827d39347066bb727817a0faa71fe3cb2bdc37
Template:Infobox/doc
10
11
14
2023-10-17T16:26:11Z
LamayII
2
Created page with "{{distinguish|Template:Userbox}} {{Documentation subpage}} {{Lua|Module:Infobox}} {{Parameter names example |name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>...... |image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>...... |header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div> |label2={{{label1}}} |data2={{{data1}}} |data3=( ''or'' ) |data4=<..."
wikitext
text/x-wiki
{{distinguish|Template:Userbox}}
{{Documentation subpage}}
{{Lua|Module:Infobox}}
{{Parameter names example
|name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
|image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>......
|header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div>
|label2={{{label1}}} |data2={{{data1}}}
|data3=( ''or'' ) |data4=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data1}}}</div>
|header5={{{header2}}}<br/><div style="padding:0.75em 0 0.5em;">{{nobold|( ''or'' )}}</div>
|label6={{{label2}}} |data6={{{data2}}}
|data7=( ''or'' ) |data8=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data2}}}</div>
|data9=<div style="padding:0.75em 0 0.5em;">( ''etc'' )</div>
|below
}}
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[Help:Infobox]] contains an introduction about the recommended content and design of infoboxes; [[Wikipedia:Manual of Style/Infoboxes]] contains additional style guidelines. See [[WP:List of infoboxes]] and [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
== Usage ==
Usage is similar to {{tl|navbox}}, but with an additional distinction. Each row on the table can contain either a header, or a label/data pair, or just a data cell. These are mutually exclusive states so if you define a row with both a header and a label/data pair, the label/data pair is ignored.
To insert an image somewhere other than at the top of the infobox, or to insert freeform data, use a row with only a data field.
== Optional control parameters ==
; name : If this parameter is present, "view/discuss/edit" links will be added to the bottom of the infobox, pointing to the named page. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however this is rarely what you want, because it will send users clicking these links in an infobox in an article to the template code rather than the data in the infobox that they probably want to change.
; child : See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
; subbox : See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
== Content parameters ==
=== Title ===
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts as a caption it on top of the table. You can use both of them together if you like, or just one or the other, or even neither (though this is not recommended):
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For [[Wikipedia:Manual of Style/Accessibility#Tables|accessibility reasons]], this is the most recommended alternative.
; above : Text to put within the uppermost cell of the table.
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
Examples:
{{Infobox
| name = Infobox/doc
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
{{Infobox
| name = Infobox/doc
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
=== Illustration images ===
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default. See [[WP:ALT]] for more on alt text.
; caption(n) : Text to put underneath the images.
=== Main data ===
; header(n) : Text to use as a header in row n.
; label(n) : Text to use as a label in row n.
; data(n) : Text to display as data in row n.
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a {{para|header''(n)''}} will cause the corresponding {{para|data''(n)''}} (and {{para|rowclass''(n)''}} {{para|label''(n)''}}, see below) to be ignored; the absence of a {{para|data''(n)''}} will cause the corresponding {{para|label''(n)''}} to be ignored. Valid combinations for any single row are:
* {{para|class''(n)''}} {{para|header''(n)''}}
* {{para|rowclass''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
* {{para|rowclass''(n)''}} {{para|label''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
==== Number ranges ====
To allow flexibility when the layout of an infobox is changed, it may be helpful when developing an infobox to use non-contiguous numbers for header and label/data rows. Parameters for new rows can then be inserted in future without having to renumber existing parameters. For example:
<pre style="overflow:auto">
| header3 = Section 1
| label5 = Label A
| data5 = Data A
| label7 = Label C
| data7 = Data C
| header10 = Section 2
| label12 = Label D
| data12 = Data D
</pre>{{clear}}
It is also possible to automatically renumber parameter names by using [[User:Frietjes/infoboxgap.js]] or [[Module:IncrementParams]].
==== Making data fields optional ====
A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:
<pre style="overflow:auto">
| label5 = Population
| data5 = {{{population|}}}
</pre>{{clear}}
This way if an article doesn't define the population parameter in its infobox the row won't be displayed.
For more complex fields with pre-formatted contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter ''mass'' has been supplied |then display it, followed by 'kg'":
<pre style="overflow:auto">
| label6 = Mass
| data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}
</pre>{{clear}}
For more on #if, see [[meta:ParserFunctions##if:|here]].
==== Hiding headers when all data fields are hidden ====
You can also make headers optional in a similar way. Consider this example:
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
If you want the first header to appear only if one or more of the data fields that fall under it are filled, one could use the following pattern as an example of how to do it:
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no emty row appears before the next static content. The trick to this is that the "#if" returns false only if there is nothing whatsoever in the conditional section, so only if all three of item1, item2 and item3 are undefined will the if statement fail.
Note that such trick may be sometimes very complex to test if there are many data items whose value depends on complex tests (or when a data row is generated by a recursive invokation of this template as a [[#Subboxes|subbox]]). Ideally, the Lua module supporting this template should now support a new way to make each header row autohideable by detecting if there is at least one non-empty data row after that header row (a parameter like "autohide header1 = yes", for example, would remove the need to perform the "#if" test so that we can just to define "header1 = Optional header"),
=== Footer ===
; below : Text to put in the bottom cell. The bottom cell is intended for footnotes, see-also, and other such information.
== Presentation parameters ==
=== Italic titles ===
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
* Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{para|italic title|<nowiki>{{{italic title|no}}}</nowiki>}}
* Do not make any titles italic by not passing the parameter at all.
=== CSS styling ===
; bodystyle : Applies to the infobox table as a whole
; titlestyle : Applies only to the title caption. Adding a background color is usually inadvisable since the text is rendered "outside" the infobox.
; abovestyle : Applies only to the "above" cell at the top. The default style has font-size:125%; since this cell is usually used for a title, if you want to use the above cell for regular-sized text include "font-size:100%;" in the abovestyle.
; imagestyle : Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
; captionstyle : Applies to the text of the image caption.
; rowstyle(n) : This parameter is inserted into the <code>style</code> attribute for the specified row.
; headerstyle : Applies to all header cells
; labelstyle : Applies to all label cells
; datastyle : Applies to all data cells
; belowstyle : Applies only to the below cell
=== HTML classes and microformats ===
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
<!-- currently not implemented in Lua module
; aboverowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''above''' cell is on.
-->
; aboveclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''above''' cell.
; subheaderrowclass(n) : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''subheader''' is on.
; subheaderclass(n) : This parameter is inserted into the <code>class</code> attribute for the infobox's '''subheader'''.
; imagerowclass(n) : These parameters are inserted into the <code>class</code> attribute for the complete table row their respective '''image''' is on.
; imageclass : This parameter is inserted into the <code>class</code> attribute for the '''image'''.
; rowclass(n) : This parameter is inserted into the <code>class</code> attribute for the specified row including the '''label''' and '''data''' cells.
; class(n) : This parameter is inserted into the <code>class</code> attribute for the '''data''' cell of the specified row. If there's no '''data''' cell it has no effect.
<!-- currently not implemented in Lua module
; belowrowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''below''' cell is on.
-->
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others beig used for microformats.
To flag an infobox as containing [[hCard]] information, for example, add the following parameter:
<pre style="overflow:auto">
| bodyclass = vcard
</pre>{{clear}}
And for each row containing a data cell that's part of the vcard, add a corresponding class parameter:
<pre style="overflow:auto">
| class1 = fn
| class2 = org
| class3 = tel
</pre>{{clear}}
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
== Examples ==
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
{{Infobox
|name = Infobox/doc
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
<pre style="overflow:auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
| image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
</pre>{{clear}}
For this example, the '''bodystyle''' and '''labelstyle''' parameters are used to adjust the infobox width and define a default width for the column of labels:
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
<pre style="overflow: auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
</pre>{{clear}}
== Embedding ==
<!--Linked from [[Template:Subinfobox bodystyle/doc]]-->
One infobox template can be embedded into another using the {{para|child}} parameter or the {{para|embed}} parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note, in the examples above, the child infobox is placed in a <code>data</code> field, not a <code>header</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a '''header''' field (but not in a '''label''' field because it would not be displayed!), either using
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
or,
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note that omitting the {{para|title}} parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation.
[[Wikipedia:WikiProject Infoboxes/embed]] includes some links to Wikipedia articles which include infoboxes embedded within other infoboxes.
== Subboxes ==
An alternative method for embedding is to use {{para|subbox|yes}}, which removes the outer border from the infobox, but preserves the interior structure. One feature of this approach is that the parent and child boxes need not have the same structure, and the label and data fields are not aligned between the parent and child boxes because they are not in the same parent table.
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
<source lang="sass" style="overflow:auto">
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
</source>{{clear}}
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
<source lang="sass" style="overflow:auto">
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
</source>{{clear}}
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
== Controlling line-breaking in embedded bulletless lists ==
Template {{tlx|nbsp}} may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists embedded in infoboxes (e.g. cast list in {{tlx|Infobox film}}), to prevent wrapped long entries from being confused with multiple entries. See [[Template:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
== Full blank syntax ==
(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| child = {{{child|}}}
| subbox = {{{subbox|}}}
| italic title = {{{italic title|no}}}
| bodystyle =
| titlestyle =
| abovestyle =
| subheaderstyle =
| title =
| above =
| subheader =
| imagestyle =
| captionstyle =
| image =
| caption =
| image2 =
| caption2 =
| headerstyle =
| labelstyle =
| datastyle =
| header1 =
| label1 =
| data1 =
| header2 =
| label2 =
| data2 =
| header3 =
| label3 =
| data3 =
| header4 =
| label4 =
| data4 =
| header5 =
| label5 =
| data5 =
| header6 =
| label6 =
| data6 =
| header7 =
| label7 =
| data7 =
| header8 =
| label8 =
| data8 =
| header9 =
| label9 =
| data9 =
| header10 =
| label10 =
| data10 =
| header11 =
| label11 =
| data11 =
| header12 =
| label12 =
| data12 =
| header13 =
| label13 =
| data13 =
| header14 =
| label14 =
| data14 =
| header15 =
| label15 =
| data15 =
| header16 =
| label16 =
| data16 =
| header17 =
| label17 =
| data17 =
| header18 =
| label18 =
| data18 =
| header19 =
| label19 =
| data19 =
| header20 =
| label20 =
| data20 =
| belowstyle =
| below =
}}
</pre>{{clear}}
{{Help:Infobox/user style}}
== Porting to other MediaWikis ==
The infobox template requires the [[:mw:Extension:Scribunto|Scribunto]] extension and [[mw:Manual:Using content from Wikipedia#HTMLTidy|HTMLTidy]] to be installed. It may not work with other MediaWikis. [[Wikipedia:WikiProject Transwiki|WikiProject Transwiki]] has a version of this template that has been modified to work on other MediaWikis.
==See also==
* [[Module:Infobox]], the [[WP:LUA|Lua]] module on which this template is based
* [[Special:Permalink/558855956|Template:Infobox/old]], the previous ParserFunctions implementation
* {{tl|Infobox3cols}}
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[Wikipedia:List of infoboxes|List of infoboxes]]
* [[:Module:InfoboxImage]]
* Maintenance categories:
** [[:Category:Articles which use infobox templates with no data rows]]
** [[:Category:Pages which use embedded infobox templates with the title parameter]]
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[Category:Infobox templates| ]]
[[Category:Wikipedia metatemplates|Infobox]]
[[Category:Templates generating microformats]]
}}</includeonly>
c767a15bb58ea62ebebf6e3e4e3579c68465da04
Template:Documentation
10
12
15
2023-10-17T16:27:51Z
LamayII
2
Created page with "{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude> <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude>"
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
ce7fd93f18c46b4fa871bf679afd05cbda72d8c4
19
15
2023-10-17T16:31:03Z
LamayII
2
Protected "[[Template:Documentation]]": Edit warring ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
ce7fd93f18c46b4fa871bf679afd05cbda72d8c4
20
19
2023-10-17T16:31:28Z
LamayII
2
Removed protection from "[[Template:Documentation]]"
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
ce7fd93f18c46b4fa871bf679afd05cbda72d8c4
46
20
2023-10-17T16:37:21Z
LamayII
2
1 revision imported from [[:meta:Template:Documentation]]
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
ce7fd93f18c46b4fa871bf679afd05cbda72d8c4
Module:Documentation
828
13
16
2023-10-17T16:28:13Z
LamayII
2
Initial Commit
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return mw.ustring.format('[[%s|%s]]', page, display)
else
return mw.ustring.format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return mw.ustring.format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return '<span class="' .. message('toolbar-class') .. '">('
.. table.concat(ret, ' | ') .. ')</span>'
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.fullUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
local data = {}
data.title = title
data.docTitle = docTitle
-- View, display, edit, and purge links if /doc exists.
data.viewLinkDisplay = message('view-link-display')
data.editLinkDisplay = message('edit-link-display')
data.historyLinkDisplay = message('history-link-display')
data.purgeLinkDisplay = message('purge-link-display')
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 6 then -- File namespace
preload = message('file-docpage-preload')
elseif subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
data.preload = preload
data.createLinkDisplay = message('create-link-display')
return data
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local function escapeBrackets(s)
-- Escapes square brackets with HTML entities.
s = s:gsub('%[', '[') -- Replace square brackets with HTML entities.
s = s:gsub('%]', ']')
return s
end
local ret
local docTitle = data.docTitle
local title = data.title
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
ret = '[%s] [%s] [%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
else
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
ret = '[%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, createLink)
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editUrl = docTitle:fullUrl{action = 'edit'}
local editDisplay = message('edit-link-display')
local editLink = makeUrlLink(editUrl, editDisplay)
local historyUrl = docTitle:fullUrl{action = 'history'}
local historyDisplay = message('history-link-display')
local historyLink = makeUrlLink(historyUrl, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
621cd86c0b54a1771f02723bad84203cf7c7ed8e
48
16
2023-10-17T16:37:21Z
LamayII
2
1 revision imported from [[:meta:Module:Documentation]]
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return mw.ustring.format('[[%s|%s]]', page, display)
else
return mw.ustring.format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return mw.ustring.format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return '<span class="' .. message('toolbar-class') .. '">('
.. table.concat(ret, ' | ') .. ')</span>'
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.fullUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
local data = {}
data.title = title
data.docTitle = docTitle
-- View, display, edit, and purge links if /doc exists.
data.viewLinkDisplay = message('view-link-display')
data.editLinkDisplay = message('edit-link-display')
data.historyLinkDisplay = message('history-link-display')
data.purgeLinkDisplay = message('purge-link-display')
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 6 then -- File namespace
preload = message('file-docpage-preload')
elseif subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
data.preload = preload
data.createLinkDisplay = message('create-link-display')
return data
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local function escapeBrackets(s)
-- Escapes square brackets with HTML entities.
s = s:gsub('%[', '[') -- Replace square brackets with HTML entities.
s = s:gsub('%]', ']')
return s
end
local ret
local docTitle = data.docTitle
local title = data.title
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
ret = '[%s] [%s] [%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
else
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
ret = '[%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, createLink)
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editUrl = docTitle:fullUrl{action = 'edit'}
local editDisplay = message('edit-link-display')
local editLink = makeUrlLink(editUrl, editDisplay)
local historyUrl = docTitle:fullUrl{action = 'history'}
local historyDisplay = message('history-link-display')
local historyLink = makeUrlLink(historyUrl, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
621cd86c0b54a1771f02723bad84203cf7c7ed8e
Module:Arguments
828
14
17
2023-10-17T16:29:07Z
LamayII
2
Initial Commit
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
26
17
2023-10-17T16:37:17Z
LamayII
2
1 revision imported from [[:meta:Module:Arguments]]
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Documentation/config
828
15
18
2023-10-17T16:30:16Z
LamayII
2
Created page with "---------------------------------------------------------------------------------------------------- -- -- Configuration for Module:Documentation -- -- Here you can set the values of the parameters and messages used in Module:Documentation to -- localise it to your wiki and your language. Unless specified otherwise, values given here -- should be string values. ---------------------------------------------------------------------------------..."
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['file-docpage-preload']
-- Preload file for documentation page in the file namespace.
cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
5f4ad23fca41592ae0f03e5f07d2b9e235fd7170
50
18
2023-10-17T16:37:22Z
LamayII
2
1 revision imported from [[:meta:Module:Documentation/config]]
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['file-docpage-preload']
-- Preload file for documentation page in the file namespace.
cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
5f4ad23fca41592ae0f03e5f07d2b9e235fd7170
Module:Yesno
828
16
24
23
2023-10-17T16:37:17Z
LamayII
2
1 revision imported from [[:meta:Module:Yesno]]
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Module:Template translation
828
17
28
27
2023-10-17T16:37:18Z
LamayII
2
1 revision imported from [[:meta:Module:Template_translation]]
Scribunto
text/plain
local this = {}
function this.checkLanguage(subpage, default)
--[[Check first if there's an any invalid character that would cause the
mw.language.isKnownLanguageTag function() to throw an exception:
- all ASCII controls in [\000-\031\127],
- double quote ("), sharp sign (#), ampersand (&), apostrophe ('),
- slash (/), colon (:), semicolon (;), lower than (<), greater than (>),
- brackets and braces ([, ], {, }), pipe (|), backslash (\\)
All other characters are accepted, including space and all non-ASCII
characters (including \192, which is invalid in UTF-8).
--]]
if mw.language.isValidCode(subpage) and mw.language.isKnownLanguageTag(subpage)
--[[However "SupportedLanguages" are too restrictive, as they discard many
valid BCP47 script variants (only because MediaWiki still does not
define automatic transliterators for them, e.g. "en-dsrt" or
"fr-brai" for French transliteration in Braille), and country variants,
(useful in localized data, even if they are no longer used for
translations, such as zh-cn, also useful for legacy codes).
We want to avoid matching subpagenames containing any uppercase letter,
(even if they are considered valid in BCP 47, in which they are
case-insensitive; they are not "SupportedLanguages" for MediaWiki, so
they are not "KnownLanguageTags" for MediaWiki).
To be more restrictive, we exclude tags
* for specific uses in template subpages and unusable as language tags;
* that is not ASCII and not a lowercase letter, minus-hyphen, or digit,
or does not start by a letter or does not finish by a letter or digit;
* or that has subtags with more than 8 characters between hyphens;
* or that has two hyphens.
--]]
or subpage ~= "doc"
and subpage ~= "layout"
and subpage ~= "button"
and subpage ~= "buttons"
and subpage ~= "sandbox"
and subpage ~= "testcase"
and subpage ~= "testcases"
and string.find(subpage, "^[%l][%-%d%l]*[%d%l]$") ~= nil
and string.find(subpage, "[%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l]") == nil
and string.find(subpage, "%-%-") == nil then
return subpage
end
-- Otherwise there's currently no known language subpage
return default
end
--[[Get the last subpage of an arbitrary page if it is a translation.
To be used from templates.
]]
function this.getLanguageSubpage(frame)
local title = frame and frame.args[1]
if not title or title == '' then
title = mw.title.getCurrentTitle()
end
return this._getLanguageSubpage(title)
end
--[[Get the last subpage of an arbitrary page if it is a translation.
To be used from Lua.
]]
function this._getLanguageSubpage(title)
if type(title) == 'string' then
title = mw.title.new(title)
end
if not title then
-- invalid title
return nil
end
--[[This code does not work in all namespaces where the Translate tool works.
-- It works in the main namespace on Meta because it allows subpages there
-- It would not work in the main namespace of English Wikipedia (but the
-- articles are monolignual on that wiki).
-- On Meta-Wiki the main space uses subpages and its pages are translated.
-- The Translate tool allows translatng pages in all namespaces, even if
-- the namespace officially does not have subpages.
-- On Meta-Wiki the Category namespace still does not have subpages enabled,
-- even if they would be very useful for categorizing templates, that DO have
-- subpages (for documentatio and tstboxes pages). This is a misconfiguration
-- bug of Meta-Wiki. The work-around is to split the full title and then
-- get the last titlepart.
local subpage = title.subpageText
--]]
local titleparts = mw.text.split(title.fullText, '/')
local subpage = titleparts[#titleparts]
return this.checkLanguage(subpage, '')
end
--[[Get the last subpage of the current page if it is a translation.
]]
function this.getCurrentLanguageSubpage()
return this._getLanguageSubpage(mw.title.getCurrentTitle())
end
--[[Get the first part of the language code of the subpage, before the '-'.
--]]
function this.getMainLanguageSubpage()
parts = mw.text.split(this.getCurrentLanguageSubpage(), '-')
return parts[1]
end
--[[Get the last subpage of the current frame if it is a translation.
Not used locally.
--]]
function this.getFrameLanguageSubpage(frame)
return this._getLanguageSubpage(frame:getParent():getTitle())
end
--[[Get the language of the current page. Not used locally.
--]]
function this.getLanguage()
local subpage = mw.title.getCurrentTitle().subpageText
return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode())
end
--[[Get the language of the current frame. Not used locally.
--]]
function this.getFrameLanguage(frame)
local titleparts = mw.text.split(frame:getParent():getTitle(), '/')
local subpage = titleparts[#titleparts]
return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode())
end
function this.title(namespace, basepagename, subpage)
local message, title
local pagename = basepagename
if (subpage or '') ~= '' then
pagename = pagename .. '/' .. subpage
end
local valid, title = xpcall(function()
return mw.title.new(pagename, namespace) -- costly
end, function(msg) -- catch undocumented exception (!?)
-- thrown when namespace does not exist. The doc still
-- says it should return a title, even in that case...
message = msg
end)
if valid and title ~= nil and (title.id or 0) ~= 0 then
return title
end
return { -- "pseudo" mw.title object with id = nil in case of error
prefixedText = pagename, -- the only property we need below
message = message -- only for debugging
}
end
--[[If on a translation subpage (like Foobar/de), this function returns
a given template in the same language, if the translation is available.
Otherwise, the template is returned in its default language, without
modification.
This is aimed at replacing the current implementation of Template:TNTN.
This version does not expand the returned template name: this solves the
problem of self-recursion in TNT when translatable templates need themselves
to transclude other translable templates (such as Tnavbar).
--]]
function this.getTranslatedTemplate(frame, withStatus)
local args = frame.args
local pagename = args['template']
--[[Check whether the pagename is actually in the Template namespace, or
if we're transcluding a main-namespace page.
(added for backward compatibility of Template:TNT)
]]
local namespace, title = args['tntns'] or ''
if namespace ~= '' then -- Checks for tntns parameter for custom ns.
title = this.title(namespace, pagename) -- Costly
else -- Supposes that set page is in ns10.
namespace = 'Template'
title = this.title(namespace, pagename) -- Costly
if title.id == nil then -- not found in the Template namespace, assume the main namespace (for backward compatibility)
namespace = ''
title = this.title(namespace, pagename) -- Costly
end
end
-- Get the last subpage and check if it matches a known language code.
local subpage = args['uselang'] or ''
if subpage == '' then
subpage = this.getCurrentLanguageSubpage()
end
if subpage == '' then
-- Check if a translation of the pagename exists in English
local newtitle = this.title(namespace, pagename, 'en') -- Costly
-- Use the translation when it exists
if newtitle.id ~= nil then
title = newtitle
end
else
-- Check if a translation of the pagename exists in that language
local newtitle = this.title(namespace, pagename, subpage) -- Costly
if newtitle.id == nil then
-- Check if a translation of the pagename exists in English
newtitle = this.title(namespace, pagename, 'en') -- Costly
end
-- Use the translation when it exists
if newtitle.id ~= nil then
title = newtitle
end
end
-- At this point the title should exist
if withStatus then
-- status returned to Lua function below
return title.prefixedText, title.id ~= nil
else
-- returned directly to MediaWiki
return title.prefixedText
end
end
--[[If on a translation subpage (like Foobar/de), this function renders
a given template in the same language, if the translation is available.
Otherwise, the template is rendered in its default language, without
modification.
This is aimed at replacing the current implementation of Template:TNT.
Note that translatable templates cannot transclude themselves other
translatable templates, as it will recurse on TNT. Use TNTN instead
to return only the effective template name to expand externally, with
template parameters also provided externally.
--]]
function this.renderTranslatedTemplate(frame)
local title, found = this.getTranslatedTemplate(frame, true)
-- At this point the title should exist prior to performing the expansion
-- of the template, otherwise render a red link to the missing page
-- (resolved in its assumed namespace). If we don't tet this here, a
-- script error would be thrown. Returning a red link is consistant with
-- MediaWiki behavior when attempting to transclude inexistant templates.
if not found then
return '[[' .. title .. ']]'
end
-- Copy args pseudo-table to a proper table so we can feed it to expandTemplate.
-- Then render the pagename.
local args = frame.args
local pargs = (frame:getParent() or {}).args
local arguments = {}
if (args['noshift'] or '') == '' then
for k, v in pairs(pargs) do
local n = tonumber(k) or 0
if n <= 0 then -- unnumbered args
arguments[k] = v
elseif n >= 2 then -- numbered args >= 2 need to be shifted
arguments[n - 1] = v
end
end
else -- special case where TNT is used as autotranslate
-- (don't shift again what is shifted in the invokation)
for k, v in pairs(pargs) do
arguments[k] = v
end
end
arguments['template'] = title -- override the existing parameter of the base template name supplied with the full name of the actual template expanded
arguments['tntns'] = nil -- discard the specified namespace override
arguments['uselang'] = args['uselang'] -- argument forwarded into parent frame
arguments['noshift'] = args['noshift'] -- argument forwarded into parent frame
return frame:expandTemplate{title = ':' .. title, args = arguments}
end
--[[A helper for mocking TNT in Special:TemplateSandbox. TNT breaks
TemplateSandbox; mocking it with this method means templates won't be
localized but at least TemplateSandbox substitutions will work properly.
Won't work with complex uses.
--]]
function this.mockTNT(frame)
local pargs = (frame:getParent() or {}).args
local arguments = {}
for k, v in pairs(pargs) do
local n = tonumber(k) or 0
if n <= 0 then -- unnumbered args
arguments[k] = v
elseif n >= 2 then -- numbered args >= 2 need to be shifted
arguments[n - 1] = v
end
end
if not pargs[1] then
return ''
end
return frame:expandTemplate{title = 'Template:' .. pargs[1], args = arguments}
end
return this
5d6ccce18a15ce0078fd1918b6afeb5b443f37ee
Module:Message box
828
18
30
29
2023-10-17T16:37:18Z
LamayII
2
1 revision imported from [[:meta:Module:Message_box]]
Scribunto
text/plain
require('Module:No globals')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
or 'Imbox notice.png', imageSize)
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
fd6a8b1a0ac5916465cdf2eb099825f1d006cfba
Module:No globals
828
19
32
31
2023-10-17T16:37:18Z
LamayII
2
1 revision imported from [[:meta:Module:No_globals]]
Scribunto
text/plain
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
-- perf optimization here and below: do not load Module:TNT unless there is an error
error(require('Module:TNT').format('I18n/No globals', 'err-read', tostring(k)), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error(require('Module:TNT').format('I18n/No globals', 'err-write', tostring(k)), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)
efcb47c74e7e2bb9a4ad8764d99a0afce8fed410
Module:Message box/configuration
828
20
34
33
2023-10-17T16:37:19Z
LamayII
2
1 revision imported from [[:meta:Module:Message_box/configuration]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '<small>[[Help:Maintenance template removal|Learn how and when to remove this template message]]</small>',
templatestyles = 'Module:Message box/ambox.css'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true,
templatestyles = 'Module:Message box/cmbox.css'
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false,
templatestyles = 'Module:Message box/fmbox.css'
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox license.png' -- @todo We need an SVG version of this
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg'
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes',
templatestyles = 'Module:Message box/imbox.css'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true,
templatestyles = 'Module:Message box/ombox.css'
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
templateCategory = 'Talk message boxes',
templatestyles = 'Module:Message box/tmbox.css'
}
}
b6f0151037e6867b577c8cca32ff297e48697a10
Module:Infobox/styles.css
828
21
44
43
2023-10-17T16:37:21Z
LamayII
2
1 revision imported from [[:meta:Module:Infobox/styles.css]]
text
text/plain
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
.infobox .navbar {
font-size: 100%;
}
/* T281642 */
body.skin-minerva .infobox-header,
body.skin-minerva .infobox-subheader,
body.skin-minerva .infobox-above,
body.skin-minerva .infobox-title,
body.skin-minerva .infobox-image,
body.skin-minerva .infobox-full-data,
body.skin-minerva .infobox-below {
text-align: center;
}
/* Infobox template style */
.infobox {
border: 1px solid #a2a9b1;
border-spacing: 3px;
background-color: #f8f9fa;
color: black;
/* @noflip */
margin: 0.5em 0 0.5em 1em;
padding: 0.2em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
font-size: 88%;
line-height: 1.5em;
width: 22em;
}
.infobox-header,
.infobox-label,
.infobox-above,
.infobox-full-data,
.infobox-data,
.infobox-below,
.infobox-subheader,
.infobox-image,
.infobox-navbar,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
vertical-align: top;
}
.infobox-label,
.infobox-data,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
/* @noflip */
text-align: left;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-above,
.infobox .infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
font-size: 125%;
font-weight: bold;
text-align: center;
}
.infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
padding: 0.2em;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-header,
.infobox .infobox-subheader,
.infobox .infobox-image,
.infobox .infobox-full-data,
.infobox .infobox-below {
text-align: center;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-navbar {
/* @noflip */
text-align: right;
}
eb850346855e4c081e692209d188b8432a2378d4
Module:TNT
828
22
52
51
2023-10-17T16:37:22Z
LamayII
2
1 revision imported from [[:meta:Module:TNT]]
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
params[k - 2] = mw.text.trim(v)
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in ipairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in ipairs(data.data) do
local newVal = {}
local name = nil
for pos, columnName in ipairs(names) do
if columnName == 'name' then
name = row[pos]
else
newVal[columnName] = row[pos]
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
2c570369c78089aef29c72768918373f61b7075d
Module:Documentation/i18n
828
23
54
53
2023-10-17T16:37:22Z
LamayII
2
1 revision imported from [[:meta:Module:Documentation/i18n]]
Scribunto
text/plain
local format = require('Module:TNT').format
local i18n = {}
i18n['cfg-error-msg-type'] = format('I18n/Documentation', 'cfg-error-msg-type')
i18n['cfg-error-msg-empty'] = format('I18n/Documentation', 'cfg-error-msg-empty')
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
i18n['template-namespace-heading'] = format('I18n/Documentation', 'template-namespace-heading')
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
i18n['module-namespace-heading'] = format('I18n/Documentation', 'module-namespace-heading')
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
i18n['file-namespace-heading'] = format('I18n/Documentation', 'file-namespace-heading')
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
i18n['other-namespaces-heading'] = format('I18n/Documentation', 'other-namespaces-heading')
-- cfg['view-link-display']
-- The text to display for "view" links.
i18n['view-link-display'] = format('I18n/Documentation', 'view-link-display')
-- cfg['edit-link-display']
-- The text to display for "edit" links.
i18n['edit-link-display'] = format('I18n/Documentation', 'edit-link-display')
-- cfg['history-link-display']
-- The text to display for "history" links.
i18n['history-link-display'] = format('I18n/Documentation', 'history-link-display')
-- cfg['purge-link-display']
-- The text to display for "purge" links.
i18n['purge-link-display'] = format('I18n/Documentation', 'purge-link-display')
-- cfg['create-link-display']
-- The text to display for "create" links.
i18n['create-link-display'] = format('I18n/Documentation', 'create-link-display')
return i18n
9a9f234b177a424f1fc465eb25c484eff54905c0
Module:Documentation/styles.css
828
24
56
55
2023-10-17T16:37:23Z
LamayII
2
1 revision imported from [[:meta:Module:Documentation/styles.css]]
text
text/plain
/* {{PP-template}} */
.ts-doc-sandbox .mbox-image {
padding:.75em 0 .75em .75em;
}
.ts-doc-doc {
clear: both;
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
margin-top: 1em;
padding: 5px;
}
.ts-doc-header {
padding-bottom: 3px;
border-bottom: 1px solid #a2a9b1;
margin-bottom: 1ex;
}
.ts-doc-header .ts-tlinks-tlinks {
display: inline-block;
line-height: 24px;
margin-left: 1em;
}
.ts-doc-header .ts-tlinks-tlinks a.external {
color: #0645ad;
}
.ts-doc-header .ts-tlinks-tlinks a.external:visited {
color: #0b0080;
}
.ts-doc-header .ts-tlinks-tlinks a.external:active {
color: #faa700;
}
.ts-doc-content:after {
content: '';
clear: both;
display: block;
}
.ts-doc-heading {
display: inline-block;
padding-left: 55px;
background: center left/50px no-repeat;
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png);
background-image: url(https://upload.wikimedia.org/wikipedia/commons/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg);
font-size: 1.5em;
}
.ts-doc-content > *:first-child,
.ts-doc-footer > *:first-child {
margin-top: .5em;
}
.ts-doc-content > *:last-child,
.ts-doc-footer > *:last-child {
margin-bottom: .5em;
}
.ts-doc-footer {
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
padding: .25em 1em;
margin-top: .2em;
font-style: italic;
}
.ts-doc-footer small {
font-style: normal;
}
.ts-doc-sandbox {
clear: both;
}
c37b0ddfd0b1c128c187ca56721d1c4e481b05ff
Template:Documentation subpage
10
25
58
57
2023-10-17T16:37:23Z
LamayII
2
1 revision imported from [[:meta:Template:Documentation_subpage]]
wikitext
text/x-wiki
<includeonly>{{#if:{{IsDocSubpage|override={{{override|doc}}}}}
| <!--doc subpage--></includeonly>{{#ifeq:{{{doc-notice|show}}}|show
| {{Ombox|type=notice|image=[[File:Edit-copy green.svg|40px|link=]]
|text='''This is a documentation [[mw:Help:Subpages|subpage]] for {{#if:{{{1|}}}
| {{{1}}}
| [[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]
}}.'''<br/> It contains usage information, categories, and other content that is not part of the original<!--
--> {{#if: {{{text2|}}}
| {{{text2|}}}
| {{#if: {{{text1|}}}
| {{{text1|}}}
| {{#ifeq: {{SUBJECTSPACE}} | {{ns:User}}
| {{lc:{{SUBJECTSPACE}}}} template page
| {{#if: {{SUBJECTSPACE}}
| {{lc:{{SUBJECTSPACE}}}} page
| article
}}
}}
}}
}}.
}}
<!--If not on a doc subpage, do nothing-->}}{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}{{#if: {{{inhibit|}}}
| <!--Skip-->
| <includeonly>{{#ifexist: {{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch: {{SUBJECTSPACE}}
|Template=Template
|Module=Module
|User=User
|#default=Template
}} documentation pages{{#translation:}}]]
| [[Category:Documentation subpages without corresponding pages{{#translation:}}]]
}}</includeonly>
}}<includeonly>
}}</includeonly><noinclude>{{Documentation}}<!--Add categories and interwikis to the /doc subpage, not here!--></noinclude>
2fcb7e4e2d233f798b114d37652fc333213f5ea7
Template:IsDocSubpage
10
26
60
59
2023-10-17T16:37:24Z
LamayII
2
1 revision imported from [[:meta:Template:IsDocSubpage]]
wikitext
text/x-wiki
<onlyinclude><includeonly>{{#ifexpr: (
{{#ifeq:{{lc:{{SUBPAGENAME}}}}|{{lc:{{{override|doc}}}}}|1|0}} or (
{{#ifeq:{{lc:{{#titleparts:{{FULLPAGENAME}}|-1|-2}}}}|{{lc:{{{override|doc}}}}}|1|0}}
and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}}
)
)<!--
-->|{{{true|1}}}<!--
-->|{{{false|}}}<!--
-->}}</includeonly></onlyinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
e60f69b26953d441bf5b76229c9222f16c042ae6
Module:List
828
27
62
61
2023-10-17T16:37:24Z
LamayII
2
1 revision imported from [[:meta:Module:List]]
Scribunto
text/plain
-- This module outputs different kinds of lists. At the moment, bulleted,
-- unbulleted, horizontal, ordered, and horizontal ordered lists are supported.
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes
data.classes = {}
data.templatestyles = ''
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Template:Flatlist/styles.css' }
}
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Template:Plainlist/styles.css' }
}
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for i, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for i, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for i, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return data.templatestyles .. tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
b60cb90a28f54a237f389f8009157816b631d806
Module:Message box/ombox.css
828
28
64
63
2023-10-17T16:37:24Z
LamayII
2
1 revision imported from [[:meta:Module:Message_box/ombox.css]]
text
text/plain
/* {{pp|small=y}} */
.ombox {
margin: 4px 0;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
/* For the "small=yes" option. */
.ombox.mbox-small {
font-size: 88%;
line-height: 1.25em;
}
.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ombox-delete {
border: 2px solid #b32424; /* Red */
}
.ombox-content {
border: 1px solid #f28500; /* Orange */
}
.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
.ombox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.9em;
width: 100%;
}
.ombox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.ombox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ombox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ombox .mbox-invalid-type {
text-align: center;
}
@media (min-width: 720px) {
.ombox {
margin: 4px 10%;
}
.ombox.mbox-small {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
width: 238px;
}
}
8fe3df4bb607e699eab2dbd23bd4a1a446391002
Module:Lua banner
828
29
66
65
2023-10-17T16:37:25Z
LamayII
2
1 revision imported from [[:meta:Module:Lua_banner]]
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local TNT = require('Module:TNT')
local p = {}
local function format(msg)
return TNT.format('I18n/Lua banner', msg)
end
local function getConfig()
return mw.loadData('Module:Lua banner/config')
end
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args, cfg)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules, cfg)
local trackingCategories = p.renderTrackingCategories(args, modules, nil, cfg)
return box .. trackingCategories
end
function p.renderBox(modules, cfg)
local boxArgs = {}
if #modules < 1 then
cfg = cfg or getConfig()
if cfg['allow_wishes'] then
boxArgs.text = format('wishtext')
else
boxArgs.text = string.format('<strong class="error">%s</strong>', format('error_emptylist'))
end
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
end
local moduleList = mList.makeList('bulleted', moduleLinks)
boxArgs.text = format('header') .. '\n' .. moduleList
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = string.format(
'[[File:Lua-logo-nolabel.svg|30px|alt=%s|link=%s]]',
format('logo_alt'),
format('logo_link')
)
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj, cfg)
if yesno(args.nocat) then
return ''
end
cfg = cfg or getConfig()
local cats = {}
-- Error category
if #modules < 1 and not cfg['allow_wishes'] and cfg['error_category'] then
cats[#cats + 1] = cfg['error_category']
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
if titleObj.namespace == 10
and not cfg['subpage_blacklist'][titleObj.subpageText]
then
local category = args.category
if not category then
local pagename = modules[1] and mw.title.new(modules[1])
category = pagename and cfg['module_categories'][pagename.text]
if not category then
if cfg['allow_wishes'] and #modules < 1 then
category = cfg['wish_category']
else
category = cfg['default_category']
end
end
end
if category then
cats[#cats + 1] = category
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
0fa5bd41f4b7ea898a70bc3d83af64846d0b0338
Module:Lua banner/config
828
30
68
67
2023-10-17T16:37:26Z
LamayII
2
1 revision imported from [[:meta:Module:Lua_banner/config]]
Scribunto
text/plain
local cfg = {} -- Don’t touch this line.
-- Subpage blacklist: these subpages will not be categorized (except for the
-- error category, which is always added if there is an error).
-- For example “Template:Foo/doc” matches the `doc = true` rule, so it will have
-- no categories. “Template:Foo” and “Template:Foo/documentation” match no rules,
-- so they *will* have categories. All rules should be in the
-- ['<subpage name>'] = true,
-- format.
cfg['subpage_blacklist'] = {
['doc'] = true,
['sandbox'] = true,
['sandbox2'] = true,
['testcases'] = true,
}
-- Allow wishes: whether wishes for conversion to Lua are allowed.
-- If true, calls with zero parameters are valid, and considered to be wishes:
-- The box’s text is “This template should use Lua”, and cfg['wish_category'] is
-- added. If false, such calls are invalid, an error message appears, and
-- cfg['error_category'] is added.
cfg['allow_wishes'] = false
-- Default category: this category is added if the module call contains errors
-- (e.g. no module listed). A category name without namespace, or nil
-- to disable categorization (not recommended).
cfg['error_category'] = 'Lua templates with errors'
-- Wish category: this category is added if no module is listed, and wishes are
-- allowed. (Not used if wishes are not allowed.) A category name without
-- namespace, or nil to disable categorization.
cfg['wish_category'] = nil
-- Default category: this category is added if none of the below module_categories
-- matches the first module listed. A category name without namespace, or nil
-- to disable categorization.
cfg['default_category'] = 'Lua-based templates'
-- Module categories: one of these categories is added if the first listed module
-- is the listed module (e.g. {{Lua|Module:String}} adds
-- [[Category:Lua String-based templates]].) Format:
-- ['<module name>'] = '<category name>'
-- where neither <module name> nor <category name> contains namespace. An empty
-- table (i.e. no module-based categorization) will suffice on smaller wikis.
cfg['module_categories'] = {
['Citation'] = 'Lua-based citation templates',
['Citation/CS1'] = 'Lua-based citation templates',
}
return cfg -- Don’t touch this line.
96ff2360e00fa7bf1df8fa9bea988789b8a82cab
Template:Lua
10
31
70
69
2023-10-17T16:37:27Z
LamayII
2
1 revision imported from [[:meta:Template:Lua]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>{{Lua|Module:Lua banner}}{{documentation}}[[Category:Utility templates]]</noinclude>
fd85a870209733ca65a7290fa45f6b4f321bac0b
Template:Infobox/doc
10
11
72
14
2023-10-17T16:37:28Z
LamayII
2
1 revision imported from [[:meta:Template:Infobox/doc]]
wikitext
text/x-wiki
{{distinguish|Template:Userbox}}
{{Documentation subpage}}
{{Lua|Module:Infobox}}
{{Parameter names example
|name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
|image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>......
|header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div>
|label2={{{label1}}} |data2={{{data1}}}
|data3=( ''or'' ) |data4=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data1}}}</div>
|header5={{{header2}}}<br/><div style="padding:0.75em 0 0.5em;">{{nobold|( ''or'' )}}</div>
|label6={{{label2}}} |data6={{{data2}}}
|data7=( ''or'' ) |data8=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data2}}}</div>
|data9=<div style="padding:0.75em 0 0.5em;">( ''etc'' )</div>
|below
}}
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[Help:Infobox]] contains an introduction about the recommended content and design of infoboxes; [[Wikipedia:Manual of Style/Infoboxes]] contains additional style guidelines. See [[WP:List of infoboxes]] and [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
== Usage ==
Usage is similar to {{tl|navbox}}, but with an additional distinction. Each row on the table can contain either a header, or a label/data pair, or just a data cell. These are mutually exclusive states so if you define a row with both a header and a label/data pair, the label/data pair is ignored.
To insert an image somewhere other than at the top of the infobox, or to insert freeform data, use a row with only a data field.
== Optional control parameters ==
; name : If this parameter is present, "view/discuss/edit" links will be added to the bottom of the infobox, pointing to the named page. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however this is rarely what you want, because it will send users clicking these links in an infobox in an article to the template code rather than the data in the infobox that they probably want to change.
; child : See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
; subbox : See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
== Content parameters ==
=== Title ===
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts as a caption it on top of the table. You can use both of them together if you like, or just one or the other, or even neither (though this is not recommended):
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For [[Wikipedia:Manual of Style/Accessibility#Tables|accessibility reasons]], this is the most recommended alternative.
; above : Text to put within the uppermost cell of the table.
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
Examples:
{{Infobox
| name = Infobox/doc
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
{{Infobox
| name = Infobox/doc
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
=== Illustration images ===
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default. See [[WP:ALT]] for more on alt text.
; caption(n) : Text to put underneath the images.
=== Main data ===
; header(n) : Text to use as a header in row n.
; label(n) : Text to use as a label in row n.
; data(n) : Text to display as data in row n.
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a {{para|header''(n)''}} will cause the corresponding {{para|data''(n)''}} (and {{para|rowclass''(n)''}} {{para|label''(n)''}}, see below) to be ignored; the absence of a {{para|data''(n)''}} will cause the corresponding {{para|label''(n)''}} to be ignored. Valid combinations for any single row are:
* {{para|class''(n)''}} {{para|header''(n)''}}
* {{para|rowclass''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
* {{para|rowclass''(n)''}} {{para|label''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
==== Number ranges ====
To allow flexibility when the layout of an infobox is changed, it may be helpful when developing an infobox to use non-contiguous numbers for header and label/data rows. Parameters for new rows can then be inserted in future without having to renumber existing parameters. For example:
<pre style="overflow:auto">
| header3 = Section 1
| label5 = Label A
| data5 = Data A
| label7 = Label C
| data7 = Data C
| header10 = Section 2
| label12 = Label D
| data12 = Data D
</pre>{{clear}}
It is also possible to automatically renumber parameter names by using [[User:Frietjes/infoboxgap.js]] or [[Module:IncrementParams]].
==== Making data fields optional ====
A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:
<pre style="overflow:auto">
| label5 = Population
| data5 = {{{population|}}}
</pre>{{clear}}
This way if an article doesn't define the population parameter in its infobox the row won't be displayed.
For more complex fields with pre-formatted contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter ''mass'' has been supplied |then display it, followed by 'kg'":
<pre style="overflow:auto">
| label6 = Mass
| data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}
</pre>{{clear}}
For more on #if, see [[meta:ParserFunctions##if:|here]].
==== Hiding headers when all data fields are hidden ====
You can also make headers optional in a similar way. Consider this example:
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
If you want the first header to appear only if one or more of the data fields that fall under it are filled, one could use the following pattern as an example of how to do it:
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no emty row appears before the next static content. The trick to this is that the "#if" returns false only if there is nothing whatsoever in the conditional section, so only if all three of item1, item2 and item3 are undefined will the if statement fail.
Note that such trick may be sometimes very complex to test if there are many data items whose value depends on complex tests (or when a data row is generated by a recursive invokation of this template as a [[#Subboxes|subbox]]). Ideally, the Lua module supporting this template should now support a new way to make each header row autohideable by detecting if there is at least one non-empty data row after that header row (a parameter like "autohide header1 = yes", for example, would remove the need to perform the "#if" test so that we can just to define "header1 = Optional header"),
=== Footer ===
; below : Text to put in the bottom cell. The bottom cell is intended for footnotes, see-also, and other such information.
== Presentation parameters ==
=== Italic titles ===
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
* Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{para|italic title|<nowiki>{{{italic title|no}}}</nowiki>}}
* Do not make any titles italic by not passing the parameter at all.
=== CSS styling ===
; bodystyle : Applies to the infobox table as a whole
; titlestyle : Applies only to the title caption. Adding a background color is usually inadvisable since the text is rendered "outside" the infobox.
; abovestyle : Applies only to the "above" cell at the top. The default style has font-size:125%; since this cell is usually used for a title, if you want to use the above cell for regular-sized text include "font-size:100%;" in the abovestyle.
; imagestyle : Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
; captionstyle : Applies to the text of the image caption.
; rowstyle(n) : This parameter is inserted into the <code>style</code> attribute for the specified row.
; headerstyle : Applies to all header cells
; labelstyle : Applies to all label cells
; datastyle : Applies to all data cells
; belowstyle : Applies only to the below cell
=== HTML classes and microformats ===
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
<!-- currently not implemented in Lua module
; aboverowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''above''' cell is on.
-->
; aboveclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''above''' cell.
; subheaderrowclass(n) : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''subheader''' is on.
; subheaderclass(n) : This parameter is inserted into the <code>class</code> attribute for the infobox's '''subheader'''.
; imagerowclass(n) : These parameters are inserted into the <code>class</code> attribute for the complete table row their respective '''image''' is on.
; imageclass : This parameter is inserted into the <code>class</code> attribute for the '''image'''.
; rowclass(n) : This parameter is inserted into the <code>class</code> attribute for the specified row including the '''label''' and '''data''' cells.
; class(n) : This parameter is inserted into the <code>class</code> attribute for the '''data''' cell of the specified row. If there's no '''data''' cell it has no effect.
<!-- currently not implemented in Lua module
; belowrowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''below''' cell is on.
-->
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others beig used for microformats.
To flag an infobox as containing [[hCard]] information, for example, add the following parameter:
<pre style="overflow:auto">
| bodyclass = vcard
</pre>{{clear}}
And for each row containing a data cell that's part of the vcard, add a corresponding class parameter:
<pre style="overflow:auto">
| class1 = fn
| class2 = org
| class3 = tel
</pre>{{clear}}
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
== Examples ==
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
{{Infobox
|name = Infobox/doc
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
<pre style="overflow:auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
| image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
</pre>{{clear}}
For this example, the '''bodystyle''' and '''labelstyle''' parameters are used to adjust the infobox width and define a default width for the column of labels:
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
<pre style="overflow: auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
</pre>{{clear}}
== Embedding ==
<!--Linked from [[Template:Subinfobox bodystyle/doc]]-->
One infobox template can be embedded into another using the {{para|child}} parameter or the {{para|embed}} parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note, in the examples above, the child infobox is placed in a <code>data</code> field, not a <code>header</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a '''header''' field (but not in a '''label''' field because it would not be displayed!), either using
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
or,
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note that omitting the {{para|title}} parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation.
[[Wikipedia:WikiProject Infoboxes/embed]] includes some links to Wikipedia articles which include infoboxes embedded within other infoboxes.
== Subboxes ==
An alternative method for embedding is to use {{para|subbox|yes}}, which removes the outer border from the infobox, but preserves the interior structure. One feature of this approach is that the parent and child boxes need not have the same structure, and the label and data fields are not aligned between the parent and child boxes because they are not in the same parent table.
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
<source lang="sass" style="overflow:auto">
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
</source>{{clear}}
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
<source lang="sass" style="overflow:auto">
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
</source>{{clear}}
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
== Controlling line-breaking in embedded bulletless lists ==
Template {{tlx|nbsp}} may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists embedded in infoboxes (e.g. cast list in {{tlx|Infobox film}}), to prevent wrapped long entries from being confused with multiple entries. See [[Template:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
== Full blank syntax ==
(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| child = {{{child|}}}
| subbox = {{{subbox|}}}
| italic title = {{{italic title|no}}}
| bodystyle =
| titlestyle =
| abovestyle =
| subheaderstyle =
| title =
| above =
| subheader =
| imagestyle =
| captionstyle =
| image =
| caption =
| image2 =
| caption2 =
| headerstyle =
| labelstyle =
| datastyle =
| header1 =
| label1 =
| data1 =
| header2 =
| label2 =
| data2 =
| header3 =
| label3 =
| data3 =
| header4 =
| label4 =
| data4 =
| header5 =
| label5 =
| data5 =
| header6 =
| label6 =
| data6 =
| header7 =
| label7 =
| data7 =
| header8 =
| label8 =
| data8 =
| header9 =
| label9 =
| data9 =
| header10 =
| label10 =
| data10 =
| header11 =
| label11 =
| data11 =
| header12 =
| label12 =
| data12 =
| header13 =
| label13 =
| data13 =
| header14 =
| label14 =
| data14 =
| header15 =
| label15 =
| data15 =
| header16 =
| label16 =
| data16 =
| header17 =
| label17 =
| data17 =
| header18 =
| label18 =
| data18 =
| header19 =
| label19 =
| data19 =
| header20 =
| label20 =
| data20 =
| belowstyle =
| below =
}}
</pre>{{clear}}
{{Help:Infobox/user style}}
== Porting to other MediaWikis ==
The infobox template requires the [[:mw:Extension:Scribunto|Scribunto]] extension and [[mw:Manual:Using content from Wikipedia#HTMLTidy|HTMLTidy]] to be installed. It may not work with other MediaWikis. [[Wikipedia:WikiProject Transwiki|WikiProject Transwiki]] has a version of this template that has been modified to work on other MediaWikis.
==See also==
* [[Module:Infobox]], the [[WP:LUA|Lua]] module on which this template is based
* [[Special:Permalink/558855956|Template:Infobox/old]], the previous ParserFunctions implementation
* {{tl|Infobox3cols}}
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[Wikipedia:List of infoboxes|List of infoboxes]]
* [[:Module:InfoboxImage]]
* Maintenance categories:
** [[:Category:Articles which use infobox templates with no data rows]]
** [[:Category:Pages which use embedded infobox templates with the title parameter]]
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[Category:Infobox templates| ]]
[[Category:Wikipedia metatemplates|Infobox]]
[[Category:Templates generating microformats]]
}}</includeonly>
c767a15bb58ea62ebebf6e3e4e3579c68465da04
108
72
2023-10-17T17:21:18Z
LamayII
2
1 revision imported from [[:dev:Template:Infobox/doc]]
wikitext
text/x-wiki
{{distinguish|Template:Userbox}}
{{Documentation subpage}}
{{Lua|Module:Infobox}}
{{Parameter names example
|name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
|image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>......
|header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div>
|label2={{{label1}}} |data2={{{data1}}}
|data3=( ''or'' ) |data4=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data1}}}</div>
|header5={{{header2}}}<br/><div style="padding:0.75em 0 0.5em;">{{nobold|( ''or'' )}}</div>
|label6={{{label2}}} |data6={{{data2}}}
|data7=( ''or'' ) |data8=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data2}}}</div>
|data9=<div style="padding:0.75em 0 0.5em;">( ''etc'' )</div>
|below
}}
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[Help:Infobox]] contains an introduction about the recommended content and design of infoboxes; [[Wikipedia:Manual of Style/Infoboxes]] contains additional style guidelines. See [[WP:List of infoboxes]] and [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
== Usage ==
Usage is similar to {{tl|navbox}}, but with an additional distinction. Each row on the table can contain either a header, or a label/data pair, or just a data cell. These are mutually exclusive states so if you define a row with both a header and a label/data pair, the label/data pair is ignored.
To insert an image somewhere other than at the top of the infobox, or to insert freeform data, use a row with only a data field.
== Optional control parameters ==
; name : If this parameter is present, "view/discuss/edit" links will be added to the bottom of the infobox, pointing to the named page. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however this is rarely what you want, because it will send users clicking these links in an infobox in an article to the template code rather than the data in the infobox that they probably want to change.
; child : See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
; subbox : See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
== Content parameters ==
=== Title ===
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts as a caption it on top of the table. You can use both of them together if you like, or just one or the other, or even neither (though this is not recommended):
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For [[Wikipedia:Manual of Style/Accessibility#Tables|accessibility reasons]], this is the most recommended alternative.
; above : Text to put within the uppermost cell of the table.
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
Examples:
{{Infobox
| name = Infobox/doc
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
{{Infobox
| name = Infobox/doc
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
=== Illustration images ===
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default. See [[WP:ALT]] for more on alt text.
; caption(n) : Text to put underneath the images.
=== Main data ===
; header(n) : Text to use as a header in row n.
; label(n) : Text to use as a label in row n.
; data(n) : Text to display as data in row n.
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a {{para|header''(n)''}} will cause the corresponding {{para|data''(n)''}} (and {{para|rowclass''(n)''}} {{para|label''(n)''}}, see below) to be ignored; the absence of a {{para|data''(n)''}} will cause the corresponding {{para|label''(n)''}} to be ignored. Valid combinations for any single row are:
* {{para|class''(n)''}} {{para|header''(n)''}}
* {{para|rowclass''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
* {{para|rowclass''(n)''}} {{para|label''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
==== Number ranges ====
To allow flexibility when the layout of an infobox is changed, it may be helpful when developing an infobox to use non-contiguous numbers for header and label/data rows. Parameters for new rows can then be inserted in future without having to renumber existing parameters. For example:
<pre style="overflow:auto">
| header3 = Section 1
| label5 = Label A
| data5 = Data A
| label7 = Label C
| data7 = Data C
| header10 = Section 2
| label12 = Label D
| data12 = Data D
</pre>{{clear}}
It is also possible to automatically renumber parameter names by using [[User:Frietjes/infoboxgap.js]] or [[Module:IncrementParams]].
==== Making data fields optional ====
A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:
<pre style="overflow:auto">
| label5 = Population
| data5 = {{{population|}}}
</pre>{{clear}}
This way if an article doesn't define the population parameter in its infobox the row won't be displayed.
For more complex fields with pre-formatted contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter ''mass'' has been supplied |then display it, followed by 'kg'":
<pre style="overflow:auto">
| label6 = Mass
| data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}
</pre>{{clear}}
For more on #if, see [[meta:ParserFunctions##if:|here]].
==== Hiding headers when all data fields are hidden ====
You can also make headers optional in a similar way. Consider this example:
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
If you want the first header to appear only if one or more of the data fields that fall under it are filled, one could use the following pattern as an example of how to do it:
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no emty row appears before the next static content. The trick to this is that the "#if" returns false only if there is nothing whatsoever in the conditional section, so only if all three of item1, item2 and item3 are undefined will the if statement fail.
Note that such trick may be sometimes very complex to test if there are many data items whose value depends on complex tests (or when a data row is generated by a recursive invokation of this template as a [[#Subboxes|subbox]]). Ideally, the Lua module supporting this template should now support a new way to make each header row autohideable by detecting if there is at least one non-empty data row after that header row (a parameter like "autohide header1 = yes", for example, would remove the need to perform the "#if" test so that we can just to define "header1 = Optional header"),
=== Footer ===
; below : Text to put in the bottom cell. The bottom cell is intended for footnotes, see-also, and other such information.
== Presentation parameters ==
=== Italic titles ===
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
* Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{para|italic title|<nowiki>{{{italic title|no}}}</nowiki>}}
* Do not make any titles italic by not passing the parameter at all.
=== CSS styling ===
; bodystyle : Applies to the infobox table as a whole
; titlestyle : Applies only to the title caption. Adding a background color is usually inadvisable since the text is rendered "outside" the infobox.
; abovestyle : Applies only to the "above" cell at the top. The default style has font-size:125%; since this cell is usually used for a title, if you want to use the above cell for regular-sized text include "font-size:100%;" in the abovestyle.
; imagestyle : Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
; captionstyle : Applies to the text of the image caption.
; rowstyle(n) : This parameter is inserted into the <code>style</code> attribute for the specified row.
; headerstyle : Applies to all header cells
; labelstyle : Applies to all label cells
; datastyle : Applies to all data cells
; belowstyle : Applies only to the below cell
=== HTML classes and microformats ===
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
<!-- currently not implemented in Lua module
; aboverowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''above''' cell is on.
-->
; aboveclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''above''' cell.
; subheaderrowclass(n) : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''subheader''' is on.
; subheaderclass(n) : This parameter is inserted into the <code>class</code> attribute for the infobox's '''subheader'''.
; imagerowclass(n) : These parameters are inserted into the <code>class</code> attribute for the complete table row their respective '''image''' is on.
; imageclass : This parameter is inserted into the <code>class</code> attribute for the '''image'''.
; rowclass(n) : This parameter is inserted into the <code>class</code> attribute for the specified row including the '''label''' and '''data''' cells.
; class(n) : This parameter is inserted into the <code>class</code> attribute for the '''data''' cell of the specified row. If there's no '''data''' cell it has no effect.
<!-- currently not implemented in Lua module
; belowrowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''below''' cell is on.
-->
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others beig used for microformats.
To flag an infobox as containing [[hCard]] information, for example, add the following parameter:
<pre style="overflow:auto">
| bodyclass = vcard
</pre>{{clear}}
And for each row containing a data cell that's part of the vcard, add a corresponding class parameter:
<pre style="overflow:auto">
| class1 = fn
| class2 = org
| class3 = tel
</pre>{{clear}}
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
== Examples ==
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
{{Infobox
|name = Infobox/doc
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
<pre style="overflow:auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
| image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
</pre>{{clear}}
For this example, the '''bodystyle''' and '''labelstyle''' parameters are used to adjust the infobox width and define a default width for the column of labels:
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
<pre style="overflow: auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
</pre>{{clear}}
== Embedding ==
<!--Linked from [[Template:Subinfobox bodystyle/doc]]-->
One infobox template can be embedded into another using the {{para|child}} parameter or the {{para|embed}} parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note, in the examples above, the child infobox is placed in a <code>data</code> field, not a <code>header</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a '''header''' field (but not in a '''label''' field because it would not be displayed!), either using
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
or,
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note that omitting the {{para|title}} parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation.
[[Wikipedia:WikiProject Infoboxes/embed]] includes some links to Wikipedia articles which include infoboxes embedded within other infoboxes.
== Subboxes ==
An alternative method for embedding is to use {{para|subbox|yes}}, which removes the outer border from the infobox, but preserves the interior structure. One feature of this approach is that the parent and child boxes need not have the same structure, and the label and data fields are not aligned between the parent and child boxes because they are not in the same parent table.
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
<source lang="sass" style="overflow:auto">
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
</source>{{clear}}
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
<source lang="sass" style="overflow:auto">
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
</source>{{clear}}
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
== Controlling line-breaking in embedded bulletless lists ==
Template {{tlx|nbsp}} may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists embedded in infoboxes (e.g. cast list in {{tlx|Infobox film}}), to prevent wrapped long entries from being confused with multiple entries. See [[Template:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
== Full blank syntax ==
(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| child = {{{child|}}}
| subbox = {{{subbox|}}}
| italic title = {{{italic title|no}}}
| bodystyle =
| titlestyle =
| abovestyle =
| subheaderstyle =
| title =
| above =
| subheader =
| imagestyle =
| captionstyle =
| image =
| caption =
| image2 =
| caption2 =
| headerstyle =
| labelstyle =
| datastyle =
| header1 =
| label1 =
| data1 =
| header2 =
| label2 =
| data2 =
| header3 =
| label3 =
| data3 =
| header4 =
| label4 =
| data4 =
| header5 =
| label5 =
| data5 =
| header6 =
| label6 =
| data6 =
| header7 =
| label7 =
| data7 =
| header8 =
| label8 =
| data8 =
| header9 =
| label9 =
| data9 =
| header10 =
| label10 =
| data10 =
| header11 =
| label11 =
| data11 =
| header12 =
| label12 =
| data12 =
| header13 =
| label13 =
| data13 =
| header14 =
| label14 =
| data14 =
| header15 =
| label15 =
| data15 =
| header16 =
| label16 =
| data16 =
| header17 =
| label17 =
| data17 =
| header18 =
| label18 =
| data18 =
| header19 =
| label19 =
| data19 =
| header20 =
| label20 =
| data20 =
| belowstyle =
| below =
}}
</pre>{{clear}}
{{Help:Infobox/user style}}
== Porting to other MediaWikis ==
The infobox template requires the [[:mw:Extension:Scribunto|Scribunto]] extension and [[mw:Manual:Using content from Wikipedia#HTMLTidy|HTMLTidy]] to be installed. It may not work with other MediaWikis. [[Wikipedia:WikiProject Transwiki|WikiProject Transwiki]] has a version of this template that has been modified to work on other MediaWikis.
==See also==
* [[Module:Infobox]], the [[WP:LUA|Lua]] module on which this template is based
* [[Special:Permalink/558855956|Template:Infobox/old]], the previous ParserFunctions implementation
* {{tl|Infobox3cols}}
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[Wikipedia:List of infoboxes|List of infoboxes]]
* [[:Module:InfoboxImage]]
* Maintenance categories:
** [[:Category:Articles which use infobox templates with no data rows]]
** [[:Category:Pages which use embedded infobox templates with the title parameter]]
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[Category:Infobox templates| ]]
[[Category:Wikipedia metatemplates|Infobox]]
[[Category:Templates generating microformats]]
}}</includeonly>
c767a15bb58ea62ebebf6e3e4e3579c68465da04
Template:Uses TemplateStyles
10
32
74
73
2023-10-17T16:37:28Z
LamayII
2
1 revision imported from [[:meta:Template:Uses_TemplateStyles]]
wikitext
text/x-wiki
<div style="width:250px;float:right;clear:right;margin:0 0 1em 1em;border:1px solid black;-moz-border-radius:10px;-webkit-border-radius:10px;padding:10px 10px 10px 10px; background:#FFFFFF;">
<p style="margin:0 3% 0 3%;text-align:center;font-size:94%">
[[File:Farm-Fresh css add.svg|left|30px]] '''This template uses [[Help:TemplateStyles|TemplateStyles]]''' <br />
{{{1|}}}
</p></div><includeonly>{{#ifeq:{{SUBPAGENAME}}|doc||[[Category:Templates that use TemplateStyles|{{PAGENAME}}]]}}</includeonly><noinclude>
{{clr}}
{{Documentation}}</noinclude>
fed44ca463856190bcf6280438ed7ea020ad82c3
Module:Infobox/styles.css
828
21
75
44
2023-10-17T16:49:30Z
LamayII
2
LamayII changed the content model of the page [[Module:Infobox/styles.css]] from "plain text" to "CSS"
css
text/css
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
.infobox .navbar {
font-size: 100%;
}
/* T281642 */
body.skin-minerva .infobox-header,
body.skin-minerva .infobox-subheader,
body.skin-minerva .infobox-above,
body.skin-minerva .infobox-title,
body.skin-minerva .infobox-image,
body.skin-minerva .infobox-full-data,
body.skin-minerva .infobox-below {
text-align: center;
}
/* Infobox template style */
.infobox {
border: 1px solid #a2a9b1;
border-spacing: 3px;
background-color: #f8f9fa;
color: black;
/* @noflip */
margin: 0.5em 0 0.5em 1em;
padding: 0.2em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
font-size: 88%;
line-height: 1.5em;
width: 22em;
}
.infobox-header,
.infobox-label,
.infobox-above,
.infobox-full-data,
.infobox-data,
.infobox-below,
.infobox-subheader,
.infobox-image,
.infobox-navbar,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
vertical-align: top;
}
.infobox-label,
.infobox-data,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
/* @noflip */
text-align: left;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-above,
.infobox .infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
font-size: 125%;
font-weight: bold;
text-align: center;
}
.infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
padding: 0.2em;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-header,
.infobox .infobox-subheader,
.infobox .infobox-image,
.infobox .infobox-full-data,
.infobox .infobox-below {
text-align: center;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-navbar {
/* @noflip */
text-align: right;
}
eb850346855e4c081e692209d188b8432a2378d4
78
75
2023-10-17T16:55:10Z
LamayII
2
LamayII changed the content model of the page [[Module:Infobox/styles.css]] from "CSS" to "Sanitized CSS"
sanitized-css
text/css
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
.infobox .navbar {
font-size: 100%;
}
/* T281642 */
body.skin-minerva .infobox-header,
body.skin-minerva .infobox-subheader,
body.skin-minerva .infobox-above,
body.skin-minerva .infobox-title,
body.skin-minerva .infobox-image,
body.skin-minerva .infobox-full-data,
body.skin-minerva .infobox-below {
text-align: center;
}
/* Infobox template style */
.infobox {
border: 1px solid #a2a9b1;
border-spacing: 3px;
background-color: #f8f9fa;
color: black;
/* @noflip */
margin: 0.5em 0 0.5em 1em;
padding: 0.2em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
font-size: 88%;
line-height: 1.5em;
width: 22em;
}
.infobox-header,
.infobox-label,
.infobox-above,
.infobox-full-data,
.infobox-data,
.infobox-below,
.infobox-subheader,
.infobox-image,
.infobox-navbar,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
vertical-align: top;
}
.infobox-label,
.infobox-data,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
/* @noflip */
text-align: left;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-above,
.infobox .infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
font-size: 125%;
font-weight: bold;
text-align: center;
}
.infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
padding: 0.2em;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-header,
.infobox .infobox-subheader,
.infobox .infobox-image,
.infobox .infobox-full-data,
.infobox .infobox-below {
text-align: center;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-navbar {
/* @noflip */
text-align: right;
}
eb850346855e4c081e692209d188b8432a2378d4
Module:Navbar/styles.css
828
7
76
9
2023-10-17T16:50:41Z
LamayII
2
LamayII changed the content model of the page [[Module:Navbar/styles.css]] from "plain text" to "CSS"
css
text/css
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar-collapse {
float: left;
text-align: left;
}
.navbar-boxtext {
word-spacing: 0;
}
.navbar ul {
display: inline-block;
white-space: nowrap;
line-height: inherit;
}
.navbar-brackets::before {
margin-right: -0.125em;
content: '[ ';
}
.navbar-brackets::after {
margin-left: -0.125em;
content: ' ]';
}
.navbar li {
word-spacing: -0.125em;
}
.navbar a > span,
.navbar a > abbr {
text-decoration: inherit;
}
.navbar-mini abbr {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
.navbar-ct-full {
font-size: 114%;
margin: 0 7em;
}
.navbar-ct-mini {
font-size: 114%;
margin: 0 4em;
}
ffa40f872281063642a36504ff608aa4c75ecf55
109
76
2023-10-17T17:21:53Z
LamayII
2
LamayII changed the content model of the page [[Module:Navbar/styles.css]] from "CSS" to "Sanitized CSS"
sanitized-css
text/css
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar-collapse {
float: left;
text-align: left;
}
.navbar-boxtext {
word-spacing: 0;
}
.navbar ul {
display: inline-block;
white-space: nowrap;
line-height: inherit;
}
.navbar-brackets::before {
margin-right: -0.125em;
content: '[ ';
}
.navbar-brackets::after {
margin-left: -0.125em;
content: ' ]';
}
.navbar li {
word-spacing: -0.125em;
}
.navbar a > span,
.navbar a > abbr {
text-decoration: inherit;
}
.navbar-mini abbr {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
.navbar-ct-full {
font-size: 114%;
margin: 0 7em;
}
.navbar-ct-mini {
font-size: 114%;
margin: 0 4em;
}
ffa40f872281063642a36504ff608aa4c75ecf55
Module:Documentation/styles.css
828
24
77
56
2023-10-17T16:54:27Z
LamayII
2
LamayII changed the content model of the page [[Module:Documentation/styles.css]] from "plain text" to "Sanitized CSS"
sanitized-css
text/css
/* {{PP-template}} */
.ts-doc-sandbox .mbox-image {
padding:.75em 0 .75em .75em;
}
.ts-doc-doc {
clear: both;
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
margin-top: 1em;
padding: 5px;
}
.ts-doc-header {
padding-bottom: 3px;
border-bottom: 1px solid #a2a9b1;
margin-bottom: 1ex;
}
.ts-doc-header .ts-tlinks-tlinks {
display: inline-block;
line-height: 24px;
margin-left: 1em;
}
.ts-doc-header .ts-tlinks-tlinks a.external {
color: #0645ad;
}
.ts-doc-header .ts-tlinks-tlinks a.external:visited {
color: #0b0080;
}
.ts-doc-header .ts-tlinks-tlinks a.external:active {
color: #faa700;
}
.ts-doc-content:after {
content: '';
clear: both;
display: block;
}
.ts-doc-heading {
display: inline-block;
padding-left: 55px;
background: center left/50px no-repeat;
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png);
background-image: url(https://upload.wikimedia.org/wikipedia/commons/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg);
font-size: 1.5em;
}
.ts-doc-content > *:first-child,
.ts-doc-footer > *:first-child {
margin-top: .5em;
}
.ts-doc-content > *:last-child,
.ts-doc-footer > *:last-child {
margin-bottom: .5em;
}
.ts-doc-footer {
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
padding: .25em 1em;
margin-top: .2em;
font-style: italic;
}
.ts-doc-footer small {
font-style: normal;
}
.ts-doc-sandbox {
clear: both;
}
c37b0ddfd0b1c128c187ca56721d1c4e481b05ff
98
77
2023-10-17T17:21:16Z
LamayII
2
1 revision imported from [[:dev:Module:Documentation/styles.css]]
sanitized-css
text/css
/* {{PP-template}} */
.ts-doc-sandbox .mbox-image {
padding:.75em 0 .75em .75em;
}
.ts-doc-doc {
clear: both;
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
margin-top: 1em;
padding: 5px;
}
.ts-doc-header {
padding-bottom: 3px;
border-bottom: 1px solid #a2a9b1;
margin-bottom: 1ex;
}
.ts-doc-header .ts-tlinks-tlinks {
display: inline-block;
line-height: 24px;
margin-left: 1em;
}
.ts-doc-header .ts-tlinks-tlinks a.external {
color: #0645ad;
}
.ts-doc-header .ts-tlinks-tlinks a.external:visited {
color: #0b0080;
}
.ts-doc-header .ts-tlinks-tlinks a.external:active {
color: #faa700;
}
.ts-doc-content:after {
content: '';
clear: both;
display: block;
}
.ts-doc-heading {
display: inline-block;
padding-left: 55px;
background: center left/50px no-repeat;
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png);
background-image: url(https://upload.wikimedia.org/wikipedia/commons/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg);
font-size: 1.5em;
}
.ts-doc-content > *:first-child,
.ts-doc-footer > *:first-child {
margin-top: .5em;
}
.ts-doc-content > *:last-child,
.ts-doc-footer > *:last-child {
margin-bottom: .5em;
}
.ts-doc-footer {
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
padding: .25em 1em;
margin-top: .2em;
font-style: italic;
}
.ts-doc-footer small {
font-style: normal;
}
.ts-doc-sandbox {
clear: both;
}
c37b0ddfd0b1c128c187ca56721d1c4e481b05ff
117
98
2023-10-17T17:25:59Z
LamayII
2
LamayII changed the content model of the page [[Module:Documentation/styles.css]] from "Sanitized CSS" to "wikitext"
wikitext
text/x-wiki
/* {{PP-template}} */
.ts-doc-sandbox .mbox-image {
padding:.75em 0 .75em .75em;
}
.ts-doc-doc {
clear: both;
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
margin-top: 1em;
padding: 5px;
}
.ts-doc-header {
padding-bottom: 3px;
border-bottom: 1px solid #a2a9b1;
margin-bottom: 1ex;
}
.ts-doc-header .ts-tlinks-tlinks {
display: inline-block;
line-height: 24px;
margin-left: 1em;
}
.ts-doc-header .ts-tlinks-tlinks a.external {
color: #0645ad;
}
.ts-doc-header .ts-tlinks-tlinks a.external:visited {
color: #0b0080;
}
.ts-doc-header .ts-tlinks-tlinks a.external:active {
color: #faa700;
}
.ts-doc-content:after {
content: '';
clear: both;
display: block;
}
.ts-doc-heading {
display: inline-block;
padding-left: 55px;
background: center left/50px no-repeat;
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png);
background-image: url(https://upload.wikimedia.org/wikipedia/commons/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg);
font-size: 1.5em;
}
.ts-doc-content > *:first-child,
.ts-doc-footer > *:first-child {
margin-top: .5em;
}
.ts-doc-content > *:last-child,
.ts-doc-footer > *:last-child {
margin-bottom: .5em;
}
.ts-doc-footer {
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
padding: .25em 1em;
margin-top: .2em;
font-style: italic;
}
.ts-doc-footer small {
font-style: normal;
}
.ts-doc-sandbox {
clear: both;
}
c37b0ddfd0b1c128c187ca56721d1c4e481b05ff
118
117
2023-10-17T17:26:22Z
LamayII
2
LamayII changed the content model of the page [[Module:Documentation/styles.css]] from "wikitext" to "Sanitized CSS"
sanitized-css
text/css
/* {{PP-template}} */
.ts-doc-sandbox .mbox-image {
padding:.75em 0 .75em .75em;
}
.ts-doc-doc {
clear: both;
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
margin-top: 1em;
padding: 5px;
}
.ts-doc-header {
padding-bottom: 3px;
border-bottom: 1px solid #a2a9b1;
margin-bottom: 1ex;
}
.ts-doc-header .ts-tlinks-tlinks {
display: inline-block;
line-height: 24px;
margin-left: 1em;
}
.ts-doc-header .ts-tlinks-tlinks a.external {
color: #0645ad;
}
.ts-doc-header .ts-tlinks-tlinks a.external:visited {
color: #0b0080;
}
.ts-doc-header .ts-tlinks-tlinks a.external:active {
color: #faa700;
}
.ts-doc-content:after {
content: '';
clear: both;
display: block;
}
.ts-doc-heading {
display: inline-block;
padding-left: 55px;
background: center left/50px no-repeat;
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png);
background-image: url(https://upload.wikimedia.org/wikipedia/commons/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg);
font-size: 1.5em;
}
.ts-doc-content > *:first-child,
.ts-doc-footer > *:first-child {
margin-top: .5em;
}
.ts-doc-content > *:last-child,
.ts-doc-footer > *:last-child {
margin-bottom: .5em;
}
.ts-doc-footer {
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
padding: .25em 1em;
margin-top: .2em;
font-style: italic;
}
.ts-doc-footer small {
font-style: normal;
}
.ts-doc-sandbox {
clear: both;
}
c37b0ddfd0b1c128c187ca56721d1c4e481b05ff
Template:Navbar
10
33
79
2023-10-17T16:58:04Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
<includeonly>{{#invoke:Template translation{{{sandbox|}}}|renderTranslatedTemplate|uselang={{{uselang|}}}|tntns={{{namespace|{{{tntns|}}}}}}|template={{#if:{{{noshift|}}}|{{{template}}}|{{{1}}}}}|noshift={{{noshift|}}}<!-- all other numbered or named parameters are found by the module using the parent frame -->}}</includeonly><noinclude>{{documentation}}</noinclude>
639aa3ce6c91c67b8151f8394f92cd2a44bb7a4b
Template:Template other
10
34
81
80
2023-10-17T17:01:42Z
LamayII
2
1 revision imported from [[:meta:Template:Template_other]]: for infobox
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Template:Infobox law enforcement agency
10
2
82
3
2023-10-17T17:05:25Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
<includeonly>
{{Infobox
|agencyname = {{{Agency Name}}}
}}
c15d7e69144fcc639c4b28b466d0344560cf9857
83
82
2023-10-17T17:11:48Z
LamayII
2
wikitext
text/x-wiki
<includeonly>
{{Infobox
|agencyname = {{{Agency Name}}}
|commonname = {{{Common Name}}}
|motto = {{{Motto}}}
}}
<noinclude>
<templatedata>
{
"params": {
"Agency Name": {
"label": "Agency Name",
"required": true
}
},
"paramOrder": [
"Agency Name"
]
}
</templatedata>
</noinclude>
7a6ca3ad46563e2308e457c6144299cf83c547cd
Los Alameda County Sheriff's Department
0
8
84
11
2023-10-17T17:14:40Z
LamayII
2
Removed protection from "[[Los Alameda County Sheriff's Department]]"
wikitext
text/x-wiki
The '''Los Alameda County Sheriff's Department (LASD)''', officially the '''County of Los Alameda Sheriff's Department''' is a law enforcement agency within the State of Santa Modesta serving Los Alameda County. LASD is the largest law enforcement agency in the state. Since the department’s formation in 1850, the County of Los Alameda Sheriff’s Department has taken the responsibilities of providing contracted municipal police services within unincorporated communities of Los Alameda County, provide courthouse security for the Superior Court of Los Alameda County, and regulate the housing and transportation services of inmates within the county jail system.
== History ==
b352d4ddb41f8078c47e5519b0f22c5fb166fc3f
Template:Infobox
10
9
86
22
2023-10-17T17:19:56Z
LamayII
2
1 revision imported from [[:dev:Template:Infobox]]
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{Documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
{{En-WP attribution notice|Template:Infobox}}
</noinclude>
9e34306414672f80e601e13674f4524ccd7b70ec
134
86
2023-10-17T17:44:48Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox]]
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{Documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
{{En-WP attribution notice|Template:Infobox}}
</noinclude>
9e34306414672f80e601e13674f4524ccd7b70ec
Template:Documentation
10
12
88
46
2023-10-17T17:21:10Z
LamayII
2
1 revision imported from [[:dev:Template:Documentation]]
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
ce7fd93f18c46b4fa871bf679afd05cbda72d8c4
Template:Documentation subpage
10
25
90
58
2023-10-17T17:21:11Z
LamayII
2
1 revision imported from [[:dev:Template:Documentation_subpage]]
wikitext
text/x-wiki
<includeonly>{{#if:{{IsDocSubpage|override={{{override|doc}}}}}
| <!--doc subpage--></includeonly>{{#ifeq:{{{doc-notice|show}}}|show
| {{Ombox|type=notice|image=[[File:Edit-copy green.svg|40px|link=]]
|text='''This is a documentation [[mw:Help:Subpages|subpage]] for {{#if:{{{1|}}}
| {{{1}}}
| [[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]
}}.'''<br/> It contains usage information, categories, and other content that is not part of the original<!--
--> {{#if: {{{text2|}}}
| {{{text2|}}}
| {{#if: {{{text1|}}}
| {{{text1|}}}
| {{#ifeq: {{SUBJECTSPACE}} | {{ns:User}}
| {{lc:{{SUBJECTSPACE}}}} template page
| {{#if: {{SUBJECTSPACE}}
| {{lc:{{SUBJECTSPACE}}}} page
| article
}}
}}
}}
}}.
}}
<!--If not on a doc subpage, do nothing-->}}{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}{{#if: {{{inhibit|}}}
| <!--Skip-->
| <includeonly>{{#ifexist: {{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch: {{SUBJECTSPACE}}
|Template=Template
|Module=Module
|User=User
|#default=Template
}} documentation pages{{#translation:}}]]
| [[Category:Documentation subpages without corresponding pages{{#translation:}}]]
}}</includeonly>
}}<includeonly>
}}</includeonly><noinclude>{{Documentation}}<!--Add categories and interwikis to the /doc subpage, not here!--></noinclude>
2fcb7e4e2d233f798b114d37652fc333213f5ea7
Module:Arguments
828
14
92
26
2023-10-17T17:21:11Z
LamayII
2
1 revision imported from [[:dev:Module:Arguments]]
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
138
92
2023-10-17T17:44:48Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Arguments]]
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Documentation
828
13
94
48
2023-10-17T17:21:12Z
LamayII
2
1 revision imported from [[:dev:Module:Documentation]]
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return mw.ustring.format('[[%s|%s]]', page, display)
else
return mw.ustring.format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return mw.ustring.format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return '<span class="' .. message('toolbar-class') .. '">('
.. table.concat(ret, ' | ') .. ')</span>'
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.fullUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
local data = {}
data.title = title
data.docTitle = docTitle
-- View, display, edit, and purge links if /doc exists.
data.viewLinkDisplay = message('view-link-display')
data.editLinkDisplay = message('edit-link-display')
data.historyLinkDisplay = message('history-link-display')
data.purgeLinkDisplay = message('purge-link-display')
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 6 then -- File namespace
preload = message('file-docpage-preload')
elseif subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
data.preload = preload
data.createLinkDisplay = message('create-link-display')
return data
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local function escapeBrackets(s)
-- Escapes square brackets with HTML entities.
s = s:gsub('%[', '[') -- Replace square brackets with HTML entities.
s = s:gsub('%]', ']')
return s
end
local ret
local docTitle = data.docTitle
local title = data.title
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
ret = '[%s] [%s] [%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
else
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
ret = '[%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, createLink)
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editUrl = docTitle:fullUrl{action = 'edit'}
local editDisplay = message('edit-link-display')
local editLink = makeUrlLink(editUrl, editDisplay)
local historyUrl = docTitle:fullUrl{action = 'history'}
local historyDisplay = message('history-link-display')
local historyLink = makeUrlLink(historyUrl, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
621cd86c0b54a1771f02723bad84203cf7c7ed8e
Module:Documentation/config
828
15
96
50
2023-10-17T17:21:15Z
LamayII
2
1 revision imported from [[:dev:Module:Documentation/config]]
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['file-docpage-preload']
-- Preload file for documentation page in the file namespace.
cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
5f4ad23fca41592ae0f03e5f07d2b9e235fd7170
Template:Template link
10
35
100
99
2023-10-17T17:21:16Z
LamayII
2
1 revision imported from [[:dev:Template:Template_link]]
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eabbec62efe3044a98ebb3ce9e7d4d43c222351d
142
100
2023-10-17T17:44:49Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Template_link]]
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eabbec62efe3044a98ebb3ce9e7d4d43c222351d
Template:Tl
10
36
102
101
2023-10-17T17:21:17Z
LamayII
2
1 revision imported from [[:dev:Template:Tl]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
fb9a6b420e13178e581af6e7d64274cd30a79017
140
102
2023-10-17T17:44:49Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Tl]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
fb9a6b420e13178e581af6e7d64274cd30a79017
Template:Clear
10
37
104
103
2023-10-17T17:21:17Z
LamayII
2
1 revision imported from [[:dev:Template:Clear]]
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
Module:Infobox
828
3
106
38
2023-10-17T17:21:17Z
LamayII
2
1 revision imported from [[:dev:Module:Infobox]]
Scribunto
text/plain
--
-- This module implements {{Infobox}}
--
local p = {}
local navbar = require('Module:Navbar')._navbar
local args = {}
local origArgs
local root
local function notempty( s ) return s and s:match( '%S' ) end
local function fixChildBoxes(sval, tt)
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' .. subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' .. subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
return s
else
return sval
end
end
local function union(t1, t2)
-- Returns the union of the values of two tables, as a sequence.
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
local function getArgNums(prefix)
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
local function addRow(rowArgs)
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
if rowArgs.header then
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:attr('id', rowArgs.rowid)
:tag('th')
:attr('colspan', 2)
:attr('id', rowArgs.headerid)
:addClass(rowArgs.class)
:addClass(args.headerclass)
:css('text-align', 'center')
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
elseif rowArgs.data then
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
row:attr('id', rowArgs.rowid)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:attr('id', rowArgs.labelid)
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
if not rowArgs.label then
dataCell
:attr('colspan', 2)
:css('text-align', 'center')
end
dataCell
:attr('id', rowArgs.dataid)
:addClass(rowArgs.class)
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:newline()
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
end
end
local function renderTitle()
if not args.title then return end
root
:tag('caption')
:addClass(args.titleclass)
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
root
:tag('tr')
:tag('th')
:attr('colspan', 2)
:addClass(args.aboveclass)
:css('text-align', 'center')
:css('font-size', '125%')
:css('font-weight', 'bold')
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass(args.belowclass)
:css('text-align', 'center')
:cssText(args.belowstyle)
:newline()
:wikitext(fixChildBoxes(args.below,'td'))
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addRow({
data = args['subheader' .. tostring(num)],
datastyle = args.subheaderstyle or args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:cssText(args.captionstyle)
:wikitext(caption)
end
addRow({
data = tostring(data),
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
local function renderRows()
-- Gets the union of the header and data argument numbers,
-- and renders them all in order using addRow.
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)],
dataid = args['dataid' .. tostring(num)],
labelid = args['labelid' .. tostring(num)],
headerid = args['headerid' .. tostring(num)],
rowid = args['rowid' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:css('text-align', 'right')
:wikitext(navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
local function renderTrackingCategories()
if args.decat ~= 'yes' then
if #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
end
if args.child == 'yes' and args.title then
root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]')
end
end
end
local function _infobox()
-- Specify the overall layout of the infobox, with special settings
-- if the infobox is used as a 'child' inside another infobox.
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass('infobox')
:addClass(args.bodyclass)
if args.subbox == 'yes' then
root
:css('padding', '0')
:css('border', 'none')
:css('margin', '-3px')
:css('width', 'auto')
:css('min-width', '100%')
:css('font-size', '100%')
:css('clear', 'none')
:css('float', 'none')
:css('background-color', 'transparent')
else
root
:css('width', '22em')
end
root
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
renderSubheaders()
renderImages()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderTrackingCategories()
return tostring(root)
end
local function preprocessSingleArg(argName)
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
local function preprocessArgs(prefixTable, step)
-- Assign the parameters with the given prefixes to the args table, in order, in batches
-- of the step size specified. This is to prevent references etc. from appearing in the
-- wrong order. The prefixTable should be an array containing tables, each of which has
-- two possible fields, a "prefix" string and a "depend" table. The function always parses
-- parameters containing the "prefix" string, but only parses parameters in the "depend"
-- table if the prefix parameter is present and non-blank.
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or (v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
moreArgumentsExist = true -- Do another loop if any arguments are found, even blank ones.
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present and not blank, or
-- we are processing "prefix1" and "prefix" is present and not blank, and
-- if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
function p.infobox(frame)
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so that
-- references etc. will display in the expected places. Parameters that depend on
-- another parameter are only processed if that parameter is present, to avoid
-- phantom references appearing in article reference lists.
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'},
{prefix = 'dataid'},
{prefix = 'labelid'},
{prefix = 'headerid'},
{prefix = 'rowid'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent
preprocessSingleArg('decat')
return frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
} .. _infobox()
end
return p
eccecf7ea52ce105242adb57836ea74e04395312
Module:Message box/ombox.css
828
28
110
64
2023-10-17T17:22:18Z
LamayII
2
LamayII changed the content model of the page [[Module:Message box/ombox.css]] from "plain text" to "Sanitized CSS"
sanitized-css
text/css
/* {{pp|small=y}} */
.ombox {
margin: 4px 0;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
/* For the "small=yes" option. */
.ombox.mbox-small {
font-size: 88%;
line-height: 1.25em;
}
.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ombox-delete {
border: 2px solid #b32424; /* Red */
}
.ombox-content {
border: 1px solid #f28500; /* Orange */
}
.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
.ombox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.9em;
width: 100%;
}
.ombox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.ombox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ombox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ombox .mbox-invalid-type {
text-align: center;
}
@media (min-width: 720px) {
.ombox {
margin: 4px 10%;
}
.ombox.mbox-small {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
width: 238px;
}
}
8fe3df4bb607e699eab2dbd23bd4a1a446391002
Template:Documentation/doc
10
38
112
111
2023-10-17T17:24:54Z
LamayII
2
1 revision imported from [[:dev:Template:Documentation/doc]]
wikitext
text/x-wiki
{{documentation subpage}}
This is the {{tl|Documentation}} template, used on almost every template page to contain that template's documented instructions and information.
For detailed instructions on how and when to use this template, see [[w:Wikipedia:Template documentation]].
This template displays a green documentation box like you are seeing now and automatically loads the content from a /doc subpage. It can also load the content from other places if instructed to.
This template is intended for documenting templates and other pages that are [[w:Wikipedia:Transclusion|transcluded]] onto other pages. It can be used in the [[w:Wikipedia:Template namespace|template namespace]] and most other [[w:Wikipedia:Namespace|namespace]]s.
Use of this template allows templates to be [[w:Wikipedia:Protection policy|protected]] where necessary, while allowing anyone to edit the documentation and categories.
===Usage===
Normally this template is used without any parameters, placed at the bottom of the template or page being documented, within a <noinclude> container:
<syntaxhighlight lang="xml+smarty">
<!--Last line of your template code--><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
</syntaxhighlight>
Then this template automatically loads the content from the /doc subpage of the template it is used on.
This template can also load the content from any other page. Like this:
<syntaxhighlight lang="xml+smarty">
<!--Last line of your template code--><noinclude>
{{Documentation |Template:Other page/doc}}
</noinclude>
</syntaxhighlight>
Note that when loading the documentation from a page other than the local /doc page it becomes tricky to handle the categories.
The content can also be fed directly as text. Like this:
<syntaxhighlight lang="xml+smarty">
<!--Last line of your template code--><noinclude>
{{Documentation
| content =
(some documentation)
}}</noinclude>
</syntaxhighlight>
When the <nowiki>|content=</nowiki> parameter is used, the doc box normally does not show the [edit] [purge] links in the top right corner. Note that if the /doc page exists, a link to it is still shown in the link box below the doc box.
Parameter <nowiki>|1=</nowiki> and the <nowiki>|content=</nowiki> parameter can also be combined, like this:
<syntaxhighlight lang="xml+smarty">
<!--Last line of your template code--><noinclude>
{{Documentation |1=Template:Any page/doc
| content =
{{Template:Any page/doc |parameters}}
}}</noinclude>
</syntaxhighlight>
Then the pagename fed as parameter 1 is used for the [edit] [purge] links and for the /doc link in the link box below the doc box. But the '''content''' parameter is used for the content shown in the doc box. The above code means that the content is transcluded as {{tlx|Any page/doc|parameters}}. In this example a parameter is also fed to the /doc page being loaded.
=== Shortcut ===
To automatically insert the [[w:Wikipedia:Noinclude|noinclude tags]], the template call and the guiding comment, use this [[w:WP:Substitution|substitution]] code:<br>
:<code><nowiki>{{subst:doc-code}}</nowiki></code>
===Best practice===
The code should be added at the bottom of the template code, with no space before <noinclude> (which would cause extra space on pages where the template is used).
Categories that apply to the template itself should be added to the bottom of the /doc subpage, inside <includeonly> tags.
If the documentation page contains <includeonly> or <noinclude> tags as part of the visible documentation text, replace the "<code><</code>" with "<code>&lt;</code>".
===Heading===
When in the Template namespace, this template shows this heading:
:[[File:Test Template Info-Icon - Version (2).svg|32px|link=[[w:Wikipedia:Template documentation]]]] '''Template documentation'''
In most other namespaces, such as "{{SITENAME}}:", it shows this heading:
:'''Documentation'''
But when on File (image) pages it shows this heading:
:'''Summary'''
The '''heading''' parameter can be used to set the heading to something else. Like this:
:<code><nowiki>{{Documentation |heading=Infobox documentation}}</nowiki></code>
If the '''heading''' parameter is empty but defined, no heading is shown and no [edit] [purge] links are shown. Like this:
:<code><nowiki>{{Documentation |heading=}}</nowiki></code>
The '''heading-style''' parameter can be fed optional [[w:Cascading Style Sheets|CSS]] values. Without quotation marks <code>" "</code> but with the ending semicolons <code>;</code>. For example:
:<code>heading-style=font-size:150%;color:red;</code>
===Link box===
Below the big doc box is a small link box that shows some meta-data about the documentation. The link box shows different things depending on what parameters are fed to this template, and in which namespace it is used. In some cases the link box is not shown at all.
To hide the link box, add the parameter
: <nowiki>|link box=off</nowiki>.
You can also insert customised text into the link box, by setting the <nowiki>|link box=</nowiki> parameter. For example:
<pre style="width:auto; overflow:scroll">
|link box=This documentation is automatically generated by [[w:Template:Country showdata]]
</pre>
===Automatic functions===
If the documentation page does not exist, the [create] link includes a [[mw:Manual:Creating pages with preloaded text|preload]] page so that clicking it will pre-fill the edit form with the basic documentation page format. Preload text is also used for the /sandbox and /testcases [create] links.
===Subject namespaces vs. talk namespaces===
Terminology: ''Subject namespaces'' are the opposite of ''talk namespaces''. For instance "Template:" is the subject space of "Template talk:".
This template is usually placed in a subject namespace, within <noinclude> tags. But in some cases this template needs to be on the talk page:
* In the Mediawiki namespace, since <noinclude> often does not work in system messages, and since the Mediawiki namespace needs to be kept clean for performance reasons.
When placed on talk pages, this template usually is placed near the top of the page and without <noinclude> tags.
The /doc, /sandbox and /testcases pages should normally be in the subject namespace, except in the namespaces that do not have the MediaWiki [[w:m:Help:Link#Subpage feature|subpage feature]] enabled: Main, File, Mediawiki and Category. (But currently we only show the /sandbox and /testcases links from User, User talk, Template and Template talk namespaces.) There are also a whole bunch of other technical reasons why the /doc page must be stored under the talk page for those (but only those) namespaces.
This template automatically points its [create] links for the /doc, /sandbox and /testcases to the right namespace.
===Technical details===
The preload page for the /doc [create] link is [[Template:Documentation/preload]]. The preload pages for the /sandbox and /testcases [create] links are [[Template:Documentation/preload-sandbox]] and [[Template:Documentation/preload-testcases]]. The preload page for the /sandbox [mirror] link is [[Template:Documentation/mirror]].
====Full syntax====
<pre>
{{Documentation}}
{{Documentation
| content =
}}
{{Documentation
| [path to documentation page]
| heading-style =
| heading =
| link box =
}}
</pre>
===See also===
* {{tl|Documentation subpage}}, a notice placed at the top of a /doc subpage explaining its role and including a link to the page it documents.
* [[w:Wikipedia:Template documentation]] is a how-to guide to template documentation.
* [[w:Wikipedia:Template sandbox and test cases]] explains the use of /sandbox and /testcases subpages and includes more information about template testing.
92ff94e315af492eb2698f80537068806f486349
Template:Template link expanded
10
39
114
113
2023-10-17T17:24:55Z
LamayII
2
1 revision imported from [[:dev:Template:Template_link_expanded]]
wikitext
text/x-wiki
<code><nowiki>{{</nowiki>{{#if:{{{subst|}}} |[[Help:Substitution|subst]]:}}<!--
-->[[{{{sister|{{{SISTER|}}}}}}{{ns:Template}}:{{{1|}}}|{{{1|}}}]]<!--
-->{{#if:{{{2|}}} ||{{{2}}}}}<!--
-->{{#if:{{{3|}}} ||{{{3}}}}}<!--
-->{{#if:{{{4|}}} ||{{{4}}}}}<!--
-->{{#if:{{{5|}}} ||{{{5}}}}}<!--
-->{{#if:{{{6|}}} ||{{{6}}}}}<!--
-->{{#if:{{{7|}}} ||{{{7}}}}}<!--
-->{{#if:{{{8|}}} ||{{{8}}}}}<!--
-->{{#if:{{{9|}}} ||{{{9}}}}}<!--
-->{{#if:{{{10|}}} ||{{{10}}}}}<!--
-->{{#if:{{{11|}}} ||{{{11}}}}}<!--
-->{{#if:{{{12|}}} ||{{{12}}}}}<!--
-->{{#if:{{{13|}}} ||{{{13}}}}}<!--
-->{{#if:{{{14|}}} ||{{{14}}}}}<!--
-->{{#if:{{{15|}}} ||{{{15}}}}}<!--
-->{{#if:{{{16|}}} ||{{{16}}}}}<!--
-->{{#if:{{{17|}}} ||{{{17}}}}}<!--
-->{{#if:{{{18|}}} ||{{{18}}}}}<!--
-->{{#if:{{{19|}}} ||{{{19}}}}}<!--
-->{{#if:{{{20|}}} ||{{{20}}}}}<!--
-->{{#if:{{{21|}}} ||''...''}}<!--
--><nowiki>}}</nowiki></code><noinclude>
{{Documentation}}
</noinclude>
9f670205d4b358df089b1a820f78f02a88afca3a
Template:Tlx
10
40
116
115
2023-10-17T17:24:55Z
LamayII
2
1 revision imported from [[:dev:Template:Tlx]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link expanded]]
155e901040104f96908f1f4627c4eb3501301bf9
Template:Documentation/preload
10
41
120
119
2023-10-17T17:29:31Z
LamayII
2
1 revision imported from [[:dev:Template:Documentation/preload]]
wikitext
text/x-wiki
{{Documentation subpage}}
== Usage ==
<include<includeonly></includeonly>only>
<!-- Categories below this line -->
}}</include<includeonly></includeonly>only><noinclude>
{{Documentation|content=
This page contains the default wikitext that appears when an editor clicks "create" to begin creating a new template documentation page.
[[Category:Documentation preloads]]
}}</noinclude>
587413cafd960a3f7f3c9257a4160f3654fdbe0f
MediaWiki:Common.css
8
42
122
121
2023-10-17T17:33:38Z
LamayII
2
1 revision imported from [[:dev:MediaWiki:Common.css]]
css
text/css
/* Default style for navigation boxes */
.navbox { /* Navbox container style */
box-sizing: border-box;
border: 1px solid #a2a9b1;
width: 100%;
clear: both;
font-size: 88%;
text-align: center;
padding: 1px;
margin: 1em auto 0; /* Prevent preceding content from clinging to navboxes */
}
.navbox .navbox {
margin-top: 0; /* No top margin for nested navboxes */
}
.navbox + .navbox {
margin-top: -1px; /* Single pixel border between adjacent navboxes */
}
.navbox-inner,
.navbox-subgroup {
width: 100%;
}
.navbox-group,
.navbox-title,
.navbox-abovebelow {
padding: 0.25em 1em; /* Title, group and above/below styles */
line-height: 1.5em;
text-align: center;
}
th.navbox-group { /* Group style */
white-space: nowrap;
/* @noflip */
text-align: right;
}
.navbox,
.navbox-subgroup {
background-color: #fdfdfd; /* Background color */
}
.navbox-list {
line-height: 1.5em;
border-color: #fdfdfd; /* Must match background color */
}
/* cell spacing for navbox cells */
tr + tr > .navbox-abovebelow,
tr + tr > .navbox-group,
tr + tr > .navbox-image,
tr + tr > .navbox-list { /* Borders above 2nd, 3rd, etc. rows */
border-top: 2px solid #fdfdfd; /* Must match background color */
}
.navbox th,
.navbox-title {
background-color: #ccccff; /* Level 1 color */
}
.navbox-abovebelow,
th.navbox-group,
.navbox-subgroup .navbox-title {
background-color: #ddddff; /* Level 2 color */
}
.navbox-subgroup .navbox-group,
.navbox-subgroup .navbox-abovebelow {
background-color: #e6e6ff; /* Level 3 color */
}
.navbox-even {
background-color: #f7f7f7; /* Even row striping */
}
.navbox-odd {
background-color: transparent; /* Odd row striping */
}
.navbox .hlist td dl,
.navbox .hlist td ol,
.navbox .hlist td ul,
.navbox td.hlist dl,
.navbox td.hlist ol,
.navbox td.hlist ul {
padding: 0.125em 0; /* Adjust hlist padding in navboxes */
}
/* Default styling for Navbar template */
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar ul {
display: inline;
white-space: nowrap;
}
.mw-body-content .navbar ul {
line-height: inherit;
}
.navbar li {
word-spacing: -0.125em;
}
.navbar.mini li abbr[title] {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
/* Navbar styling when nested in infobox and navbox */
.infobox .navbar {
font-size: 100%;
}
.navbox .navbar {
display: block;
font-size: 100%;
}
.navbox-title .navbar {
/* @noflip */
float: left;
/* @noflip */
text-align: left;
/* @noflip */
margin-right: 0.5em;
}
.infobox {
border: 1px solid #a2a9b1;
border-spacing: 3px;
background-color: #f8f9fa;
color: black;
/* @noflip */
margin: 0.5em 0 0.5em 1em;
padding: 0.2em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
font-size: 88%;
line-height: 1.5em;
}
.infobox caption {
font-size: 125%;
font-weight: bold;
padding: 0.2em;
text-align: center;
}
.infobox td,
.infobox th {
vertical-align: top;
/* @noflip */
text-align: left;
}
.infobox.bordered {
border-collapse: collapse;
}
.infobox.bordered td,
.infobox.bordered th {
border: 1px solid #a2a9b1;
}
.infobox.bordered .borderless td,
.infobox.bordered .borderless th {
border: 0;
}
.infobox.sisterproject {
width: 20em;
font-size: 90%;
}
.infobox.standard-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
}
.infobox.standard-talk.bordered td,
.infobox.standard-talk.bordered th {
border: 1px solid #c0c090;
}
/* styles for bordered infobox with merged rows */
.infobox.bordered .mergedtoprow td,
.infobox.bordered .mergedtoprow th {
border: 0;
border-top: 1px solid #a2a9b1;
/* @noflip */
border-right: 1px solid #a2a9b1;
}
.infobox.bordered .mergedrow td,
.infobox.bordered .mergedrow th {
border: 0;
/* @noflip */
border-right: 1px solid #a2a9b1;
}
/* Styles for geography infoboxes, eg countries,
country subdivisions, cities, etc. */
.infobox.geography {
border-collapse: collapse;
line-height: 1.2em;
font-size: 90%;
}
.infobox.geography td,
.infobox.geography th {
border-top: 1px solid #a2a9b1;
padding: 0.4em 0.6em 0.4em 0.6em;
}
.infobox.geography .mergedtoprow td,
.infobox.geography .mergedtoprow th {
border-top: 1px solid #a2a9b1;
padding: 0.4em 0.6em 0.2em 0.6em;
}
.infobox.geography .mergedrow td,
.infobox.geography .mergedrow th {
border: 0;
padding: 0 0.6em 0.2em 0.6em;
}
.infobox.geography .mergedbottomrow td,
.infobox.geography .mergedbottomrow th {
border-top: 0;
border-bottom: 1px solid #a2a9b1;
padding: 0 0.6em 0.4em 0.6em;
}
.infobox.geography .maptable td,
.infobox.geography .maptable th {
border: 0;
padding: 0;
}
div.listenlist {
background: url("//upload.wikimedia.org/wikipedia/commons/4/47/Sound-icon.svg") no-repeat scroll 0 0 transparent;
background-size: 30px;
padding-left: 40px;
}
/* Fix for hieroglyphs specificity issue in infoboxes ([[phab:T43869]]) */
table.mw-hiero-table td {
vertical-align: middle;
}
/* Style rules for media list templates */
/* TemplateStyles */
div.medialist {
min-height: 50px;
margin: 1em;
/* @noflip */
background-position: top left;
background-repeat: no-repeat;
}
div.medialist ul {
list-style-type: none;
list-style-image: none;
margin: 0;
}
div.medialist ul li {
padding-bottom: 0.5em;
}
div.medialist ul li li {
font-size: 91%;
padding-bottom: 0;
}
/* Messagebox templates */
.messagebox {
border: 1px solid #a2a9b1;
background-color: #f8f9fa;
width: 80%;
margin: 0 auto 1em auto;
padding: .2em;
}
.messagebox.merge {
border: 1px solid #c0b8cc;
background-color: #f0e5ff;
text-align: center;
}
.messagebox.cleanup {
border: 1px solid #9f9fff;
background-color: #efefff;
text-align: center;
}
.messagebox.standard-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
margin: 4px auto;
}
/* For old WikiProject banners inside banner shells. */
.mbox-inside .standard-talk,
.messagebox.nested-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
width: 100%;
margin: 2px 0;
padding: 2px;
}
.messagebox.small {
width: 238px;
font-size: 85%;
/* @noflip */
float: right;
clear: both;
/* @noflip */
margin: 0 0 1em 1em;
line-height: 1.25em;
}
.messagebox.small-talk {
width: 238px;
font-size: 85%;
/* @noflip */
float: right;
clear: both;
/* @noflip */
margin: 0 0 1em 1em;
line-height: 1.25em;
background-color: #F8EABA;
}
/* Cell sizes for ambox/tmbox/imbox/cmbox/ombox/fmbox/dmbox message boxes */
th.mbox-text, td.mbox-text { /* The message body cell(s) */
border: none;
/* @noflip */
padding: 0.25em 0.9em; /* 0.9em left/right */
width: 100%; /* Make all mboxes the same width regardless of text length */
}
td.mbox-image { /* The left image cell */
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em; /* 0.9em left, 0px right */
text-align: center;
}
td.mbox-imageright { /* The right image cell */
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0; /* 0px left, 0.9em right */
text-align: center;
}
td.mbox-empty-cell { /* An empty narrow cell */
border: none;
padding: 0;
width: 1px;
}
/* Article message box styles */
table.ambox {
margin: 0 10%; /* 10% = Will not overlap with other elements */
border: 1px solid #a2a9b1;
/* @noflip */
border-left: 10px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
table.ambox + table.ambox { /* Single border between stacked boxes. */
margin-top: -1px;
}
.ambox th.mbox-text,
.ambox td.mbox-text { /* The message body cell(s) */
padding: 0.25em 0.5em; /* 0.5em left/right */
}
.ambox td.mbox-image { /* The left image cell */
/* @noflip */
padding: 2px 0 2px 0.5em; /* 0.5em left, 0px right */
}
.ambox td.mbox-imageright { /* The right image cell */
/* @noflip */
padding: 2px 0.5em 2px 0; /* 0px left, 0.5em right */
}
table.ambox-notice {
/* @noflip */
border-left: 10px solid #36c; /* Blue */
}
table.ambox-speedy {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.ambox-delete {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
}
table.ambox-content {
/* @noflip */
border-left: 10px solid #f28500; /* Orange */
}
table.ambox-style {
/* @noflip */
border-left: 10px solid #fc3; /* Yellow */
}
table.ambox-move {
/* @noflip */
border-left: 10px solid #9932cc; /* Purple */
}
table.ambox-protection {
/* @noflip */
border-left: 10px solid #a2a9b1; /* Gray-gold */
}
/* Image message box styles */
table.imbox {
margin: 4px 10%;
border-collapse: collapse;
border: 3px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
.imbox .mbox-text .imbox { /* For imboxes inside imbox-text cells. */
margin: 0 -0.5em; /* 0.9 - 0.5 = 0.4em left/right. */
display: block; /* Fix for webkit to force 100% width. */
}
.mbox-inside .imbox { /* For imboxes inside other templates. */
margin: 4px;
}
table.imbox-notice {
border: 3px solid #36c; /* Blue */
}
table.imbox-speedy {
border: 3px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.imbox-delete {
border: 3px solid #b32424; /* Red */
}
table.imbox-content {
border: 3px solid #f28500; /* Orange */
}
table.imbox-style {
border: 3px solid #fc3; /* Yellow */
}
table.imbox-move {
border: 3px solid #9932cc; /* Purple */
}
table.imbox-protection {
border: 3px solid #a2a9b1; /* Gray-gold */
}
table.imbox-license {
border: 3px solid #88a; /* Dark gray */
background-color: #f7f8ff; /* Light gray */
}
table.imbox-featured {
border: 3px solid #cba135; /* Brown-gold */
}
/* Category message box styles */
table.cmbox {
margin: 3px 10%;
border-collapse: collapse;
border: 1px solid #a2a9b1;
background-color: #DFE8FF; /* Default "notice" blue */
box-sizing: border-box;
}
table.cmbox-notice {
background-color: #D8E8FF; /* Blue */
}
table.cmbox-speedy {
margin-top: 4px;
margin-bottom: 4px;
border: 4px solid #b32424; /* Red */
background-color: #FFDBDB; /* Pink */
}
table.cmbox-delete {
background-color: #FFDBDB; /* Red */
}
table.cmbox-content {
background-color: #FFE7CE; /* Orange */
}
table.cmbox-style {
background-color: #FFF9DB; /* Yellow */
}
table.cmbox-move {
background-color: #E4D8FF; /* Purple */
}
table.cmbox-protection {
background-color: #EFEFE1; /* Gray-gold */
}
/* Other pages message box styles */
table.ombox {
margin: 4px 10%;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
table.ombox-notice {
border: 1px solid #a2a9b1; /* Gray */
}
table.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.ombox-delete {
border: 2px solid #b32424; /* Red */
}
table.ombox-content {
border: 1px solid #f28500; /* Orange */
}
table.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
table.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
table.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
/* Talk page message box styles */
table.tmbox {
margin: 4px 10%;
border-collapse: collapse;
border: 1px solid #c0c090; /* Default "notice" gray-brown */
background-color: #f8eaba;
min-width: 80%;
box-sizing: border-box;
}
.tmbox.mbox-small {
min-width: 0; /* reset the min-width of tmbox above */
}
.mediawiki .mbox-inside .tmbox { /* For tmboxes inside other templates. The "mediawiki" class ensures that */
margin: 2px 0; /* this declaration overrides other styles (including mbox-small above) */
width: 100%; /* For Safari and Opera */
}
.mbox-inside .tmbox.mbox-small { /* "small" tmboxes should not be small when */
line-height: 1.5em; /* also "nested", so reset styles that are */
font-size: 100%; /* set in "mbox-small" above. */
}
table.tmbox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.tmbox-delete {
border: 2px solid #b32424; /* Red */
}
table.tmbox-content {
border: 2px solid #f28500; /* Orange */
}
table.tmbox-style {
border: 2px solid #fc3; /* Yellow */
}
table.tmbox-move {
border: 2px solid #9932cc; /* Purple */
}
table.tmbox-protection,
table.tmbox-notice {
border: 1px solid #c0c090; /* Gray-brown */
}
/* Disambig and set index box styles */
table.dmbox {
clear: both;
margin: 0.9em 1em;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
background-color: transparent;
}
/* Footer and header message box styles */
table.fmbox {
clear: both;
margin: 0.2em 0;
width: 100%;
border: 1px solid #a2a9b1;
background-color: #f8f9fa; /* Default "system" gray */
box-sizing: border-box;
}
table.fmbox-system {
background-color: #f8f9fa;
}
table.fmbox-warning {
border: 1px solid #bb7070; /* Dark pink */
background-color: #ffdbdb; /* Pink */
}
table.fmbox-editnotice {
background-color: transparent;
}
/* Div based "warning" style fmbox messages. */
div.mw-warning-with-logexcerpt,
div.mw-lag-warn-high,
div.mw-cascadeprotectedwarning,
div#mw-protect-cascadeon,
div.titleblacklist-warning,
div.locked-warning {
clear: both;
margin: 0.2em 0;
border: 1px solid #bb7070;
background-color: #ffdbdb;
padding: 0.25em 0.9em;
box-sizing: border-box;
}
/* These mbox-small classes must be placed after all other
ambox/tmbox/ombox etc classes. "html body.mediawiki" is so
they override "table.ambox + table.ambox" above. */
html body.mediawiki .mbox-small { /* For the "small=yes" option. */
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
box-sizing: border-box;
width: 238px;
font-size: 88%;
line-height: 1.25em;
}
html body.mediawiki .mbox-small-left { /* For the "small=left" option. */
/* @noflip */
margin: 4px 1em 4px 0;
box-sizing: border-box;
overflow: hidden;
width: 238px;
border-collapse: collapse;
font-size: 88%;
line-height: 1.25em;
}
/* Style for compact ambox */
/* Hide the images */
.compact-ambox table .mbox-image,
.compact-ambox table .mbox-imageright,
.compact-ambox table .mbox-empty-cell {
display: none;
}
/* Remove borders, backgrounds, padding, etc. */
.compact-ambox table.ambox {
border: none;
border-collapse: collapse;
background-color: transparent;
margin: 0 0 0 1.6em !important;
padding: 0 !important;
width: auto;
display: block;
}
body.mediawiki .compact-ambox table.mbox-small-left {
font-size: 100%;
width: auto;
margin: 0;
}
/* Style the text cell as a list item and remove its padding */
.compact-ambox table .mbox-text {
padding: 0 !important;
margin: 0 !important;
}
.compact-ambox table .mbox-text-span {
display: list-item;
line-height: 1.5em;
list-style-type: square;
list-style-image: url(/w/skins/MonoBook/resources/images/bullet.gif);
}
.skin-vector .compact-ambox table .mbox-text-span {
list-style-type: disc;
list-style-image: url(/w/skins/Vector/images/bullet-icon.svg);
list-style-image: url(/w/skins/Vector/images/bullet-icon.png)\9;
}
/* Allow for hiding text in compact form */
.compact-ambox .hide-when-compact {
display: none;
}
/* For template documentation */
/* TemplateStyles */
.template-documentation {
clear: both;
margin: 1em 0 0 0;
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
padding: 1em;
}
d9e4c7221dafae29c01080b36effd079723d287b
MediaWiki:Common.js
8
43
124
123
2023-10-17T17:34:56Z
LamayII
2
1 revision imported from [[:dev:MediaWiki:Common.js]]
javascript
text/javascript
/* Any JavaScript here will be loaded for all users on every page load. */
7850587e5c59a0259c9c96f81797dcf059b3cac9
Module:Message box
828
18
126
30
2023-10-17T17:38:38Z
LamayII
2
1 revision imported from [[:dev:Module:Message_box]]
Scribunto
text/plain
require('Module:No globals')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
or 'Imbox notice.png', imageSize)
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
fd6a8b1a0ac5916465cdf2eb099825f1d006cfba
144
126
2023-10-17T17:44:49Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Message_box]]
Scribunto
text/plain
require('Module:No globals')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
or 'Imbox notice.png', imageSize)
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
fd6a8b1a0ac5916465cdf2eb099825f1d006cfba
Module:Message box/doc
828
44
128
127
2023-10-17T17:38:41Z
LamayII
2
1 revision imported from [[:dev:Module:Message_box/doc]]
wikitext
text/x-wiki
{{documentation subpage}}
This is a meta-module that implements the message box templates {{tl|mbox}} etc.. It is intended to be used from Lua modules, and should not be used directly from wiki pages. If you want to use this module's functionality from a wiki page, please use the individual message box templates instead.
== Usage ==
To use this module from another Lua module, first you need to load it.
<syntaxhighlight lang="lua">
local messageBox = require('Module:Message box')
</syntaxhighlight>
To create a message box, use the <code>main</code> function. It takes two parameters: the first is the box type (as a string), and the second is a table containing the message box parameters.
<syntaxhighlight lang="lua">
local box = messageBox.main( boxType, {
param1 = param1,
param2 = param2,
-- More parameters...
})
</syntaxhighlight>
There are seven available box types:
{| class="wikitable"
! Box type !! Template !! Purpose
|-
| <code>mbox</code> || For message boxes to be used in multiple namespaces
|-
| <code>ambox</code> || For article message boxes
|-
| <code>cmbox</code> || For category message boxes
|-
| <code>fmbox</code> || For interface message boxes
|-
| <code>imbox</code> || For file namespace message boxes
|-
| <code>tmbox</code> || For talk page message boxes
|-
| <code>ombox</code> || For message boxes in other namespaces
|}
See {{Tl|mbox}] for the available parameters.
== Usage from #invoke ==
As well as the <code>main</code> function, this module has separate functions for each box type. They are accessed using the code <code><nowiki>{{#invoke:Message box|mbox|...}}</nowiki></code>, <code><nowiki>{{#invoke:Message box|ambox|...}}</nowiki></code>, etc. These will work when called from other modules, but they access code used to process arguments passed from #invoke, and so calling them will be less efficient than calling <code>main</code>.
== Technical details ==
The module uses the same basic code for each of the templates listed above; the differences between each of them are configured using the data at [[Module:Message box/configuration]]. Here are the various configuration options and what they mean:
* <code>types</code> – a table containing data used by the type parameter of the message box. The table keys are the values that can be passed to the type parameter, and the table values are tables containing the class and the image used by that type.
* <code>default</code> – the type to use if no value was passed to the type parameter, or if an invalid value was specified.
* <code>showInvalidTypeError</code> – whether to show an error if the value passed to the type parameter was invalid.
* <code>allowBlankParams</code> – usually blank values are stripped from parameters passed to the module. However, whitespace is preserved for the parameters included in the allowBlankParams table.
* <code>allowSmall</code> – whether a small version of the message box can be produced with "small=yes".
* <code>smallParam</code> – a custom name for the small parameter. For example, if set to "left" you can produce a small message box using "small=left".
* <code>smallClass</code> – the class to use for small message boxes.
* <code>substCheck</code> – whether to perform a subst check or not.
* <code>classes</code> – an array of classes to use with the message box.
* <code>imageEmptyCell</code> – whether to use an empty <td> cell if there is no image set. This is used to preserve spacing for message boxes with a width of less than 100% of the screen.
* <code>imageEmptyCellStyle</code> – whether empty image cells should be styled.
* <code>imageCheckBlank</code> – whether "image=blank" results in no image being displayed.
* <code>imageSmallSize</code> – usually, images used in small message boxes are set to 30x30px. This sets a custom size.
* <code>imageCellDiv</code> – whether to enclose the image in a div enforcing a maximum image size.
* <code>useCollapsibleTextFields</code> – whether to use text fields that can be collapsed, i.e. "issue", "fix", "talk", etc. Currently only used in ambox.
* <code>imageRightNone</code> – whether imageright=none results in no image being displayed on the right-hand side of the message box.
* <code>sectionDefault</code> – the default name for the "section" parameter. Depends on <code>useCollapsibleTextFields</code>.
* <code>allowMainspaceCategories</code> – allow categorisation in the main namespace.
* <code>templateCategory</code> – the name of a category to be placed on the template page.
* <code>templateCategoryRequireName</code> – whether the <code>name</code> parameter is required to display the template category.
* <code>templateErrorCategory</code> – the name of the error category to be used on the template page.
* <code>templateErrorParamsToCheck</code> – an array of parameter names to check. If any are absent, the <code>templateErrorCategory</code> is applied to the template page.
38bb5d3c8f58e991b70953e50ee89b56cf05ca4e
Module:Yesno
828
16
130
24
2023-10-17T17:39:11Z
LamayII
2
1 revision imported from [[:dev:Module:Yesno]]
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
136
130
2023-10-17T17:44:48Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Yesno]]
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Module:Yesno/doc
828
45
132
131
2023-10-17T17:39:13Z
LamayII
2
1 revision imported from [[:dev:Module:Yesno/doc]]
wikitext
text/x-wiki
{{documentation subpage}}
This module provides a consistent interface for processing boolean or boolean-style string input. While Lua allows the <code>true</code> and <code>false</code> boolean values, wikicode templates can only express boolean values through strings such as "yes", "no", etc. This module processes these kinds of strings and turns them into boolean input for Lua to process. It also returns <code>nil</code> values as <code>nil</code>, to allow for distinctions between <code>nil</code> and <code>false</code>. The module also accepts other Lua structures as input, i.e. booleans, numbers, tables, and functions. If it is passed input that it does not recognise as boolean or <code>nil</code>, it is possible to specify a default value to return.
== Syntax ==
<syntaxhighlight lang="lua">yesno(value, default)</syntaxhighlight>
<code>value</code> is the value to be tested. Boolean input or boolean-style input (see below) always evaluates to either <code>true</code> or <code>false</code>, and <code>nil</code> always evaluates to <code>nil</code>. Other values evaluate to <code>default</code>.
== Usage ==
First, load the module. Note that it can only be loaded from other Lua modules, not from normal wiki pages. For normal wiki pages you can use {{tl|yesno}} instead.
<syntaxhighlight lang="lua">
local yesno = require('Module:Yesno')
</syntaxhighlight>
Some input values always return <code>true</code>, and some always return <code>false</code>. <code>nil</code> values always return <code>nil</code>.
<syntaxhighlight lang="lua">
-- These always return true:
yesno('yes')
yesno('y')
yesno('true')
yesno('t')
yesno('1')
yesno(1)
yesno(true)
-- These always return false:
yesno('no')
yesno('n')
yesno('false')
yesno('f')
yesno('0')
yesno(0)
yesno(false)
-- A nil value always returns nil:
yesno(nil)
</syntaxhighlight>
String values are converted to lower case before they are matched:
<syntaxhighlight lang="lua">
-- These always return true:
yesno('Yes')
yesno('YES')
yesno('yEs')
yesno('Y')
yesno('tRuE')
-- These always return false:
yesno('No')
yesno('NO')
yesno('nO')
yesno('N')
yesno('fALsE')
</syntaxhighlight>
===Undefined input ('foo')===
You can specify a default value if yesno receives input other than that listed above. If you don't supply a default, the module will return <code>nil</code> for these inputs.
<syntaxhighlight lang="lua">
-- These return nil:
yesno('foo')
yesno({})
yesno(5)
yesno(function() return 'This is a function.' end)
yesno(nil, true)
yesno(nil, 'bar')
-- These return true:
yesno('foo', true)
yesno({}, true)
yesno(5, true)
yesno(function() return 'This is a function.' end, true)
-- These return "bar":
yesno('foo', 'bar')
yesno({}, 'bar')
yesno(5, 'bar')
yesno(function() return 'This is a function.' end, 'bar')
</syntaxhighlight>
Note that the empty string also functions this way:
<syntaxhighlight lang="lua">
yesno('') -- Returns nil.
yesno('', true) -- Returns true.
yesno('', 'bar') -- Returns "bar".
</syntaxhighlight>
Although the empty string usually evaluates to false in wikitext, it evaluates to true in Lua. This module prefers the Lua behaviour over the wikitext behaviour. If treating the empty string as false is important for your module, you will need to convert empty strings to a value that evaluates to false before passing them to this module. In the case of arguments received from wikitext, this can be done by using [[Module:Arguments]].
===Handling nil results===
By definition
:<syntaxhighlight lang="lua">
yesno(nil) -- Returns nil.
yesno('foo') -- Returns nil.
yesno(nil, true) -- Returns nil.
yesno(nil, false) -- Returns nil.
yesno('foo', true) -- Returns true.
</syntaxhighlight>
To get the binary <syntaxhighlight lang="lua" inline>true/false</syntaxhighlight>-only values, use code like:
<syntaxhighlight lang="lua">
myvariable = yesno(value) or false -- When value is nil, result is false.
myvariable = yesno(value) or true -- When value is nil, result is true.
myvariable = yesno('foo') or false -- Unknown string returns nil, result is false.
myvariable = yesno('foo', true) or false -- Default value (here: true) applies, result is true.
</syntaxhighlight>
03067100698692707464a82f865632745988653f
Module:Message box/configuration
828
20
146
34
2023-10-17T17:44:49Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Message_box/configuration]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '<small>[[Help:Maintenance template removal|Learn how and when to remove this template message]]</small>',
templatestyles = 'Module:Message box/ambox.css'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true,
templatestyles = 'Module:Message box/cmbox.css'
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false,
templatestyles = 'Module:Message box/fmbox.css'
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox license.png' -- @todo We need an SVG version of this
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg'
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes',
templatestyles = 'Module:Message box/imbox.css'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true,
templatestyles = 'Module:Message box/ombox.css'
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
templateCategory = 'Talk message boxes',
templatestyles = 'Module:Message box/tmbox.css'
}
}
b6f0151037e6867b577c8cca32ff297e48697a10
Template:Yesno
10
46
148
147
2023-10-17T17:44:50Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Yesno]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }}
|no
|n
|f
|false
|off
|0 = {{{no|<!-- null -->}}}
| = {{{blank|{{{no|<!-- null -->}}}}}}
|¬ = {{{¬|}}}
|yes
|y
|t
|true
|on
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
629c2937bc5cf7cfe13cd2a598582af832782399
Template:Main other
10
47
150
149
2023-10-17T17:44:51Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Main_other]]
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
</noinclude>
86ad907ffeea3cc545159e00cd1f2d6433946450
Template:Nobold
10
48
152
151
2023-10-17T17:44:51Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Nobold]]
wikitext
text/x-wiki
<templatestyles src="Nobold/styles.css"/><span class="nobold">{{{1}}}</span><noinclude>
{{documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
9c92b5951772bb26ca0fbe9256418b65e47700dd
Template:Nobold/styles.css
10
49
154
153
2023-10-17T17:44:51Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Nobold/styles.css]]
sanitized-css
text/css
/* {{pp-template}} */
/* Styling for Template:Nobold */
.nobold {
font-weight: normal;
}
83e5f0adacf8c7984251f1fd9d11ed82ebaadf03
Module:Check for unknown parameters
828
50
156
155
2023-10-17T17:44:52Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Check_for_unknown_parameters]]
Scribunto
text/plain
-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
local function clean(text)
-- Return text cleaned for display and truncated if too long.
-- Strip markers are replaced with dummy text representing the original wikitext.
local pos, truncated
local function truncate(text)
if truncated then
return ''
end
if mw.ustring.len(text) > 25 then
truncated = true
text = mw.ustring.sub(text, 1, 25) .. '...'
end
return mw.text.nowiki(text)
end
local parts = {}
for before, tag, remainder in text:gmatch('([^\127]*)\127[^\127]*%-(%l+)%-[^\127]*\127()') do
pos = remainder
table.insert(parts, truncate(before) .. '<' .. tag .. '>...</' .. tag .. '>')
end
table.insert(parts, truncate(text:sub(pos or 1)))
return table.concat(parts)
end
function p._check(args, pargs)
if type(args) ~= "table" or type(pargs) ~= "table" then
-- TODO: error handling
return
end
-- create the list of known args, regular expressions, and the return string
local knownargs = {}
local regexps = {}
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
-- loop over the parent args, and make sure they are on the list
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local values = {}
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
table.insert(values, clean(k))
end
elseif type(k) == 'number' and knownargs[tostring(k)] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(tostring(k), regexp) then
knownflag = true
break
end
end
if not knownflag and ( showblankpos or isnotempty(v) ) then
table.insert(values, k .. ' = ' .. clean(v))
end
end
end
-- add results to the output tables
local res = {}
if #values > 0 then
local unknown_text = args['unknown'] or 'Found _VALUE_, '
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
local preview_text = args['preview']
if isnotempty(preview_text) then
preview_text = require('Module:If preview')._warning({preview_text})
elseif preview == nil then
preview_text = unknown_text
end
unknown_text = preview_text
end
for _, v in pairs(values) do
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
if v == '' then v = ' ' end
-- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
end
end
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
return p
93db6d115d4328d2a5148bb42959105e367b663e
Module:String
828
51
158
157
2023-10-17T17:44:52Z
LamayII
2
1 revision imported from [[:wikipedia:Module:String]]
Scribunto
text/plain
--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters,
unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
automatically remove any leading or trailing whitespace from the parameter.
Depending on the intended use, it may be advantageous to either preserve or
remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in
an empty string being returned rather than an error message.
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String].
no_category: If set to 'true' or 1, no category will be added if an error
is generated.
Unit tests for this module are available at Module:String/tests.
]]
local str = {}
--[[
len
This function returns the length of the target string.
Usage:
{{#invoke:String|len|target_string|}}
OR
{{#invoke:String|len|s=target_string}}
Parameters
s: The string whose length to report
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string.
]]
function str.len( frame )
local new_args = str._getParameters( frame.args, {'s'} )
local s = new_args['s'] or ''
return mw.ustring.len( s )
end
--[[
sub
This function returns a substring of the target string at specified indices.
Usage:
{{#invoke:String|sub|target_string|start_index|end_index}}
OR
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
Parameters
s: The string to return a subset of
i: The fist index of the substring to return, defaults to 1.
j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j
is a negative value, it is interpreted the same as selecting a character by
counting from the end of the string. Hence, a value of -1 is the same as
selecting the last character of the string.
If the requested indices are out of range for the given string, an error is
reported.
]]
function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } )
local s = new_args['s'] or ''
local i = tonumber( new_args['i'] ) or 1
local j = tonumber( new_args['j'] ) or -1
local len = mw.ustring.len( s )
-- Convert negatives for range checking
if i < 0 then
i = len + i + 1
end
if j < 0 then
j = len + j + 1
end
if i > len or j > len or i < 1 or j < 1 then
return str._error( 'String subset index out of range' )
end
if j < i then
return str._error( 'String subset indices out of order' )
end
return mw.ustring.sub( s, i, j )
end
--[[
This function implements that features of {{str sub old}} and is kept in order
to maintain these older templates.
]]
function str.sublength( frame )
local i = tonumber( frame.args.i ) or 0
local len = tonumber( frame.args.len )
return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
end
--[[
_match
This function returns a substring from the source string that matches a
specified pattern. It is exported for use in other modules
Usage:
strmatch = require("Module:String")._match
sresult = strmatch( s, pattern, start, match, plain, nomatch )
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This sub-routine is exported for use in other modules
function str._match( s, pattern, start, match_index, plain_flag, nomatch )
if s == '' then
return str._error( 'Target string is empty' )
end
if pattern == '' then
return str._error( 'Pattern string is empty' )
end
start = tonumber(start) or 1
if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
return str._error( 'Requested start is out of range' )
end
if match_index == 0 then
return str._error( 'Match index is out of range' )
end
if plain_flag then
pattern = str._escapePattern( pattern )
end
local result
if match_index == 1 then
-- Find first match is simple case
result = mw.ustring.match( s, pattern, start )
else
if start > 1 then
s = mw.ustring.sub( s, start )
end
local iterator = mw.ustring.gmatch(s, pattern)
if match_index > 0 then
-- Forward search
for w in iterator do
match_index = match_index - 1
if match_index == 0 then
result = w
break
end
end
else
-- Reverse search
local result_table = {}
local count = 1
for w in iterator do
result_table[count] = w
count = count + 1
end
result = result_table[ count + match_index ]
end
end
if result == nil then
if nomatch == nil then
return str._error( 'Match not found' )
else
return nomatch
end
else
return result
end
end
--[[
match
This function returns a substring from the source string that matches a
specified pattern.
Usage:
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
OR
{{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index
|match=match_number|plain=plain_flag|nomatch=nomatch_output}}
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from each string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then
this function generates an error. An error is also generated if no match is found.
If one adds the parameter ignore_errors=true, then the error will be suppressed and
an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This is the entry point for #invoke:String|match
function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} )
local s = new_args['s'] or ''
local start = tonumber( new_args['start'] ) or 1
local plain_flag = str._getBoolean( new_args['plain'] or false )
local pattern = new_args['pattern'] or ''
local match_index = math.floor( tonumber(new_args['match']) or 1 )
local nomatch = new_args['nomatch']
return str._match( s, pattern, start, match_index, plain_flag, nomatch )
end
--[[
pos
This function returns a single character from the target string at position pos.
Usage:
{{#invoke:String|pos|target_string|index_value}}
OR
{{#invoke:String|pos|target=target_string|pos=index_value}}
Parameters
target: The string to search
pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards
from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error.
]]
function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} )
local target_str = new_args['target'] or ''
local pos = tonumber( new_args['pos'] ) or 0
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
return str._error( 'String index out of range' )
end
return mw.ustring.sub( target_str, pos, pos )
end
--[[
str_find
This function duplicates the behavior of {{str_find}}, including all of its quirks.
This is provided in order to support existing templates, but is NOT RECOMMENDED for
new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based,
and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a
value of "1", which is generally unexpected behavior, and must be accounted for
separatetly.
]]
function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} )
local source_str = new_args['source'] or ''
local target_str = new_args['target'] or ''
if target_str == '' then
return 1
end
local start = mw.ustring.find( source_str, target_str, 1, true )
if start == nil then
start = -1
end
return start
end
--[[
find
This function allows one to search for a target string or pattern within another
string.
Usage:
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
OR
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
Parameters
source: The string to search
target: The string or pattern to find within source
start: The index within the source string to start the search, defaults to 1
plain: Boolean flag indicating that target should be understood as plain
text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the parameter. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found
within "source". Indices are 1-based. If "target" is not found, then this
function returns 0. If either "source" or "target" are missing / empty, this
function also returns 0.
This function should be safe for UTF-8 strings.
]]
function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['target'] or ''
local start_pos = tonumber(new_args['start']) or 1
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return 0
end
plain = str._getBoolean( plain )
local start = mw.ustring.find( source_str, pattern, start_pos, plain )
if start == nil then
start = 0
end
return start
end
--[[
replace
This function allows one to replace a target string or pattern within another
string.
Usage:
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
OR
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
count=replacement_count|plain=plain_flag}}
Parameters
source: The string to search
pattern: The string or pattern to find within source
replace: The replacement text
count: The number of occurences to replace, defaults to all.
plain: Boolean flag indicating that pattern should be understood as plain
text and not as a Lua style regular expression, defaults to true
]]
function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['pattern'] or ''
local replace = new_args['replace'] or ''
local count = tonumber( new_args['count'] )
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return source_str
end
plain = str._getBoolean( plain )
if plain then
pattern = str._escapePattern( pattern )
replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences.
end
local result
if count ~= nil then
result = mw.ustring.gsub( source_str, pattern, replace, count )
else
result = mw.ustring.gsub( source_str, pattern, replace )
end
return result
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] )
if not repetitions then
return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
return string.rep( frame.args[1] or '', repetitions )
end
--[[
escapePattern
This function escapes special characters from a Lua string pattern. See [1]
for details on how patterns work.
[1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
Usage:
{{#invoke:String|escapePattern|pattern_string}}
Parameters
pattern_string: The pattern string to escape.
]]
function str.escapePattern( frame )
local pattern_str = frame.args[1]
if not pattern_str then
return str._error( 'No pattern string specified' )
end
local result = str._escapePattern( pattern_str )
return result
end
--[[
count
This function counts the number of occurrences of one string in another.
]]
function str.count(frame)
local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'})
local source = args.source or ''
local pattern = args.pattern or ''
local plain = str._getBoolean(args.plain or true)
if plain then
pattern = str._escapePattern(pattern)
end
local _, count = mw.ustring.gsub(source, pattern, '')
return count
end
--[[
endswith
This function determines whether a string ends with another string.
]]
function str.endswith(frame)
local args = str._getParameters(frame.args, {'source', 'pattern'})
local source = args.source or ''
local pattern = args.pattern or ''
if pattern == '' then
-- All strings end with the empty string.
return "yes"
end
if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then
return "yes"
else
return ""
end
end
--[[
join
Join all non empty arguments together; the first argument is the separator.
Usage:
{{#invoke:String|join|sep|one|two|three}}
]]
function str.join(frame)
local args = {}
local sep
for _, v in ipairs( frame.args ) do
if sep then
if v ~= '' then
table.insert(args, v)
end
else
sep = v
end
end
return table.concat( args, sep or '' )
end
--[[
Helper function that populates the argument list given that user may need to use a mix of
named and unnamed parameters. This is relevant because named parameters are not
identical to unnamed parameters due to string trimming, and when dealing with strings
we sometimes want to either preserve or remove that whitespace depending on the application.
]]
function str._getParameters( frame_args, arg_list )
local new_args = {}
local index = 1
local value
for _, arg in ipairs( arg_list ) do
value = frame_args[arg]
if value == nil then
value = frame_args[index]
index = index + 1
end
new_args[arg] = value
end
return new_args
end
--[[
Helper function to handle error messages.
]]
function str._error( error_str )
local frame = mw.getCurrentFrame()
local error_category = frame.args.error_category or 'Errors reported by Module String'
local ignore_errors = frame.args.ignore_errors or false
local no_category = frame.args.no_category or false
if str._getBoolean(ignore_errors) then
return ''
end
local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>'
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str
end
return error_str
end
--[[
Helper Function to interpret boolean strings
]]
function str._getBoolean( boolean_str )
local boolean_value
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower()
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
or boolean_str == '' then
boolean_value = false
else
boolean_value = true
end
elseif type( boolean_str ) == 'boolean' then
boolean_value = boolean_str
else
error( 'No boolean value found' )
end
return boolean_value
end
--[[
Helper function that escapes all pattern characters so that they will be treated
as plain text.
]]
function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" )
end
return str
6df794dd52434e0f6a372c9918f5a9dedd15f579
Module:Infobox
828
3
160
106
2023-10-17T17:44:53Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Infobox]]
Scribunto
text/plain
--
-- This module implements {{Infobox}}
--
local p = {}
local navbar = require('Module:Navbar')._navbar
local args = {}
local origArgs
local root
local function notempty( s ) return s and s:match( '%S' ) end
local function fixChildBoxes(sval, tt)
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' .. subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' .. subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
return s
else
return sval
end
end
local function union(t1, t2)
-- Returns the union of the values of two tables, as a sequence.
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
local function getArgNums(prefix)
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
local function addRow(rowArgs)
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
if rowArgs.header then
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:attr('id', rowArgs.rowid)
:tag('th')
:attr('colspan', 2)
:attr('id', rowArgs.headerid)
:addClass(rowArgs.class)
:addClass(args.headerclass)
:css('text-align', 'center')
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
elseif rowArgs.data then
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
row:attr('id', rowArgs.rowid)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:attr('id', rowArgs.labelid)
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
if not rowArgs.label then
dataCell
:attr('colspan', 2)
:css('text-align', 'center')
end
dataCell
:attr('id', rowArgs.dataid)
:addClass(rowArgs.class)
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:newline()
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
end
end
local function renderTitle()
if not args.title then return end
root
:tag('caption')
:addClass(args.titleclass)
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
root
:tag('tr')
:tag('th')
:attr('colspan', 2)
:addClass(args.aboveclass)
:css('text-align', 'center')
:css('font-size', '125%')
:css('font-weight', 'bold')
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass(args.belowclass)
:css('text-align', 'center')
:cssText(args.belowstyle)
:newline()
:wikitext(fixChildBoxes(args.below,'td'))
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addRow({
data = args['subheader' .. tostring(num)],
datastyle = args.subheaderstyle or args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:cssText(args.captionstyle)
:wikitext(caption)
end
addRow({
data = tostring(data),
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
local function renderRows()
-- Gets the union of the header and data argument numbers,
-- and renders them all in order using addRow.
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)],
dataid = args['dataid' .. tostring(num)],
labelid = args['labelid' .. tostring(num)],
headerid = args['headerid' .. tostring(num)],
rowid = args['rowid' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:css('text-align', 'right')
:wikitext(navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
local function renderTrackingCategories()
if args.decat ~= 'yes' then
if #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
end
if args.child == 'yes' and args.title then
root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]')
end
end
end
local function _infobox()
-- Specify the overall layout of the infobox, with special settings
-- if the infobox is used as a 'child' inside another infobox.
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass('infobox')
:addClass(args.bodyclass)
if args.subbox == 'yes' then
root
:css('padding', '0')
:css('border', 'none')
:css('margin', '-3px')
:css('width', 'auto')
:css('min-width', '100%')
:css('font-size', '100%')
:css('clear', 'none')
:css('float', 'none')
:css('background-color', 'transparent')
else
root
:css('width', '22em')
end
root
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
renderSubheaders()
renderImages()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderTrackingCategories()
return tostring(root)
end
local function preprocessSingleArg(argName)
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
local function preprocessArgs(prefixTable, step)
-- Assign the parameters with the given prefixes to the args table, in order, in batches
-- of the step size specified. This is to prevent references etc. from appearing in the
-- wrong order. The prefixTable should be an array containing tables, each of which has
-- two possible fields, a "prefix" string and a "depend" table. The function always parses
-- parameters containing the "prefix" string, but only parses parameters in the "depend"
-- table if the prefix parameter is present and non-blank.
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or (v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
moreArgumentsExist = true -- Do another loop if any arguments are found, even blank ones.
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present and not blank, or
-- we are processing "prefix1" and "prefix" is present and not blank, and
-- if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
function p.infobox(frame)
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so that
-- references etc. will display in the expected places. Parameters that depend on
-- another parameter are only processed if that parameter is present, to avoid
-- phantom references appearing in article reference lists.
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'},
{prefix = 'dataid'},
{prefix = 'labelid'},
{prefix = 'headerid'},
{prefix = 'rowid'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent
preprocessSingleArg('decat')
return frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
} .. _infobox()
end
return p
eccecf7ea52ce105242adb57836ea74e04395312
Module:Infobox/styles.css
828
21
162
78
2023-10-17T17:44:53Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Infobox/styles.css]]
sanitized-css
text/css
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
.infobox .navbar {
font-size: 100%;
}
/* T281642 */
body.skin-minerva .infobox-header,
body.skin-minerva .infobox-subheader,
body.skin-minerva .infobox-above,
body.skin-minerva .infobox-title,
body.skin-minerva .infobox-image,
body.skin-minerva .infobox-full-data,
body.skin-minerva .infobox-below {
text-align: center;
}
/* Infobox template style */
.infobox {
border: 1px solid #a2a9b1;
border-spacing: 3px;
background-color: #f8f9fa;
color: black;
/* @noflip */
margin: 0.5em 0 0.5em 1em;
padding: 0.2em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
font-size: 88%;
line-height: 1.5em;
width: 22em;
}
.infobox-header,
.infobox-label,
.infobox-above,
.infobox-full-data,
.infobox-data,
.infobox-below,
.infobox-subheader,
.infobox-image,
.infobox-navbar,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
vertical-align: top;
}
.infobox-label,
.infobox-data,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
/* @noflip */
text-align: left;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-above,
.infobox .infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
font-size: 125%;
font-weight: bold;
text-align: center;
}
.infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
padding: 0.2em;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-header,
.infobox .infobox-subheader,
.infobox .infobox-image,
.infobox .infobox-full-data,
.infobox .infobox-below {
text-align: center;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-navbar {
/* @noflip */
text-align: right;
}
eb850346855e4c081e692209d188b8432a2378d4
Module:List
828
27
164
62
2023-10-17T17:44:53Z
LamayII
2
1 revision imported from [[:wikipedia:Module:List]]
Scribunto
text/plain
-- This module outputs different kinds of lists. At the moment, bulleted,
-- unbulleted, horizontal, ordered, and horizontal ordered lists are supported.
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes
data.classes = {}
data.templatestyles = ''
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Template:Flatlist/styles.css' }
}
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Template:Plainlist/styles.css' }
}
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for i, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for i, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for i, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return data.templatestyles .. tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
b60cb90a28f54a237f389f8009157816b631d806
Module:TableTools
828
6
166
36
2023-10-17T17:44:53Z
LamayII
2
1 revision imported from [[:wikipedia:Module:TableTools]]
Scribunto
text/plain
--[[
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should --
-- not be called directly from #invoke. --
------------------------------------------------------------------------------------
--]]
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
--[[
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
--]]
function p.isPositiveInteger(v)
return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end
--[[
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a value can be a valid table key. Lua will
-- generate an error if a NaN is used as a table key.
------------------------------------------------------------------------------------
--]]
function p.isNan(v)
return type(v) == 'number' and tostring(v) == '-nan'
end
--[[
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
--]]
function p.shallowClone(t)
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
--]]
function p.removeDuplicates(t)
checkType('removeDuplicates', 1, t, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for i, v in ipairs(t) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
--]]
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k, v in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
-- return {1, 3, 6}.
------------------------------------------------------------------------------------
--]]
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k, v in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
-- of subtables in the format
-- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
-- Keys that don't end with an integer are stored in a subtable named "other".
-- The compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
--]]
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
--[[
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
--]]
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for k in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
else -- This will fail with table, boolean, function.
return item1 < item2
end
end
--[[
Returns a list of the keys in a table, sorted using either a default
comparison function or a custom keySort function.
]]
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, { 'function', 'boolean', 'nil' })
end
local list = {}
local index = 1
for key, value in pairs(t) do
list[index] = key
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(list, keySort)
end
return list
end
--[[
Iterates through a table, with the keys sorted using the keysToList function.
If there are only numerical keys, sparseIpairs is probably more efficient.
]]
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local list = p.keysToList(t, keySort, true)
local i = 0
return function()
i = i + 1
local key = list[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
--[[
Returns true if all keys in the table are consecutive integers starting at 1.
--]]
function p.isArray(t)
checkType("isArray", 1, t, "table")
local i = 0
for k, v in pairs(t) do
i = i + 1
if t[i] == nil then
return false
end
end
return true
end
-- { "a", "b", "c" } -> { a = 1, b = 2, c = 3 }
function p.invert(array)
checkType("invert", 1, array, "table")
local map = {}
for i, v in ipairs(array) do
map[v] = i
end
return map
end
--[[
{ "a", "b", "c" } -> { ["a"] = true, ["b"] = true, ["c"] = true }
--]]
function p.listToSet(t)
checkType("listToSet", 1, t, "table")
local set = {}
for _, item in ipairs(t) do
set[item] = true
end
return set
end
--[[
Recursive deep copy function.
Preserves identities of subtables.
]]
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[deepcopy(orig_key, includeMetatable, already_seen)] = deepcopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = deepcopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
--[[
Concatenates all values in the table that are indexed by a number, in order.
sparseConcat{ a, nil, c, d } => "acd"
sparseConcat{ nil, b, c, d } => "bcd"
]]
function p.sparseConcat(t, sep, i, j)
local list = {}
local list_i = 0
for _, v in p.sparseIpairs(t) do
list_i = list_i + 1
list[list_i] = v
end
return table.concat(list, sep, i, j)
end
--[[
-- Finds the length of an array, or of a quasi-array with keys such
-- as "data1", "data2", etc., using an exponential search algorithm.
-- It is similar to the operator #, but may return
-- a different value when there are gaps in the array portion of the table.
-- Intended to be used on data loaded with mw.loadData. For other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of
-- the number of unnamed template parameters, so use this function for
-- frame.args.
--]]
function p.length(t, prefix)
-- requiring module inline so that [[Module:Exponential search]]
-- which is only needed by this one function
-- doesn't get millions of transclusions
local expSearch = require("Module:Exponential search")
checkType('length', 1, t, 'table')
checkType('length', 2, prefix, 'string', true)
return expSearch(function(i)
local key
if prefix then
key = prefix .. tostring(i)
else
key = i
end
return t[key] ~= nil
end) or 0
end
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
ad3062fee63cdfb979a1543abf96236cf7bf609d
Template:Tlx
10
40
168
116
2023-10-17T17:44:54Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Tlx]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link expanded]]
155e901040104f96908f1f4627c4eb3501301bf9
Template:Template link expanded
10
39
170
114
2023-10-17T17:44:54Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Template_link_expanded]]
wikitext
text/x-wiki
<code><nowiki>{{</nowiki>{{#if:{{{subst|}}} |[[Help:Substitution|subst]]:}}<!--
-->[[{{{sister|{{{SISTER|}}}}}}{{ns:Template}}:{{{1|}}}|{{{1|}}}]]<!--
-->{{#if:{{{2|}}} ||{{{2}}}}}<!--
-->{{#if:{{{3|}}} ||{{{3}}}}}<!--
-->{{#if:{{{4|}}} ||{{{4}}}}}<!--
-->{{#if:{{{5|}}} ||{{{5}}}}}<!--
-->{{#if:{{{6|}}} ||{{{6}}}}}<!--
-->{{#if:{{{7|}}} ||{{{7}}}}}<!--
-->{{#if:{{{8|}}} ||{{{8}}}}}<!--
-->{{#if:{{{9|}}} ||{{{9}}}}}<!--
-->{{#if:{{{10|}}} ||{{{10}}}}}<!--
-->{{#if:{{{11|}}} ||{{{11}}}}}<!--
-->{{#if:{{{12|}}} ||{{{12}}}}}<!--
-->{{#if:{{{13|}}} ||{{{13}}}}}<!--
-->{{#if:{{{14|}}} ||{{{14}}}}}<!--
-->{{#if:{{{15|}}} ||{{{15}}}}}<!--
-->{{#if:{{{16|}}} ||{{{16}}}}}<!--
-->{{#if:{{{17|}}} ||{{{17}}}}}<!--
-->{{#if:{{{18|}}} ||{{{18}}}}}<!--
-->{{#if:{{{19|}}} ||{{{19}}}}}<!--
-->{{#if:{{{20|}}} ||{{{20}}}}}<!--
-->{{#if:{{{21|}}} ||''...''}}<!--
--><nowiki>}}</nowiki></code><noinclude>
{{Documentation}}
</noinclude>
9f670205d4b358df089b1a820f78f02a88afca3a
Module:Template link general
828
52
172
171
2023-10-17T17:44:54Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Template_link_general]]
Scribunto
text/plain
-- This implements Template:Tlg
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Is a string non-empty?
local function _ne(s)
return s ~= nil and s ~= ""
end
local nw = mw.text.nowiki
local function addTemplate(s)
local i, _ = s:find(':', 1, true)
if i == nil then
return 'Template:' .. s
end
local ns = s:sub(1, i - 1)
if ns == '' or mw.site.namespaces[ns] then
return s
else
return 'Template:' .. s
end
end
local function trimTemplate(s)
local needle = 'template:'
if s:sub(1, needle:len()):lower() == needle then
return s:sub(needle:len() + 1)
else
return s
end
end
local function linkTitle(args)
if _ne(args.nolink) then
return args['1']
end
local titleObj
local titlePart = '[['
if args['1'] then
-- This handles :Page and other NS
titleObj = mw.title.new(args['1'], 'Template')
else
titleObj = mw.title.getCurrentTitle()
end
titlePart = titlePart .. (titleObj ~= nil and titleObj.fullText or
addTemplate(args['1']))
local textPart = args.alttext
if not _ne(textPart) then
if titleObj ~= nil then
textPart = titleObj:inNamespace("Template") and args['1'] or titleObj.fullText
else
-- redlink
textPart = args['1']
end
end
if _ne(args.subst) then
-- HACK: the ns thing above is probably broken
textPart = 'subst:' .. textPart
end
if _ne(args.brace) then
textPart = nw('{{') .. textPart .. nw('}}')
elseif _ne(args.braceinside) then
textPart = nw('{') .. textPart .. nw('}')
end
titlePart = titlePart .. '|' .. textPart .. ']]'
if _ne(args.braceinside) then
titlePart = nw('{') .. titlePart .. nw('}')
end
return titlePart
end
function p.main(frame)
local args = getArgs(frame, {
trim = true,
removeBlanks = false
})
return p._main(args)
end
function p._main(args)
local bold = _ne(args.bold) or _ne(args.boldlink) or _ne(args.boldname)
local italic = _ne(args.italic) or _ne(args.italics)
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
local code = _ne(args.code) or _ne(args.tt)
local show_result = _ne(args._show_result)
local expand = _ne(args._expand)
-- Build the link part
local titlePart = linkTitle(args)
if bold then titlePart = "'''" .. titlePart .. "'''" end
if _ne(args.nowrapname) then titlePart = '<span class="nowrap">' .. titlePart .. '</span>' end
-- Build the arguments
local textPart = ""
local textPartBuffer = "|"
local codeArguments = {}
local codeArgumentsString = ""
local i = 2
local j = 1
while args[i] do
local val = args[i]
if val ~= "" then
if _ne(args.nowiki) then
-- Unstrip nowiki tags first because calling nw on something that already contains nowiki tags will
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
val = nw(mw.text.unstripNoWiki(val))
end
local k, v = string.match(val, "(.*)=(.*)")
if not k then
codeArguments[j] = val
j = j + 1
else
codeArguments[k] = v
end
codeArgumentsString = codeArgumentsString .. textPartBuffer .. val
if italic then
val = '<span style="font-style:italic;">' .. val .. '</span>'
end
textPart = textPart .. textPartBuffer .. val
end
i = i + 1
end
-- final wrap
local ret = titlePart .. textPart
if not dontBrace then ret = nw('{{') .. ret .. nw('}}') end
if _ne(args.a) then ret = nw('*') .. ' ' .. ret end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
if code then
ret = '<code>' .. ret .. '</code>'
elseif _ne(args.plaincode) then
ret = '<code style="border:none;background:transparent;">' .. ret .. '</code>'
end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
--[[ Wrap as html??
local span = mw.html.create('span')
span:wikitext(ret)
--]]
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
if show_result then
local result = mw.getCurrentFrame():expandTemplate{title = addTemplate(args[1]), args = codeArguments}
ret = ret .. " → " .. result
end
if expand then
local query = mw.text.encode('{{' .. addTemplate(args[1]) .. string.gsub(codeArgumentsString, textPartBuffer, "|") .. '}}')
local url = mw.uri.fullUrl('special:ExpandTemplates', 'wpInput=' .. query)
mw.log()
ret = ret .. " [" .. tostring(url) .. "]"
end
return ret
end
return p
c7307fa3959d308a2dd7fd2f5009c1ce6db3d122
Template:Template other
10
34
174
81
2023-10-17T17:44:55Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Template_other]]
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Template:Clear
10
37
176
104
2023-10-17T17:44:55Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Clear]]
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
Template:Distinguish
10
53
178
177
2023-10-17T17:44:55Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Distinguish]]
wikitext
text/x-wiki
{{#invoke:Distinguish|distinguish}}<noinclude><!-- splitting these lines causes {{Documentation}} template to terminate green shading when Distinguish is used in /doc pages. -->
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis to Wikidata, not here! -->
</noinclude>
f949a4cbfd6eb0ab77b832e69059a40a964b1fd8
Template:Sidebar
10
54
180
179
2023-10-17T17:44:56Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Sidebar]]
wikitext
text/x-wiki
{{#invoke:Sidebar|sidebar}}<noinclude>
{{documentation}}</noinclude>
ab2498000a99daf324f656b0badd187b4a3e2b42
Module:Distinguish
828
55
182
181
2023-10-17T17:44:56Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Distinguish]]
Scribunto
text/plain
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local mTableTools --initialize lazily
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
function p.distinguish(frame)
mArguments = require('Module:Arguments')
mTableTools = require('Module:TableTools')
local args = mArguments.getArgs(frame)
local selfref = args.selfref
local text = args.text
args = mTableTools.compressSparseArray(args)
return p._distinguish(args, text, selfref)
end
function p._distinguish(args, text, selfref)
checkType("_distinguish", 1, args, 'table')
if #args == 0 and not text then return '' end
local text = string.format(
'Not to be confused with %s.',
text or mHatlist.orList(args, true)
)
hnOptions = {selfref = selfref}
return mHatnote._hatnote(text, hnOptions)
end
return p
0364d14af01fc656ad1d898c5036fbd12a7ca938
Module:Effective protection expiry
828
56
184
183
2023-10-17T17:44:57Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Effective_protection_expiry]]
Scribunto
text/plain
local p = {}
-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)
return stabilitySettings and stabilitySettings.expiry or 'unknown'
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
end
local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
if rawExpiry == 'infinity' then
return 'infinity'
elseif rawExpiry == '' then
return 'unknown'
else
local year, month, day, hour, minute, second = rawExpiry:match(
'^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$'
)
if year then
return string.format(
'%s-%s-%sT%s:%s:%s',
year, month, day, hour, minute, second
)
else
error('internal error in Module:Effective protection expiry; malformed expiry timestamp')
end
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
9a8c58dc2667232ed08a9b206a5d89ca8150312b
Module:Effective protection level
828
57
186
185
2023-10-17T17:44:57Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Effective_protection_level]]
Scribunto
text/plain
local p = {}
-- Returns the permission required to perform a given action on a given title.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local level = mw.ext.FlaggedRevs.getStabilitySettings(title)
level = level and level.autoreview
if level == 'review' then
return 'reviewer'
elseif level ~= '' then
return level
else
return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review
end
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then
error( 'First parameter must be one of edit, move, create, upload, undelete, autoreview', 2 )
end
if title.namespace == 8 then -- MediaWiki namespace
if title.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page
return 'interfaceadmin'
else -- any non-JS/CSS MediaWiki page
return 'sysop'
end
elseif title.namespace == 2 and title.isSubpage then
if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page
return 'interfaceadmin'
elseif title.contentModel == 'json' then -- user JSON page
return 'sysop'
end
end
if action == 'undelete' then
return 'sysop'
end
local level = title.protectionLevels[action] and title.protectionLevels[action][1]
if level == 'sysop' or level == 'editprotected' then
return 'sysop'
elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
return 'sysop'
elseif level == 'templateeditor' then
return 'templateeditor'
elseif action == 'move' then
local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move.
if blacklistentry and not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif title.namespace == 6 then
return 'filemover'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
end
local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
if blacklistentry then
if not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason
return 'autoconfirmed'
elseif level then
return level
elseif action == 'upload' then
return 'autoconfirmed'
elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts
return 'user'
else
return '*'
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
70256a489edf6be9808031b14a7e3ef3e025da97
Module:File link
828
58
188
187
2023-10-17T17:44:57Z
LamayII
2
1 revision imported from [[:wikipedia:Module:File_link]]
Scribunto
text/plain
-- This module provides a library for formatting file wikilinks.
local yesno = require('Module:Yesno')
local checkType = require('libraryUtil').checkType
local p = {}
function p._main(args)
checkType('_main', 1, args, 'table')
-- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our
-- own function to get the right error level.
local function checkArg(key, val, level)
if type(val) ~= 'string' then
error(string.format(
"type error in '%s' parameter of '_main' (expected string, got %s)",
key, type(val)
), level)
end
end
local ret = {}
-- Adds a positional parameter to the buffer.
local function addPositional(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = val
end
-- Adds a named parameter to the buffer. We assume that the parameter name
-- is the same as the argument key.
local function addNamed(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = key .. '=' .. val
end
-- Filename
checkArg('file', args.file, 3)
ret[#ret + 1] = 'File:' .. args.file
-- Format
if args.format then
checkArg('format', args.format)
if args.formatfile then
checkArg('formatfile', args.formatfile)
ret[#ret + 1] = args.format .. '=' .. args.formatfile
else
ret[#ret + 1] = args.format
end
end
-- Border
if yesno(args.border) then
ret[#ret + 1] = 'border'
end
addPositional('location')
addPositional('alignment')
addPositional('size')
addNamed('upright')
addNamed('link')
addNamed('alt')
addNamed('page')
addNamed('class')
addNamed('lang')
addNamed('start')
addNamed('end')
addNamed('thumbtime')
addPositional('caption')
return string.format('[[%s]]', table.concat(ret, '|'))
end
function p.main(frame)
local origArgs = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:File link'
})
if not origArgs.file then
error("'file' parameter missing from [[Template:File link]]", 0)
end
-- Copy the arguments that were passed to a new table to avoid looking up
-- every possible parameter in the frame object.
local args = {}
for k, v in pairs(origArgs) do
-- Make _BLANK a special argument to add a blank parameter. For use in
-- conditional templates etc. it is useful for blank arguments to be
-- ignored, but we still need a way to specify them so that we can do
-- things like [[File:Example.png|link=]].
if v == '_BLANK' then
v = ''
end
args[k] = v
end
return p._main(args)
end
return p
66925f088d11530f2482f04181a3baaaa0ad3d0c
Module:Format link
828
59
190
189
2023-10-17T17:44:58Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Format_link]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Format link
--
-- Makes a wikilink from the given link and display values. Links are escaped
-- with colons if necessary, and links to sections are detected and displayed
-- with " § " as a separator rather than the standard MediaWiki "#". Used in
-- the {{format link}} template.
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local mError -- lazily initialise [[Module:Error]]
local yesno -- lazily initialise [[Module:Yesno]]
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
local function maybeItalicize(s, shouldItalicize)
-- Italicize s if s is a string and the shouldItalicize parameter is true.
if s and shouldItalicize then
return '<i>' .. s .. '</i>'
else
return s
end
end
local function parseLink(link)
-- Parse a link and return a table with the link's components.
-- These components are:
-- - link: the link, stripped of any initial colon (always present)
-- - page: the page name (always present)
-- - section: the page name (may be nil)
-- - display: the display text, if manually entered after a pipe (may be nil)
link = removeInitialColon(link)
-- Find whether a faux display value has been added with the {{!}} magic
-- word.
local prePipe, display = link:match('^(.-)|(.*)$')
link = prePipe or link
-- Find the page, if it exists.
-- For links like [[#Bar]], the page will be nil.
local preHash, postHash = link:match('^(.-)#(.*)$')
local page
if not preHash then
-- We have a link like [[Foo]].
page = link
elseif preHash ~= '' then
-- We have a link like [[Foo#Bar]].
page = preHash
end
-- Find the section, if it exists.
local section
if postHash and postHash ~= '' then
section = postHash
end
return {
link = link,
page = page,
section = section,
display = display,
}
end
local function formatDisplay(parsed, options)
-- Formats a display string based on a parsed link table (matching the
-- output of parseLink) and an options table (matching the input options for
-- _formatLink).
local page = maybeItalicize(parsed.page, options.italicizePage)
local section = maybeItalicize(parsed.section, options.italicizeSection)
if (not section) then
return page
elseif (not page) then
return mw.ustring.format('§ %s', section)
else
return mw.ustring.format('%s § %s', page, section)
end
end
local function missingArgError(target)
mError = require('Module:Error')
return mError.error{message =
'Error: no link or target specified! ([[' .. target .. '#Errors|help]])'
}
end
--------------------------------------------------------------------------------
-- Main functions
--------------------------------------------------------------------------------
function p.formatLink(frame)
-- The formatLink export function, for use in templates.
yesno = require('Module:Yesno')
local args = getArgs(frame)
local link = args[1] or args.link
local target = args[3] or args.target
if not (link or target) then
return missingArgError('Template:Format link')
end
return p._formatLink{
link = link,
display = args[2] or args.display,
target = target,
italicizePage = yesno(args.italicizepage),
italicizeSection = yesno(args.italicizesection),
categorizeMissing = args.categorizemissing
}
end
function p._formatLink(options)
-- The formatLink export function, for use in modules.
checkType('_formatLink', 1, options, 'table')
local function check(key, expectedType) --for brevity
checkTypeForNamedArg(
'_formatLink', key, options[key], expectedType or 'string', true
)
end
check('link')
check('display')
check('target')
check('italicizePage', 'boolean')
check('italicizeSection', 'boolean')
check('categorizeMissing')
-- Normalize link and target and check that at least one is present
if options.link == '' then options.link = nil end
if options.target == '' then options.target = nil end
if not (options.link or options.target) then
return missingArgError('Module:Format link')
end
local parsed = parseLink(options.link)
local display = options.display or parsed.display
local catMissing = options.categorizeMissing
local category = ''
-- Find the display text
if not display then display = formatDisplay(parsed, options) end
-- Handle the target option if present
if options.target then
local parsedTarget = parseLink(options.target)
parsed.link = parsedTarget.link
parsed.page = parsedTarget.page
end
-- Test if page exists if a diagnostic category is specified
if catMissing and (mw.ustring.len(catMissing) > 0) then
local title = nil
if parsed.page then title = mw.title.new(parsed.page) end
if title and (not title.isExternal) then
local success, exists = pcall(function() return title.exists end)
if success and not exists then
category = mw.ustring.format('[[Category:%s]]', catMissing)
end
end
end
-- Format the result as a link
if parsed.link == display then
return mw.ustring.format('[[:%s]]%s', parsed.link, category)
else
return mw.ustring.format('[[:%s|%s]]%s', parsed.link, display, category)
end
end
--------------------------------------------------------------------------------
-- Derived convenience functions
--------------------------------------------------------------------------------
function p.formatPages(options, pages)
-- Formats an array of pages using formatLink and the given options table,
-- and returns it as an array. Nil values are not allowed.
local ret = {}
for i, page in ipairs(pages) do
ret[i] = p._formatLink{
link = page,
categorizeMissing = options.categorizeMissing,
italicizePage = options.italicizePage,
italicizeSection = options.italicizeSection
}
end
return ret
end
return p
1253bdd2683ee4badc33856bfd5499b09a7dca1f
Module:Hatnote
828
60
192
191
2023-10-17T17:44:58Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Hatnote]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote --
-- --
-- This module produces hatnote links and links to related articles. It --
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local formatLink -- lazily initialise [[Module:Format link]] ._formatLink
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
function p.defaultClasses(inline)
-- Provides the default hatnote classes as a space-separated string; useful
-- for hatnote-manipulation modules like [[Module:Hatnote group]].
return
(inline == 1 and 'hatnote-inline' or 'hatnote') .. ' ' ..
'navigation-not-searchable'
end
function p.disambiguate(page, disambiguator)
-- Formats a page title with a disambiguation parenthetical,
-- i.e. "Example" → "Example (disambiguation)".
checkType('disambiguate', 1, page, 'string')
checkType('disambiguate', 2, disambiguator, 'string', true)
disambiguator = disambiguator or 'disambiguation'
return mw.ustring.format('%s (%s)', page, disambiguator)
end
function p.findNamespaceId(link, removeColon)
-- Finds the namespace id (namespace number) of a link or a pagename. This
-- function will not work if the link is enclosed in double brackets. Colons
-- are trimmed from the start of the link by default. To skip colon
-- trimming, set the removeColon parameter to false.
checkType('findNamespaceId', 1, link, 'string')
checkType('findNamespaceId', 2, removeColon, 'boolean', true)
if removeColon ~= false then
link = removeInitialColon(link)
end
local namespace = link:match('^(.-):')
if namespace then
local nsTable = mw.site.namespaces[namespace]
if nsTable then
return nsTable.id
end
end
return 0
end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
-- Formats an error message to be returned to wikitext. If
-- addTrackingCategory is not false after being returned from
-- [[Module:Yesno]], and if we are not on a talk page, a tracking category
-- is added.
checkType('makeWikitextError', 1, msg, 'string')
checkType('makeWikitextError', 2, helpLink, 'string', true)
yesno = require('Module:Yesno')
title = title or mw.title.getCurrentTitle()
-- Make the help link text.
local helpText
if helpLink then
helpText = ' ([[' .. helpLink .. '|help]])'
else
helpText = ''
end
-- Make the category text.
local category
if not title.isTalkPage -- Don't categorise talk pages
and title.namespace ~= 2 -- Don't categorise userspace
and yesno(addTrackingCategory) ~= false -- Allow opting out
then
category = 'Hatnote templates with errors'
category = mw.ustring.format(
'[[%s:%s]]',
mw.site.namespaces[14].name,
category
)
else
category = ''
end
return mw.ustring.format(
'<strong class="error">Error: %s%s.</strong>%s',
msg,
helpText,
category
)
end
local curNs = mw.title.getCurrentTitle().namespace
p.missingTargetCat =
--Default missing target category, exported for use in related modules
((curNs == 0) or (curNs == 14)) and
'Articles with hatnote templates targeting a nonexistent page' or nil
function p.quote(title)
--Wraps titles in quotation marks. If the title starts/ends with a quotation
--mark, kerns that side as with {{-'}}
local quotationMarks = {
["'"]=true, ['"']=true, ['“']=true, ["‘"]=true, ['”']=true, ["’"]=true
}
local quoteLeft, quoteRight = -- Test if start/end are quotation marks
quotationMarks[string.sub(title, 1, 1)],
quotationMarks[string.sub(title, -1, -1)]
if quoteLeft or quoteRight then
title = mw.html.create("span"):wikitext(title)
end
if quoteLeft then title:css("padding-left", "0.15em") end
if quoteRight then title:css("padding-right", "0.15em") end
return '"' .. tostring(title) .. '"'
end
--------------------------------------------------------------------------------
-- Hatnote
--
-- Produces standard hatnote text. Implements the {{hatnote}} template.
--------------------------------------------------------------------------------
function p.hatnote(frame)
local args = getArgs(frame)
local s = args[1]
if not s then
return p.makeWikitextError(
'no text specified',
'Template:Hatnote#Errors',
args.category
)
end
return p._hatnote(s, {
extraclasses = args.extraclasses,
selfref = args.selfref
})
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
checkType('_hatnote', 2, options, 'table', true)
options = options or {}
local inline = options.inline
local hatnote = mw.html.create(inline == 1 and 'span' or 'div')
local extraclasses
if type(options.extraclasses) == 'string' then
extraclasses = options.extraclasses
end
hatnote
:attr('role', 'note')
:addClass(p.defaultClasses(inline))
:addClass(extraclasses)
:addClass(options.selfref and 'selfref' or nil)
:wikitext(s)
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
} .. tostring(hatnote)
end
return p
3ae1ed7094c5005ca0896395ec9a587287a0bef1
Module:Hatnote/styles.css
828
61
194
193
2023-10-17T17:44:59Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Hatnote/styles.css]]
sanitized-css
text/css
/* {{pp|small=y}} */
.hatnote {
font-style: italic;
}
/* Limit structure CSS to divs because of [[Module:Hatnote inline]] */
div.hatnote {
/* @noflip */
padding-left: 1.6em;
margin-bottom: 0.5em;
}
.hatnote i {
font-style: normal;
}
/* The templatestyles element inserts a link element before hatnotes.
* TODO: Remove link if/when WMF resolves T200206 */
.hatnote + link + .hatnote {
margin-top: -0.5em;
}
44680ffd6e888866df2cdfa0341af9c7b97da94c
Module:Hatnote list
828
62
196
195
2023-10-17T17:44:59Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Hatnote_list]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote list --
-- --
-- This module produces and formats lists for use in hatnotes. In particular, --
-- it implements the for-see list, i.e. lists of "For X, see Y" statements, --
-- as used in {{about}}, {{redirect}}, and their variants. Also introduced --
-- are andList & orList helpers for formatting lists with those conjunctions. --
--------------------------------------------------------------------------------
local mArguments --initialize lazily
local mFormatLink = require('Module:Format link')
local mHatnote = require('Module:Hatnote')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
--------------------------------------------------------------------------------
-- List stringification helper functions
--
-- These functions are used for stringifying lists, usually page lists inside
-- the "Y" portion of "For X, see Y" for-see items.
--------------------------------------------------------------------------------
--default options table used across the list stringification functions
local stringifyListDefaultOptions = {
conjunction = "and",
separator = ",",
altSeparator = ";",
space = " ",
formatted = false
}
--Searches display text only
local function searchDisp(haystack, needle)
return string.find(
string.sub(haystack, (string.find(haystack, '|') or 0) + 1), needle
)
end
-- Stringifies a list generically; probably shouldn't be used directly
local function stringifyList(list, options)
-- Type-checks, defaults, and a shortcut
checkType("stringifyList", 1, list, "table")
if #list == 0 then return nil end
checkType("stringifyList", 2, options, "table", true)
options = options or {}
for k, v in pairs(stringifyListDefaultOptions) do
if options[k] == nil then options[k] = v end
end
local s = options.space
-- Format the list if requested
if options.formatted then
list = mFormatLink.formatPages(
{categorizeMissing = mHatnote.missingTargetCat}, list
)
end
-- Set the separator; if any item contains it, use the alternate separator
local separator = options.separator
for k, v in pairs(list) do
if searchDisp(v, separator) then
separator = options.altSeparator
break
end
end
-- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
local conjunction = s .. options.conjunction .. s
if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
conjunction = separator .. conjunction
end
-- Return the formatted string
return mw.text.listToText(list, separator .. s, conjunction)
end
--DRY function
function p.conjList (conj, list, fmt)
return stringifyList(list, {conjunction = conj, formatted = fmt})
end
-- Stringifies lists with "and" or "or"
function p.andList (...) return p.conjList("and", ...) end
function p.orList (...) return p.conjList("or", ...) end
--------------------------------------------------------------------------------
-- For see
--
-- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
-- {{about}} and {{redirect}} templates and their variants.
--------------------------------------------------------------------------------
--default options table used across the forSee family of functions
local forSeeDefaultOptions = {
andKeyword = 'and',
title = mw.title.getCurrentTitle().text,
otherText = 'other uses',
forSeeForm = 'For %s, see %s.',
}
--Collapses duplicate punctuation
local function punctuationCollapse (text)
local replacements = {
["%.%.$"] = ".",
["%?%.$"] = "?",
["%!%.$"] = "!",
["%.%]%]%.$"] = ".]]",
["%?%]%]%.$"] = "?]]",
["%!%]%]%.$"] = "!]]"
}
for k, v in pairs(replacements) do text = string.gsub(text, k, v) end
return text
end
-- Structures arguments into a table for stringification, & options
function p.forSeeArgsToTable (args, from, options)
-- Type-checks and defaults
checkType("forSeeArgsToTable", 1, args, 'table')
checkType("forSeeArgsToTable", 2, from, 'number', true)
from = from or 1
checkType("forSeeArgsToTable", 3, options, 'table', true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- maxArg's gotten manually because getArgs() and table.maxn aren't friends
local maxArg = 0
for k, v in pairs(args) do
if type(k) == 'number' and k > maxArg then maxArg = k end
end
-- Structure the data out from the parameter list:
-- * forTable is the wrapper table, with forRow rows
-- * Rows are tables of a "use" string & a "pages" table of pagename strings
-- * Blanks are left empty for defaulting elsewhere, but can terminate list
local forTable = {}
local i = from
local terminated = false
-- If there is extra text, and no arguments are given, give nil value
-- to not produce default of "For other uses, see foo (disambiguation)"
if options.extratext and i > maxArg then return nil end
-- Loop to generate rows
repeat
-- New empty row
local forRow = {}
-- On blank use, assume list's ended & break at end of this loop
forRow.use = args[i]
if not args[i] then terminated = true end
-- New empty list of pages
forRow.pages = {}
-- Insert first pages item if present
table.insert(forRow.pages, args[i + 1])
-- If the param after next is "and", do inner loop to collect params
-- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
while args[i + 2] == options.andKeyword do
if args[i + 3] then
table.insert(forRow.pages, args[i + 3])
end
-- Increment to next "and"
i = i + 2
end
-- Increment to next use
i = i + 2
-- Append the row
table.insert(forTable, forRow)
until terminated or i > maxArg
return forTable
end
-- Stringifies a table as formatted by forSeeArgsToTable
function p.forSeeTableToString (forSeeTable, options)
-- Type-checks and defaults
checkType("forSeeTableToString", 1, forSeeTable, "table", true)
checkType("forSeeTableToString", 2, options, "table", true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- Stringify each for-see item into a list
local strList = {}
if forSeeTable then
for k, v in pairs(forSeeTable) do
local useStr = v.use or options.otherText
local pagesStr =
p.andList(v.pages, true) or
mFormatLink._formatLink{
categorizeMissing = mHatnote.missingTargetCat,
link = mHatnote.disambiguate(options.title)
}
local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
forSeeStr = punctuationCollapse(forSeeStr)
table.insert(strList, forSeeStr)
end
end
if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
-- Return the concatenated list
return table.concat(strList, ' ')
end
-- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
-- but not blank/whitespace values. Ignores named args and args < "from".
function p._forSee (args, from, options)
local forSeeTable = p.forSeeArgsToTable(args, from, options)
return p.forSeeTableToString(forSeeTable, options)
end
-- As _forSee, but uses the frame.
function p.forSee (frame, from, options)
mArguments = require('Module:Arguments')
return p._forSee(mArguments.getArgs(frame), from, options)
end
return p
d0828422b1aa0d0d0092d699d059c9e882260398
Module:Navbar
828
4
198
40
2023-10-17T17:45:00Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Navbar]]
Scribunto
text/plain
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local function get_title_arg(is_collapsible, template)
local title_arg = 1
if is_collapsible then title_arg = 2 end
if template then title_arg = 'template' end
return title_arg
end
local function choose_links(template, args)
-- The show table indicates the default displayed items.
-- view, talk, edit, hist, move, watch
-- TODO: Move to configuration.
local show = {true, true, true, false, false, false}
if template then
show[2] = false
show[3] = false
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6,
talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
-- TODO: Consider removing TableTools dependency.
for _, v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
local remove_edit_link = args.noedit
if remove_edit_link then show[3] = false end
return show
end
local function add_link(link_description, ul, is_mini, font_style)
local l
if link_description.url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-' .. link_description.full)
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:attr('title', link_description.html_title)
:cssText(font_style)
:wikitext(is_mini and link_description.mini or link_description.full)
:done()
:wikitext(l[3])
:done()
end
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
if not title then
error(cfg.invalid_title .. title_text)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- TODO: Get link_descriptions and show into the configuration module.
-- link_descriptions should be easier...
local link_descriptions = {
{ ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template',
['link'] = title.fullText, ['url'] = false },
{ ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template',
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = title:fullUrl('action=edit'), ['url'] = true },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = title:fullUrl('action=history'), ['url'] = true },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template',
['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
local ul = mw.html.create('ul')
if has_brackets then
ul:addClass(cfg.classes.brackets)
:cssText(font_style)
end
for i, _ in ipairs(displayed_links) do
if displayed_links[i] then add_link(link_descriptions[i], ul, is_mini, font_style) end
end
return ul:done()
end
function p._navbar(args)
-- TODO: We probably don't need both fontstyle and fontcolor...
local font_style = args.fontstyle
local font_color = args.fontcolor
local is_collapsible = args.collapsible
local is_mini = args.mini
local is_plain = args.plain
local collapsible_class = nil
if is_collapsible then
collapsible_class = cfg.classes.collapsible
if not is_plain then is_mini = 1 end
if font_color then
font_style = (font_style or '') .. '; color: ' .. font_color .. ';'
end
end
local navbar_style = args.style
local div = mw.html.create():tag('div')
div
:addClass(cfg.classes.navbar)
:addClass(cfg.classes.plainlinks)
:addClass(cfg.classes.horizontal_list)
:addClass(collapsible_class) -- we made the determination earlier
:cssText(navbar_style)
if is_mini then div:addClass(cfg.classes.mini) end
local box_text = (args.text or cfg.box_text) .. ' '
-- the concatenated space guarantees the box text is separated
if not (is_mini or is_plain) then
div
:tag('span')
:addClass(cfg.classes.box_text)
:cssText(font_style)
:wikitext(box_text)
end
local template = args.template
local displayed_links = choose_links(template, args)
local has_brackets = args.brackets
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local list = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(list)
if is_collapsible then
local title_text_class
if is_mini then
title_text_class = cfg.classes.collapsible_title_mini
else
title_text_class = cfg.classes.collapsible_title_full
end
div:done()
:tag('div')
:addClass(title_text_class)
:cssText(font_style)
:wikitext(args[1])
end
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())
end
function p.navbar(frame)
return p._navbar(require('Module:Arguments').getArgs(frame))
end
return p
a5c8d3a8f8beb18984ea7f145ddbdf88a065d23e
Module:Navbar/configuration
828
5
200
42
2023-10-17T17:45:00Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Navbar/configuration]]
Scribunto
text/plain
local configuration = {
['templatestyles'] = 'Module:Navbar/styles.css',
['box_text'] = 'This box: ', -- default text box when not plain or mini
['title_namespace'] = 'Template', -- namespace to default to for title
['invalid_title'] = 'Invalid title ',
['classes'] = { -- set a line to nil if you don't want it
['navbar'] = 'navbar',
['plainlinks'] = 'plainlinks', -- plainlinks
['horizontal_list'] = 'hlist', -- horizontal list class
['mini'] = 'navbar-mini', -- class indicating small links in the navbar
['this_box'] = 'navbar-boxtext',
['brackets'] = 'navbar-brackets',
-- 'collapsible' is the key for a class to indicate the navbar is
-- setting up the collapsible element in addition to the normal
-- navbar.
['collapsible'] = 'navbar-collapse',
['collapsible_title_mini'] = 'navbar-ct-mini',
['collapsible_title_full'] = 'navbar-ct-full'
}
}
return configuration
7f1b6300bc4a690ecfb1c83b582f36c603bd1dff
Module:Navbar/styles.css
828
7
202
109
2023-10-17T17:45:00Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Navbar/styles.css]]
sanitized-css
text/css
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar-collapse {
float: left;
text-align: left;
}
.navbar-boxtext {
word-spacing: 0;
}
.navbar ul {
display: inline-block;
white-space: nowrap;
line-height: inherit;
}
.navbar-brackets::before {
margin-right: -0.125em;
content: '[ ';
}
.navbar-brackets::after {
margin-left: -0.125em;
content: ' ]';
}
.navbar li {
word-spacing: -0.125em;
}
.navbar a > span,
.navbar a > abbr {
text-decoration: inherit;
}
.navbar-mini abbr {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
.navbar-ct-full {
font-size: 114%;
margin: 0 7em;
}
.navbar-ct-mini {
font-size: 114%;
margin: 0 4em;
}
ffa40f872281063642a36504ff608aa4c75ecf55
Module:Protection banner
828
63
204
203
2023-10-17T17:45:01Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Protection_banner]]
Scribunto
text/plain
-- This module implements {{pp-meta}} and its daughter templates such as
-- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.
-- Initialise necessary modules.
require('strict')
local makeFileLink = require('Module:File link')._main
local effectiveProtectionLevel = require('Module:Effective protection level')._main
local effectiveProtectionExpiry = require('Module:Effective protection expiry')._main
local yesno = require('Module:Yesno')
-- Lazily initialise modules and objects we don't always need.
local getArgs, makeMessageBox, lang
-- Set constants.
local CONFIG_MODULE = 'Module:Protection banner/config'
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function makeCategoryLink(cat, sort)
if cat then
return string.format(
'[[%s:%s|%s]]',
mw.site.namespaces[14].name,
cat,
sort
)
end
end
-- Validation function for the expiry and the protection date
local function validateDate(dateString, dateType)
if not lang then
lang = mw.language.getContentLanguage()
end
local success, result = pcall(lang.formatDate, lang, 'U', dateString)
if success then
result = tonumber(result)
if result then
return result
end
end
error(string.format(
'invalid %s: %s',
dateType,
tostring(dateString)
), 4)
end
local function makeFullUrl(page, query, display)
return string.format(
'[%s %s]',
tostring(mw.uri.fullUrl(page, query)),
display
)
end
-- Given a directed graph formatted as node -> table of direct successors,
-- get a table of all nodes reachable from a given node (though always
-- including the given node).
local function getReachableNodes(graph, start)
local toWalk, retval = {[start] = true}, {}
while true do
-- Can't use pairs() since we're adding and removing things as we're iterating
local k = next(toWalk) -- This always gets the "first" key
if k == nil then
return retval
end
toWalk[k] = nil
retval[k] = true
for _,v in ipairs(graph[k]) do
if not retval[v] then
toWalk[v] = true
end
end
end
end
--------------------------------------------------------------------------------
-- Protection class
--------------------------------------------------------------------------------
local Protection = {}
Protection.__index = Protection
Protection.supportedActions = {
edit = true,
move = true,
autoreview = true,
upload = true
}
Protection.bannerConfigFields = {
'text',
'explanation',
'tooltip',
'alt',
'link',
'image'
}
function Protection.new(args, cfg, title)
local obj = {}
obj._cfg = cfg
obj.title = title or mw.title.getCurrentTitle()
-- Set action
if not args.action then
obj.action = 'edit'
elseif Protection.supportedActions[args.action] then
obj.action = args.action
else
error(string.format(
'invalid action: %s',
tostring(args.action)
), 3)
end
-- Set level
obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title)
if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then
-- Users need to be autoconfirmed to move pages anyway, so treat
-- semi-move-protected pages as unprotected.
obj.level = '*'
end
-- Set expiry
local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title)
if effectiveExpiry == 'infinity' then
obj.expiry = 'indef'
elseif effectiveExpiry ~= 'unknown' then
obj.expiry = validateDate(effectiveExpiry, 'expiry date')
end
-- Set reason
if args[1] then
obj.reason = mw.ustring.lower(args[1])
if obj.reason:find('|') then
error('reasons cannot contain the pipe character ("|")', 3)
end
end
-- Set protection date
if args.date then
obj.protectionDate = validateDate(args.date, 'protection date')
end
-- Set banner config
do
obj.bannerConfig = {}
local configTables = {}
if cfg.banners[obj.action] then
configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason]
end
if cfg.defaultBanners[obj.action] then
configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level]
configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default
end
configTables[#configTables + 1] = cfg.masterBanner
for i, field in ipairs(Protection.bannerConfigFields) do
for j, t in ipairs(configTables) do
if t[field] then
obj.bannerConfig[field] = t[field]
break
end
end
end
end
return setmetatable(obj, Protection)
end
function Protection:isUserScript()
-- Whether the page is a user JavaScript or CSS page.
local title = self.title
return title.namespace == 2 and (
title.contentModel == 'javascript' or title.contentModel == 'css'
)
end
function Protection:isProtected()
return self.level ~= '*'
end
function Protection:shouldShowLock()
-- Whether we should output a banner/padlock
return self:isProtected() and not self:isUserScript()
end
-- Whether this page needs a protection category.
Protection.shouldHaveProtectionCategory = Protection.shouldShowLock
function Protection:isTemporary()
return type(self.expiry) == 'number'
end
function Protection:makeProtectionCategory()
if not self:shouldHaveProtectionCategory() then
return ''
end
local cfg = self._cfg
local title = self.title
-- Get the expiry key fragment.
local expiryFragment
if self.expiry == 'indef' then
expiryFragment = self.expiry
elseif type(self.expiry) == 'number' then
expiryFragment = 'temp'
end
-- Get the namespace key fragment.
local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace]
if not namespaceFragment and title.namespace % 2 == 1 then
namespaceFragment = 'talk'
end
-- Define the order that key fragments are tested in. This is done with an
-- array of tables containing the value to be tested, along with its
-- position in the cfg.protectionCategories table.
local order = {
{val = expiryFragment, keypos = 1},
{val = namespaceFragment, keypos = 2},
{val = self.reason, keypos = 3},
{val = self.level, keypos = 4},
{val = self.action, keypos = 5}
}
--[[
-- The old protection templates used an ad-hoc protection category system,
-- with some templates prioritising namespaces in their categories, and
-- others prioritising the protection reason. To emulate this in this module
-- we use the config table cfg.reasonsWithNamespacePriority to set the
-- reasons for which namespaces have priority over protection reason.
-- If we are dealing with one of those reasons, move the namespace table to
-- the end of the order table, i.e. give it highest priority. If not, the
-- reason should have highest priority, so move that to the end of the table
-- instead.
--]]
table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))
--[[
-- Define the attempt order. Inactive subtables (subtables with nil "value"
-- fields) are moved to the end, where they will later be given the key
-- "all". This is to cut down on the number of table lookups in
-- cfg.protectionCategories, which grows exponentially with the number of
-- non-nil keys. We keep track of the number of active subtables with the
-- noActive parameter.
--]]
local noActive, attemptOrder
do
local active, inactive = {}, {}
for i, t in ipairs(order) do
if t.val then
active[#active + 1] = t
else
inactive[#inactive + 1] = t
end
end
noActive = #active
attemptOrder = active
for i, t in ipairs(inactive) do
attemptOrder[#attemptOrder + 1] = t
end
end
--[[
-- Check increasingly generic key combinations until we find a match. If a
-- specific category exists for the combination of key fragments we are
-- given, that match will be found first. If not, we keep trying different
-- key fragment combinations until we match using the key
-- "all-all-all-all-all".
--
-- To generate the keys, we index the key subtables using a binary matrix
-- with indexes i and j. j is only calculated up to the number of active
-- subtables. For example, if there were three active subtables, the matrix
-- would look like this, with 0 corresponding to the key fragment "all", and
-- 1 corresponding to other key fragments.
--
-- j 1 2 3
-- i
-- 1 1 1 1
-- 2 0 1 1
-- 3 1 0 1
-- 4 0 0 1
-- 5 1 1 0
-- 6 0 1 0
-- 7 1 0 0
-- 8 0 0 0
--
-- Values of j higher than the number of active subtables are set
-- to the string "all".
--
-- A key for cfg.protectionCategories is constructed for each value of i.
-- The position of the value in the key is determined by the keypos field in
-- each subtable.
--]]
local cats = cfg.protectionCategories
for i = 1, 2^noActive do
local key = {}
for j, t in ipairs(attemptOrder) do
if j > noActive then
key[t.keypos] = 'all'
else
local quotient = i / 2 ^ (j - 1)
quotient = math.ceil(quotient)
if quotient % 2 == 1 then
key[t.keypos] = t.val
else
key[t.keypos] = 'all'
end
end
end
key = table.concat(key, '|')
local attempt = cats[key]
if attempt then
return makeCategoryLink(attempt, title.text)
end
end
return ''
end
function Protection:isIncorrect()
local expiry = self.expiry
return not self:shouldHaveProtectionCategory()
or type(expiry) == 'number' and expiry < os.time()
end
function Protection:isTemplateProtectedNonTemplate()
local action, namespace = self.action, self.title.namespace
return self.level == 'templateeditor'
and (
(action ~= 'edit' and action ~= 'move')
or (namespace ~= 10 and namespace ~= 828)
)
end
function Protection:makeCategoryLinks()
local msg = self._cfg.msg
local ret = {self:makeProtectionCategory()}
if self:isIncorrect() then
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-incorrect'],
self.title.text
)
end
if self:isTemplateProtectedNonTemplate() then
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-template'],
self.title.text
)
end
return table.concat(ret)
end
--------------------------------------------------------------------------------
-- Blurb class
--------------------------------------------------------------------------------
local Blurb = {}
Blurb.__index = Blurb
Blurb.bannerTextFields = {
text = true,
explanation = true,
tooltip = true,
alt = true,
link = true
}
function Blurb.new(protectionObj, args, cfg)
return setmetatable({
_cfg = cfg,
_protectionObj = protectionObj,
_args = args
}, Blurb)
end
-- Private methods --
function Blurb:_formatDate(num)
-- Formats a Unix timestamp into dd Month, YYYY format.
lang = lang or mw.language.getContentLanguage()
local success, date = pcall(
lang.formatDate,
lang,
self._cfg.msg['expiry-date-format'] or 'j F Y',
'@' .. tostring(num)
)
if success then
return date
end
end
function Blurb:_getExpandedMessage(msgKey)
return self:_substituteParameters(self._cfg.msg[msgKey])
end
function Blurb:_substituteParameters(msg)
if not self._params then
local parameterFuncs = {}
parameterFuncs.CURRENTVERSION = self._makeCurrentVersionParameter
parameterFuncs.EDITREQUEST = self._makeEditRequestParameter
parameterFuncs.EXPIRY = self._makeExpiryParameter
parameterFuncs.EXPLANATIONBLURB = self._makeExplanationBlurbParameter
parameterFuncs.IMAGELINK = self._makeImageLinkParameter
parameterFuncs.INTROBLURB = self._makeIntroBlurbParameter
parameterFuncs.INTROFRAGMENT = self._makeIntroFragmentParameter
parameterFuncs.PAGETYPE = self._makePagetypeParameter
parameterFuncs.PROTECTIONBLURB = self._makeProtectionBlurbParameter
parameterFuncs.PROTECTIONDATE = self._makeProtectionDateParameter
parameterFuncs.PROTECTIONLEVEL = self._makeProtectionLevelParameter
parameterFuncs.PROTECTIONLOG = self._makeProtectionLogParameter
parameterFuncs.TALKPAGE = self._makeTalkPageParameter
parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter
parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter
parameterFuncs.VANDAL = self._makeVandalTemplateParameter
self._params = setmetatable({}, {
__index = function (t, k)
local param
if parameterFuncs[k] then
param = parameterFuncs[k](self)
end
param = param or ''
t[k] = param
return param
end
})
end
msg = msg:gsub('${(%u+)}', self._params)
return msg
end
function Blurb:_makeCurrentVersionParameter()
-- A link to the page history or the move log, depending on the kind of
-- protection.
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'move' then
-- We need the move log link.
return makeFullUrl(
'Special:Log',
{type = 'move', page = pagename},
self:_getExpandedMessage('current-version-move-display')
)
else
-- We need the history link.
return makeFullUrl(
pagename,
{action = 'history'},
self:_getExpandedMessage('current-version-edit-display')
)
end
end
function Blurb:_makeEditRequestParameter()
local mEditRequest = require('Module:Submit an edit request')
local action = self._protectionObj.action
local level = self._protectionObj.level
-- Get the edit request type.
local requestType
if action == 'edit' then
if level == 'autoconfirmed' then
requestType = 'semi'
elseif level == 'extendedconfirmed' then
requestType = 'extended'
elseif level == 'templateeditor' then
requestType = 'template'
end
end
requestType = requestType or 'full'
-- Get the display value.
local display = self:_getExpandedMessage('edit-request-display')
return mEditRequest._link{type = requestType, display = display}
end
function Blurb:_makeExpiryParameter()
local expiry = self._protectionObj.expiry
if type(expiry) == 'number' then
return self:_formatDate(expiry)
else
return expiry
end
end
function Blurb:_makeExplanationBlurbParameter()
-- Cover special cases first.
if self._protectionObj.title.namespace == 8 then
-- MediaWiki namespace
return self:_getExpandedMessage('explanation-blurb-nounprotect')
end
-- Get explanation blurb table keys
local action = self._protectionObj.action
local level = self._protectionObj.level
local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject'
-- Find the message in the explanation blurb table and substitute any
-- parameters.
local explanations = self._cfg.explanationBlurbs
local msg
if explanations[action][level] and explanations[action][level][talkKey] then
msg = explanations[action][level][talkKey]
elseif explanations[action][level] and explanations[action][level].default then
msg = explanations[action][level].default
elseif explanations[action].default and explanations[action].default[talkKey] then
msg = explanations[action].default[talkKey]
elseif explanations[action].default and explanations[action].default.default then
msg = explanations[action].default.default
else
error(string.format(
'could not find explanation blurb for action "%s", level "%s" and talk key "%s"',
action,
level,
talkKey
), 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeImageLinkParameter()
local imageLinks = self._cfg.imageLinks
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if imageLinks[action][level] then
msg = imageLinks[action][level]
elseif imageLinks[action].default then
msg = imageLinks[action].default
else
msg = imageLinks.edit.default
end
return self:_substituteParameters(msg)
end
function Blurb:_makeIntroBlurbParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('intro-blurb-expiry')
else
return self:_getExpandedMessage('intro-blurb-noexpiry')
end
end
function Blurb:_makeIntroFragmentParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('intro-fragment-expiry')
else
return self:_getExpandedMessage('intro-fragment-noexpiry')
end
end
function Blurb:_makePagetypeParameter()
local pagetypes = self._cfg.pagetypes
return pagetypes[self._protectionObj.title.namespace]
or pagetypes.default
or error('no default pagetype defined', 8)
end
function Blurb:_makeProtectionBlurbParameter()
local protectionBlurbs = self._cfg.protectionBlurbs
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if protectionBlurbs[action][level] then
msg = protectionBlurbs[action][level]
elseif protectionBlurbs[action].default then
msg = protectionBlurbs[action].default
elseif protectionBlurbs.edit.default then
msg = protectionBlurbs.edit.default
else
error('no protection blurb defined for protectionBlurbs.edit.default', 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeProtectionDateParameter()
local protectionDate = self._protectionObj.protectionDate
if type(protectionDate) == 'number' then
return self:_formatDate(protectionDate)
else
return protectionDate
end
end
function Blurb:_makeProtectionLevelParameter()
local protectionLevels = self._cfg.protectionLevels
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if protectionLevels[action][level] then
msg = protectionLevels[action][level]
elseif protectionLevels[action].default then
msg = protectionLevels[action].default
elseif protectionLevels.edit.default then
msg = protectionLevels.edit.default
else
error('no protection level defined for protectionLevels.edit.default', 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeProtectionLogParameter()
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'autoreview' then
-- We need the pending changes log.
return makeFullUrl(
'Special:Log',
{type = 'stable', page = pagename},
self:_getExpandedMessage('pc-log-display')
)
else
-- We need the protection log.
return makeFullUrl(
'Special:Log',
{type = 'protect', page = pagename},
self:_getExpandedMessage('protection-log-display')
)
end
end
function Blurb:_makeTalkPageParameter()
return string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[self._protectionObj.title.namespace].talk.name,
self._protectionObj.title.text,
self._args.section or 'top',
self:_getExpandedMessage('talk-page-link-display')
)
end
function Blurb:_makeTooltipBlurbParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-blurb-expiry')
else
return self:_getExpandedMessage('tooltip-blurb-noexpiry')
end
end
function Blurb:_makeTooltipFragmentParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-fragment-expiry')
else
return self:_getExpandedMessage('tooltip-fragment-noexpiry')
end
end
function Blurb:_makeVandalTemplateParameter()
return mw.getCurrentFrame():expandTemplate{
title="vandal-m",
args={self._args.user or self._protectionObj.title.baseText}
}
end
-- Public methods --
function Blurb:makeBannerText(key)
-- Validate input.
if not key or not Blurb.bannerTextFields[key] then
error(string.format(
'"%s" is not a valid banner config field',
tostring(key)
), 2)
end
-- Generate the text.
local msg = self._protectionObj.bannerConfig[key]
if type(msg) == 'string' then
return self:_substituteParameters(msg)
elseif type(msg) == 'function' then
msg = msg(self._protectionObj, self._args)
if type(msg) ~= 'string' then
error(string.format(
'bad output from banner config function with key "%s"'
.. ' (expected string, got %s)',
tostring(key),
type(msg)
), 4)
end
return self:_substituteParameters(msg)
end
end
--------------------------------------------------------------------------------
-- BannerTemplate class
--------------------------------------------------------------------------------
local BannerTemplate = {}
BannerTemplate.__index = BannerTemplate
function BannerTemplate.new(protectionObj, cfg)
local obj = {}
obj._cfg = cfg
-- Set the image filename.
local imageFilename = protectionObj.bannerConfig.image
if imageFilename then
obj._imageFilename = imageFilename
else
-- If an image filename isn't specified explicitly in the banner config,
-- generate it from the protection status and the namespace.
local action = protectionObj.action
local level = protectionObj.level
local namespace = protectionObj.title.namespace
local reason = protectionObj.reason
-- Deal with special cases first.
if (
namespace == 10
or namespace == 828
or reason and obj._cfg.indefImageReasons[reason]
)
and action == 'edit'
and level == 'sysop'
and not protectionObj:isTemporary()
then
-- Fully protected modules and templates get the special red "indef"
-- padlock.
obj._imageFilename = obj._cfg.msg['image-filename-indef']
else
-- Deal with regular protection types.
local images = obj._cfg.images
if images[action] then
if images[action][level] then
obj._imageFilename = images[action][level]
elseif images[action].default then
obj._imageFilename = images[action].default
end
end
end
end
return setmetatable(obj, BannerTemplate)
end
function BannerTemplate:renderImage()
local filename = self._imageFilename
or self._cfg.msg['image-filename-default']
or 'Transparent.gif'
return makeFileLink{
file = filename,
size = (self.imageWidth or 20) .. 'px',
alt = self._imageAlt,
link = self._imageLink,
caption = self.imageCaption
}
end
--------------------------------------------------------------------------------
-- Banner class
--------------------------------------------------------------------------------
local Banner = setmetatable({}, BannerTemplate)
Banner.__index = Banner
function Banner.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj.imageWidth = 40
obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip.
obj._reasonText = blurbObj:makeBannerText('text')
obj._explanationText = blurbObj:makeBannerText('explanation')
obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing.
return setmetatable(obj, Banner)
end
function Banner:__tostring()
-- Renders the banner.
makeMessageBox = makeMessageBox or require('Module:Message box').main
local reasonText = self._reasonText or error('no reason text set', 2)
local explanationText = self._explanationText
local mbargs = {
page = self._page,
type = 'protection',
image = self:renderImage(),
text = string.format(
"'''%s'''%s",
reasonText,
explanationText and '<br />' .. explanationText or ''
)
}
return makeMessageBox('mbox', mbargs)
end
--------------------------------------------------------------------------------
-- Padlock class
--------------------------------------------------------------------------------
local Padlock = setmetatable({}, BannerTemplate)
Padlock.__index = Padlock
function Padlock.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj.imageWidth = 20
obj.imageCaption = blurbObj:makeBannerText('tooltip')
obj._imageAlt = blurbObj:makeBannerText('alt')
obj._imageLink = blurbObj:makeBannerText('link')
obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action]
or cfg.padlockIndicatorNames.default
or 'pp-default'
return setmetatable(obj, Padlock)
end
function Padlock:__tostring()
local frame = mw.getCurrentFrame()
-- The nowiki tag helps prevent whitespace at the top of articles.
return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{
name = 'indicator',
args = {name = self._indicatorName},
content = self:renderImage()
}
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p = {}
function p._exportClasses()
-- This is used for testing purposes.
return {
Protection = Protection,
Blurb = Blurb,
BannerTemplate = BannerTemplate,
Banner = Banner,
Padlock = Padlock,
}
end
function p._main(args, cfg, title)
args = args or {}
cfg = cfg or require(CONFIG_MODULE)
local protectionObj = Protection.new(args, cfg, title)
local ret = {}
-- If a page's edit protection is equally or more restrictive than its
-- protection from some other action, then don't bother displaying anything
-- for the other action (except categories).
if not yesno(args.catonly) and (protectionObj.action == 'edit' or
args.demolevel or
not getReachableNodes(
cfg.hierarchy,
protectionObj.level
)[effectiveProtectionLevel('edit', protectionObj.title)])
then
-- Initialise the blurb object
local blurbObj = Blurb.new(protectionObj, args, cfg)
-- Render the banner
if protectionObj:shouldShowLock() then
ret[#ret + 1] = tostring(
(yesno(args.small) and Padlock or Banner)
.new(protectionObj, blurbObj, cfg)
)
end
end
-- Render the categories
if yesno(args.category) ~= false then
ret[#ret + 1] = protectionObj:makeCategoryLinks()
end
return table.concat(ret)
end
function p.main(frame, cfg)
cfg = cfg or require(CONFIG_MODULE)
-- Find default args, if any.
local parent = frame.getParent and frame:getParent()
local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', '')]
-- Find user args, and use the parent frame if we are being called from a
-- wrapper template.
getArgs = getArgs or require('Module:Arguments').getArgs
local userArgs = getArgs(frame, {
parentOnly = defaultArgs,
frameOnly = not defaultArgs
})
-- Build the args table. User-specified args overwrite default args.
local args = {}
for k, v in pairs(defaultArgs or {}) do
args[k] = v
end
for k, v in pairs(userArgs) do
args[k] = v
end
return p._main(args, cfg)
end
return p
894f0884d4c2da1ce19d385b96f59af654b0946a
Module:Protection banner/config
828
64
206
205
2023-10-17T17:45:01Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Protection_banner/config]]
Scribunto
text/plain
-- This module provides configuration data for [[Module:Protection banner]].
return {
--------------------------------------------------------------------------------
--
-- BANNER DATA
--
--------------------------------------------------------------------------------
--[[
-- Banner data consists of six fields:
-- * text - the main protection text that appears at the top of protection
-- banners.
-- * explanation - the text that appears below the main protection text, used
-- to explain the details of the protection.
-- * tooltip - the tooltip text you see when you move the mouse over a small
-- padlock icon.
-- * link - the page that the small padlock icon links to.
-- * alt - the alt text for the small padlock icon. This is also used as tooltip
-- text for the large protection banners.
-- * image - the padlock image used in both protection banners and small padlock
-- icons.
--
-- The module checks in three separate tables to find a value for each field.
-- First it checks the banners table, which has values specific to the reason
-- for the page being protected. Then the module checks the defaultBanners
-- table, which has values specific to each protection level. Finally, the
-- module checks the masterBanner table, which holds data for protection
-- templates to use if no data has been found in the previous two tables.
--
-- The values in the banner data can take parameters. These are specified
-- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name
-- enclosed in curly braces).
--
-- Available parameters:
--
-- ${CURRENTVERSION} - a link to the page history or the move log, with the
-- display message "current-version-edit-display" or
-- "current-version-move-display".
--
-- ${EDITREQUEST} - a link to create an edit request for the current page.
--
-- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes
-- on the talk page; you may submit a request to ask an administrator to make
-- an edit if it is minor or supported by consensus."
--
-- ${IMAGELINK} - a link to set the image to, depending on the protection
-- action and protection level.
--
-- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
-- is set. E.g. "Editing of this page by new or unregistered users is currently
-- disabled until dd Month YYYY."
--
-- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation
-- so that it can be used in run-on sentences.
--
-- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
-- Defined in the cfg.pagetypes table.
--
-- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.
-- "Editing of this page by new or unregistered users is currently disabled"
--
-- ${PROTECTIONDATE} - the protection date, if it has been supplied to the
-- template.
--
-- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or
-- "semi-protected".
--
-- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,
-- depending on the protection action.
--
-- ${TALKPAGE} - a link to the talk page. If a section is specified, links
-- straight to that talk page section.
--
-- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to
-- create a blurb like "This template is semi-protected", or "This article is
-- move-protected until DD Month YYYY".
--
-- ${VANDAL} - links for the specified username (or the root page name)
-- using Module:Vandal-m.
--
-- Functions
--
-- For advanced users, it is possible to use Lua functions instead of strings
-- in the banner config tables. Using functions gives flexibility that is not
-- possible just by using parameters. Functions take two arguments, the
-- protection object and the template arguments, and they must output a string.
--
-- For example:
--
-- text = function (protectionObj, args)
-- if protectionObj.level == 'autoconfirmed' then
-- return 'foo'
-- else
-- return 'bar'
-- end
-- end
--
-- Some protection object properties and methods that may be useful:
-- protectionObj.action - the protection action
-- protectionObj.level - the protection level
-- protectionObj.reason - the protection reason
-- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set
-- to indefinite, and the protection time in unix time if temporary.
-- protectionObj.protectionDate - the protection date in unix time, or nil if
-- unspecified.
-- protectionObj.bannerConfig - the banner config found by the module. Beware
-- of editing the config field used by the function, as it could create an
-- infinite loop.
-- protectionObj:isProtected - returns a boolean showing whether the page is
-- protected.
-- protectionObj:isTemporary - returns a boolean showing whether the expiry is
-- temporary.
-- protectionObj:isIncorrect - returns a boolean showing whether the protection
-- template is incorrect.
--]]
-- The master banner data, used if no values have been found in banners or
-- defaultBanners.
masterBanner = {
text = '${INTROBLURB}',
explanation = '${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPBLURB}',
link = '${IMAGELINK}',
alt = 'Page ${PROTECTIONLEVEL}'
},
-- The default banner data. This holds banner data for different protection
-- levels.
-- *required* - this table needs edit, move, autoreview and upload subtables.
defaultBanners = {
edit = {},
move = {},
autoreview = {
default = {
alt = 'Page protected with pending changes',
tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users',
image = 'Pending-protection-shackle.svg'
}
},
upload = {}
},
-- The banner data. This holds banner data for different protection reasons.
-- In fact, the reasons specified in this table control which reasons are
-- valid inputs to the first positional parameter.
--
-- There is also a non-standard "description" field that can be used for items
-- in this table. This is a description of the protection reason for use in the
-- module documentation.
--
-- *required* - this table needs edit, move, autoreview and upload subtables.
banners = {
edit = {
blp = {
description = 'For pages protected to promote compliance with the'
.. ' [[Wikipedia:Biographies of living persons'
.. '|biographies of living persons]] policy',
text = '${INTROFRAGMENT} to promote compliance with'
.. ' [[Wikipedia:Biographies of living persons'
.. "|Wikipedia's policy on the biographies"
.. ' of living people]].',
tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on'
.. ' biographies of living persons',
},
dmca = {
description = 'For pages protected by the Wikimedia Foundation'
.. ' due to [[Digital Millennium Copyright Act]] takedown requests',
explanation = function (protectionObj, args)
local ret = 'Pursuant to a rights owner notice under the Digital'
.. ' Millennium Copyright Act (DMCA) regarding some content'
.. ' in this article, the Wikimedia Foundation acted under'
.. ' applicable law and took down and restricted the content'
.. ' in question.'
if args.notice then
ret = ret .. ' A copy of the received notice can be found here: '
.. args.notice .. '.'
end
ret = ret .. ' For more information, including websites discussing'
.. ' how to file a counter-notice, please see'
.. " [[Wikipedia:Office actions]] and the article's ${TALKPAGE}."
.. "'''Do not remove this template from the article until the"
.. " restrictions are withdrawn'''."
return ret
end,
image = 'Office-protection-shackle.svg',
},
dispute = {
description = 'For pages protected due to editing disputes',
text = function (protectionObj, args)
-- Find the value of "disputes".
local display = 'disputes'
local disputes
if args.section then
disputes = string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[protectionObj.title.namespace].talk.name,
protectionObj.title.text,
args.section,
display
)
else
disputes = display
end
-- Make the blurb, depending on the expiry.
local msg
if type(protectionObj.expiry) == 'number' then
msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
else
msg = '${INTROFRAGMENT} until editing %s have been resolved.'
end
return string.format(msg, disputes)
end,
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPFRAGMENT} due to editing disputes',
},
ecp = {
description = 'For articles in topic areas authorized by'
.. ' [[Wikipedia:Arbitration Committee|ArbCom]] or'
.. ' meets the criteria for community use',
tooltip = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
alt = 'Extended-protected ${PAGETYPE}',
},
mainpage = {
description = 'For pages protected for being displayed on the [[Main Page]]',
text = 'This file is currently'
.. ' [[Wikipedia:This page is protected|protected]] from'
.. ' editing because it is currently or will soon be displayed'
.. ' on the [[Main Page]].',
explanation = 'Images on the Main Page are protected due to their high'
.. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.'
.. '<br /><span style="font-size:90%;">'
.. "'''Administrators:''' Once this image is definitely off the Main Page,"
.. ' please unprotect this file, or reduce to semi-protection,'
.. ' as appropriate.</span>',
},
office = {
description = 'For pages protected by the Wikimedia Foundation',
text = function (protectionObj, args)
local ret = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the'
.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
.. ' and is protected.'
if protectionObj.protectionDate then
ret = ret .. ' It has been protected since ${PROTECTIONDATE}.'
end
return ret
end,
explanation = "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
.. " page unless you are authorized by the Wikimedia Foundation to do"
.. " so.'''",
image = 'Office-protection-shackle.svg',
},
reset = {
description = 'For pages protected by the Wikimedia Foundation and'
.. ' "reset" to a bare-bones version',
text = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the'
.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
.. ' and is protected.',
explanation = function (protectionObj, args)
local ret = ''
if protectionObj.protectionDate then
ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was'
else
ret = ret .. 'This ${PAGETYPE} has been'
end
ret = ret .. ' reduced to a'
.. ' simplified, "bare bones" version so that it may be completely'
.. ' rewritten to ensure it meets the policies of'
.. ' [[WP:NPOV|Neutral Point of View]] and [[WP:V|Verifiability]].'
.. ' Standard Wikipedia policies will apply to its rewriting—which'
.. ' will eventually be open to all editors—and will be strictly'
.. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while'
.. ' it is being rebuilt.\n\n'
.. 'Any insertion of material directly from'
.. ' pre-protection revisions of the ${PAGETYPE} will be removed, as'
.. ' will any material added to the ${PAGETYPE} that is not properly'
.. ' sourced. The associated talk page(s) were also cleared on the'
.. " same date.\n\n"
.. "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not override"
.. " this action, and do not remove protection from this page,"
.. " unless you are authorized by the Wikimedia Foundation"
.. " to do so. No editor may remove this notice.'''"
return ret
end,
image = 'Office-protection-shackle.svg',
},
sock = {
description = 'For pages protected due to'
.. ' [[Wikipedia:Sock puppetry|sock puppetry]]',
text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
.. ' [[Wikipedia:Blocking policy|blocked]] or'
.. ' [[Wikipedia:Banning policy|banned users]]'
.. ' from editing it.',
tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from'
.. ' editing it',
},
template = {
description = 'For [[Wikipedia:High-risk templates|high-risk]]'
.. ' templates and Lua modules',
text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
.. ' as it is [[Wikipedia:High-risk templates|high-risk]].',
explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] or'
.. ' [[Wikipedia:Template editor|template editor]] to make an edit if'
.. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by'
.. ' [[Wikipedia:Consensus|consensus]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'
.. ' to prevent vandalism',
alt = 'Permanently protected ${PAGETYPE}',
},
usertalk = {
description = 'For pages protected against disruptive edits by a'
.. ' particular user',
text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
.. ' such as abusing the'
.. ' {{[[Template:unblock|unblock]]}} template.',
explanation = 'If you cannot edit this user talk page and you need to'
.. ' make a change or leave a message, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for edits to a protected page'
.. '|request an edit]],'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]],'
.. ' [[Special:Userlogin|log in]],'
.. ' or [[Special:UserLogin/signup|create an account]].',
},
vandalism = {
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism|vandalism]]',
text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
explanation = function (protectionObj, args)
local ret = ''
if protectionObj.level == 'sysop' then
ret = ret .. "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. '
end
return ret .. '${EXPLANATIONBLURB}'
end,
tooltip = '${TOOLTIPFRAGMENT} due to vandalism',
}
},
move = {
dispute = {
description = 'For pages protected against page moves due to'
.. ' disputes over the page title',
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
image = 'Move-protection-shackle.svg'
},
vandalism = {
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism#Page-move vandalism'
.. ' |page-move vandalism]]'
}
},
autoreview = {},
upload = {}
},
--------------------------------------------------------------------------------
--
-- GENERAL DATA TABLES
--
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Protection blurbs
--------------------------------------------------------------------------------
-- This table produces the protection blurbs available with the
-- ${PROTECTIONBLURB} parameter. It is sorted by protection action and
-- protection level, and is checked by the module in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
protectionBlurbs = {
edit = {
default = 'This ${PAGETYPE} is currently [[Help:Protection|'
.. 'protected]] from editing',
autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'
.. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'
.. ' users|unregistered]] users is currently [[Help:Protection|disabled]]',
extendedconfirmed = 'This ${PAGETYPE} is currently under extended confirmed protection',
},
move = {
default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
.. ' from [[Help:Moving a page|page moves]]'
},
autoreview = {
default = 'All edits made to this ${PAGETYPE} by'
.. ' [[Wikipedia:User access levels#New users|new]] or'
.. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]'
.. ' users are currently'
.. ' [[Wikipedia:Pending changes|subject to review]]'
},
upload = {
default = 'Uploading new versions of this ${PAGETYPE} is currently disabled'
}
},
--------------------------------------------------------------------------------
-- Explanation blurbs
--------------------------------------------------------------------------------
-- This table produces the explanation blurbs available with the
-- ${EXPLANATIONBLURB} parameter. It is sorted by protection action,
-- protection level, and whether the page is a talk page or not. If the page is
-- a talk page it will have a talk key of "talk"; otherwise it will have a talk
-- key of "subject". The table is checked in the following order:
-- 1. page's protection action, page's protection level, page's talk key
-- 2. page's protection action, page's protection level, default talk key
-- 3. page's protection action, default protection level, page's talk key
-- 4. page's protection action, default protection level, default talk key
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
explanationBlurbs = {
edit = {
autoconfirmed = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
.. ' ${EDITREQUEST}, discuss changes on the ${TALKPAGE},'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].',
},
extendedconfirmed = {
default = 'Extended confirmed protection prevents edits from all unregistered editors'
.. ' and registered users with fewer than 30 days tenure and 500 edits.'
.. ' The [[Wikipedia:Protection policy#extended|policy on community use]]'
.. ' specifies that extended confirmed protection can be applied to combat'
.. ' disruption, if semi-protection has proven to be ineffective.'
.. ' Extended confirmed protection may also be applied to enforce'
.. ' [[Wikipedia:Arbitration Committee|arbitration sanctions]].'
.. ' Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask for uncontroversial changes supported by'
.. ' [[Wikipedia:Consensus|consensus]].'
},
default = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Please discuss any changes on the ${TALKPAGE}; you'
.. ' may ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
.. '|consensus]]. You may also [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|request]] that this page be unprotected.',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' You may [[Wikipedia:Requests for page'
.. ' protection#Current requests for edits to a protected page|request an'
.. ' edit]] to this page, or [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|ask]] for it to be unprotected.'
}
},
move = {
default = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves on the'
.. ' ${TALKPAGE} or at [[Wikipedia:Requested moves]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves at'
.. ' [[Wikipedia:Requested moves]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.'
}
},
autoreview = {
default = {
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Edits to this ${PAGETYPE} by new and unregistered users'
.. ' will not be visible to readers until they are accepted by'
.. ' a reviewer. To avoid the need for your edits to be'
.. ' reviewed, you may'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].'
},
},
upload = {
default = {
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but new versions of the file'
.. ' cannot be uploaded until it is unprotected. You can'
.. ' request that a new version be uploaded by using a'
.. ' [[Wikipedia:Edit requests|protected edit request]], or you'
.. ' can [[Wikipedia:Requests for page protection|request]]'
.. ' that the file be unprotected.'
}
}
},
--------------------------------------------------------------------------------
-- Protection levels
--------------------------------------------------------------------------------
-- This table provides the data for the ${PROTECTIONLEVEL} parameter, which
-- produces a short label for different protection levels. It is sorted by
-- protection action and protection level, and is checked in the following
-- order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
protectionLevels = {
edit = {
default = 'protected',
templateeditor = 'template-protected',
extendedconfirmed = 'extended-protected',
autoconfirmed = 'semi-protected',
},
move = {
default = 'move-protected'
},
autoreview = {
},
upload = {
default = 'upload-protected'
}
},
--------------------------------------------------------------------------------
-- Images
--------------------------------------------------------------------------------
-- This table lists different padlock images for each protection action and
-- protection level. It is used if an image is not specified in any of the
-- banner data tables, and if the page does not satisfy the conditions for using
-- the ['image-filename-indef'] image. It is checked in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
images = {
edit = {
default = 'Full-protection-shackle.svg',
templateeditor = 'Template-protection-shackle.svg',
extendedconfirmed = 'Extended-protection-shackle.svg',
autoconfirmed = 'Semi-protection-shackle.svg'
},
move = {
default = 'Move-protection-shackle.svg',
},
autoreview = {
default = 'Pending-protection-shackle.svg'
},
upload = {
default = 'Upload-protection-shackle.svg'
}
},
-- Pages with a reason specified in this table will show the special "indef"
-- padlock, defined in the 'image-filename-indef' message, if no expiry is set.
indefImageReasons = {
template = true
},
--------------------------------------------------------------------------------
-- Image links
--------------------------------------------------------------------------------
-- This table provides the data for the ${IMAGELINK} parameter, which gets
-- the image link for small padlock icons based on the page's protection action
-- and protection level. It is checked in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
imageLinks = {
edit = {
default = 'Wikipedia:Protection policy#full',
templateeditor = 'Wikipedia:Protection policy#template',
extendedconfirmed = 'Wikipedia:Protection policy#extended',
autoconfirmed = 'Wikipedia:Protection policy#semi'
},
move = {
default = 'Wikipedia:Protection policy#move'
},
autoreview = {
default = 'Wikipedia:Protection policy#pending'
},
upload = {
default = 'Wikipedia:Protection policy#upload'
}
},
--------------------------------------------------------------------------------
-- Padlock indicator names
--------------------------------------------------------------------------------
-- This table provides the "name" attribute for the <indicator> extension tag
-- with which small padlock icons are generated. All indicator tags on a page
-- are displayed in alphabetical order based on this attribute, and with
-- indicator tags with duplicate names, the last tag on the page wins.
-- The attribute is chosen based on the protection action; table keys must be a
-- protection action name or the string "default".
padlockIndicatorNames = {
autoreview = 'pp-autoreview',
default = 'pp-default'
},
--------------------------------------------------------------------------------
-- Protection categories
--------------------------------------------------------------------------------
--[[
-- The protection categories are stored in the protectionCategories table.
-- Keys to this table are made up of the following strings:
--
-- 1. the expiry date
-- 2. the namespace
-- 3. the protection reason (e.g. "dispute" or "vandalism")
-- 4. the protection level (e.g. "sysop" or "autoconfirmed")
-- 5. the action (e.g. "edit" or "move")
--
-- When the module looks up a category in the table, first it will will check to
-- see a key exists that corresponds to all five parameters. For example, a
-- user page semi-protected from vandalism for two weeks would have the key
-- "temp-user-vandalism-autoconfirmed-edit". If no match is found, the module
-- changes the first part of the key to "all" and checks the table again. It
-- keeps checking increasingly generic key combinations until it finds the
-- field, or until it reaches the key "all-all-all-all-all".
--
-- The module uses a binary matrix to determine the order in which to search.
-- This is best demonstrated by a table. In this table, the "0" values
-- represent "all", and the "1" values represent the original data (e.g.
-- "indef" or "file" or "vandalism").
--
-- expiry namespace reason level action
-- order
-- 1 1 1 1 1 1
-- 2 0 1 1 1 1
-- 3 1 0 1 1 1
-- 4 0 0 1 1 1
-- 5 1 1 0 1 1
-- 6 0 1 0 1 1
-- 7 1 0 0 1 1
-- 8 0 0 0 1 1
-- 9 1 1 1 0 1
-- 10 0 1 1 0 1
-- 11 1 0 1 0 1
-- 12 0 0 1 0 1
-- 13 1 1 0 0 1
-- 14 0 1 0 0 1
-- 15 1 0 0 0 1
-- 16 0 0 0 0 1
-- 17 1 1 1 1 0
-- 18 0 1 1 1 0
-- 19 1 0 1 1 0
-- 20 0 0 1 1 0
-- 21 1 1 0 1 0
-- 22 0 1 0 1 0
-- 23 1 0 0 1 0
-- 24 0 0 0 1 0
-- 25 1 1 1 0 0
-- 26 0 1 1 0 0
-- 27 1 0 1 0 0
-- 28 0 0 1 0 0
-- 29 1 1 0 0 0
-- 30 0 1 0 0 0
-- 31 1 0 0 0 0
-- 32 0 0 0 0 0
--
-- In this scheme the action has the highest priority, as it is the last
-- to change, and the expiry has the least priority, as it changes the most.
-- The priorities of the expiry, the protection level and the action are
-- fixed, but the priorities of the reason and the namespace can be swapped
-- through the use of the cfg.bannerDataNamespaceHasPriority table.
--]]
-- If the reason specified to the template is listed in this table,
-- namespace data will take priority over reason data in the protectionCategories
-- table.
reasonsWithNamespacePriority = {
vandalism = true,
},
-- The string to use as a namespace key for the protectionCategories table for each
-- namespace number.
categoryNamespaceKeys = {
[ 2] = 'user',
[ 3] = 'user',
[ 4] = 'project',
[ 6] = 'file',
[ 8] = 'mediawiki',
[ 10] = 'template',
[ 12] = 'project',
[ 14] = 'category',
[100] = 'portal',
[828] = 'module',
},
protectionCategories = {
['all|all|all|all|all'] = 'Wikipedia fully protected pages',
['all|all|office|all|all'] = 'Wikipedia Office-protected pages',
['all|all|reset|all|all'] = 'Wikipedia Office-protected pages',
['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages',
['all|all|mainpage|all|all'] = 'Wikipedia fully protected main page files',
['all|all|all|extendedconfirmed|all'] = 'Wikipedia extended-confirmed-protected pages',
['all|all|ecp|extendedconfirmed|all'] = 'Wikipedia extended-confirmed-protected pages',
['all|template|all|all|edit'] = 'Wikipedia fully protected templates',
['all|all|all|autoconfirmed|edit'] = 'Wikipedia semi-protected pages',
['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages',
['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people',
['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people',
['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute',
['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users',
['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism',
['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories',
['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files',
['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals',
['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages',
['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages',
['all|template|all|autoconfirmed|edit'] = 'Wikipedia semi-protected templates',
['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages',
['all|all|all|templateeditor|edit'] = 'Wikipedia template-protected pages other than templates and modules',
['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates',
['all|template|all|templateeditor|move'] = 'Wikipedia template-protected templates', -- move-protected templates
['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people',
['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people',
['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute',
['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users',
['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism',
['all|category|all|sysop|edit'] = 'Wikipedia fully protected categories',
['all|file|all|sysop|edit'] = 'Wikipedia fully protected files',
['all|project|all|sysop|edit'] = 'Wikipedia fully protected project pages',
['all|talk|all|sysop|edit'] = 'Wikipedia fully protected talk pages',
['all|template|all|extendedconfirmed|edit'] = 'Wikipedia extended-confirmed-protected templates',
['all|template|all|sysop|edit'] = 'Wikipedia fully protected templates',
['all|user|all|sysop|edit'] = 'Wikipedia fully protected user and user talk pages',
['all|module|all|all|edit'] = 'Wikipedia fully protected modules',
['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules',
['all|module|all|extendedconfirmed|edit'] = 'Wikipedia extended-confirmed-protected modules',
['all|module|all|autoconfirmed|edit'] = 'Wikipedia semi-protected modules',
['all|all|all|sysop|move'] = 'Wikipedia move-protected pages',
['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages',
['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute',
['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism',
['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals',
['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages',
['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages',
['all|template|all|sysop|move'] = 'Wikipedia move-protected templates',
['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages',
['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages',
['all|file|all|all|upload'] = 'Wikipedia upload-protected files',
},
--------------------------------------------------------------------------------
-- Expiry category config
--------------------------------------------------------------------------------
-- This table configures the expiry category behaviour for each protection
-- action.
-- * If set to true, setting that action will always categorise the page if
-- an expiry parameter is not set.
-- * If set to false, setting that action will never categorise the page.
-- * If set to nil, the module will categorise the page if:
-- 1) an expiry parameter is not set, and
-- 2) a reason is provided, and
-- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck
-- table.
expiryCheckActions = {
edit = nil,
move = false,
autoreview = true,
upload = false
},
reasonsWithoutExpiryCheck = {
blp = true,
template = true,
},
--------------------------------------------------------------------------------
-- Pagetypes
--------------------------------------------------------------------------------
-- This table produces the page types available with the ${PAGETYPE} parameter.
-- Keys are namespace numbers, or the string "default" for the default value.
pagetypes = {
[0] = 'article',
[6] = 'file',
[10] = 'template',
[14] = 'category',
[828] = 'module',
default = 'page'
},
--------------------------------------------------------------------------------
-- Strings marking indefinite protection
--------------------------------------------------------------------------------
-- This table contains values passed to the expiry parameter that mean the page
-- is protected indefinitely.
indefStrings = {
['indef'] = true,
['indefinite'] = true,
['indefinitely'] = true,
['infinite'] = true,
},
--------------------------------------------------------------------------------
-- Group hierarchy
--------------------------------------------------------------------------------
-- This table maps each group to all groups that have a superset of the original
-- group's page editing permissions.
hierarchy = {
sysop = {},
reviewer = {'sysop'},
filemover = {'sysop'},
templateeditor = {'sysop'},
extendedconfirmed = {'sysop'},
autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'},
user = {'autoconfirmed'},
['*'] = {'user'}
},
--------------------------------------------------------------------------------
-- Wrapper templates and their default arguments
--------------------------------------------------------------------------------
-- This table contains wrapper templates used with the module, and their
-- default arguments. Templates specified in this table should contain the
-- following invocation, and no other template content:
--
-- {{#invoke:Protection banner|main}}
--
-- If other content is desired, it can be added between
-- <noinclude>...</noinclude> tags.
--
-- When a user calls one of these wrapper templates, they will use the
-- default arguments automatically. However, users can override any of the
-- arguments.
wrappers = {
['Template:Pp'] = {},
['Template:Pp-extended'] = {'ecp'},
['Template:Pp-blp'] = {'blp'},
-- we don't need Template:Pp-create
['Template:Pp-dispute'] = {'dispute'},
['Template:Pp-main-page'] = {'mainpage'},
['Template:Pp-move'] = {action = 'move', catonly = 'yes'},
['Template:Pp-move-dispute'] = {'dispute', action = 'move', catonly = 'yes'},
-- we don't need Template:Pp-move-indef
['Template:Pp-move-vandalism'] = {'vandalism', action = 'move', catonly = 'yes'},
['Template:Pp-office'] = {'office'},
['Template:Pp-office-dmca'] = {'dmca'},
['Template:Pp-pc'] = {action = 'autoreview', small = true},
['Template:Pp-pc1'] = {action = 'autoreview', small = true},
['Template:Pp-reset'] = {'reset'},
['Template:Pp-semi-indef'] = {small = true},
['Template:Pp-sock'] = {'sock'},
['Template:Pp-template'] = {'template', small = true},
['Template:Pp-upload'] = {action = 'upload'},
['Template:Pp-usertalk'] = {'usertalk'},
['Template:Pp-vandalism'] = {'vandalism'},
},
--------------------------------------------------------------------------------
--
-- MESSAGES
--
--------------------------------------------------------------------------------
msg = {
--------------------------------------------------------------------------------
-- Intro blurb and intro fragment
--------------------------------------------------------------------------------
-- These messages specify what is produced by the ${INTROBLURB} and
-- ${INTROFRAGMENT} parameters. If the protection is temporary they use the
-- intro-blurb-expiry or intro-fragment-expiry, and if not they use
-- intro-blurb-noexpiry or intro-fragment-noexpiry.
-- It is possible to use banner parameters in these messages.
['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
--------------------------------------------------------------------------------
-- Tooltip blurb
--------------------------------------------------------------------------------
-- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.
-- If the protection is temporary the tooltip-blurb-expiry message is used, and
-- if not the tooltip-blurb-noexpiry message is used.
-- It is possible to use banner parameters in these messages.
['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.',
['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},',
['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
--------------------------------------------------------------------------------
-- Special explanation blurb
--------------------------------------------------------------------------------
-- An explanation blurb for pages that cannot be unprotected, e.g. for pages
-- in the MediaWiki namespace.
-- It is possible to use banner parameters in this message.
['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Please discuss any changes on the ${TALKPAGE}; you'
.. ' may ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
.. '|consensus]].',
--------------------------------------------------------------------------------
-- Protection log display values
--------------------------------------------------------------------------------
-- These messages determine the display values for the protection log link
-- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.
-- It is possible to use banner parameters in these messages.
['protection-log-display'] = 'protection log',
['pc-log-display'] = 'pending changes log',
--------------------------------------------------------------------------------
-- Current version display values
--------------------------------------------------------------------------------
-- These messages determine the display values for the page history link
-- or the move log link produced by the ${CURRENTVERSION} parameter.
-- It is possible to use banner parameters in these messages.
['current-version-move-display'] = 'current title',
['current-version-edit-display'] = 'current version',
--------------------------------------------------------------------------------
-- Talk page
--------------------------------------------------------------------------------
-- This message determines the display value of the talk page link produced
-- with the ${TALKPAGE} parameter.
-- It is possible to use banner parameters in this message.
['talk-page-link-display'] = 'talk page',
--------------------------------------------------------------------------------
-- Edit requests
--------------------------------------------------------------------------------
-- This message determines the display value of the edit request link produced
-- with the ${EDITREQUEST} parameter.
-- It is possible to use banner parameters in this message.
['edit-request-display'] = 'submit an edit request',
--------------------------------------------------------------------------------
-- Expiry date format
--------------------------------------------------------------------------------
-- This is the format for the blurb expiry date. It should be valid input for
-- the first parameter of the #time parser function.
['expiry-date-format'] = 'F j, Y "at" H:i e',
--------------------------------------------------------------------------------
-- Tracking categories
--------------------------------------------------------------------------------
-- These messages determine which tracking categories the module outputs.
['tracking-category-incorrect'] = 'Wikipedia pages with incorrect protection templates',
['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules',
--------------------------------------------------------------------------------
-- Images
--------------------------------------------------------------------------------
-- These are images that are not defined by their protection action and protection level.
['image-filename-indef'] = 'Full-protection-shackle.svg',
['image-filename-default'] = 'Transparent.gif',
--------------------------------------------------------------------------------
-- End messages
--------------------------------------------------------------------------------
}
--------------------------------------------------------------------------------
-- End configuration
--------------------------------------------------------------------------------
}
a20552ae38cb5253a4fa29aa126abc74215a589f
Module:Sidebar
828
65
208
207
2023-10-17T17:45:01Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Sidebar]]
Scribunto
text/plain
require('strict')
local cfg = mw.loadData('Module:Sidebar/configuration')
local p = {}
local getArgs = require('Module:Arguments').getArgs
--[[
Categorizes calling templates and modules with a 'style' parameter of any sort
for tracking to convert to TemplateStyles.
TODO after a long cleanup: Catch sidebars in other namespaces than Template and Module.
TODO would probably want to remove /log and /archive as CS1 does
]]
local function categorizeTemplatesWithInlineStyles(args)
local title = mw.title.getCurrentTitle()
if title.namespace ~= 10 and title.namespace ~= 828 then return '' end
for _, pattern in ipairs (cfg.i18n.pattern.uncategorized_conversion_titles) do
if title.text:match(pattern) then return '' end
end
for key, _ in pairs(args) do
if mw.ustring.find(key, cfg.i18n.pattern.style_conversion) or key == 'width' then
return cfg.i18n.category.conversion
end
end
end
--[[
For compatibility with the original {{sidebar with collapsible lists}}
implementation, which passed some parameters through {{#if}} to trim their
whitespace. This also triggered the automatic newline behavior.
]]
-- See ([[meta:Help:Newlines and spaces#Automatic newline]])
local function trimAndAddAutomaticNewline(s)
s = mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1")
if mw.ustring.find(s, '^[#*:;]') or mw.ustring.find(s, '^{|') then
return '\n' .. s
else
return s
end
end
--[[
Finds whether a sidebar has a subgroup sidebar.
]]
local function hasSubgroup(s)
if mw.ustring.find(s, cfg.i18n.pattern.subgroup) then
return true
else
return false
end
end
local function has_navbar(navbar_mode, sidebar_name)
return navbar_mode ~= cfg.i18n.navbar_none and
navbar_mode ~= cfg.i18n.navbar_off and
(
sidebar_name or
mw.getCurrentFrame():getParent():getTitle():gsub(cfg.i18n.pattern.sandbox, '') ~=
cfg.i18n.title_not_to_add_navbar
)
end
local function has_list_class(args, htmlclass)
local patterns = {
'^' .. htmlclass .. '$',
'%s' .. htmlclass .. '$',
'^' .. htmlclass .. '%s',
'%s' .. htmlclass .. '%s'
}
for arg, value in pairs(args) do
if type(arg) == 'string' and mw.ustring.find(arg, 'class') then
for _, pattern in ipairs(patterns) do
if mw.ustring.find(args[arg] or '', pattern) then
return true
end
end
end
end
return false
end
-- there are a lot of list classes in the wild, so we add their TemplateStyles
local function add_list_styles(args)
local frame = mw.getCurrentFrame()
local function add_list_templatestyles(htmlclass, templatestyles)
if has_list_class(args, htmlclass) then
return frame:extensionTag{
name = 'templatestyles', args = { src = templatestyles }
}
else
return ''
end
end
local plainlist_styles = add_list_templatestyles('plainlist', cfg.i18n.plainlist_templatestyles)
local hlist_styles = add_list_templatestyles('hlist', cfg.i18n.hlist_templatestyles)
-- a second workaround for [[phab:T303378]]
-- when that issue is fixed, we can actually use has_navbar not to emit the
-- tag here if we want
if has_navbar(args.navbar, args.name) and hlist_styles == '' then
hlist_styles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.i18n.hlist_templatestyles}
}
end
-- hlist -> plainlist is best-effort to preserve old Common.css ordering. [hlist_note]
return hlist_styles .. plainlist_styles
end
-- work around [[phab:T303378]]
-- for each arg: find all the templatestyles strip markers, insert them into a
-- table. then remove all templatestyles markers from the arg
local function move_hiding_templatestyles(args)
local gfind = string.gfind
local gsub = string.gsub
local templatestyles_markers = {}
local strip_marker_pattern = '(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)'
for k, arg in pairs(args) do
for marker in gfind(arg, strip_marker_pattern) do
table.insert(templatestyles_markers, marker)
end
args[k] = gsub(arg, strip_marker_pattern, '')
end
return templatestyles_markers
end
--[[
Main sidebar function. Takes the frame, args, and an optional collapsibleClass.
The collapsibleClass is and should be used only for sidebars with collapsible
lists, as in p.collapsible.
]]
function p.sidebar(frame, args, collapsibleClass)
if not args then
args = getArgs(frame)
end
local hiding_templatestyles = table.concat(move_hiding_templatestyles(args))
local root = mw.html.create()
local child = args.child and mw.text.trim(args.child) == cfg.i18n.child_yes
root = root:tag('table')
if not child then
root
:addClass(cfg.i18n.class.sidebar)
-- force collapsibleclass to be sidebar-collapse otherwise output nothing
:addClass(collapsibleClass == cfg.i18n.class.collapse and cfg.i18n.class.collapse or nil)
:addClass('nomobile')
:addClass(args.float == cfg.i18n.float_none and cfg.i18n.class.float_none or nil)
:addClass(args.float == cfg.i18n.float_left and cfg.i18n.class.float_left or nil)
:addClass(args.wraplinks ~= cfg.i18n.wrap_true and cfg.i18n.class.wraplinks or nil)
:addClass(args.bodyclass or args.class)
:css('width', args.width or nil)
:cssText(args.bodystyle or args.style)
if args.outertitle then
root
:tag('caption')
:addClass(cfg.i18n.class.outer_title)
:addClass(args.outertitleclass)
:cssText(args.outertitlestyle)
:wikitext(args.outertitle)
end
if args.topimage then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(cfg.i18n.class.top_image)
:addClass(args.topimageclass)
:cssText(args.topimagestyle)
:wikitext(args.topimage)
if args.topcaption then
imageCell
:tag('div')
:addClass(cfg.i18n.class.top_caption)
:cssText(args.topcaptionstyle)
:wikitext(args.topcaption)
end
end
if args.pretitle then
root
:tag('tr')
:tag('td')
:addClass(args.topimage and cfg.i18n.class.pretitle_with_top_image
or cfg.i18n.class.pretitle)
:addClass(args.pretitleclass)
:cssText(args.basestyle)
:cssText(args.pretitlestyle)
:wikitext(args.pretitle)
end
else
root
:addClass(cfg.i18n.class.subgroup)
:addClass(args.bodyclass or args.class)
:cssText(args.bodystyle or args.style)
end
if args.title then
if child then
root
:wikitext(args.title)
else
root
:tag('tr')
:tag('th')
:addClass(args.pretitle and cfg.i18n.class.title_with_pretitle
or cfg.i18n.class.title)
:addClass(args.titleclass)
:cssText(args.basestyle)
:cssText(args.titlestyle)
:wikitext(args.title)
end
end
if args.image then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(cfg.i18n.class.image)
:addClass(args.imageclass)
:cssText(args.imagestyle)
:wikitext(args.image)
if args.caption then
imageCell
:tag('div')
:addClass(cfg.i18n.class.caption)
:cssText(args.captionstyle)
:wikitext(args.caption)
end
end
if args.above then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.above)
:addClass(args.aboveclass)
:cssText(args.abovestyle)
:newline() -- newline required for bullet-points to work
:wikitext(args.above)
end
local rowNums = {}
for k, v in pairs(args) do
k = '' .. k
local num = k:match('^heading(%d+)$') or k:match('^content(%d+)$')
if num then table.insert(rowNums, tonumber(num)) end
end
table.sort(rowNums)
-- remove duplicates from the list (e.g. 3 will be duplicated if both heading3
-- and content3 are specified)
for i = #rowNums, 1, -1 do
if rowNums[i] == rowNums[i - 1] then
table.remove(rowNums, i)
end
end
for i, num in ipairs(rowNums) do
local heading = args['heading' .. num]
if heading then
root
:tag('tr')
:tag('th')
:addClass(cfg.i18n.class.heading)
:addClass(args.headingclass)
:addClass(args['heading' .. num .. 'class'])
:cssText(args.basestyle)
:cssText(args.headingstyle)
:cssText(args['heading' .. num .. 'style'])
:newline()
:wikitext(heading)
end
local content = args['content' .. num]
if content then
root
:tag('tr')
:tag('td')
:addClass(hasSubgroup(content) and cfg.i18n.class.content_with_subgroup
or cfg.i18n.class.content)
:addClass(args.contentclass)
:addClass(args['content' .. num .. 'class'])
:cssText(args.contentstyle)
:cssText(args['content' .. num .. 'style'])
:newline()
:wikitext(content)
:done()
-- Without a linebreak after the </td>, a nested list like
-- "* {{hlist| ...}}" doesn't parse correctly.
:newline()
end
end
if args.below then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.below)
:addClass(args.belowclass)
:cssText(args.belowstyle)
:newline()
:wikitext(args.below)
end
if not child and has_navbar(args.navbar, args.name) then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.navbar)
:cssText(args.navbarstyle)
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
fontstyle = args.navbarfontstyle
})
end
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.i18n.templatestyles }
}
local templatestyles = ''
if args['templatestyles'] and args['templatestyles'] ~= '' then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] and args['child templatestyles'] ~= '' then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] and args['grandchild templatestyles'] ~= '' then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
add_list_styles(args), -- see [hlist_note] above about ordering
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles,
hiding_templatestyles,
tostring(root),
(child and cfg.i18n.category.child or ''),
categorizeTemplatesWithInlineStyles(args)
})
end
local function list_title(args, is_centered_list_titles, num)
local title_text = trimAndAddAutomaticNewline(args['list' .. num .. 'title']
or cfg.i18n.default_list_title)
local title
if is_centered_list_titles then
-- collapsible can be finicky, so provide some CSS/HTML to support
title = mw.html.create('div')
:addClass(cfg.i18n.class.list_title_centered)
:wikitext(title_text)
else
title = mw.html.create()
:wikitext(title_text)
end
local title_container = mw.html.create('div')
:addClass(cfg.i18n.class.list_title)
-- don't /need/ a listnumtitleclass because you can do
-- .templateclass .listnumclass .sidebar-list-title
:addClass(args.listtitleclass)
:cssText(args.basestyle)
:cssText(args.listtitlestyle)
:cssText(args['list' .. num .. 'titlestyle'])
:node(title)
:done()
return title_container
end
--[[
Main entry point for sidebar with collapsible lists.
Does the work of creating the collapsible lists themselves and including them
into the args.
]]
function p.collapsible(frame)
local args = getArgs(frame)
if not args.name and
frame:getParent():getTitle():gsub(cfg.i18n.pattern.collapse_sandbox, '') ==
cfg.i18n.collapse_title_not_to_add_navbar then
args.navbar = cfg.i18n.navbar_none
end
local contentArgs = {}
local is_centered_list_titles = false
if args['centered list titles'] and args['centered list titles'] ~= '' then
is_centered_list_titles = true
end
for k, v in pairs(args) do
local num = string.match(k, '^list(%d+)$')
if num then
local expand = args.expanded and
(args.expanded == 'all' or args.expanded == args['list' .. num .. 'name'])
local row = mw.html.create('div')
row
:addClass(cfg.i18n.class.list)
:addClass('mw-collapsible')
:addClass((not expand) and 'mw-collapsed' or nil)
:addClass(args['list' .. num .. 'class'])
:cssText(args.listframestyle)
:cssText(args['list' .. num .. 'framestyle'])
:node(list_title(args, is_centered_list_titles, num))
:tag('div')
:addClass(cfg.i18n.class.list_content)
:addClass('mw-collapsible-content')
-- don't /need/ a listnumstyleclass because you can do
-- .templatename .listnumclass .sidebar-list
:addClass(args.listclass)
:cssText(args.liststyle)
:cssText(args['list' .. num .. 'style'])
:wikitext(trimAndAddAutomaticNewline(args['list' .. num]))
contentArgs['content' .. num] = tostring(row)
end
end
for k, v in pairs(contentArgs) do
args[k] = v
end
return p.sidebar(frame, args, cfg.i18n.class.collapse)
end
return p
71fe765846593e025ca2f94371315e9dbb5bb4d2
Module:Sidebar/configuration
828
66
210
209
2023-10-17T17:45:02Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Sidebar/configuration]]
Scribunto
text/plain
return {
i18n = {
child_yes = 'yes',
float_none = 'none',
float_left = 'left',
wrap_true = 'true',
navbar_none = 'none',
navbar_off = 'off',
default_list_title = 'List',
title_not_to_add_navbar = 'Template:Sidebar',
collapse_title_not_to_add_navbar = 'Template:Sidebar with collapsible lists',
templatestyles = 'Module:Sidebar/styles.css',
hlist_templatestyles = 'Hlist/styles.css',
plainlist_templatestyles = 'Plainlist/styles.css',
category = {
child = '[[Category:Pages using sidebar with the child parameter]]',
conversion = '[[Category:Sidebars with styles needing conversion]]'
},
pattern = {
collapse_sandbox = '/sandbox$',
sandbox = '/sandbox$',
subgroup = 'sidebar%-subgroup',
style_conversion = 'style$',
uncategorized_conversion_titles = {
'/[Ss]andbox',
'/[Tt]estcases',
'/[Dd]oc$'
}
},
class = {
sidebar = 'sidebar',
subgroup = 'sidebar-subgroup',
collapse = 'sidebar-collapse',
float_none = 'sidebar-none',
float_left = 'sidebar-left',
wraplinks = 'nowraplinks',
outer_title = 'sidebar-outer-title',
top_image = 'sidebar-top-image',
top_caption = 'sidebar-top-caption',
pretitle = 'sidebar-pretitle',
pretitle_with_top_image = 'sidebar-pretitle-with-top-image',
title = 'sidebar-title',
title_with_pretitle = 'sidebar-title-with-pretitle',
image = 'sidebar-image',
caption = 'sidebar-caption',
above = 'sidebar-above',
heading = 'sidebar-heading',
content = 'sidebar-content',
content_with_subgroup = 'sidebar-content-with-subgroup',
below = 'sidebar-below',
navbar = 'sidebar-navbar',
list = 'sidebar-list',
list_title = 'sidebar-list-title',
list_title_centered = 'sidebar-list-title-c',
list_content = 'sidebar-list-content'
}
}
}
dc2a980ac2162a898f7c21e6d6ba7e994dfeb315
Module:Sidebar/styles.css
828
67
212
211
2023-10-17T17:45:02Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Sidebar/styles.css]]
sanitized-css
text/css
/* {{pp-template}} */
/* TODO: Invert width design to be "mobile first" */
.sidebar {
/* TODO: Ask if we should have max-width 22em instead */
width: 22em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
/* @noflip */
margin: 0.5em 0 1em 1em;
background: #f8f9fa;
border: 1px solid #aaa;
padding: 0.2em;
text-align: center;
line-height: 1.4em;
font-size: 88%;
border-collapse: collapse;
/* Timeless has display: none on .nomobile at mobile resolutions, so we
* unhide it with display: table and let precedence and proximity win.
*/
display: table;
}
/* Unfortunately, so does Minerva desktop, except Minerva drops an
* !important on the declaration. So we have to be mean for Minerva users.
* Mobile removes the element entirely with `wgMFRemovableClasses` in
* https://github.com/wikimedia/operations-mediawiki-config/blob/master/
wmf-config/InitialiseSettings.php#L16992
* which is why displaying it categorically with display: table works.
* We don't really want to expose the generic user in the wild on mobile to have
* to deal with sidebars. (Maybe the ones with collapsible lists, so that
* might be an improvement. That is blocked on [[:phab:T111565]].)
*/
body.skin-minerva .sidebar {
display: table !important;
/* also, minerva is way too aggressive about other stylings on tables.
* TODO remove when this template gets moved to a div. plans on talk page.
* We always float right on Minerva because that's a lot of extra CSS
* otherwise. */
float: right !important;
margin: 0.5em 0 1em 1em !important;
}
.sidebar-subgroup {
width: 100%;
margin: 0;
border-spacing: 0;
}
.sidebar-left {
/* @noflip */
float: left;
/* @noflip */
clear: left;
/* @noflip */
margin: 0.5em 1em 1em 0;
}
.sidebar-none {
float: none;
clear: both;
/* @noflip */
margin: 0.5em 1em 1em 0;
}
.sidebar-outer-title {
padding: 0 0.4em 0.2em;
font-size: 125%;
line-height: 1.2em;
font-weight: bold;
}
.sidebar-top-image {
padding: 0.4em;
}
.sidebar-top-caption,
.sidebar-pretitle-with-top-image,
.sidebar-caption {
padding: 0.2em 0.4em 0;
line-height: 1.2em;
}
.sidebar-pretitle {
padding: 0.4em 0.4em 0;
line-height: 1.2em;
}
.sidebar-title,
.sidebar-title-with-pretitle {
padding: 0.2em 0.8em;
font-size: 145%;
line-height: 1.2em;
}
.sidebar-title-with-pretitle {
padding: 0.1em 0.4em;
}
.sidebar-image {
padding: 0.2em 0.4em 0.4em;
}
.sidebar-heading {
padding: 0.1em 0.4em;
}
.sidebar-content {
padding: 0 0.5em 0.4em;
}
.sidebar-content-with-subgroup {
padding: 0.1em 0.4em 0.2em;
}
.sidebar-above,
.sidebar-below {
padding: 0.3em 0.8em;
font-weight: bold;
}
.sidebar-collapse .sidebar-above,
.sidebar-collapse .sidebar-below {
border-top: 1px solid #aaa;
border-bottom: 1px solid #aaa;
}
.sidebar-navbar {
text-align: right;
font-size: 115%;
padding: 0 0.4em 0.4em;
}
.sidebar-list-title {
padding: 0 0.4em;
text-align: left;
font-weight: bold;
line-height: 1.6em;
font-size: 105%;
}
/* centered text with mw-collapsible headers is finicky */
.sidebar-list-title-c {
padding: 0 0.4em;
text-align: center;
margin: 0 3.3em;
}
@media (max-width: 720px) {
/* users have wide latitude to set arbitrary width and margin :(
"Super-specific" selector to prevent overriding this appearance by
lower level sidebars too */
body.mediawiki .sidebar {
width: 100% !important;
clear: both;
float: none !important; /* Remove when we div based; Minerva is dumb */
margin-left: 0 !important;
margin-right: 0 !important;
}
/* TODO: We might consider making all links wrap at small resolutions and then
* only introduce nowrap at higher resolutions. Do when we invert the media
* query.
*/
}
7d621b35a37807a103b59075851fe36201204ceb
Template:Div col
10
68
214
213
2023-10-17T17:45:03Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Div_col]]
wikitext
text/x-wiki
<includeonly><templatestyles src="Div col/styles.css"/><!--
--><div class="div-col {{#ifeq:{{{small|}}}|yes|div-col-small}} {{#ifeq:{{{rules|}}}|yes|div-col-rules}} {{{class|}}}" <!--
-->{{#if:{{{colwidth|}}}{{{gap|}}}{{{style|}}}|<!--
-->style="{{#if:{{{colwidth|}}}|column-width: {{{colwidth}}};}}{{#if:{{{gap|}}}|column-gap: {{{gap}}};}}{{#if:{{{style|}}}|{{{style}}}}}"<!--
-->}}><!--
-->{{#if:{{{content|}}}|{{{content}}}</div>}}<!-- Inventory how many pages use small=yes
-->{{#ifeq:{{{small|}}}|yes|[[Category:Pages using div col with small parameter]]}}<!--
--></includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using div col with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Div col]] with unknown parameter "_VALUE_"; use colwidth= to specify column size |ignoreblank=y | class | colwidth | content | gap | rules | small | style }}<noinclude>
{{Documentation}}
</noinclude>
6e84133dd867d6c701e7b161878cf66665bb7eb7
Template:Div col/styles.css
10
69
216
215
2023-10-17T17:45:04Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Div_col/styles.css]]
sanitized-css
text/css
/* {{pp|small=yes}} */
.div-col {
margin-top: 0.3em;
column-width: 30em;
}
.div-col-small {
font-size: 90%;
}
.div-col-rules {
column-rule: 1px solid #aaa;
}
/* Reset top margin for lists in div col */
.div-col dl,
.div-col ol,
.div-col ul {
margin-top: 0;
}
/* Avoid elements breaking between columns
See also Template:No col break */
.div-col li,
.div-col dd {
page-break-inside: avoid; /* Removed from CSS in favor of break-inside c. 2020 */
break-inside: avoid-column;
}
/* Unbulleted lists */
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none;
margin: 0;
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
76c2c0a042b9164cff638cd44af5ab129702c141
Template:Div col end
10
70
218
217
2023-10-17T17:45:04Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Div_col_end]]
wikitext
text/x-wiki
<includeonly></div></includeonly><noinclude>
{{Documentation|Template:Div col/doc}}
</noinclude>
78088d41c21d779e3722f220fcc9773dfbbc1e4f
Template:Yesno-no
10
71
220
219
2023-10-17T17:45:04Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Yesno-no]]
wikitext
text/x-wiki
{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|¬={{{¬|no}}}|def={{{def|no}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1ad7b7800da1b867ead8f6ff8cef76e6201b3b56
Template:Para
10
72
222
221
2023-10-17T17:45:05Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Para]]
wikitext
text/x-wiki
<code class="tpl-para" style="word-break:break-word;{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
06006deea2ed5d552aab61b4332321ab749ae7e8
Template:Documentation
10
12
224
88
2023-10-17T17:45:05Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Documentation]]
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
ce7fd93f18c46b4fa871bf679afd05cbda72d8c4
Module:Documentation
828
13
226
94
2023-10-17T17:45:06Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Documentation]]
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return mw.ustring.format('[[%s|%s]]', page, display)
else
return mw.ustring.format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return mw.ustring.format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return '<span class="' .. message('toolbar-class') .. '">('
.. table.concat(ret, ' | ') .. ')</span>'
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.fullUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
local data = {}
data.title = title
data.docTitle = docTitle
-- View, display, edit, and purge links if /doc exists.
data.viewLinkDisplay = message('view-link-display')
data.editLinkDisplay = message('edit-link-display')
data.historyLinkDisplay = message('history-link-display')
data.purgeLinkDisplay = message('purge-link-display')
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 6 then -- File namespace
preload = message('file-docpage-preload')
elseif subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
data.preload = preload
data.createLinkDisplay = message('create-link-display')
return data
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local function escapeBrackets(s)
-- Escapes square brackets with HTML entities.
s = s:gsub('%[', '[') -- Replace square brackets with HTML entities.
s = s:gsub('%]', ']')
return s
end
local ret
local docTitle = data.docTitle
local title = data.title
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
ret = '[%s] [%s] [%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
else
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
ret = '[%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, createLink)
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editUrl = docTitle:fullUrl{action = 'edit'}
local editDisplay = message('edit-link-display')
local editLink = makeUrlLink(editUrl, editDisplay)
local historyUrl = docTitle:fullUrl{action = 'history'}
local historyDisplay = message('history-link-display')
local historyLink = makeUrlLink(historyUrl, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
621cd86c0b54a1771f02723bad84203cf7c7ed8e
Module:Documentation/config
828
15
228
96
2023-10-17T17:45:06Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Documentation/config]]
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['file-docpage-preload']
-- Preload file for documentation page in the file namespace.
cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
5f4ad23fca41592ae0f03e5f07d2b9e235fd7170
Module:Documentation/styles.css
828
24
230
118
2023-10-17T17:45:06Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Documentation/styles.css]]
sanitized-css
text/css
/* {{PP-template}} */
.ts-doc-sandbox .mbox-image {
padding:.75em 0 .75em .75em;
}
.ts-doc-doc {
clear: both;
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
margin-top: 1em;
padding: 5px;
}
.ts-doc-header {
padding-bottom: 3px;
border-bottom: 1px solid #a2a9b1;
margin-bottom: 1ex;
}
.ts-doc-header .ts-tlinks-tlinks {
display: inline-block;
line-height: 24px;
margin-left: 1em;
}
.ts-doc-header .ts-tlinks-tlinks a.external {
color: #0645ad;
}
.ts-doc-header .ts-tlinks-tlinks a.external:visited {
color: #0b0080;
}
.ts-doc-header .ts-tlinks-tlinks a.external:active {
color: #faa700;
}
.ts-doc-content:after {
content: '';
clear: both;
display: block;
}
.ts-doc-heading {
display: inline-block;
padding-left: 55px;
background: center left/50px no-repeat;
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png);
background-image: url(https://upload.wikimedia.org/wikipedia/commons/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg);
font-size: 1.5em;
}
.ts-doc-content > *:first-child,
.ts-doc-footer > *:first-child {
margin-top: .5em;
}
.ts-doc-content > *:last-child,
.ts-doc-footer > *:last-child {
margin-bottom: .5em;
}
.ts-doc-footer {
background-color: #ecfcf4;
border: 1px solid #a2a9b1;
padding: .25em 1em;
margin-top: .2em;
font-style: italic;
}
.ts-doc-footer small {
font-style: normal;
}
.ts-doc-sandbox {
clear: both;
}
c37b0ddfd0b1c128c187ca56721d1c4e481b05ff
Template:Sandbox other
10
73
232
231
2023-10-17T17:45:07Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Sandbox_other]]
wikitext
text/x-wiki
{{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
91e4ae891d6b791615152c1fbc971414961ba872
Template:Documentation subpage
10
25
234
90
2023-10-17T17:45:08Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Documentation_subpage]]
wikitext
text/x-wiki
<includeonly>{{#if:{{IsDocSubpage|override={{{override|doc}}}}}
| <!--doc subpage--></includeonly>{{#ifeq:{{{doc-notice|show}}}|show
| {{Ombox|type=notice|image=[[File:Edit-copy green.svg|40px|link=]]
|text='''This is a documentation [[mw:Help:Subpages|subpage]] for {{#if:{{{1|}}}
| {{{1}}}
| [[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]
}}.'''<br/> It contains usage information, categories, and other content that is not part of the original<!--
--> {{#if: {{{text2|}}}
| {{{text2|}}}
| {{#if: {{{text1|}}}
| {{{text1|}}}
| {{#ifeq: {{SUBJECTSPACE}} | {{ns:User}}
| {{lc:{{SUBJECTSPACE}}}} template page
| {{#if: {{SUBJECTSPACE}}
| {{lc:{{SUBJECTSPACE}}}} page
| article
}}
}}
}}
}}.
}}
<!--If not on a doc subpage, do nothing-->}}{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}{{#if: {{{inhibit|}}}
| <!--Skip-->
| <includeonly>{{#ifexist: {{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch: {{SUBJECTSPACE}}
|Template=Template
|Module=Module
|User=User
|#default=Template
}} documentation pages{{#translation:}}]]
| [[Category:Documentation subpages without corresponding pages{{#translation:}}]]
}}</includeonly>
}}<includeonly>
}}</includeonly><noinclude>{{Documentation}}<!--Add categories and interwikis to the /doc subpage, not here!--></noinclude>
2fcb7e4e2d233f798b114d37652fc333213f5ea7
Template:Template link with link off
10
74
236
235
2023-10-17T17:45:08Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Template_link_with_link_off]]
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nowrap=yes|nolink=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlf}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
b099fea5d1f36b0b4b9cb253ad3a9f4e095f6851
Template:Tlf
10
75
238
237
2023-10-17T17:45:09Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Tlf]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link with link off]]
{{Redirect category shell|
{{R from move}}
}}
52759e1d3f7c9aa4a03d0b7d4f84f4c6adf53edf
Template:High-use
10
76
240
239
2023-10-17T17:45:09Z
LamayII
2
1 revision imported from [[:wikipedia:Template:High-use]]
wikitext
text/x-wiki
{{#invoke:High-use|main|1={{{1|}}}|2={{{2|}}}|info={{{info|}}}|demo={{{demo|}}}|form={{{form|}}}|expiry={{{expiry|}}}|system={{{system|}}}}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! -->
</noinclude>
a3322d1bd47ac03df14fa2090855cff4fede9bc7
Template:TemplateData header
10
77
242
241
2023-10-17T17:45:10Z
LamayII
2
1 revision imported from [[:wikipedia:Template:TemplateData_header]]
wikitext
text/x-wiki
<div class="templatedata-header">{{#if:{{{noheader|}}}|<!--
noheader:
-->{{Template parameter usage|based=y}}|<!--
+header:
-->This is the {{#if:{{{nolink|}}}|<!--
+header, nolink TD
-->TemplateData|<!--
+header, +link [[TD]]; DEFAULT:
-->[[Wikipedia:TemplateData|TemplateData]]}}<!--
e.o. #if:nolink; DEFAULT:
--> for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools. {{Template parameter usage|based=y}}<!--
e.o. #if:noheader
-->}}
'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
</div><includeonly><!--
check parameters
-->{{#invoke:Check for unknown parameters|check
|unknown={{template other|1=[[Category:Pages using TemplateData header with unknown parameters|_VALUE_]]}}
|template=Template:TemplateData header
|1 |nolink |noheader
|preview=<div class="error" style="font-weight:normal">Unknown parameter '_VALUE_' in [[Template:TemplateData header]].</div>
}}<!--
-->{{template other|{{sandbox other||
[[Category:Templates using TemplateData]]
}}}}</includeonly><!--
--><noinclude>{{Documentation}}</noinclude>
ddfbb4ae793846b96d4c06330417fa6ed4da2adc
Template:Template parameter usage
10
78
244
243
2023-10-17T17:45:10Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Template_parameter_usage]]
wikitext
text/x-wiki
{{#switch:{{{label|}}}
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|this template}} in articles{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|[[Template:{{ROOTPAGENAME}}]]}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|#default=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{{label|}}}]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
}}<noinclude>
{{documentation}}
</noinclude>
10a89e6a4bc63a1427518ea21bf94b8f623a7391
Module:High-use
828
79
246
245
2023-10-17T17:45:11Z
LamayII
2
1 revision imported from [[:wikipedia:Module:High-use]]
Scribunto
text/plain
local p = {}
-- _fetch looks at the "demo" argument.
local _fetch = require('Module:Transclusion_count').fetch
local yesno = require('Module:Yesno')
function p.num(frame, count)
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
-- Build output string
local return_value = ""
if count == nil then
if frame.args[1] == "risk" then
return_value = "a very large number of"
else
return_value = "many"
end
else
-- Use 2 significant figures for smaller numbers and 3 for larger ones
local sigfig = 2
if count >= 100000 then
sigfig = 3
end
-- Prepare to round to appropriate number of sigfigs
local f = math.floor(math.log10(count)) - sigfig + 1
-- Round and insert "approximately" or "+" when appropriate
if (frame.args[2] == "yes") or (mw.ustring.sub(frame.args[1],-1) == "+") then
-- Round down
return_value = string.format("%s+", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )
else
-- Round to nearest
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
end
end
end
return return_value
end
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
local return_value = ""
if frame.args[1] == "risk" then
return_value = "risk"
else
local count = _fetch(frame)
if count and count >= 100000 then return_value = "risk" end
end
return return_value
end
function p.text(frame, count)
-- Only show the information about how this template gets updated if someone
-- is actually editing the page and maybe trying to update the count.
local bot_text = (frame:preprocess("{{REVISIONID}}") == "") and "\n\n----\n'''Preview message''': Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]])." or ''
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" or title.subpageText == "sandbox" then
title = title.basePageTitle
end
local systemMessages = frame.args['system']
if frame.args['system'] == '' then
systemMessages = nil
end
-- This retrieves the project URL automatically to simplify localiation.
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and ("''', and " .. templateCount) or ("'''"))
else
used_on_text = used_on_text .. templateCount .. "'''"
end
local sandbox_text = ("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. "):format(
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
mw.title.getCurrentTitle().namespace == 828 and "Module:Sandbox|module sandbox" or "Wikipedia:User pages#SUB|user subpage"
)
local infoArg = frame.args["info"] ~= "" and frame.args["info"]
if (systemMessages or frame.args[1] == "risk" or (count and count >= 100000) ) then
local info = systemMessages and '.<br/>Changes to it can cause immediate changes to the Wikipedia user interface.' or '.'
if infoArg then
info = info .. "<br />" .. infoArg
end
sandbox_text = info .. '<br /> To avoid major disruption' ..
(count and count >= 100000 and ' and server load' or '') ..
', any changes should be tested in the ' .. sandbox_text ..
'The tested changes can be added to this page in a single edit. '
else
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
'hanges may be widely noticed. Test changes in the ' .. sandbox_text
end
local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
else
discussion_text = string.format("%son the [[%s|talk page]]", discussion_text, title.talkPageTitle.fullText )
end
return used_on_text .. sandbox_text .. discussion_text .. " before implementing them." .. bot_text
end
function p.main(frame)
local count = nil
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
local type_param = "style"
local epilogue = ''
if frame.args['system'] and frame.args['system'] ~= '' then
image = "[[File:Ambox important.svg|40px|alt=Warning|link=]]"
type_param = "content"
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local categorise = (nocat == '' or not yesno(nocat))
if categorise then
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
end
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"
type_param = "content"
end
if frame.args["form"] == "editnotice" then
return frame:expandTemplate{
title = 'editnotice',
args = {
["image"] = image,
["text"] = p.text(frame, count),
["expiry"] = (frame.args["expiry"] or "")
}
} .. epilogue
else
return require('Module:Message box').main('ombox', {
type = type_param,
image = image,
text = p.text(frame, count),
expiry = (frame.args["expiry"] or "")
}) .. epilogue
end
end
return p
134551888e066954a89c109d2faa8af71a4454a4
Module:Transclusion count
828
80
248
247
2023-10-17T17:45:11Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Transclusion_count]]
Scribunto
text/plain
local p = {}
function p.fetch(frame)
local template = nil
local return_value = nil
-- Use demo parameter if it exists, otherswise use current template name
local namespace = mw.title.getCurrentTitle().namespace
if frame.args["demo"] and frame.args["demo"] ~= "" then
template = mw.ustring.gsub(frame.args["demo"],"^[Tt]emplate:","")
elseif namespace == 10 then -- Template namespace
template = mw.title.getCurrentTitle().text
elseif namespace == 828 then -- Module namespace
template = (mw.site.namespaces[828].name .. ":" .. mw.title.getCurrentTitle().text)
end
-- If in template or module namespace, look up count in /data
if template ~= nil then
namespace = mw.title.new(template, "Template").namespace
if namespace == 10 or namespace == 828 then
template = mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end
template = mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end
local index = mw.ustring.sub(mw.title.new(template).text,1,1)
local status, data = pcall(function ()
return(mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other")))
end)
if status then
return_value = tonumber(data[mw.ustring.gsub(template, " ", "_")])
end
end
end
-- If database value doesn't exist, use value passed to template
if return_value == nil and frame.args[1] ~= nil then
local arg1=mw.ustring.match(frame.args[1], '[%d,]+')
if arg1 and arg1 ~= '' then
return_value = tonumber(frame:callParserFunction('formatnum', arg1, 'R'))
end
end
return return_value
end
-- Tabulate this data for [[Wikipedia:Database reports/Templates transcluded on the most pages]]
function p.tabulate(frame)
local list = {}
for i = 65, 91 do
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i)))
for name, count in pairs(data) do
table.insert(list, {mw.title.new(name, "Template").fullText, count})
end
end
table.sort(list, function(a, b)
return (a[2] == b[2]) and (a[1] < b[1]) or (a[2] > b[2])
end)
local lang = mw.getContentLanguage();
for i = 1, #list do
list[i] = ('|-\n| %d || [[%s]] || %s\n'):format(i, list[i][1]:gsub('_', ' '), lang:formatNum(list[i][2]))
end
return table.concat(list)
end
return p
000ef6bcbf7b66e727870b0c300c4009da300513
Module:Lua banner
828
29
250
66
2023-10-17T17:45:11Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Lua_banner]]
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local TNT = require('Module:TNT')
local p = {}
local function format(msg)
return TNT.format('I18n/Lua banner', msg)
end
local function getConfig()
return mw.loadData('Module:Lua banner/config')
end
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args, cfg)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules, cfg)
local trackingCategories = p.renderTrackingCategories(args, modules, nil, cfg)
return box .. trackingCategories
end
function p.renderBox(modules, cfg)
local boxArgs = {}
if #modules < 1 then
cfg = cfg or getConfig()
if cfg['allow_wishes'] then
boxArgs.text = format('wishtext')
else
boxArgs.text = string.format('<strong class="error">%s</strong>', format('error_emptylist'))
end
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
end
local moduleList = mList.makeList('bulleted', moduleLinks)
boxArgs.text = format('header') .. '\n' .. moduleList
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = string.format(
'[[File:Lua-logo-nolabel.svg|30px|alt=%s|link=%s]]',
format('logo_alt'),
format('logo_link')
)
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj, cfg)
if yesno(args.nocat) then
return ''
end
cfg = cfg or getConfig()
local cats = {}
-- Error category
if #modules < 1 and not cfg['allow_wishes'] and cfg['error_category'] then
cats[#cats + 1] = cfg['error_category']
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
if titleObj.namespace == 10
and not cfg['subpage_blacklist'][titleObj.subpageText]
then
local category = args.category
if not category then
local pagename = modules[1] and mw.title.new(modules[1])
category = pagename and cfg['module_categories'][pagename.text]
if not category then
if cfg['allow_wishes'] and #modules < 1 then
category = cfg['wish_category']
else
category = cfg['default_category']
end
end
end
if category then
cats[#cats + 1] = category
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
0fa5bd41f4b7ea898a70bc3d83af64846d0b0338
Module:Parameter names example
828
81
252
251
2023-10-17T17:45:12Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Parameter_names_example]]
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
--targs['nocat'] = 'yes';
--targs['categories'] = 'no';
--targs['demo'] = 'yes';
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
fdf94fb7a5dc1fabf118d60488a02f1e65b0df24
Template:Lua
10
31
254
70
2023-10-17T17:45:12Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Lua]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>{{Lua|Module:Lua banner}}{{documentation}}[[Category:Utility templates]]</noinclude>
fd85a870209733ca65a7290fa45f6b4f321bac0b
Template:Parameter names example
10
82
256
255
2023-10-17T17:45:12Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Parameter_names_example]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{documentation}}<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
256a11b9ae7ac7e492b3d9de86ade1ffa96bffd1
Template:Category link with count
10
83
258
257
2023-10-17T17:45:13Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Category_link_with_count]]
wikitext
text/x-wiki
[[:Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|<!--
-->{{#if:{{{name|}}}|{{{name}}}|Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}}}<!--
-->]] ({{PAGESINCATEGORY:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|{{{2|all}}}}})<noinclude>
{{Documentation}}
</noinclude>
f93f1540b8c157703bd6d24ae35c35bef745981d
Template:Suppress categories
10
84
260
259
2023-10-17T17:45:13Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Suppress_categories]]
wikitext
text/x-wiki
<includeonly>{{{{{|safesubst:}}}#invoke:Suppress categories|main}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
1f9c6065201d31d4c70f982129b5babbb809ae8c
Module:Suppress categories
828
85
262
261
2023-10-17T17:45:14Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Suppress_categories]]
Scribunto
text/plain
-- This is a simple module to strip categories from wikitext. It does
-- not support nested links or magic words like __TOC__, etc. Even so,
-- it should still handle most categories.
local p = {}
-- Detects if a category link is valid or not. If it is valid,
-- the function returns the blank string. If not, the input
-- is returned with no changes.
local function processCategory( all, submatch )
local beforePipe = mw.ustring.match( submatch, '^(.-)[%s_]*|[%s_]*.-$' )
beforePipe = beforePipe or submatch
if mw.ustring.match( beforePipe, '[%[%]<>{}%c\n]' ) then
return all
else
return ''
end
end
-- Preprocess the content if we aren't being called from #invoke,
-- and pass it to gsub to remove valid category links.
local function suppress( content, isPreprocessed )
if not isPreprocessed then
content = mw.getCurrentFrame():preprocess( content )
end
content = mw.ustring.gsub(
content,
'(%[%[[%s_]*[cC][aA][tT][eE][gG][oO][rR][yY][%s_]*:[%s_]*(.-)[%s_]*%]%])',
processCategory
)
return content
end
-- Get the content to suppress categories from, and find
-- whether the content has already been preprocessed. (If the
-- module is called from #invoke, it has been preprocessed already.)
function p.main( frame )
local content, isPreprocessed
if frame == mw.getCurrentFrame() then
content = frame:getParent().args[1]
if frame.args[1] then
content = frame.args[1]
end
isPreprocessed = true
else
content = frame
isPreprocessed = false
end
return suppress( content, isPreprocessed )
end
return p
0ec3903841c489357a879434c5dc23c11d182c78
Module:Transclusion count/data/I
828
86
264
263
2023-10-17T17:45:14Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Transclusion_count/data/I]]
Scribunto
text/plain
return {
["IAAF_name"] = 2100,
["IAST"] = 6400,
["IBDB_name"] = 9100,
["ICD10"] = 4700,
["ICD9"] = 4400,
["ICS"] = 2900,
["IDN"] = 3400,
["IMDb_episode"] = 10000,
["IMDb_episodes"] = 2700,
["IMDb_name"] = 154000,
["IMDb_title"] = 190000,
["IMO_Number"] = 4100,
["IMSLP"] = 8300,
["INA"] = 2200,
["IND"] = 7700,
["INR"] = 6600,
["INRConvert"] = 5700,
["INRConvert/CurrentRate"] = 5600,
["INRConvert/USD"] = 5600,
["INRConvert/out"] = 5600,
["IOC_profile"] = 5100,
["IP"] = 2600,
["IPA"] = 143000,
["IPA-de"] = 8100,
["IPA-es"] = 7900,
["IPA-fr"] = 44000,
["IPA-it"] = 6000,
["IPA-nl"] = 3900,
["IPA-pl"] = 4100,
["IPA-pt"] = 3300,
["IPA-ru"] = 2700,
["IPA-sl"] = 6900,
["IPA-th"] = 3000,
["IPA_audio_link"] = 3500,
["IPA_link"] = 3500,
["IPAc-cmn"] = 2300,
["IPAc-en"] = 48000,
["IPAc-pl"] = 51000,
["IPC_athlete"] = 2800,
["IPSummary"] = 78000,
["IP_summary"] = 79000,
["IPtalk"] = 18000,
["IPuser"] = 7100,
["IPvandal"] = 2900,
["IRC"] = 7300,
["IRI"] = 2300,
["IRL"] = 5500,
["IRN"] = 3600,
["ISBN"] = 462000,
["ISBN?"] = 2100,
["ISBNT"] = 39000,
["ISBN_missing"] = 2600,
["ISFDB_name"] = 4100,
["ISFDB_title"] = 4600,
["ISL"] = 2100,
["ISO_15924/script-example-character"] = 2800,
["ISO_15924/wp-article"] = 2800,
["ISO_15924/wp-article/format"] = 2800,
["ISO_15924/wp-article/label"] = 2700,
["ISO_3166_code"] = 520000,
["ISO_3166_name"] = 16000,
["ISO_639_name"] = 8100,
["ISP"] = 5300,
["ISR"] = 4900,
["ISSN"] = 12000,
["ISSN_link"] = 30000,
["ISTAT"] = 8100,
["ISU_figure_skater"] = 2500,
["ITA"] = 17000,
["ITF"] = 6300,
["ITF_profile"] = 9100,
["ITIS"] = 4400,
["ITN_talk"] = 10000,
["ITN_talk/date"] = 10000,
["IUCN_banner"] = 15000,
["I_sup"] = 4600,
["Iaaf_name"] = 7200,
["Ice_hockey"] = 19000,
["Ice_hockey_stats"] = 19000,
["Icehockeystats"] = 12000,
["Icon"] = 582000,
["If"] = 275000,
["If_all"] = 6400,
["If_between"] = 3800,
["If_both"] = 155000,
["If_empty"] = 3670000,
["If_first_display_both"] = 73000,
["If_in_page"] = 10000,
["If_last_display_both"] = 30000,
["If_preview"] = 58000,
["If_then_show"] = 291000,
["Ifempty"] = 4000,
["Ifeq"] = 17000,
["Iferror_then_show"] = 3300,
["Ifexist_not_redirect"] = 1300000,
["Ifnotempty"] = 14000,
["Ifnumber"] = 36000,
["Ifsubst"] = 448000,
["Ih"] = 7500,
["Ill"] = 118000,
["Illm"] = 6700,
["Image_frame"] = 4900,
["Image_label"] = 4500,
["Image_label_begin"] = 3900,
["Image_label_end"] = 3800,
["Image_label_small"] = 2600,
["Image_needed"] = 4500,
["Image_other"] = 272000,
["Image_requested"] = 168000,
["Image_requested/Category_helper"] = 159000,
["Imbox"] = 919000,
["Imdb_name"] = 5300,
["Imdb_title"] = 4000,
["Import_style"] = 11000,
["Import_style/inputbox.css"] = 11000,
["Importance"] = 5650000,
["Importance/colour"] = 5660000,
["Importance_mask"] = 10400000,
["Improve_categories"] = 7100,
["Improve_documentation"] = 2500,
["In_class"] = 5900,
["In_lang"] = 357000,
["In_progress"] = 3200,
["In_string"] = 75000,
["In_title"] = 19000,
["Inactive_WikiProject_banner"] = 200000,
["Inactive_userpage_blanked"] = 4900,
["Include-USGov"] = 29000,
["Incomplete_list"] = 23000,
["Inconclusive"] = 2100,
["Increase"] = 43000,
["Incumbent_pope"] = 4300,
["Indent"] = 4400,
["IndexFungorum"] = 2200,
["Indian_English"] = 4300,
["Indian_Rupee"] = 10000,
["Indian_railway_code"] = 3200,
["Inflation"] = 21000,
["Inflation-fn"] = 5400,
["Inflation-year"] = 4500,
["Inflation/IN/startyear"] = 5600,
["Inflation/UK"] = 4400,
["Inflation/UK/dataset"] = 4400,
["Inflation/UK/startyear"] = 4400,
["Inflation/US"] = 12000,
["Inflation/US-GDP"] = 2400,
["Inflation/US-GDP/dataset"] = 2400,
["Inflation/US-GDP/startyear"] = 2400,
["Inflation/US/dataset"] = 12000,
["Inflation/US/startyear"] = 12000,
["Inflation/fn"] = 6200,
["Inflation/year"] = 25000,
["Info"] = 7300,
["Infobox"] = 3240000,
["Infobox/Columns"] = 2400,
["Infobox/mobileviewfix.css"] = 147000,
["Infobox3cols"] = 17000,
["Infobox_AFL_biography"] = 14000,
["Infobox_Aircraft_Begin"] = 5300,
["Infobox_Aircraft_Type"] = 4700,
["Infobox_Athletics_Championships"] = 2700,
["Infobox_Australian_place"] = 15000,
["Infobox_CFL_biography"] = 2200,
["Infobox_COA_wide"] = 3200,
["Infobox_Canada_electoral_district"] = 2500,
["Infobox_Canadian_Football_League_biography"] = 5700,
["Infobox_Canadian_Football_League_biography/position"] = 5700,
["Infobox_Chinese"] = 20000,
["Infobox_Chinese/Chinese"] = 2700,
["Infobox_Chinese/Footer"] = 8700,
["Infobox_Chinese/Header"] = 8700,
["Infobox_Chinese/Korean"] = 17000,
["Infobox_Christian_leader"] = 18000,
["Infobox_French_commune"] = 38000,
["Infobox_GAA_player"] = 2700,
["Infobox_Gaelic_games_player"] = 5000,
["Infobox_German_location"] = 13000,
["Infobox_German_place"] = 14000,
["Infobox_Grand_Prix_race_report"] = 2000,
["Infobox_Greece_place"] = 2800,
["Infobox_Greek_Dimos"] = 2800,
["Infobox_Hindu_temple"] = 2400,
["Infobox_Indian_constituency"] = 4700,
["Infobox_Indian_constituency/defaultdata"] = 4700,
["Infobox_Italian_comune"] = 8100,
["Infobox_Korean_name"] = 15000,
["Infobox_Korean_name/categories"] = 15000,
["Infobox_MLB_yearly"] = 3100,
["Infobox_NASCAR_race_report"] = 2200,
["Infobox_NCAA_team_season"] = 17000,
["Infobox_NFL_biography"] = 28000,
["Infobox_NFL_player"] = 7600,
["Infobox_NFL_team_season"] = 3900,
["Infobox_NRHP"] = 72000,
["Infobox_NRHP/conv"] = 18000,
["Infobox_NRHP/locmapin2region"] = 66000,
["Infobox_Officeholder"] = 4800,
["Infobox_Olympic_event"] = 7300,
["Infobox_Olympic_event/games_text"] = 7300,
["Infobox_Paralympic_event"] = 2600,
["Infobox_Paralympic_event/games_text"] = 2600,
["Infobox_Politician"] = 2200,
["Infobox_Romanian_subdivision"] = 3200,
["Infobox_Russian_district"] = 2000,
["Infobox_Russian_inhabited_locality"] = 4500,
["Infobox_SCOTUS_case"] = 3700,
["Infobox_Site_of_Special_Scientific_Interest"] = 2000,
["Infobox_Swiss_town"] = 2800,
["Infobox_Switzerland_municipality"] = 2900,
["Infobox_Turkey_place"] = 19000,
["Infobox_U.S._county"] = 3000,
["Infobox_U.S._county/district"] = 3000,
["Infobox_UK_constituency"] = 2100,
["Infobox_UK_constituency/year"] = 2100,
["Infobox_UK_legislation"] = 3300,
["Infobox_UK_place"] = 26000,
["Infobox_UK_place/NoDialCode"] = 8000,
["Infobox_UK_place/NoPostCode"] = 3200,
["Infobox_UK_place/area"] = 2400,
["Infobox_UK_place/dist"] = 2500,
["Infobox_UK_place/local"] = 26000,
["Infobox_UK_place/styles.css"] = 26000,
["Infobox_UN_resolution"] = 2300,
["Infobox_US_Supreme_Court_case"] = 3800,
["Infobox_US_Supreme_Court_case/courts"] = 3800,
["Infobox_Wikipedia_user"] = 9800,
["Infobox_YouTube_personality"] = 2700,
["Infobox_YouTube_personality/styles.css"] = 2700,
["Infobox_academic"] = 14000,
["Infobox_aircraft_begin"] = 14000,
["Infobox_aircraft_occurrence"] = 2300,
["Infobox_aircraft_type"] = 13000,
["Infobox_airline"] = 4600,
["Infobox_airport"] = 15000,
["Infobox_airport/datatable"] = 15000,
["Infobox_album"] = 162000,
["Infobox_album/color"] = 192000,
["Infobox_album/link"] = 162000,
["Infobox_anatomy"] = 4500,
["Infobox_ancient_site"] = 5400,
["Infobox_animanga/Footer"] = 6800,
["Infobox_animanga/Header"] = 6800,
["Infobox_animanga/Print"] = 5500,
["Infobox_animanga/Video"] = 4700,
["Infobox_architect"] = 3700,
["Infobox_artist"] = 29000,
["Infobox_artist_discography"] = 5900,
["Infobox_artwork"] = 11000,
["Infobox_athlete"] = 2800,
["Infobox_automobile"] = 8400,
["Infobox_award"] = 13000,
["Infobox_badminton_player"] = 3200,
["Infobox_baseball_biography"] = 28000,
["Infobox_baseball_biography/style"] = 28000,
["Infobox_baseball_biography/styles.css"] = 28000,
["Infobox_basketball_biography"] = 21000,
["Infobox_basketball_biography/style"] = 21000,
["Infobox_basketball_club"] = 3000,
["Infobox_beauty_pageant"] = 2400,
["Infobox_bilateral_relations"] = 4400,
["Infobox_body_of_water"] = 18000,
["Infobox_book"] = 52000,
["Infobox_boxer"] = 5700,
["Infobox_bridge"] = 6000,
["Infobox_building"] = 27000,
["Infobox_character"] = 7500,
["Infobox_chess_biography"] = 3900,
["Infobox_chess_player"] = 3200,
["Infobox_church"] = 15000,
["Infobox_church/denomination"] = 15000,
["Infobox_church/font_color"] = 15000,
["Infobox_civil_conflict"] = 2400,
["Infobox_civilian_attack"] = 5500,
["Infobox_college_coach"] = 12000,
["Infobox_college_football_game"] = 2100,
["Infobox_college_football_player"] = 2000,
["Infobox_college_sports_team_season"] = 40000,
["Infobox_college_sports_team_season/link"] = 40000,
["Infobox_college_sports_team_season/name"] = 40000,
["Infobox_college_sports_team_season/succession"] = 40000,
["Infobox_college_sports_team_season/team"] = 40000,
["Infobox_comic_book_title"] = 3000,
["Infobox_comics_character"] = 3600,
["Infobox_comics_creator"] = 3500,
["Infobox_comics_creator/styles.css"] = 3500,
["Infobox_company"] = 83000,
["Infobox_computing_device"] = 2400,
["Infobox_concert"] = 3300,
["Infobox_constituency"] = 5400,
["Infobox_country"] = 6400,
["Infobox_country/formernext"] = 6000,
["Infobox_country/imagetable"] = 5200,
["Infobox_country/multirow"] = 8300,
["Infobox_country/status_text"] = 2800,
["Infobox_country/styles.css"] = 6400,
["Infobox_country_at_games"] = 15000,
["Infobox_country_at_games/core"] = 15000,
["Infobox_country_at_games/see_also"] = 12000,
["Infobox_court_case"] = 4700,
["Infobox_court_case/images"] = 2400,
["Infobox_cricket_tournament"] = 2300,
["Infobox_cricketer"] = 32000,
["Infobox_cricketer/career"] = 32000,
["Infobox_cricketer/national_side"] = 7500,
["Infobox_criminal"] = 6400,
["Infobox_curler"] = 2600,
["Infobox_cycling_race_report"] = 4500,
["Infobox_cyclist"] = 16000,
["Infobox_dam"] = 5700,
["Infobox_designation_list"] = 20000,
["Infobox_designation_list/entry"] = 17000,
["Infobox_dim"] = 7000,
["Infobox_dim/core"] = 7000,
["Infobox_diocese"] = 3800,
["Infobox_drug"] = 9800,
["Infobox_drug/chemical_formula"] = 9800,
["Infobox_drug/data_page_link"] = 9800,
["Infobox_drug/formatATC"] = 9700,
["Infobox_drug/formatCASnumber"] = 9800,
["Infobox_drug/formatChEBI"] = 9800,
["Infobox_drug/formatChEMBL"] = 9800,
["Infobox_drug/formatChemDBNIAID"] = 9800,
["Infobox_drug/formatChemSpider"] = 9800,
["Infobox_drug/formatCompTox"] = 9800,
["Infobox_drug/formatDrugBank"] = 9800,
["Infobox_drug/formatIUPHARBPS"] = 9800,
["Infobox_drug/formatJmol"] = 9800,
["Infobox_drug/formatKEGG"] = 9800,
["Infobox_drug/formatPDBligand"] = 9100,
["Infobox_drug/formatPubChemCID"] = 9800,
["Infobox_drug/formatPubChemSID"] = 9800,
["Infobox_drug/formatUNII"] = 9800,
["Infobox_drug/legal_status"] = 10000,
["Infobox_drug/licence"] = 9800,
["Infobox_drug/maintenance_categories"] = 9800,
["Infobox_drug/non-ref-space"] = 4300,
["Infobox_drug/pregnancy_category"] = 9800,
["Infobox_drug/title"] = 9800,
["Infobox_election"] = 30000,
["Infobox_election/row"] = 30000,
["Infobox_election/shortname"] = 28000,
["Infobox_enzyme"] = 5100,
["Infobox_ethnic_group"] = 7300,
["Infobox_event"] = 5400,
["Infobox_family"] = 2100,
["Infobox_figure_skater"] = 4200,
["Infobox_film"] = 157000,
["Infobox_film/short_description"] = 153000,
["Infobox_film_awards"] = 2600,
["Infobox_film_awards/link"] = 2600,
["Infobox_film_awards/style"] = 2600,
["Infobox_food"] = 6900,
["Infobox_football_biography"] = 207000,
["Infobox_football_club"] = 27000,
["Infobox_football_club_season"] = 20000,
["Infobox_football_league"] = 2600,
["Infobox_football_league_season"] = 20000,
["Infobox_football_match"] = 5900,
["Infobox_football_tournament_season"] = 8000,
["Infobox_former_subdivision"] = 3300,
["Infobox_former_subdivision/styles.css"] = 3300,
["Infobox_galaxy"] = 2100,
["Infobox_game"] = 2600,
["Infobox_game_score"] = 3400,
["Infobox_gene"] = 13000,
["Infobox_given_name"] = 4100,
["Infobox_golfer"] = 4400,
["Infobox_golfer/highest_ranking"] = 4400,
["Infobox_government_agency"] = 10000,
["Infobox_government_cabinet"] = 2600,
["Infobox_gridiron_football_person"] = 2400,
["Infobox_gridiron_football_person/position"] = 5700,
["Infobox_gymnast"] = 3400,
["Infobox_handball_biography"] = 4900,
["Infobox_historic_site"] = 11000,
["Infobox_horseraces"] = 2600,
["Infobox_hospital"] = 6300,
["Infobox_hospital/care_system"] = 6300,
["Infobox_hospital/lists"] = 6300,
["Infobox_ice_hockey_biography"] = 20000,
["Infobox_ice_hockey_player"] = 19000,
["Infobox_ice_hockey_team"] = 3000,
["Infobox_ice_hockey_team_season"] = 2000,
["Infobox_international_football_competition"] = 5800,
["Infobox_islands"] = 8900,
["Infobox_islands/area"] = 9300,
["Infobox_islands/density"] = 9300,
["Infobox_islands/length"] = 8900,
["Infobox_islands/styles.css"] = 8900,
["Infobox_journal"] = 9700,
["Infobox_journal/Abbreviation_search"] = 9600,
["Infobox_journal/Bluebook_check"] = 9400,
["Infobox_journal/Former_check"] = 9400,
["Infobox_journal/ISO_4_check"] = 9400,
["Infobox_journal/ISSN-eISSN"] = 9500,
["Infobox_journal/Indexing_search"] = 9500,
["Infobox_journal/MathSciNet_check"] = 9400,
["Infobox_journal/NLM_check"] = 9400,
["Infobox_journal/frequency"] = 8600,
["Infobox_lake"] = 4200,
["Infobox_language"] = 9500,
["Infobox_language/family-color"] = 11000,
["Infobox_language/genetic"] = 6600,
["Infobox_language/linguistlist"] = 9500,
["Infobox_language/ref"] = 7100,
["Infobox_legislature"] = 3700,
["Infobox_library"] = 2200,
["Infobox_lighthouse"] = 2600,
["Infobox_lighthouse/light"] = 2600,
["Infobox_locomotive"] = 4900,
["Infobox_magazine"] = 7600,
["Infobox_manner_of_address"] = 3300,
["Infobox_mapframe"] = 81000,
["Infobox_martial_artist"] = 5700,
["Infobox_martial_artist/record"] = 5700,
["Infobox_medal_templates"] = 424000,
["Infobox_medical_condition"] = 10000,
["Infobox_medical_condition_(new)"] = 8200,
["Infobox_medical_details"] = 2000,
["Infobox_military_conflict"] = 22000,
["Infobox_military_installation"] = 9800,
["Infobox_military_person"] = 45000,
["Infobox_military_unit"] = 26000,
["Infobox_mine"] = 2100,
["Infobox_model"] = 2300,
["Infobox_monument"] = 2000,
["Infobox_mountain"] = 28000,
["Infobox_multi-sport_competition_event"] = 2400,
["Infobox_museum"] = 10000,
["Infobox_musical_artist"] = 121000,
["Infobox_musical_artist/color"] = 122000,
["Infobox_musical_artist/hCard_class"] = 313000,
["Infobox_musical_composition"] = 2900,
["Infobox_name"] = 7500,
["Infobox_name_module"] = 7000,
["Infobox_newspaper"] = 9700,
["Infobox_nobility"] = 2500,
["Infobox_noble"] = 7400,
["Infobox_officeholder"] = 220000,
["Infobox_officeholder/office"] = 225000,
["Infobox_official_post"] = 8100,
["Infobox_organization"] = 36000,
["Infobox_pageant_titleholder"] = 2900,
["Infobox_park"] = 7500,
["Infobox_person"] = 475000,
["Infobox_person/Wikidata"] = 4700,
["Infobox_person/height"] = 103000,
["Infobox_person/length"] = 7000,
["Infobox_person/weight"] = 66000,
["Infobox_philosopher"] = 3400,
["Infobox_planet"] = 4700,
["Infobox_play"] = 3900,
["Infobox_political_party"] = 14000,
["Infobox_power_station"] = 3000,
["Infobox_prepared_food"] = 3100,
["Infobox_professional_wrestler"] = 4300,
["Infobox_professional_wrestling_event"] = 2700,
["Infobox_protected_area"] = 14000,
["Infobox_protein_family"] = 2100,
["Infobox_publisher"] = 2400,
["Infobox_racehorse"] = 5500,
["Infobox_racing_driver"] = 3900,
["Infobox_racing_driver_series_section"] = 2000,
["Infobox_radio_station"] = 22000,
["Infobox_rail"] = 2900,
["Infobox_rail_line"] = 7300,
["Infobox_rail_service"] = 2900,
["Infobox_rail_service/doc"] = 2900,
["Infobox_reality_competition_season"] = 3500,
["Infobox_record_label"] = 4000,
["Infobox_recurring_event"] = 6400,
["Infobox_religious_biography"] = 5300,
["Infobox_religious_building"] = 12000,
["Infobox_religious_building/color"] = 17000,
["Infobox_restaurant"] = 2900,
["Infobox_river"] = 30000,
["Infobox_river/calcunit"] = 30000,
["Infobox_river/discharge"] = 30000,
["Infobox_river/row-style"] = 30000,
["Infobox_river/source"] = 30000,
["Infobox_road"] = 24000,
["Infobox_road/meta/mask/category"] = 24000,
["Infobox_road/meta/mask/country"] = 24000,
["Infobox_road/styles.css"] = 25000,
["Infobox_road_small"] = 2300,
["Infobox_rockunit"] = 6500,
["Infobox_royalty"] = 22000,
["Infobox_royalty/short_description"] = 12000,
["Infobox_rugby_biography"] = 16000,
["Infobox_rugby_biography/correct_date"] = 16000,
["Infobox_rugby_biography/depcheck"] = 16000,
["Infobox_rugby_league_biography"] = 9900,
["Infobox_rugby_league_biography/PLAYER"] = 9800,
["Infobox_rugby_team"] = 2600,
["Infobox_sailboat_specifications"] = 2300,
["Infobox_saint"] = 5000,
["Infobox_school"] = 38000,
["Infobox_school/short_description"] = 38000,
["Infobox_school_district"] = 5700,
["Infobox_school_district/styles.css"] = 5700,
["Infobox_scientist"] = 48000,
["Infobox_service_record"] = 2600,
["Infobox_settlement"] = 562000,
["Infobox_settlement/areadisp"] = 238000,
["Infobox_settlement/columns"] = 95000,
["Infobox_settlement/columns/styles.css"] = 95000,
["Infobox_settlement/densdisp"] = 437000,
["Infobox_settlement/impus"] = 82000,
["Infobox_settlement/lengthdisp"] = 169000,
["Infobox_settlement/link"] = 94000,
["Infobox_settlement/metric"] = 211000,
["Infobox_settlement/pref"] = 293000,
["Infobox_settlement/styles.css"] = 562000,
["Infobox_ship_begin"] = 41000,
["Infobox_ship_career"] = 37000,
["Infobox_ship_characteristics"] = 41000,
["Infobox_ship_class_overview"] = 4100,
["Infobox_ship_image"] = 40000,
["Infobox_shopping_mall"] = 3500,
["Infobox_short_story"] = 2400,
["Infobox_skier"] = 2500,
["Infobox_soap_character"] = 2900,
["Infobox_software"] = 14000,
["Infobox_software/simple"] = 14000,
["Infobox_song"] = 76000,
["Infobox_song/color"] = 76000,
["Infobox_song/link"] = 76000,
["Infobox_spaceflight"] = 3600,
["Infobox_spaceflight/styles.css"] = 3600,
["Infobox_sport_event"] = 2200,
["Infobox_sports_competition_event"] = 17000,
["Infobox_sports_competition_event/medalrow"] = 12000,
["Infobox_sports_league"] = 5000,
["Infobox_sports_season"] = 5400,
["Infobox_sports_team"] = 2200,
["Infobox_sportsperson"] = 106000,
["Infobox_stadium"] = 3500,
["Infobox_station"] = 55000,
["Infobox_station/doc"] = 55000,
["Infobox_station/services"] = 55000,
["Infobox_station/styles.css"] = 55000,
["Infobox_street"] = 3400,
["Infobox_swimmer"] = 9400,
["Infobox_television"] = 57000,
["Infobox_television/Short_description"] = 54000,
["Infobox_television_channel"] = 6200,
["Infobox_television_episode"] = 12000,
["Infobox_television_episode/styles.css"] = 12000,
["Infobox_television_season"] = 9500,
["Infobox_television_station"] = 3700,
["Infobox_tennis_biography"] = 10000,
["Infobox_tennis_event"] = 2500,
["Infobox_tennis_tournament_event"] = 19000,
["Infobox_tennis_tournament_year"] = 9200,
["Infobox_tennis_tournament_year/color"] = 28000,
["Infobox_tennis_tournament_year/footer"] = 28000,
["Infobox_train"] = 2300,
["Infobox_union"] = 2100,
["Infobox_university"] = 26000,
["Infobox_user"] = 2700,
["Infobox_venue"] = 18000,
["Infobox_video_game"] = 28000,
["Infobox_video_game/styles.css"] = 28000,
["Infobox_volleyball_biography"] = 5400,
["Infobox_weapon"] = 7300,
["Infobox_website"] = 7700,
["Infobox_writer"] = 39000,
["Information"] = 101000,
["Information/styles.css"] = 101000,
["Inline_block"] = 4600,
["Inprogress"] = 2400,
["Input_link"] = 32000,
["Instagram"] = 11000,
["Interlanguage_link"] = 156000,
["Interlanguage_link_multi"] = 19000,
["Internet_Archive_author"] = 19000,
["Internet_Archive_film"] = 2500,
["Intitle"] = 12000,
["Invalid_SVG"] = 3600,
["Invalid_SVG/styles.css"] = 3600,
["Iptalk"] = 17000,
["IranCensus2006"] = 46000,
["IranNCSGN"] = 3200,
["Iran_Census_2006"] = 46000,
["Irc"] = 2100,
["Irish_place_name"] = 2700,
["IsIPAddress"] = 38000,
["IsValidPageName"] = 142000,
["Is_country_in_Central_America"] = 13000,
["Is_country_in_the_Caribbean"] = 14000,
["Is_interwiki_link"] = 6100,
["Is_italic_taxon"] = 481000,
["Is_redirect"] = 27000,
["Isbn"] = 7600,
["Isfdb_name"] = 3700,
["Isfdb_title"] = 4400,
["Isnumeric"] = 212000,
["Iso2continent"] = 35000,
["Iso2country"] = 23000,
["Iso2country/article"] = 22000,
["Iso2country/data"] = 23000,
["Iso2nationality"] = 227000,
["Issubst"] = 72000,
["Isu_name"] = 2200,
["Italic_dab2"] = 5300,
["Italic_title"] = 284000,
["Italic_title_prefixed"] = 8700,
["Italics_colon"] = 3800,
["Italictitle"] = 4200,
["Ivm"] = 5700,
["Ivm/styles.css"] = 5700,
["Ivmbox"] = 123000,
["Ivory_messagebox"] = 143000,
["Module:I18n/complex_date"] = 66000,
["Module:IP"] = 131000,
["Module:IPA"] = 143000,
["Module:IPA/data"] = 128000,
["Module:IPA/styles.css"] = 114000,
["Module:IPA_symbol"] = 4800,
["Module:IPA_symbol/data"] = 4800,
["Module:IPAc-en"] = 48000,
["Module:IPAc-en/data"] = 48000,
["Module:IPAc-en/phonemes"] = 48000,
["Module:IPAc-en/pronunciation"] = 48000,
["Module:IPAddress"] = 188000,
["Module:ISO_3166"] = 1040000,
["Module:ISO_3166/data/AT"] = 2500,
["Module:ISO_3166/data/BA"] = 3400,
["Module:ISO_3166/data/CA"] = 2500,
["Module:ISO_3166/data/CN"] = 2100,
["Module:ISO_3166/data/DE"] = 14000,
["Module:ISO_3166/data/ES"] = 3600,
["Module:ISO_3166/data/FR"] = 38000,
["Module:ISO_3166/data/GB"] = 6400,
["Module:ISO_3166/data/GR"] = 3100,
["Module:ISO_3166/data/IN"] = 29000,
["Module:ISO_3166/data/IR"] = 8800,
["Module:ISO_3166/data/National"] = 1040000,
["Module:ISO_3166/data/PL"] = 6700,
["Module:ISO_3166/data/RS"] = 3200,
["Module:ISO_3166/data/RU"] = 25000,
["Module:ISO_3166/data/US"] = 85000,
["Module:ISO_639_name"] = 20000,
["Module:ISOdate"] = 66000,
["Module:Icon"] = 582000,
["Module:Icon/data"] = 582000,
["Module:If_empty"] = 3670000,
["Module:If_in_page"] = 10000,
["Module:If_preview"] = 296000,
["Module:If_preview/configuration"] = 296000,
["Module:If_preview/styles.css"] = 296000,
["Module:Import_style"] = 11000,
["Module:In_lang"] = 357000,
["Module:Indent"] = 4400,
["Module:Infobox"] = 4110000,
["Module:Infobox/dates"] = 69000,
["Module:Infobox/styles.css"] = 4370000,
["Module:Infobox3cols"] = 297000,
["Module:InfoboxImage"] = 4430000,
["Module:Infobox_body_of_water_tracking"] = 18000,
["Module:Infobox_cyclist_tracking"] = 16000,
["Module:Infobox_gene"] = 13000,
["Module:Infobox_mapframe"] = 406000,
["Module:Infobox_military_conflict"] = 22000,
["Module:Infobox_military_conflict/styles.css"] = 22000,
["Module:Infobox_multi-lingual_name"] = 20000,
["Module:Infobox_multi-lingual_name/data"] = 20000,
["Module:Infobox_power_station"] = 3100,
["Module:Infobox_road"] = 25000,
["Module:Infobox_road/browselinks"] = 25000,
["Module:Infobox_road/errors"] = 24000,
["Module:Infobox_road/length"] = 25000,
["Module:Infobox_road/locations"] = 24000,
["Module:Infobox_road/map"] = 25000,
["Module:Infobox_road/route"] = 25000,
["Module:Infobox_road/sections"] = 24000,
["Module:Infobox_television"] = 57000,
["Module:Infobox_television_disambiguation_check"] = 63000,
["Module:Infobox_television_episode"] = 12000,
["Module:Infobox_television_season_disambiguation_check"] = 9000,
["Module:Infobox_television_season_name"] = 9500,
["Module:Internet_Archive"] = 19000,
["Module:IrelandByCountyCatNav"] = 3300,
["Module:Is_infobox_in_lead"] = 377000,
["Module:Is_instance"] = 336000,
["Module:Italic_title"] = 1120000,
["Module:Italic_title2"] = 5300,
}
d316bc1ba95abf959ff5706924dd1220d6b1987d
Template:Infobox/doc
10
11
266
108
2023-10-17T17:45:14Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox/doc]]
wikitext
text/x-wiki
{{distinguish|Template:Userbox}}
{{Documentation subpage}}
{{Lua|Module:Infobox}}
{{Parameter names example
|name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
|image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>......
|header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div>
|label2={{{label1}}} |data2={{{data1}}}
|data3=( ''or'' ) |data4=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data1}}}</div>
|header5={{{header2}}}<br/><div style="padding:0.75em 0 0.5em;">{{nobold|( ''or'' )}}</div>
|label6={{{label2}}} |data6={{{data2}}}
|data7=( ''or'' ) |data8=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data2}}}</div>
|data9=<div style="padding:0.75em 0 0.5em;">( ''etc'' )</div>
|below
}}
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[Help:Infobox]] contains an introduction about the recommended content and design of infoboxes; [[Wikipedia:Manual of Style/Infoboxes]] contains additional style guidelines. See [[WP:List of infoboxes]] and [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
== Usage ==
Usage is similar to {{tl|navbox}}, but with an additional distinction. Each row on the table can contain either a header, or a label/data pair, or just a data cell. These are mutually exclusive states so if you define a row with both a header and a label/data pair, the label/data pair is ignored.
To insert an image somewhere other than at the top of the infobox, or to insert freeform data, use a row with only a data field.
== Optional control parameters ==
; name : If this parameter is present, "view/discuss/edit" links will be added to the bottom of the infobox, pointing to the named page. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however this is rarely what you want, because it will send users clicking these links in an infobox in an article to the template code rather than the data in the infobox that they probably want to change.
; child : See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
; subbox : See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
== Content parameters ==
=== Title ===
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts as a caption it on top of the table. You can use both of them together if you like, or just one or the other, or even neither (though this is not recommended):
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For [[Wikipedia:Manual of Style/Accessibility#Tables|accessibility reasons]], this is the most recommended alternative.
; above : Text to put within the uppermost cell of the table.
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
Examples:
{{Infobox
| name = Infobox/doc
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
{{Infobox
| name = Infobox/doc
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
=== Illustration images ===
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default. See [[WP:ALT]] for more on alt text.
; caption(n) : Text to put underneath the images.
=== Main data ===
; header(n) : Text to use as a header in row n.
; label(n) : Text to use as a label in row n.
; data(n) : Text to display as data in row n.
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a {{para|header''(n)''}} will cause the corresponding {{para|data''(n)''}} (and {{para|rowclass''(n)''}} {{para|label''(n)''}}, see below) to be ignored; the absence of a {{para|data''(n)''}} will cause the corresponding {{para|label''(n)''}} to be ignored. Valid combinations for any single row are:
* {{para|class''(n)''}} {{para|header''(n)''}}
* {{para|rowclass''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
* {{para|rowclass''(n)''}} {{para|label''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
==== Number ranges ====
To allow flexibility when the layout of an infobox is changed, it may be helpful when developing an infobox to use non-contiguous numbers for header and label/data rows. Parameters for new rows can then be inserted in future without having to renumber existing parameters. For example:
<pre style="overflow:auto">
| header3 = Section 1
| label5 = Label A
| data5 = Data A
| label7 = Label C
| data7 = Data C
| header10 = Section 2
| label12 = Label D
| data12 = Data D
</pre>{{clear}}
It is also possible to automatically renumber parameter names by using [[User:Frietjes/infoboxgap.js]] or [[Module:IncrementParams]].
==== Making data fields optional ====
A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:
<pre style="overflow:auto">
| label5 = Population
| data5 = {{{population|}}}
</pre>{{clear}}
This way if an article doesn't define the population parameter in its infobox the row won't be displayed.
For more complex fields with pre-formatted contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter ''mass'' has been supplied |then display it, followed by 'kg'":
<pre style="overflow:auto">
| label6 = Mass
| data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}
</pre>{{clear}}
For more on #if, see [[meta:ParserFunctions##if:|here]].
==== Hiding headers when all data fields are hidden ====
You can also make headers optional in a similar way. Consider this example:
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
If you want the first header to appear only if one or more of the data fields that fall under it are filled, one could use the following pattern as an example of how to do it:
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no emty row appears before the next static content. The trick to this is that the "#if" returns false only if there is nothing whatsoever in the conditional section, so only if all three of item1, item2 and item3 are undefined will the if statement fail.
Note that such trick may be sometimes very complex to test if there are many data items whose value depends on complex tests (or when a data row is generated by a recursive invokation of this template as a [[#Subboxes|subbox]]). Ideally, the Lua module supporting this template should now support a new way to make each header row autohideable by detecting if there is at least one non-empty data row after that header row (a parameter like "autohide header1 = yes", for example, would remove the need to perform the "#if" test so that we can just to define "header1 = Optional header"),
=== Footer ===
; below : Text to put in the bottom cell. The bottom cell is intended for footnotes, see-also, and other such information.
== Presentation parameters ==
=== Italic titles ===
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
* Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{para|italic title|<nowiki>{{{italic title|no}}}</nowiki>}}
* Do not make any titles italic by not passing the parameter at all.
=== CSS styling ===
; bodystyle : Applies to the infobox table as a whole
; titlestyle : Applies only to the title caption. Adding a background color is usually inadvisable since the text is rendered "outside" the infobox.
; abovestyle : Applies only to the "above" cell at the top. The default style has font-size:125%; since this cell is usually used for a title, if you want to use the above cell for regular-sized text include "font-size:100%;" in the abovestyle.
; imagestyle : Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
; captionstyle : Applies to the text of the image caption.
; rowstyle(n) : This parameter is inserted into the <code>style</code> attribute for the specified row.
; headerstyle : Applies to all header cells
; labelstyle : Applies to all label cells
; datastyle : Applies to all data cells
; belowstyle : Applies only to the below cell
=== HTML classes and microformats ===
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
<!-- currently not implemented in Lua module
; aboverowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''above''' cell is on.
-->
; aboveclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''above''' cell.
; subheaderrowclass(n) : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''subheader''' is on.
; subheaderclass(n) : This parameter is inserted into the <code>class</code> attribute for the infobox's '''subheader'''.
; imagerowclass(n) : These parameters are inserted into the <code>class</code> attribute for the complete table row their respective '''image''' is on.
; imageclass : This parameter is inserted into the <code>class</code> attribute for the '''image'''.
; rowclass(n) : This parameter is inserted into the <code>class</code> attribute for the specified row including the '''label''' and '''data''' cells.
; class(n) : This parameter is inserted into the <code>class</code> attribute for the '''data''' cell of the specified row. If there's no '''data''' cell it has no effect.
<!-- currently not implemented in Lua module
; belowrowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''below''' cell is on.
-->
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others beig used for microformats.
To flag an infobox as containing [[hCard]] information, for example, add the following parameter:
<pre style="overflow:auto">
| bodyclass = vcard
</pre>{{clear}}
And for each row containing a data cell that's part of the vcard, add a corresponding class parameter:
<pre style="overflow:auto">
| class1 = fn
| class2 = org
| class3 = tel
</pre>{{clear}}
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
== Examples ==
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
{{Infobox
|name = Infobox/doc
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
<pre style="overflow:auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
| image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
</pre>{{clear}}
For this example, the '''bodystyle''' and '''labelstyle''' parameters are used to adjust the infobox width and define a default width for the column of labels:
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
<pre style="overflow: auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
</pre>{{clear}}
== Embedding ==
<!--Linked from [[Template:Subinfobox bodystyle/doc]]-->
One infobox template can be embedded into another using the {{para|child}} parameter or the {{para|embed}} parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note, in the examples above, the child infobox is placed in a <code>data</code> field, not a <code>header</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a '''header''' field (but not in a '''label''' field because it would not be displayed!), either using
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
or,
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note that omitting the {{para|title}} parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation.
[[Wikipedia:WikiProject Infoboxes/embed]] includes some links to Wikipedia articles which include infoboxes embedded within other infoboxes.
== Subboxes ==
An alternative method for embedding is to use {{para|subbox|yes}}, which removes the outer border from the infobox, but preserves the interior structure. One feature of this approach is that the parent and child boxes need not have the same structure, and the label and data fields are not aligned between the parent and child boxes because they are not in the same parent table.
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
<source lang="sass" style="overflow:auto">
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
</source>{{clear}}
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
<source lang="sass" style="overflow:auto">
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
</source>{{clear}}
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
== Controlling line-breaking in embedded bulletless lists ==
Template {{tlx|nbsp}} may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists embedded in infoboxes (e.g. cast list in {{tlx|Infobox film}}), to prevent wrapped long entries from being confused with multiple entries. See [[Template:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
== Full blank syntax ==
(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| child = {{{child|}}}
| subbox = {{{subbox|}}}
| italic title = {{{italic title|no}}}
| bodystyle =
| titlestyle =
| abovestyle =
| subheaderstyle =
| title =
| above =
| subheader =
| imagestyle =
| captionstyle =
| image =
| caption =
| image2 =
| caption2 =
| headerstyle =
| labelstyle =
| datastyle =
| header1 =
| label1 =
| data1 =
| header2 =
| label2 =
| data2 =
| header3 =
| label3 =
| data3 =
| header4 =
| label4 =
| data4 =
| header5 =
| label5 =
| data5 =
| header6 =
| label6 =
| data6 =
| header7 =
| label7 =
| data7 =
| header8 =
| label8 =
| data8 =
| header9 =
| label9 =
| data9 =
| header10 =
| label10 =
| data10 =
| header11 =
| label11 =
| data11 =
| header12 =
| label12 =
| data12 =
| header13 =
| label13 =
| data13 =
| header14 =
| label14 =
| data14 =
| header15 =
| label15 =
| data15 =
| header16 =
| label16 =
| data16 =
| header17 =
| label17 =
| data17 =
| header18 =
| label18 =
| data18 =
| header19 =
| label19 =
| data19 =
| header20 =
| label20 =
| data20 =
| belowstyle =
| below =
}}
</pre>{{clear}}
{{Help:Infobox/user style}}
== Porting to other MediaWikis ==
The infobox template requires the [[:mw:Extension:Scribunto|Scribunto]] extension and [[mw:Manual:Using content from Wikipedia#HTMLTidy|HTMLTidy]] to be installed. It may not work with other MediaWikis. [[Wikipedia:WikiProject Transwiki|WikiProject Transwiki]] has a version of this template that has been modified to work on other MediaWikis.
==See also==
* [[Module:Infobox]], the [[WP:LUA|Lua]] module on which this template is based
* [[Special:Permalink/558855956|Template:Infobox/old]], the previous ParserFunctions implementation
* {{tl|Infobox3cols}}
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[Wikipedia:List of infoboxes|List of infoboxes]]
* [[:Module:InfoboxImage]]
* Maintenance categories:
** [[:Category:Articles which use infobox templates with no data rows]]
** [[:Category:Pages which use embedded infobox templates with the title parameter]]
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[Category:Infobox templates| ]]
[[Category:Wikipedia metatemplates|Infobox]]
[[Category:Templates generating microformats]]
}}</includeonly>
c767a15bb58ea62ebebf6e3e4e3579c68465da04
Help:Infobox/user style
12
87
268
267
2023-10-17T17:45:15Z
LamayII
2
1 revision imported from [[:wikipedia:Help:Infobox/user_style]]
wikitext
text/x-wiki
{{{heading|
==Infoboxes and user style ==
}}}
Users can have [[WP:User style|user CSS]] that hides<!--, moves, or makes collapsible--> any infoboxes in their own browsers.
To hide all infoboxes, add the following to [[Special:MyPage/common.css]] (for all [[WP:Skin|skins]], or [[Special:MyPage/skin.css]] for just the current skin), on a line by itself:
<syntaxhighlight lang="css">div.mw-parser-output .infobox { display: none; }</syntaxhighlight>
Alternatively, you can add the following code to [[Special:MyPage/common.js|your common.js]] or into a browser user script that is executed by an extension like [[Greasemonkey]]:
<syntaxhighlight lang="js">$('.infobox').hide();</syntaxhighlight>
Be aware that although{{#if:{{{guideline|}}}||, per [[WP:Manual of Style/Infoboxes]],}} all information in an infobox ideally should also be found in the main body of an article, there isn't perfect compliance with this guideline. For example, the full taxonomic hierarchy in {{tlx|Taxobox}}, and the OMIM and other medical database codes of {{tlx|Infobox disease}} are often not found in the main article content. The infobox is also often the location of the most significant, even only, image in an article. There is a userscript which removes infoboxes but moves the images contained to separate thumbnails: [[User:Maddy from Celeste/disinfobox.js]].<!--
Needs Special:Mypage/common.js options for:
* Making infoboxes collapsible
** Making them auto-collapsed
* Moving infoboxes to bottom of page
--><noinclude>
{{Documentation|content=
This documentation snippet is transcluded at [[Help:Infobox]], [[Template:Infobox/doc]], [[WP:Customisation#Hiding specific messages]], [[Help:User style]], [[WP:Manual of Style/Infoboxes]], and other places where this information is relevant.
As a template, this snippet takes a {{para|heading}} parameter to replace the level-2 <code>==Infoboxes and user style==</code> section heading code, as needed. E.g., for a <code>=== ... ===</code> level-3 heading: <code><nowiki>heading={{=}}{{=}}{{=}}Infoboxes and user style{{=}}{{=}}{{=}}</nowiki></code>
}}
</noinclude>
ba4dac68eb2bdc49a32f2a11b9afd52381bf06b5
Module:Message box/ombox.css
828
28
270
110
2023-10-17T17:45:15Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Message_box/ombox.css]]
sanitized-css
text/css
/* {{pp|small=y}} */
.ombox {
margin: 4px 0;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
/* For the "small=yes" option. */
.ombox.mbox-small {
font-size: 88%;
line-height: 1.25em;
}
.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ombox-delete {
border: 2px solid #b32424; /* Red */
}
.ombox-content {
border: 1px solid #f28500; /* Orange */
}
.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
.ombox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.9em;
width: 100%;
}
.ombox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.ombox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ombox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ombox .mbox-invalid-type {
text-align: center;
}
@media (min-width: 720px) {
.ombox {
margin: 4px 10%;
}
.ombox.mbox-small {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
width: 238px;
}
}
8fe3df4bb607e699eab2dbd23bd4a1a446391002
Template:Hlist/styles.css
10
88
272
271
2023-10-17T17:45:16Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Hlist/styles.css]]
sanitized-css
text/css
/* {{pp-protected|reason=match parent|small=yes}} */
/*
* hlist styles are defined in core and Minerva and differ in Minerva. The
* current definitions here (2023-01-01) are sufficient to override Minerva
* without use of the hlist-separated class. The most problematic styles were
* related to margin, padding, and the bullet. Check files listed at
* [[MediaWiki talk:Common.css/to do#hlist-separated]]
*/
/*
* TODO: When the majority of readership supports it (or some beautiful world
* in which grade C support is above the minimum threshold), use :is()
*/
.hlist dl,
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
/*
* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again
* We also want to reset margin-right in Minerva
*/
margin: 0;
display: inline;
}
/* Display requested top-level lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
/* Display nested lists inline */
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li {
display: none;
}
/* TODO: :not() can maybe be used here to remove the later rule. naive test
* seems to work. more testing needed. like so:
*.hlist dt:not(:last-child)::after {
* content: ": ";
*}
*.hlist dd:not(:last-child)::after,
*.hlist li:not(:last-child)::after {
* content: " · ";
* font-weight: bold;
*}
*/
/* Generate interpuncts */
.hlist dt::after {
content: ": ";
}
.hlist dd::after,
.hlist li::after {
content: " · ";
font-weight: bold;
}
.hlist dd:last-child::after,
.hlist dt:last-child::after,
.hlist li:last-child::after {
content: none;
}
/* Add parentheses around nested lists */
.hlist dd dd:first-child::before,
.hlist dd dt:first-child::before,
.hlist dd li:first-child::before,
.hlist dt dd:first-child::before,
.hlist dt dt:first-child::before,
.hlist dt li:first-child::before,
.hlist li dd:first-child::before,
.hlist li dt:first-child::before,
.hlist li li:first-child::before {
content: " (";
font-weight: normal;
}
.hlist dd dd:last-child::after,
.hlist dd dt:last-child::after,
.hlist dd li:last-child::after,
.hlist dt dd:last-child::after,
.hlist dt dt:last-child::after,
.hlist dt li:last-child::after,
.hlist li dd:last-child::after,
.hlist li dt:last-child::after,
.hlist li li:last-child::after {
content: ")";
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.hlist ol {
counter-reset: listitem;
}
.hlist ol > li {
counter-increment: listitem;
}
.hlist ol > li::before {
content: " " counter(listitem) "\a0";
}
.hlist dd ol > li:first-child::before,
.hlist dt ol > li:first-child::before,
.hlist li ol > li:first-child::before {
content: " (" counter(listitem) "\a0";
}
8c9dd9c9c00f30eead17fe10f51d183333e81f33
Module:Redirect
828
89
274
273
2023-10-17T17:54:14Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Redirect]]
Scribunto
text/plain
-- This module provides functions for getting the target of a redirect page.
local p = {}
-- Gets a mw.title object, using pcall to avoid generating script errors if we
-- are over the expensive function count limit (among other possible causes).
local function getTitle(...)
local success, titleObj = pcall(mw.title.new, ...)
if success then
return titleObj
else
return nil
end
end
-- Gets the name of a page that a redirect leads to, or nil if it isn't a
-- redirect.
function p.getTargetFromText(text)
local target = string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]"
) or string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]"
)
return target and mw.uri.decode(target, 'PATH')
end
-- Gets the target of a redirect. If the page specified is not a redirect,
-- returns nil.
function p.getTarget(page, fulltext)
-- Get the title object. Both page names and title objects are allowed
-- as input.
local titleObj
if type(page) == 'string' or type(page) == 'number' then
titleObj = getTitle(page)
elseif type(page) == 'table' and type(page.getContent) == 'function' then
titleObj = page
else
error(string.format(
"bad argument #1 to 'getTarget'"
.. " (string, number, or title object expected, got %s)",
type(page)
), 2)
end
if not titleObj then
return nil
end
local targetTitle = titleObj.redirectTarget
if targetTitle then
if fulltext then
return targetTitle.fullText
else
return targetTitle.prefixedText
end
else
return nil
end
end
--[[
-- Given a single page name determines what page it redirects to and returns the
-- target page name, or the passed page name when not a redirect. The passed
-- page name can be given as plain text or as a page link.
--
-- Returns page name as plain text, or when the bracket parameter is given, as a
-- page link. Returns an error message when page does not exist or the redirect
-- target cannot be determined for some reason.
--]]
function p.luaMain(rname, bracket, fulltext)
if type(rname) ~= "string" or not rname:find("%S") then
return nil
end
bracket = bracket and "[[%s]]" or "%s"
rname = rname:match("%[%[(.+)%]%]") or rname
local target = p.getTarget(rname, fulltext)
local ret = target or rname
ret = getTitle(ret)
if ret then
if fulltext then
ret = ret.fullText
else
ret = ret.prefixedText
end
return bracket:format(ret)
else
return nil
end
end
-- Provides access to the luaMain function from wikitext.
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
return p.luaMain(args[1], args.bracket, args.fulltext) or ''
end
-- Returns true if the specified page is a redirect, and false otherwise.
function p.luaIsRedirect(page)
local titleObj = getTitle(page)
if not titleObj then
return false
end
if titleObj.isRedirect then
return true
else
return false
end
end
-- Provides access to the luaIsRedirect function from wikitext, returning 'yes'
-- if the specified page is a redirect, and the blank string otherwise.
function p.isRedirect(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
if p.luaIsRedirect(args[1]) then
return 'yes'
else
return ''
end
end
return p
a224c45940343d66f49a78b0a39b2045e2c45d20
Template:Icon
10
90
276
275
2023-10-17T17:54:17Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Icon]]
wikitext
text/x-wiki
{{#invoke:Icon|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
bd5b855953c5eec9d9c48400aa39315cb4218558
Template:Navbox
10
91
278
277
2023-10-17T17:54:18Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Navbox]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Navbox|navbox}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
fe9b964401f895918ee4fe078678f1722a3c41ec
Module:Icon
828
92
280
279
2023-10-17T17:54:20Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Icon]]
Scribunto
text/plain
-- This module implements [[Template:Icon]].
require("strict")
local yesNo = require("Module:Yesno")
local getArgs = require("Module:Arguments").getArgs
local getPlain = nil
local p = {}
-- Determine whether we're being called from a sandbox
local sandbox = mw.getCurrentFrame():getTitle():find('sandbox', 1, true) and '/sandbox' or ''
-- Implements [[Template:Icon]]
-- Returns the icon image corresponding to a string (like 'B')
function p._main(args, data)
local data_module = 'Module:Icon/data'..sandbox
data = data or mw.loadData(data_module)
local code = args.class or args[1]
local iconData
if code then
code = code:match('^%s*(.-)%s*$'):lower() -- trim whitespace and put in lower case
iconData = data[code]
end
if not iconData then
iconData = data._DEFAULT
end
return string.format(
'[[File:%s%s%s|%s|class=noviewer|alt=%s]]',
iconData.image,
iconData.tooltip and '|' .. iconData.tooltip or '',
iconData.link == false and '|link=' or '',
args.size or '16x16px',
iconData.alt or ''
)
end
-- Implements [[Template:Icon link]], a superset of [[Template:Icon]]
-- Returns an icon, plus a suitably formatted wikilink
function p._link(args, data)
args.size = args.size or args.iconsize
local icon = p._main(args, data)
-- If no link given in args[2], default back to [[Template:Icon]]
if not args[2] then
return icon
end
-- Strip wiki markup out of link
getPlain = getPlain or require("Module:Text").Text().getPlain
local link = getPlain(args[2])
local display = args[3] or args[2]
-- italicize display string, if requested
if yesNo(args.i) or yesNo(args.italic) or yesNo(args.italics) then
display = '<i>'..display..'</i>'
end
-- if display is link, just use standard wlink
if link == display then
return icon..' [['..link..']]'
end
return icon..' [['..link..'|'..display..']]'
end
function p.main(frame)
local args = getArgs(frame,{parentFirst=true})
return p._main(args)
end
function p.link(frame)
local args = getArgs(frame,{parentFirst=true})
return p._link(args)
end
return p
7688d9a465bd7c4caa51f7e5c02676c162d583f5
Module:Icon/data
828
93
282
281
2023-10-17T17:54:21Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Icon/data]]
Scribunto
text/plain
-- This module stores icon data for [[Module:Icon]].
--------------------------------------------------------------------------------
-- Icon data
--------------------------------------------------------------------------------
local data = {
fa = {
image = "Featured article star.svg",
tooltip = "Featured article",
link = true,
},
far = {
image = "Cscr-star piece.png",
tooltip = "Featured article review",
link = true,
},
farc = {
image = "Cscr-star piece.png",
tooltip = "Featured article removal candidate",
link = true,
},
ffa = {
aliases = {"dfa"},
image = "Featured article star - cross.svg",
tooltip = "Former featured article",
link = true,
},
fac = {
aliases = {"fan"},
image = "Cscr-candidate.svg",
tooltip = "Featured article candidate",
link = true,
},
ffac = {
aliases = {"nofa"},
image = "Featured article star - cross.svg",
tooltip = "Failed featured article candidate",
link = true,
},
fl = {
image = "Featured article star.svg",
tooltip = "Featured list",
link = true,
},
flrc = {
aliases = {"flr"},
image = "Cscr-star piece.png",
tooltip = "Featured list removal candidate",
link = true,
},
ffl = {
aliases = {"dfl"},
image = "Cscr-featured-strike.svg",
tooltip = "Former featured list",
link = true,
},
flc = {
aliases = {"fln"},
image = "Cscr-candidate.svg",
tooltip = "Featured list candidate",
link = true,
},
fflc = {
aliases = {"nofl"},
image = "Cscr-former.svg",
tooltip = "Failed featured list candidate",
link = true,
},
a = {
image = "Symbol a class.svg",
tooltip = "A-Class article",
link = true,
},
dac = {
aliases = {"daa"},
image = "Symbol unsupport A vote.svg",
tooltip = "Demoted A-Class article",
link = true,
},
acc = {
aliases = {"acn", "aac"},
image = "A candidate.svg",
tooltip = "A-Class article candidate",
link = true,
},
noac = {
aliases = {"faac"},
image = "Symbol unsupport A vote.svg",
tooltip = "Failed A-Class article candidate",
link = true,
},
ga = {
image = "Symbol support vote.svg",
tooltip = "Good article",
link = false,
},
gar = {
image = "GA Candidate Neutral vote(ChaosNil).svg",
tooltip = "Good article reassessment",
link = false,
},
dga = {
image = "Symbol unsupport vote.svg",
tooltip = "Delisted good article",
link = false,
},
gan = {
aliases = {"gac"},
image = "GA candidate.svg",
tooltip = "Good article nominee",
link = false,
},
ga2 = {
image = "Symbol neutral vote.svg",
tooltip = "Good article, 2nd opinion",
link = false,
},
gah = {
image = "Symbol wait.svg",
tooltip = "Good article on hold",
link = false,
},
fgan = {
aliases = {"noga", "gaf", "gf"},
image = "Symbol oppose vote.svg",
tooltip = "Failed good article nominee",
link = false,
},
fp = {
image = "Cscr-featured.svg",
tooltip = "Featured picture",
link = true,
},
fpc = {
aliases = {"fpn"},
image = "Cscr-candidate.svg",
tooltip = "Featured picture candidate",
link = true,
},
ffp = {
image = "Cscr-former.svg",
tooltip = "Former featured picture",
link = true,
},
vp = {
image = "ENWP VP Logo.svg",
tooltip = "Valued picture",
link = true,
},
vpc = {
image = "Valued pics 1.svg",
tooltip = "Valued picture candidate",
link = true,
},
fs = {
image = "Cscr-featured.svg",
tooltip = "Featured sound",
link = true,
},
ffs = {
image = "Cscr-former.svg",
tooltip = "Former featured sound",
link = true,
},
fsc = {
image = "Cscr-candidate.svg",
tooltip = "Featured sound candidate",
link = true,
},
fpo = {
image = "Linecons big-star.svg",
tooltip = "Before the featured portal process ceased in 2017, this had been designated as a featured portal.",
link = true,
},
fpor = {
image = "Cscr-star piece.png",
tooltip = "Featured portal review",
link = true,
},
ffpo = {
image = "Featured article star - cross.svg",
tooltip = "Former featured portal",
link = true,
},
fpoc = {
image = "Cscr-candidate.svg",
tooltip = "Featured portal candidate",
link = true,
},
ft = {
image = "Cscr-featuredtopic.svg",
tooltip = "Featured topic",
link = true,
},
ftrc = {
image = "Cscr-star piece.png",
tooltip = "Featured topic removal candidate",
link = true,
},
fft = {
aliases = {"dft"},
image = "DFT candidate_cluster.svg",
tooltip = "Former featured topic",
link = true,
},
ftc = {
aliases = {"ftn"},
image = "FT candidate cluster.svg",
tooltip = "Featured topic candidate",
link = false,
},
gt = {
image = "Support cluster.svg",
tooltip = "Good topic",
link = false,
},
gtrc = {
image = "Symbol unsupport vote.svg",
tooltip = "Good topic removal candidate",
link = false,
},
gtc = {
aliases = {"gtn"},
image = "GA candidate cluster.svg",
tooltip = "Good topic candidate",
link = false,
},
bplus = {
aliases = {"b+"},
image = "Symbol bplus class.svg",
tooltip = "Bplus-Class article",
link = true,
},
b = {
image = "Symbol b class.svg",
tooltip = "B-Class article",
link = true,
},
br = {
aliases = {"bcr"},
image = "Bclass-checklist.svg",
tooltip = "B-Class review",
link = true,
},
c = {
image = "Symbol c class.svg",
tooltip = "C-Class article",
link = true,
},
start = {
image = "Symbol start class.svg",
tooltip = "Start-Class article",
link = true,
},
stub = {
image = "Symbol stub class.svg",
tooltip = "Stub-Class article",
link = true,
},
list = {
aliases = {"comparison"},
image = "Symbol list class.svg",
tooltip = "List-Class article",
link = false,
},
no = {
image = "Crystal button cancel.svg",
tooltip = "Unknown-Class article",
link = true,
},
book = {
image = "Symbol book class2.svg",
tooltip = "Wikipedia book",
link = true,
},
category = {
aliases = {"cat", "categ"},
image = "Symbol category class.svg",
tooltip = "Category",
link = false,
},
disambiguation = {
aliases = {"dab", "disamb", "disambig"},
image = "Symbol dab class.svg",
tooltip = "Disambiguation page",
link = true,
},
image = {
aliases = {"file"},
image = "Symbol file class.svg",
tooltip = "File",
link = true,
},
needed = {
image = "Symbol needed class.svg",
tooltip = "Needed article",
link = false,
},
outline = {
image = "Global thinking.svg",
tooltip = "Outline",
link = false,
},
portal = {
image = "Symbol portal class.svg",
tooltip = "Portal",
link = true,
},
project = {
image = "Symbol project class.svg",
tooltip = "Project page",
link = false,
},
redirect = {
aliases = {"red", "redir"},
image = "Symbol redirect vote2.svg",
tooltip = "Redirect",
link = true,
},
template = {
aliases = {"temp", "templ"},
image = "Symbol template class.svg",
tooltip = "Template",
link = false,
},
essay = {
image = "Essay.svg",
tooltip = "Essay",
link = false,
},
na = {
image = "Symbol na class.svg",
tooltip = "Non-article page",
link = true,
},
aa = {
image = "Yes check.svg",
tooltip = "Audited article of limited subject matter",
link = false,
},
da = {
image = "Symbol oppose vote.svg",
tooltip = "Demoted article",
link = false,
},
dyk = {
image = "Symbol question.svg",
tooltip = "Did You Know?",
link = false,
},
dyk2 = {
image = "DYK questionmark icon.svg",
tooltip = "Did You Know?",
link = false,
},
pr = {
image = "Nuvola apps kedit.png",
tooltip = "Peer review",
link = true,
},
ppr = {
image = "Nuvola apps kedit.png",
tooltip = "Portal peer review",
link = true,
},
q = {
aliases = {"question"},
image = "Symbol question.svg",
tooltip = "Question",
link = false,
},
cleanup = {
image = "Edit-clear.svg",
tooltip = "Cleanup work",
link = false,
},
qi = {
image = "Quality images logo.svg",
tooltip = "Quality image on Wikimedia Commons",
link = false,
},
vi = {
image = "Valued image seal.svg",
tooltip = "Valued image on Wikimedia Commons",
link = false,
},
tfa = {
image = "Wikipedia-logo.svg",
tooltip = "Today's Featured Article",
link = true,
},
tfl = {
image = "Wikipedia-logo.svg",
tooltip = "Today's Featured List",
link = true,
},
itn = {
image = "Globe current.svg",
tooltip = "In The News",
link = true,
},
otd = {
image = "Nuvola apps date.svg",
tooltip = "On This Day",
link = true,
},
wikiproject = {
image = "People icon.svg",
tooltip = "WikiProject",
link = false,
},
goce = {
image = "Writing Magnifying.PNG",
tooltip = "Guild of Copy Editors",
link = true,
},
wikipedia = {
image = "Wikipedia-logo.svg",
tooltip = "Wikipedia page",
link = true,
},
commons = {
image = "Commons-logo.svg",
tooltip = "Commons page",
link = false,
},
wikiquote = {
image = "Wikiquote-logo.svg",
tooltip = "Wikiquote page",
link = false,
},
wikiversity = {
image = "Wikiversity logo 2017.svg",
tooltip = "Wikiversity page",
link = true,
},
wikibooks = {
image = "Wikibooks-logo.svg",
tooltip = "Wikibooks page",
link = true,
},
wikisource = {
image = "Wikisource-logo.svg",
tooltip = "Wikisource page",
link = true,
},
wiktionary = {
image = "Wiktionary-logo.svg",
tooltip = "Wiktionary page",
link = true,
},
wikinews = {
image = "Wikinews-logo.svg",
tooltip = "Wikinews page",
link = true,
},
wikispecies = {
image = "Wikispecies-logo.svg",
tooltip = "Wikispecies page",
link = true,
},
wikidata = {
image = "Wikidata-logo.svg",
tooltip = "Wikidata page",
link = false,
},
wikivoyage = {
image = "Wikivoyage-logo.svg",
tooltip = "Wikivoyage page",
link = true,
},
mediawiki = {
image = "MediaWiki-2020-icon.svg",
tooltip = "MediaWiki",
link = false,
},
phabricator = {
aliases = {"phab"},
image = "Favicon-Phabricator-WM.svg",
tooltip = "Phabricator",
link = false,
},
wikitech = {
image = "Wikitech-2021-blue-icon.svg",
tooltip = "Wikitech",
link = false,
},
meta = {
image = "Wikimedia Community Logo.svg",
tooltip = "Meta-wiki page",
link = false,
},
four = {
aliases = {"4a"},
image = "Four Award.svg",
tooltip = "Four Award",
link = false,
},
million = {
image = "Million award logo.svg",
tooltip = "Million Award",
link = true,
},
module = {
image = "Lua-logo-nolabel.svg",
tooltip = "Module",
link = false,
},
vital = {
image = "Círculos_Concéntricos.svg",
tooltip = "Vital article",
link = false,
},
potd = {
image = "Wikipedia-logo.svg",
tooltip = "Picture of the Day",
link = true,
},
_DEFAULT = {
image = "Symbol question.svg",
link = false,
}
}
--------------------------------------------------------------------------------
-- End icon data
--------------------------------------------------------------------------------
-- Make aliases work the same as normal keys, and remove the "aliases" subtables.
local ret= {}
for code, iconData in pairs(data) do
iconData.canonicalCode = code
if iconData.aliases then
for _, alias in ipairs(iconData.aliases) do
ret[alias] = iconData
end
iconData.aliases = nil
end
ret[code] = iconData
end
return ret
d8e668d4755103abdbc8325fa35964e99198c29d
Module:Navbox
828
94
284
283
2023-10-17T17:54:23Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Navbox]]
Scribunto
text/plain
require('strict')
local p = {}
local navbar = require('Module:Navbar')._navbar
local cfg = mw.loadData('Module:Navbox/configuration')
local getArgs -- lazily initialized
local args
local format = string.format
local function striped(wikitext, border)
-- Return wikitext with markers replaced for odd/even striping.
-- Child (subgroup) navboxes are flagged with a category that is removed
-- by parent navboxes. The result is that the category shows all pages
-- where a child navbox is not contained in a parent navbox.
local orphanCat = cfg.category.orphan
if border == cfg.keyword.border_subgroup and args[cfg.arg.orphan] ~= cfg.keyword.orphan_yes then
-- No change; striping occurs in outermost navbox.
return wikitext .. orphanCat
end
local first, second = cfg.class.navbox_odd_part, cfg.class.navbox_even_part
if args[cfg.arg.evenodd] then
if args[cfg.arg.evenodd] == cfg.keyword.evenodd_swap then
first, second = second, first
else
first = args[cfg.arg.evenodd]
second = first
end
end
local changer
if first == second then
changer = first
else
local index = 0
changer = function (code)
if code == '0' then
-- Current occurrence is for a group before a nested table.
-- Set it to first as a valid although pointless class.
-- The next occurrence will be the first row after a title
-- in a subgroup and will also be first.
index = 0
return first
end
index = index + 1
return index % 2 == 1 and first or second
end
end
local regex = orphanCat:gsub('([%[%]])', '%%%1')
return (wikitext:gsub(regex, ''):gsub(cfg.marker.regex, changer)) -- () omits gsub count
end
local function processItem(item, nowrapitems)
if item:sub(1, 2) == '{|' then
-- Applying nowrap to lines in a table does not make sense.
-- Add newlines to compensate for trim of x in |parm=x in a template.
return '\n' .. item ..'\n'
end
if nowrapitems == cfg.keyword.nowrapitems_yes then
local lines = {}
for line in (item .. '\n'):gmatch('([^\n]*)\n') do
local prefix, content = line:match('^([*:;#]+)%s*(.*)')
if prefix and not content:match(cfg.pattern.nowrap) then
line = format(cfg.nowrap_item, prefix, content)
end
table.insert(lines, line)
end
item = table.concat(lines, '\n')
end
if item:match('^[*:;#]') then
return '\n' .. item ..'\n'
end
return item
end
local function has_navbar()
return args[cfg.arg.navbar] ~= cfg.keyword.navbar_off
and args[cfg.arg.navbar] ~= cfg.keyword.navbar_plain
and (
args[cfg.arg.name]
or mw.getCurrentFrame():getParent():getTitle():gsub(cfg.pattern.sandbox, '')
~= cfg.pattern.navbox
)
end
local function renderNavBar(titleCell)
if has_navbar() then
titleCell:wikitext(navbar{
[cfg.navbar.name] = args[cfg.arg.name],
[cfg.navbar.mini] = 1,
[cfg.navbar.fontstyle] = (args[cfg.arg.basestyle] or '') .. ';' ..
(args[cfg.arg.titlestyle] or '') ..
';background:none transparent;border:none;box-shadow:none;padding:0;'
})
end
end
local function renderTitleRow(tbl)
if not args[cfg.arg.title] then return end
local titleRow = tbl:tag('tr')
local titleCell = titleRow:tag('th'):attr('scope', 'col')
local titleColspan = 2
if args[cfg.arg.imageleft] then titleColspan = titleColspan + 1 end
if args[cfg.arg.image] then titleColspan = titleColspan + 1 end
titleCell
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.titlestyle])
:addClass(cfg.class.navbox_title)
:attr('colspan', titleColspan)
renderNavBar(titleCell)
titleCell
:tag('div')
-- id for aria-labelledby attribute
:attr('id', mw.uri.anchorEncode(args[cfg.arg.title]))
:addClass(args[cfg.arg.titleclass])
:css('font-size', '114%')
:css('margin', '0 4em')
:wikitext(processItem(args[cfg.arg.title]))
end
local function getAboveBelowColspan()
local ret = 2
if args[cfg.arg.imageleft] then ret = ret + 1 end
if args[cfg.arg.image] then ret = ret + 1 end
return ret
end
local function renderAboveRow(tbl)
if not args[cfg.arg.above] then return end
tbl:tag('tr')
:tag('td')
:addClass(cfg.class.navbox_abovebelow)
:addClass(args[cfg.arg.aboveclass])
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.abovestyle])
:attr('colspan', getAboveBelowColspan())
:tag('div')
-- id for aria-labelledby attribute, if no title
:attr('id', (not args[cfg.arg.title]) and mw.uri.anchorEncode(args[cfg.arg.above]) or nil)
:wikitext(processItem(args[cfg.arg.above], args[cfg.arg.nowrapitems]))
end
local function renderBelowRow(tbl)
if not args[cfg.arg.below] then return end
tbl:tag('tr')
:tag('td')
:addClass(cfg.class.navbox_abovebelow)
:addClass(args[cfg.arg.belowclass])
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.belowstyle])
:attr('colspan', getAboveBelowColspan())
:tag('div')
:wikitext(processItem(args[cfg.arg.below], args[cfg.arg.nowrapitems]))
end
local function renderListRow(tbl, index, listnum, listnums_size)
local row = tbl:tag('tr')
if index == 1 and args[cfg.arg.imageleft] then
row
:tag('td')
:addClass(cfg.class.noviewer)
:addClass(cfg.class.navbox_image)
:addClass(args[cfg.arg.imageclass])
:css('width', '1px') -- Minimize width
:css('padding', '0 2px 0 0')
:cssText(args[cfg.arg.imageleftstyle])
:attr('rowspan', listnums_size)
:tag('div')
:wikitext(processItem(args[cfg.arg.imageleft]))
end
local group_and_num = format(cfg.arg.group_and_num, listnum)
local groupstyle_and_num = format(cfg.arg.groupstyle_and_num, listnum)
if args[group_and_num] then
local groupCell = row:tag('th')
-- id for aria-labelledby attribute, if lone group with no title or above
if listnum == 1 and not (args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group2]) then
groupCell
:attr('id', mw.uri.anchorEncode(args[cfg.arg.group1]))
end
groupCell
:attr('scope', 'row')
:addClass(cfg.class.navbox_group)
:addClass(args[cfg.arg.groupclass])
:cssText(args[cfg.arg.basestyle])
-- If groupwidth not specified, minimize width
:css('width', args[cfg.arg.groupwidth] or '1%')
groupCell
:cssText(args[cfg.arg.groupstyle])
:cssText(args[groupstyle_and_num])
:wikitext(args[group_and_num])
end
local listCell = row:tag('td')
if args[group_and_num] then
listCell
:addClass(cfg.class.navbox_list_with_group)
else
listCell:attr('colspan', 2)
end
if not args[cfg.arg.groupwidth] then
listCell:css('width', '100%')
end
local rowstyle -- usually nil so cssText(rowstyle) usually adds nothing
if index % 2 == 1 then
rowstyle = args[cfg.arg.oddstyle]
else
rowstyle = args[cfg.arg.evenstyle]
end
local list_and_num = format(cfg.arg.list_and_num, listnum)
local listText = args[list_and_num]
local oddEven = cfg.marker.oddeven
if listText:sub(1, 12) == '</div><table' then
-- Assume list text is for a subgroup navbox so no automatic striping for this row.
oddEven = listText:find(cfg.pattern.navbox_title) and cfg.marker.restart or cfg.class.navbox_odd_part
end
local liststyle_and_num = format(cfg.arg.liststyle_and_num, listnum)
local listclass_and_num = format(cfg.arg.listclass_and_num, listnum)
listCell
:css('padding', '0')
:cssText(args[cfg.arg.liststyle])
:cssText(rowstyle)
:cssText(args[liststyle_and_num])
:addClass(cfg.class.navbox_list)
:addClass(cfg.class.navbox_part .. oddEven)
:addClass(args[cfg.arg.listclass])
:addClass(args[listclass_and_num])
:tag('div')
:css('padding',
(index == 1 and args[cfg.arg.list1padding]) or args[cfg.arg.listpadding] or '0 0.25em'
)
:wikitext(processItem(listText, args[cfg.arg.nowrapitems]))
if index == 1 and args[cfg.arg.image] then
row
:tag('td')
:addClass(cfg.class.noviewer)
:addClass(cfg.class.navbox_image)
:addClass(args[cfg.arg.imageclass])
:css('width', '1px') -- Minimize width
:css('padding', '0 0 0 2px')
:cssText(args[cfg.arg.imagestyle])
:attr('rowspan', listnums_size)
:tag('div')
:wikitext(processItem(args[cfg.arg.image]))
end
end
local function has_list_class(htmlclass)
local patterns = {
'^' .. htmlclass .. '$',
'%s' .. htmlclass .. '$',
'^' .. htmlclass .. '%s',
'%s' .. htmlclass .. '%s'
}
for arg, _ in pairs(args) do
if type(arg) == 'string' and mw.ustring.find(arg, cfg.pattern.class) then
for _, pattern in ipairs(patterns) do
if mw.ustring.find(args[arg] or '', pattern) then
return true
end
end
end
end
return false
end
-- there are a lot of list classes in the wild, so we add their TemplateStyles
local function add_list_styles()
local frame = mw.getCurrentFrame()
local function add_list_templatestyles(htmlclass, templatestyles)
if has_list_class(htmlclass) then
return frame:extensionTag{
name = 'templatestyles', args = { src = templatestyles }
}
else
return ''
end
end
local hlist_styles = add_list_templatestyles('hlist', cfg.hlist_templatestyles)
local plainlist_styles = add_list_templatestyles('plainlist', cfg.plainlist_templatestyles)
-- a second workaround for [[phab:T303378]]
-- when that issue is fixed, we can actually use has_navbar not to emit the
-- tag here if we want
if has_navbar() and hlist_styles == '' then
hlist_styles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.hlist_templatestyles }
}
end
-- hlist -> plainlist is best-effort to preserve old Common.css ordering.
-- this ordering is not a guarantee because most navboxes will emit only
-- one of these classes [hlist_note]
return hlist_styles .. plainlist_styles
end
local function needsHorizontalLists(border)
if border == cfg.keyword.border_subgroup or args[cfg.arg.tracking] == cfg.keyword.tracking_no then
return false
end
return not has_list_class(cfg.pattern.hlist) and not has_list_class(cfg.pattern.plainlist)
end
local function hasBackgroundColors()
for _, key in ipairs({cfg.arg.titlestyle, cfg.arg.groupstyle,
cfg.arg.basestyle, cfg.arg.abovestyle, cfg.arg.belowstyle}) do
if tostring(args[key]):find('background', 1, true) then
return true
end
end
return false
end
local function hasBorders()
for _, key in ipairs({cfg.arg.groupstyle, cfg.arg.basestyle,
cfg.arg.abovestyle, cfg.arg.belowstyle}) do
if tostring(args[key]):find('border', 1, true) then
return true
end
end
return false
end
local function isIllegible()
local styleratio = require('Module:Color contrast')._styleratio
for key, style in pairs(args) do
if tostring(key):match(cfg.pattern.style) then
if styleratio{mw.text.unstripNoWiki(style)} < 4.5 then
return true
end
end
end
return false
end
local function getTrackingCategories(border)
local cats = {}
if needsHorizontalLists(border) then table.insert(cats, cfg.category.horizontal_lists) end
if hasBackgroundColors() then table.insert(cats, cfg.category.background_colors) end
if isIllegible() then table.insert(cats, cfg.category.illegible) end
if hasBorders() then table.insert(cats, cfg.category.borders) end
return cats
end
local function renderTrackingCategories(builder, border)
local title = mw.title.getCurrentTitle()
if title.namespace ~= 10 then return end -- not in template space
local subpage = title.subpageText
if subpage == cfg.keyword.subpage_doc or subpage == cfg.keyword.subpage_sandbox
or subpage == cfg.keyword.subpage_testcases then return end
for _, cat in ipairs(getTrackingCategories(border)) do
builder:wikitext('[[Category:' .. cat .. ']]')
end
end
local function renderMainTable(border, listnums)
local tbl = mw.html.create('table')
:addClass(cfg.class.nowraplinks)
:addClass(args[cfg.arg.bodyclass])
local state = args[cfg.arg.state]
if args[cfg.arg.title] and state ~= cfg.keyword.state_plain and state ~= cfg.keyword.state_off then
if state == cfg.keyword.state_collapsed then
state = cfg.class.collapsed
end
tbl
:addClass(cfg.class.collapsible)
:addClass(state or cfg.class.autocollapse)
end
tbl:css('border-spacing', 0)
if border == cfg.keyword.border_subgroup or border == cfg.keyword.border_none then
tbl
:addClass(cfg.class.navbox_subgroup)
:cssText(args[cfg.arg.bodystyle])
:cssText(args[cfg.arg.style])
else -- regular navbox - bodystyle and style will be applied to the wrapper table
tbl
:addClass(cfg.class.navbox_inner)
:css('background', 'transparent')
:css('color', 'inherit')
end
tbl:cssText(args[cfg.arg.innerstyle])
renderTitleRow(tbl)
renderAboveRow(tbl)
local listnums_size = #listnums
for i, listnum in ipairs(listnums) do
renderListRow(tbl, i, listnum, listnums_size)
end
renderBelowRow(tbl)
return tbl
end
local function add_navbox_styles(hiding_templatestyles)
local frame = mw.getCurrentFrame()
-- This is a lambda so that it doesn't need the frame as a parameter
local function add_user_styles(templatestyles)
if templatestyles and templatestyles ~= '' then
return frame:extensionTag{
name = 'templatestyles', args = { src = templatestyles }
}
end
return ''
end
-- get templatestyles. load base from config so that Lua only needs to do
-- the work once of parser tag expansion
local base_templatestyles = cfg.templatestyles
local templatestyles = add_user_styles(args[cfg.arg.templatestyles])
local child_templatestyles = add_user_styles(args[cfg.arg.child_templatestyles])
-- The 'navbox-styles' div exists to wrap the styles to work around T200206
-- more elegantly. Instead of combinatorial rules, this ends up being linear
-- number of CSS rules.
return mw.html.create('div')
:addClass(cfg.class.navbox_styles)
:wikitext(
add_list_styles() .. -- see [hlist_note] applied to 'before base_templatestyles'
base_templatestyles ..
templatestyles ..
child_templatestyles ..
table.concat(hiding_templatestyles)
)
:done()
end
-- work around [[phab:T303378]]
-- for each arg: find all the templatestyles strip markers, insert them into a
-- table. then remove all templatestyles markers from the arg
local function move_hiding_templatestyles(args)
local gfind = string.gfind
local gsub = string.gsub
local templatestyles_markers = {}
local strip_marker_pattern = '(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)'
for k, arg in pairs(args) do
for marker in gfind(arg, strip_marker_pattern) do
table.insert(templatestyles_markers, marker)
end
args[k] = gsub(arg, strip_marker_pattern, '')
end
return templatestyles_markers
end
function p._navbox(navboxArgs)
args = navboxArgs
local hiding_templatestyles = move_hiding_templatestyles(args)
local listnums = {}
for k, _ in pairs(args) do
if type(k) == 'string' then
local listnum = k:match(cfg.pattern.listnum)
if listnum then table.insert(listnums, tonumber(listnum)) end
end
end
table.sort(listnums)
local border = mw.text.trim(args[cfg.arg.border] or args[1] or '')
if border == cfg.keyword.border_child then
border = cfg.keyword.border_subgroup
end
-- render the main body of the navbox
local tbl = renderMainTable(border, listnums)
local res = mw.html.create()
-- render the appropriate wrapper for the navbox, based on the border param
if border == cfg.keyword.border_none then
res:node(add_navbox_styles(hiding_templatestyles))
local nav = res:tag('div')
:attr('role', 'navigation')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args[cfg.arg.title] or args[cfg.arg.above] or (args[cfg.arg.group1]
and not args[cfg.arg.group2]) then
nav:attr(
'aria-labelledby',
mw.uri.anchorEncode(
args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1]
)
)
else
nav:attr('aria-label', cfg.aria_label)
end
elseif border == cfg.keyword.border_subgroup then
-- We assume that this navbox is being rendered in a list cell of a
-- parent navbox, and is therefore inside a div with padding:0em 0.25em.
-- We start with a </div> to avoid the padding being applied, and at the
-- end add a <div> to balance out the parent's </div>
res
:wikitext('</div>')
:node(tbl)
:wikitext('<div>')
else
res:node(add_navbox_styles(hiding_templatestyles))
local nav = res:tag('div')
:attr('role', 'navigation')
:addClass(cfg.class.navbox)
:addClass(args[cfg.arg.navboxclass])
:cssText(args[cfg.arg.bodystyle])
:cssText(args[cfg.arg.style])
:css('padding', '3px')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args[cfg.arg.title] or args[cfg.arg.above]
or (args[cfg.arg.group1] and not args[cfg.arg.group2]) then
nav:attr(
'aria-labelledby',
mw.uri.anchorEncode(args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1])
)
else
nav:attr('aria-label', cfg.aria_label)
end
end
if (args[cfg.arg.nocat] or cfg.keyword.nocat_false):lower() == cfg.keyword.nocat_false then
renderTrackingCategories(res, border)
end
return striped(tostring(res), border)
end
function p.navbox(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {wrappers = {cfg.pattern.navbox}})
-- Read the arguments in the order they'll be output in, to make references
-- number in the right order.
local _
_ = args[cfg.arg.title]
_ = args[cfg.arg.above]
-- Limit this to 20 as covering 'most' cases (that's a SWAG) and because
-- iterator approach won't work here
for i = 1, 20 do
_ = args[format(cfg.arg.group_and_num, i)]
_ = args[format(cfg.arg.list_and_num, i)]
end
_ = args[cfg.arg.below]
return p._navbox(args)
end
return p
05be9a97c035ab3f0fac69423779e261949d473c
Module:Navbox/configuration
828
95
286
285
2023-10-17T17:54:23Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Navbox/configuration]]
Scribunto
text/plain
return {
aria_label = 'Navbox',
nowrap_item = '%s<span class="nowrap">%s</span>',
templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Navbox/styles.css' }
},
hlist_templatestyles = 'Hlist/styles.css',
plainlist_templatestyles = 'Plainlist/styles.css',
-- do not localize marker table
marker = {
oddeven = '\127_ODDEVEN_\127',
restart = '\127_ODDEVEN0_\127',
regex = '\127_ODDEVEN(%d?)_\127'
},
category = {
orphan = '[[Category:Navbox orphans]]',
horizontal_lists = 'Navigational boxes without horizontal lists',
background_colors = 'Navboxes using background colours',
illegible = 'Potentially illegible navboxes',
borders = 'Navboxes using borders',
},
keyword = {
border_subgroup = 'subgroup',
border_child = 'child',
border_none = 'none',
evenodd_swap = 'swap',
navbar_off = 'off',
navbar_plain = 'plain',
nocat_false = 'false',
nowrapitems_yes = 'yes',
orphan_yes = 'yes',
state_collapsed = 'collapsed',
state_off = 'off',
state_plain = 'plain',
subpage_doc = 'doc',
subpage_sandbox = 'sandbox',
subpage_testcases = 'testcases',
tracking_no = 'no'
},
class = {
autocollapse = 'autocollapse',
collapsible = 'mw-collapsible',
collapsed = 'mw-collapsed',
-- Warning
navbox = 'navbox', -- WMF currently hides 'navbox' from mobile,
-- so you probably shouldn't change the navbox class.
navbox_abovebelow = 'navbox-abovebelow',
navbox_group = 'navbox-group',
navbox_image = 'navbox-image',
navbox_inner = 'navbox-inner',
navbox_list = 'navbox-list',
navbox_list_with_group = 'navbox-list-with-group',
navbox_part = 'navbox-', -- do not l10n
navbox_styles = 'navbox-styles',
navbox_subgroup = 'navbox-subgroup',
navbox_title = 'navbox-title', -- l10n only if you change pattern.navbox_title below
navbox_odd_part = 'odd', -- do not l10n
navbox_even_part = 'even', -- do not l10n
nomobile = 'nomobile',
nowraplinks = 'nowraplinks',
noviewer = 'noviewer' -- used to remove images from MediaViewer
},
pattern = {
listnum = '^list(%d+)$',
class = 'class',
sandbox = '/sandbox$',
navbox = 'Template:Navbox',
nowrap = '^<span class="nowrap">',
style = 'style$',
navbox_title = '<th[^>]*"navbox%-title"',
hlist = 'hlist',
plainlist = 'plainlist',
},
arg = {
above = 'above',
aboveclass = 'aboveclass',
abovestyle = 'abovestyle',
basestyle = 'basestyle',
bodyclass = 'bodyclass',
bodystyle = 'bodystyle',
border = 'border',
below = 'below',
belowclass = 'belowclass',
belowstyle = 'belowstyle',
evenodd = 'evenodd',
evenstyle = 'evenstyle',
group1 = 'group1',
group2 = 'group2',
group_and_num = 'group%d',
groupstyle_and_num = 'group%dstyle',
groupclass = 'groupclass',
groupstyle = 'groupstyle',
groupwidth = 'groupwidth',
innerstyle = 'innerstyle',
image = 'image',
imageclass = 'imageclass',
imageleft = 'imageleft',
imageleftstyle = 'imageleftstyle',
imagesetyle = 'imagestyle',
list_and_num = 'list%d',
listclass_and_num = 'list%dclass',
liststyle_and_num = 'list%dstyle',
list1padding = 'list1padding',
listclass = 'listclass',
listpadding = 'listpadding',
liststyle = 'liststyle',
name = 'name',
navbar = 'navbar',
navboxclass = 'navboxclass',
nocat = 'nocat',
nowrapitems = 'nowrapitems',
oddstyle = 'oddstyle',
orphan = 'orphan',
state = 'state',
style = 'style',
templatestyles = 'templatestyles',
child_templatestyles = 'child templatestyles',
title = 'title',
titleclass = 'titleclass',
titlestyle = 'titlestyle',
tracking = 'tracking'
},
-- names of navbar arguments
navbar = {
name = 1,
fontstyle = 'fontstyle',
mini = 'mini'
}
}
4148736fd32a93636c0413e73ed38afaef065ec9
Module:Navbox/styles.css
828
96
288
287
2023-10-17T17:54:23Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Navbox/styles.css]]
sanitized-css
text/css
/* {{pp|small=y}} */
.navbox {
box-sizing: border-box;
border: 1px solid #a2a9b1;
width: 100%;
clear: both;
font-size: 88%;
text-align: center;
padding: 1px;
margin: 1em auto 0; /* Prevent preceding content from clinging to navboxes */
}
.navbox .navbox {
margin-top: 0; /* No top margin for nested navboxes */
}
.navbox + .navbox, /* TODO: remove first line after transclusions have updated */
.navbox + .navbox-styles + .navbox {
margin-top: -1px; /* Single pixel border between adjacent navboxes */
}
.navbox-inner,
.navbox-subgroup {
width: 100%;
}
.navbox-group,
.navbox-title,
.navbox-abovebelow {
padding: 0.25em 1em;
line-height: 1.5em;
text-align: center;
}
.navbox-group {
white-space: nowrap;
/* @noflip */
text-align: right;
}
.navbox,
.navbox-subgroup {
background-color: #fdfdfd;
}
.navbox-list {
line-height: 1.5em;
border-color: #fdfdfd; /* Must match background color */
}
.navbox-list-with-group {
text-align: left;
border-left-width: 2px;
border-left-style: solid;
}
/* cell spacing for navbox cells */
/* Borders above 2nd, 3rd, etc. rows */
/* TODO: figure out how to replace tr as structure;
* with div structure it should be just a matter of first-child */
tr + tr > .navbox-abovebelow,
tr + tr > .navbox-group,
tr + tr > .navbox-image,
tr + tr > .navbox-list {
border-top: 2px solid #fdfdfd; /* Must match background color */
}
.navbox-title {
background-color: #ccf; /* Level 1 color */
}
.navbox-abovebelow,
.navbox-group,
.navbox-subgroup .navbox-title {
background-color: #ddf; /* Level 2 color */
}
.navbox-subgroup .navbox-group,
.navbox-subgroup .navbox-abovebelow {
background-color: #e6e6ff; /* Level 3 color */
}
.navbox-even {
background-color: #f7f7f7;
}
.navbox-odd {
background-color: transparent;
}
/* TODO: figure out how to remove reliance on td as structure */
.navbox .hlist td dl,
.navbox .hlist td ol,
.navbox .hlist td ul,
.navbox td.hlist dl,
.navbox td.hlist ol,
.navbox td.hlist ul {
padding: 0.125em 0;
}
.navbox .navbar {
display: block;
font-size: 100%;
}
.navbox-title .navbar {
/* @noflip */
float: left;
/* @noflip */
text-align: left;
/* @noflip */
margin-right: 0.5em;
}
e80b0d7a5770e6e105dab832deb6c37a5245ebc6
Template:Tick
10
97
290
289
2023-10-17T17:54:25Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Tick]]
wikitext
text/x-wiki
[[{{ safesubst:<noinclude/>#switch:{{ safesubst:<noinclude/>lc:{{{color|{{{colour|}}}}}} }}
|green |grn |gn =File:Yes check.svg
|lightgreen |lgreen |lgrn |lgn =File:Light green check.svg
|red |rd |r =File:Red check.svg
|darkred |dkred |drd |dr =File:Check-188-25-49-red.svg
|pink |pnk |pk =File:Pink check.svg
|orange |or |o =File:Check.svg
|yellow |yel |y =File:Yellow check.svg
|black |blk |k =File:Black check.svg
|blue |blu |u =File:Check-blue.svg
|lightblue |lblue |lblu |lb =File:Cornflower blue check.svg
|cyan |cy |c =File:B-check.svg
|purple |pur |pu =File:Purple check.svg
|grey |gray |gry |gy =File:SemiTransBlack v.svg
|brown |brn |bn =File:Brown check.svg
<!--default--> |File:Yes check.svg
}}|{{ safesubst:<noinclude/>#if:{{{1|}}}|{{Str number/trim|{{{1}}}}}|20}}px|link=|alt={{#if:{{{alt|}}}|{{{alt}}}|check}}]]<span style="display:none">Y</span><!--template:tick--><noinclude>
{{documentation}}
</noinclude>
2a5da56c38689fc7e1a8ccfd7a51892df49d6253
Module:Color contrast
828
98
292
291
2023-10-17T17:54:25Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Color_contrast]]
Scribunto
text/plain
--
-- This module implements
-- {{Color contrast ratio}}
-- {{Greater color contrast ratio}}
-- {{ColorToLum}}
-- {{RGBColorToLum}}
--
local p = {}
local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' )
local function sRGB (v)
if (v <= 0.03928) then
v = v / 12.92
else
v = math.pow((v+0.055)/1.055, 2.4)
end
return v
end
local function rgbdec2lum(R, G, B)
if ( 0 <= R and R < 256 and 0 <= G and G < 256 and 0 <= B and B < 256 ) then
return 0.2126 * sRGB(R/255) + 0.7152 * sRGB(G/255) + 0.0722 * sRGB(B/255)
else
return ''
end
end
local function hsl2lum(h, s, l)
if ( 0 <= h and h < 360 and 0 <= s and s <= 1 and 0 <= l and l <= 1 ) then
local c = (1 - math.abs(2*l - 1))*s
local x = c*(1 - math.abs( math.fmod(h/60, 2) - 1) )
local m = l - c/2
local r, g, b = m, m, m
if( 0 <= h and h < 60 ) then
r = r + c
g = g + x
elseif( 60 <= h and h < 120 ) then
r = r + x
g = g + c
elseif( 120 <= h and h < 180 ) then
g = g + c
b = b + x
elseif( 180 <= h and h < 240 ) then
g = g + x
b = b + c
elseif( 240 <= h and h < 300 ) then
r = r + x
b = b + c
elseif( 300 <= h and h < 360 ) then
r = r + c
b = b + x
end
return rgbdec2lum(255*r, 255*g, 255*b)
else
return ''
end
end
local function color2lum(c)
if (c == nil) then
return ''
end
-- html '#' entity
c = c:gsub("#", "#")
-- whitespace
c = c:match( '^%s*(.-)[%s;]*$' )
-- unstrip nowiki strip markers
c = mw.text.unstripNoWiki(c)
-- lowercase
c = c:lower()
-- first try to look it up
local L = HTMLcolor[c]
if (L ~= nil) then
return L
end
-- convert from hsl
if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9%.]*[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9%.]*)[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100)
end
-- convert from rgb
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*%)$')
return rgbdec2lum(tonumber(R), tonumber(G), tonumber(B))
end
-- convert from rgb percent
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100)
end
-- remove leading # (if there is one) and whitespace
c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$')
-- split into rgb
local cs = mw.text.split(c or '', '')
if( #cs == 6 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[2])
local G = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[4])
local B = 16*tonumber('0x' .. cs[5]) + tonumber('0x' .. cs[6])
return rgbdec2lum(R, G, B)
elseif ( #cs == 3 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[1])
local G = 16*tonumber('0x' .. cs[2]) + tonumber('0x' .. cs[2])
local B = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[3])
return rgbdec2lum(R, G, B)
end
-- failure, return blank
return ''
end
-- This exports the function for use in other modules.
-- The colour is passed as a string.
function p._lum(color)
return color2lum(color)
end
function p._greatercontrast(args)
local bias = tonumber(args['bias'] or '0') or 0
local css = (args['css'] and args['css'] ~= '') and true or false
local v1 = color2lum(args[1] or '')
local c2 = args[2] or '#FFFFFF'
local v2 = color2lum(c2)
local c3 = args[3] or '#000000'
local v3 = color2lum(c3)
local ratio1 = -1;
local ratio2 = -1;
if (type(v1) == 'number' and type(v2) == 'number') then
ratio1 = (v2 + 0.05)/(v1 + 0.05)
ratio1 = (ratio1 < 1) and 1/ratio1 or ratio1
end
if (type(v1) == 'number' and type(v3) == 'number') then
ratio2 = (v3 + 0.05)/(v1 + 0.05)
ratio2 = (ratio2 < 1) and 1/ratio2 or ratio2
end
if css then
local c1 = args[1] or ''
if mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c1 = '#' .. c1
end
if mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c2 = '#' .. c2
end
if mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c3 = '#' .. c3
end
return 'background-color:' .. c1 .. '; color:' .. ((ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or '') .. ';'
end
return (ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or ''
end
function p._ratio(args)
local v1 = color2lum(args[1])
local v2 = color2lum(args[2])
if (type(v1) == 'number' and type(v2) == 'number') then
-- v1 should be the brighter of the two.
if v2 > v1 then
v1, v2 = v2, v1
end
return (v1 + 0.05)/(v2 + 0.05)
else
return args['error'] or '?'
end
end
function p._styleratio(args)
local style = (args[1] or ''):lower()
local bg, fg = 'white', 'black'
local lum_bg, lum_fg = 1, 0
if args[2] then
local lum = color2lum(args[2])
if lum ~= '' then bg, lum_bg = args[2], lum end
end
if args[3] then
local lum = color2lum(args[3])
if lum ~= '' then fg, lum_fg = args[3], lum end
end
local slist = mw.text.split(mw.ustring.gsub(mw.ustring.gsub(style or '', '&#[Xx]23;', '#'), '#', '#'), ';')
for k = 1,#slist do
local s = slist[k]
local k,v = s:match( '^[%s]*([^:]-):([^:]-)[%s;]*$' )
k = k or ''
v = v or ''
if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background%-color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_bg = v, lum end
elseif (k:match('^[%s]*(color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_fg = v, lum end
end
end
if lum_bg > lum_fg then
return (lum_bg + 0.05)/(lum_fg + 0.05)
else
return (lum_fg + 0.05)/(lum_bg + 0.05)
end
end
--[[
Use {{#invoke:Color contrast|somecolor}} directly or
{{#invoke:Color contrast}} from a wrapper template.
Parameters:
-- |1= — required; A color to check.
--]]
function p.lum(frame)
local color = frame.args[1] or frame:getParent().args[1]
return p._lum(color)
end
function p.ratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._ratio(args)
end
function p.styleratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._styleratio(args)
end
function p.greatercontrast(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._greatercontrast(args)
end
return p
1e399769117591366a63f62996c9a407077cc711
Module:Color contrast/colors
828
99
294
293
2023-10-17T17:54:26Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Color_contrast/colors]]
Scribunto
text/plain
return {
aliceblue = 0.92880068253475,
antiquewhite = 0.84646951707754,
aqua = 0.7874,
aquamarine = 0.8078549208338,
azure = 0.97265264954166,
beige = 0.8988459998705,
bisque = 0.80732327372979,
black = 0,
blanchedalmond = 0.85084439608156,
blue = 0.0722,
blueviolet = 0.12622014321946,
brown = 0.098224287876511,
burlywood = 0.51559844533893,
cadetblue = 0.29424681085422,
chartreuse = 0.76032025902623,
chocolate = 0.23898526114557,
coral = 0.37017930872924,
cornflowerblue = 0.30318641994179,
cornsilk = 0.93562110372965,
crimson = 0.16042199953026,
cyan = 0.7874,
darkblue = 0.018640801980939,
darkcyan = 0.20329317839046,
darkgoldenrod = 0.27264703559993,
darkgray = 0.39675523072563,
darkgreen = 0.091143429047575,
darkgrey = 0.39675523072563,
darkkhaki = 0.45747326349994,
darkmagenta = 0.07353047651207,
darkolivegreen = 0.12651920884889,
darkorange = 0.40016167026524,
darkorchid = 0.13413142174857,
darkred = 0.054889674531132,
darksalmon = 0.40541471563381,
darkseagreen = 0.43789249325969,
darkslateblue = 0.065792846227988,
darkslategray = 0.067608151928044,
darkslategrey = 0.067608151928044,
darkturquoise = 0.4874606277449,
darkviolet = 0.10999048339343,
deeppink = 0.23866895828276,
deepskyblue = 0.44481603395575,
dimgray = 0.14126329114027,
dimgrey = 0.14126329114027,
dodgerblue = 0.27442536991456,
firebrick = 0.10724525535015,
floralwhite = 0.95922484825004,
forestgreen = 0.18920812076002,
fuchsia = 0.2848,
gainsboro = 0.71569350050648,
ghostwhite = 0.94311261886323,
gold = 0.69860877428159,
goldenrod = 0.41919977809569,
gray = 0.2158605001139,
green = 0.15438342968146,
greenyellow = 0.80609472611453,
grey = 0.2158605001139,
honeydew = 0.96336535554782,
hotpink = 0.34658438169715,
indianred = 0.21406134963884,
indigo = 0.03107561486337,
ivory = 0.99071270600615,
khaki = 0.77012343394121,
lavender = 0.80318750514521,
lavenderblush = 0.90172748631046,
lawngreen = 0.73905893124963,
lemonchiffon = 0.94038992245622,
lightblue = 0.63709141280807,
lightcoral = 0.35522120733135,
lightcyan = 0.94587293494829,
lightgoldenrodyellow = 0.93348351018297,
lightgray = 0.65140563741982,
lightgreen = 0.69091979956865,
lightgrey = 0.65140563741982,
lightpink = 0.58566152734898,
lightsalmon = 0.4780675225206,
lightseagreen = 0.35050145117042,
lightskyblue = 0.56195637618331,
lightslategray = 0.23830165007287,
lightslategrey = 0.23830165007287,
lightsteelblue = 0.53983888284666,
lightyellow = 0.98161818392882,
lime = 0.7152,
limegreen = 0.44571042246098,
linen = 0.88357340984379,
magenta = 0.2848,
maroon = 0.045891942324215,
mediumaquamarine = 0.49389703310801,
mediumblue = 0.044077780212328,
mediumorchid = 0.21639251153773,
mediumpurple = 0.22905858091648,
mediumseagreen = 0.34393112338131,
mediumslateblue = 0.20284629471622,
mediumspringgreen = 0.70704308194184,
mediumturquoise = 0.5133827926448,
mediumvioletred = 0.14371899849357,
midnightblue = 0.02071786635086,
mintcream = 0.97834604947588,
mistyrose = 0.82183047859185,
moccasin = 0.80083000991567,
navajowhite = 0.76519682342785,
navy = 0.015585128108224,
oldlace = 0.91900633405549,
olive = 0.20027537200568,
olivedrab = 0.22593150951929,
orange = 0.4817026703631,
orangered = 0.25516243753416,
orchid = 0.31348806761439,
palegoldenrod = 0.78792647887614,
palegreen = 0.77936759006353,
paleturquoise = 0.76436077921714,
palevioletred = 0.28754994117889,
papayawhip = 0.87797100199835,
peachpuff = 0.74905589878251,
peru = 0.30113074877936,
pink = 0.63271070702466,
plum = 0.45734221587969,
powderblue = 0.68254586500605,
purple = 0.061477070432439,
rebeccapurple = 0.07492341159447,
red = 0.2126,
rosybrown = 0.32319457649407,
royalblue = 0.16663210743188,
saddlebrown = 0.097922285020521,
salmon = 0.36977241527596,
sandybrown = 0.46628543696283,
seagreen = 0.19734199706275,
seashell = 0.92737862206922,
sienna = 0.13697631337098,
silver = 0.52711512570581,
skyblue = 0.55291668518184,
slateblue = 0.14784278062136,
slategray = 0.20896704076536,
slategrey = 0.20896704076536,
snow = 0.96533341834849,
springgreen = 0.73052306068529,
steelblue = 0.20562642207625,
tan = 0.48237604163921,
teal = 0.16996855778968,
thistle = 0.56818401093733,
tomato = 0.30638612719415,
turquoise = 0.5895536427578,
violet = 0.40315452986676,
wheat = 0.74909702820482,
white = 1,
whitesmoke = 0.91309865179342,
yellow = 0.9278,
yellowgreen = 0.50762957208707,
}
6ae47fdb24de4eed5ec26d203faf5341a388987b
Template:No redirect
10
100
296
295
2023-10-17T17:54:27Z
LamayII
2
1 revision imported from [[:wikipedia:Template:No_redirect]]
wikitext
text/x-wiki
{{safesubst:<noinclude/>#if: {{safesubst:<noinclude/>#invoke:Redirect|isRedirect|{{{1}}}}}
| <span class="plainlinks">[{{safesubst:<noinclude/>fullurl:{{{1}}}|redirect=no}} {{{2|{{{1}}}}}}]</span>
| {{safesubst:<noinclude/>#if:{{{2|}}}|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}|{{{2}}}]]|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}]]}}
}}<noinclude>
{{documentation}}
</noinclude>
1760035b1bed54ee08b810208ed3551b812dfe13
Template:Cross
10
101
298
297
2023-10-17T17:54:27Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Cross]]
wikitext
text/x-wiki
#REDIRECT [[Template:Xmark]]
{{Redirect category shell|
{{R from move}}
}}
e97e23c5fb1a53fbf972794777b17b669b615ad4
Template:Xmark
10
102
300
299
2023-10-17T17:54:28Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Xmark]]
wikitext
text/x-wiki
[[{{ {{{|safesubst:}}}#switch:{{ {{{|safesubst:}}}lc:{{{color|{{{colour|}}}}}} }}
|red |rd |r =File:X mark.svg
|darkred |dkred |drd |dr =File:Dark Red x.svg
|orange |or |o =File:Orange x.svg
|yellow |yel |y =File:Dark yellow x.svg
|black |blk |k =File:Black x.svg
|grey |gray |gry |gy =File:SemiTransBlack x.svg
<!--default--> |File:X mark.svg
}}|{{ {{{|safesubst:}}}#if:{{{1|}}}|{{{1}}}|20}}px|link=|alt=☒]]<span style="display:none">N</span><!--template:Xmark--><noinclude>
{{documentation}}
</noinclude>
71b3471d91ac8237d642abb3e6f35824f0b554dc
Template:Tlc
10
103
302
301
2023-10-17T17:54:29Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Tlc]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link code]]
{{Redirect category shell|
{{R from template shortcut}}
{{R from high-use template}}
{{R from move}}
}}
48ef4a029c0e27cccb1148a29fb8b7ccb211a4a2
Template:Template link code
10
104
304
303
2023-10-17T17:54:30Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Template_link_code]]
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nolink=yes|code=yes|nowrap=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlc}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
044f00ca1bfc10cb967c32e893043ccc6f739764
Module:Shortcut
828
105
306
305
2023-10-17T17:54:30Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Shortcut]]
Scribunto
text/plain
-- This module implements {{shortcut}}.
-- Set constants
local CONFIG_MODULE = 'Module:Shortcut/config'
-- Load required modules
local checkType = require('libraryUtil').checkType
local yesno = require('Module:Yesno')
local p = {}
local function message(msg, ...)
return mw.message.newRawMessage(msg, ...):plain()
end
local function makeCategoryLink(cat)
return string.format('[[%s:%s]]', mw.site.namespaces[14].name, cat)
end
function p._main(shortcuts, options, frame, cfg)
checkType('_main', 1, shortcuts, 'table')
checkType('_main', 2, options, 'table', true)
options = options or {}
frame = frame or mw.getCurrentFrame()
cfg = cfg or mw.loadData(CONFIG_MODULE)
local templateMode = options.template and yesno(options.template)
local redirectMode = options.redirect and yesno(options.redirect)
local isCategorized = not options.category or yesno(options.category) ~= false
-- Validate shortcuts
for i, shortcut in ipairs(shortcuts) do
if type(shortcut) ~= 'string' or #shortcut < 1 then
error(message(cfg['invalid-shortcut-error'], i), 2)
end
end
-- Make the list items. These are the shortcuts plus any extra lines such
-- as options.msg.
local listItems = {}
for i, shortcut in ipairs(shortcuts) do
local templatePath, prefix
if templateMode then
-- Namespace detection
local titleObj = mw.title.new(shortcut, 10)
if titleObj.namespace == 10 then
templatePath = titleObj.fullText
else
templatePath = shortcut
end
prefix = options['pre' .. i] or options.pre or ''
end
if options.target and yesno(options.target) then
listItems[i] = templateMode
and string.format("{{%s[[%s|%s]]}}", prefix, templatePath, shortcut)
or string.format("[[%s]]", shortcut)
else
listItems[i] = frame:expandTemplate{
title = 'No redirect',
args = templateMode and {templatePath, shortcut} or {shortcut, shortcut}
}
if templateMode then
listItems[i] = string.format("{{%s%s}}", prefix, listItems[i])
end
end
end
table.insert(listItems, options.msg)
-- Return an error if we have nothing to display
if #listItems < 1 then
local msg = cfg['no-content-error']
msg = string.format('<strong class="error">%s</strong>', msg)
if isCategorized and cfg['no-content-error-category'] then
msg = msg .. makeCategoryLink(cfg['no-content-error-category'])
end
return msg
end
local root = mw.html.create()
root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = 'Module:Shortcut/styles.css'} })
-- Anchors
local anchorDiv = root
:tag('div')
:addClass('module-shortcutanchordiv')
for i, shortcut in ipairs(shortcuts) do
local anchor = mw.uri.anchorEncode(shortcut)
anchorDiv:tag('span'):attr('id', anchor)
end
-- Shortcut heading
local shortcutHeading
do
local nShortcuts = #shortcuts
if nShortcuts > 0 then
local headingMsg = options['shortcut-heading'] or
redirectMode and cfg['redirect-heading'] or
cfg['shortcut-heading']
shortcutHeading = message(headingMsg, nShortcuts)
shortcutHeading = frame:preprocess(shortcutHeading)
end
end
-- Shortcut box
local shortcutList = root
:tag('div')
:addClass('module-shortcutboxplain noprint')
:attr('role', 'note')
if options.float and options.float:lower() == 'left' then
shortcutList:addClass('module-shortcutboxleft')
end
if options.clear and options.clear ~= '' then
shortcutList:css('clear', options.clear)
end
if shortcutHeading then
shortcutList
:tag('div')
:addClass('module-shortcutlist')
:wikitext(shortcutHeading)
end
local ubl = require('Module:List').unbulleted(listItems)
shortcutList:wikitext(ubl)
return tostring(root)
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame)
-- Separate shortcuts from options
local shortcuts, options = {}, {}
for k, v in pairs(args) do
if type(k) == 'number' then
shortcuts[k] = v
else
options[k] = v
end
end
-- Compress the shortcut array, which may contain nils.
local function compressArray(t)
local nums, ret = {}, {}
for k in pairs(t) do
nums[#nums + 1] = k
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[i] = t[num]
end
return ret
end
shortcuts = compressArray(shortcuts)
return p._main(shortcuts, options, frame)
end
return p
03fd46a265e549852a9ed3d3a9249b247d84cb4f
Module:Shortcut/config
828
106
308
307
2023-10-17T17:54:31Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Shortcut/config]]
Scribunto
text/plain
-- This module holds configuration data for [[Module:Shortcut]].
return {
-- The heading at the top of the shortcut box. It accepts the following parameter:
-- $1 - the total number of shortcuts. (required)
['shortcut-heading'] = '[[Wikipedia:Shortcut|{{PLURAL:$1|Shortcut|Shortcuts}}]]',
-- The heading when |redirect=yes is given. It accepts the following parameter:
-- $1 - the total number of shortcuts. (required)
['redirect-heading'] = '[[Wikipedia:Redirect|{{PLURAL:$1|Redirect|Redirects}}]]',
-- The error message to display when a shortcut is invalid (is not a string, or
-- is the blank string). It accepts the following parameter:
-- $1 - the number of the shortcut in the argument list. (required)
['invalid-shortcut-error'] = 'shortcut #$1 was invalid (shortcuts must be ' ..
'strings of at least one character in length)',
-- The error message to display when no shortcuts or other displayable content
-- were specified. (required)
['no-content-error'] = 'Error: no shortcuts were specified and the ' ..
mw.text.nowiki('|msg=') ..
' parameter was not set.',
-- A category to add when the no-content-error message is displayed. (optional)
['no-content-error-category'] = 'Shortcut templates with missing parameters',
}
f9d1d94844d5953753eb19e30a3ce389eda3d319
Template:Template shortcut
10
107
310
309
2023-10-17T17:54:33Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Template_shortcut]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Shortcut|main|template=yes}}</includeonly><noinclude>{{Documentation}}</noinclude>
bfb2889c4c0ec36294b7b667f5e03350d2df680e
Template:Tsh
10
108
312
311
2023-10-17T17:54:33Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Tsh]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template shortcut]]
{{rcatsh|
{{R msp}}
{{R tsh}}
}}
9fde60ec995035a7ff432aea9b23c316c236351d
Template:Hatnote templates
10
109
314
313
2023-10-17T17:54:34Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Hatnote_templates]]
wikitext
text/x-wiki
{{Navbox
| name = Hatnote templates
| state = {{{state|<includeonly>autocollapse</includeonly>}}}
| bodyclass = hlist
| belowclass = hlist
| title = [[WP:Hatnote#Hatnote templates|Hatnote templates]]
| above =
*[[Wikipedia:Hatnote]]
*[[Wikipedia:Disambiguation]]
*[[Wikipedia:Redirect]]
| group1 = Generic
| list1 =
*{{tl|Hatnote}}
*{{tl|Self-reference}}
| group2 = For and about
| list2 =
*{{tl|For}}
*{{tl|For-text}} (for custom text)
*{{tl|For-multi}} (for multiple uses)
*{{tl|About}}
*Variations: {{tl|Other uses}}
*{{tl|Other uses of}}
*{{tl|Redirect-distinguish-for}}
*{{tl|About-distinguish}}
*{{tl|About-distinguish-text}}
| group3 = Other topics
| list3 =
*{{tl|Other people}}
*{{tl|About other people}} (adds "about" description)
*{{tl|Similar names}}
*{{tl|Other storms}}
*{{tl|Other places}}
*{{tl|Other ships}}
| group4 = Redirect
| list4 =
*{{tl|Redirect}}
*{{tl|Redirect2}} (for two redirects)
*{{tl|Redirect-multi}} (for multiple redirects)
*{{tl|Redirect-several}} (for several redirects, without listing each)
*{{tl|Redirect-synonym}}
*{{tl|Redirect-distinguish}}
*{{tl|Redirect-distinguish-text}}
*{{tl|Redirect-distinguish-for}}
*{{tl|Technical reasons}}
| group5 = Distinguish
| list5 =
*{{tl|Distinguish}} (supports custom text)
*{{tl|About-distinguish}}
*{{tl|About-distinguish-text}} (for custom text)
*{{tl|Redirect-distinguish}}
*{{tl|Redirect-distinguish-text}} (for custom text)
*{{tl|Redirect-distinguish-for}}
| group6 = For use in sections
| list6 =
*{{tl|Main}}
*{{tl|Main if exists}}
*{{tl|Main list}}
*{{tl|Further}}
*{{tl|Further-text}} (for custom text)
*{{tl|Further interlanguage link}}
*{{tl|See also}}
*{{tl|See also if exists}}
*{{tl|See also-text}} (for custom text)
*{{tl|For outline}}
*{{tl|For timeline}}
| group7 = Special
| list7 =
*{{tl|Broader}}
*{{tl|For introduction}}
*{{tl|See Wiktionary}}
*{{tl|Transcluding article}}
*{{tl|Transcluded section}}
| group8 = Subject specific
| list8 =
* {{tl|About year}}
* {{tl|Highway detail hatnote}}
* {{tl|For LMST}}
* {{tl|WikiIPA}}
| below =
*{{Icon|cat}} [[:Category:Hatnote templates]]
**[[:Category:Hatnote modules|modules]]
**[[:Category:Hatnote templates for names|for [family] names]]
**[[:Category:Hatnote templates for lists|for lists]]
*[[Template:Category hatnote templates|hatnote templates for category pages]]
}}<noinclude>
{{Documentation}}
</noinclude>
5ea17ab2381b3c2002e4846f08d462d2574b6015
Module:Transclusion count/data/D
828
110
316
315
2023-10-17T17:54:35Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Transclusion_count/data/D]]
Scribunto
text/plain
return {
["D&D"] = 3900,
["D&D_to-do"] = 5600,
["D-da"] = 2600,
["DANFS"] = 8400,
["DC-Comics-trademark-copyright"] = 2100,
["DCS_Sri_Lanka"] = 2100,
["DDR"] = 2800,
["DEC"] = 8700,
["DECADE"] = 283000,
["DEN"] = 6800,
["DEU"] = 17000,
["DMC"] = 60000,
["DMCA"] = 2360000,
["DNB"] = 8800,
["DNB-Portal"] = 2100,
["DNB_portal"] = 3800,
["DNK"] = 7800,
["DNZB"] = 3600,
["DOM"] = 2100,
["DOWs"] = 2700,
["DRV_links"] = 3600,
["DWT"] = 2300,
["DYKC"] = 6700,
["DYKF"] = 2100,
["DYK_blue"] = 3400,
["DYK_checklist"] = 14000,
["DYK_conditions"] = 67000,
["DYK_files"] = 2100,
["DYK_header"] = 35000,
["DYK_nompage_links"] = 79000,
["DYK_talk"] = 103000,
["DYK_talk/date"] = 103000,
["DYK_tools"] = 52000,
["DYK_tools/styles.css"] = 52000,
["DYKfile"] = 12000,
["DZA"] = 2800,
["Dab"] = 18000,
["Dagger"] = 18000,
["Dark_red"] = 2000,
["Dashboard.wikiedu.org_assignment"] = 15000,
["Dashboard.wikiedu.org_bibliography/guide"] = 7100,
["Dashboard.wikiedu.org_course_header"] = 6200,
["Dashboard.wikiedu.org_course_header/edit-note"] = 6200,
["Dashboard.wikiedu.org_draft_template/about_this_sandbox"] = 11000,
["Dashboard.wikiedu.org_evaluate_article/guide"] = 8500,
["Dashboard.wikiedu.org_peer_review/guide"] = 12000,
["Dashboard.wikiedu.org_sandbox"] = 97000,
["Dashboard.wikiedu.org_student_editor"] = 85000,
["Dashboard.wikiedu.org_student_program_sandbox"] = 96000,
["Dashboard.wikiedu.org_talk_course_link"] = 86000,
["Dashboard.wikiedu.org_user_talk"] = 2200,
["Date"] = 43000,
["Date-mf"] = 39000,
["Date_table_sorting"] = 39000,
["Dated_maintenance_category"] = 2410000,
["Dated_maintenance_category_(articles)"] = 2360000,
["Dated_maintenance_category_by_type_(articles)"] = 22000,
["Davis_Cup_player"] = 2500,
["Day+1"] = 6900,
["Day-1"] = 8300,
["Dbox"] = 3000,
["Dda"] = 5200,
["Dead_YouTube_link"] = 2700,
["Dead_Youtube_links"] = 2200,
["Dead_link"] = 288000,
["Deadlink"] = 3100,
["Death-date"] = 11000,
["Death-date_and_age"] = 10000,
["Death_date"] = 9200,
["Death_date_and_age"] = 390000,
["Death_date_and_given_age"] = 2800,
["Death_date_text"] = 11000,
["Death_year_and_age"] = 16000,
["Death_year_category_header"] = 2000,
["Decade"] = 2100,
["Decade_link"] = 32000,
["Decimals"] = 3100,
["Decline"] = 2500,
["Declined"] = 3200,
["Decrease"] = 35000,
["Define"] = 4400,
["Deg2DMS"] = 3400,
["Deletion_review_log_header"] = 5700,
["Deletion_review_log_header/Core"] = 5700,
["Delink"] = 1990000,
["Delink_question_hyphen-minus"] = 295000,
["Delrevxfd"] = 3600,
["Democratic_Party_(US)/meta/shading"] = 15000,
["Description_missing"] = 7000,
["Designation/abbreviation"] = 8300,
["Designation/color"] = 76000,
["Designation/colour"] = 79000,
["Designation/colour2"] = 18000,
["Designation/divbox"] = 30000,
["Designation/text"] = 42000,
["Designation_list"] = 5500,
["Details"] = 4500,
["DetailsLink"] = 5900,
["Detect_singular"] = 202000,
["Deutsche_Bahn_station_codes"] = 2200,
["DfE_performance_tables"] = 4500,
["Diff"] = 31000,
["Diff2"] = 12000,
["Digits"] = 22000,
["Directories_box"] = 3200,
["Disamb"] = 2200,
["Disambig"] = 63000,
["Disambig-Class"] = 12000,
["DisambigProj"] = 12000,
["DisambigProject"] = 150000,
["Disambigproject"] = 5800,
["Disambiguation"] = 219000,
["Disambiguation/cat"] = 218000,
["Disambiguation_page_short_description"] = 354000,
["Discogs_artist"] = 17000,
["Discogs_master"] = 12000,
["Discogs_release"] = 3100,
["Discussion_bottom"] = 12000,
["Discussion_top"] = 13000,
["DisestcatCountry"] = 9500,
["DisestcatCountry/core"] = 9500,
["DisestcatCountryDecade"] = 2600,
["DisestcatUSstate"] = 4900,
["DisestcatUSstate/core"] = 4900,
["Disputed"] = 2200,
["Distinguish"] = 98000,
["Disused_Rail_Start"] = 3900,
["Disused_rail_start"] = 4300,
["Disused_style"] = 4700,
["Div_col"] = 400000,
["Div_col/styles.css"] = 402000,
["Div_col_end"] = 302000,
["Div_end"] = 2700,
["Divbox"] = 349000,
["Divbox/styles.css"] = 372000,
["Dividing_line"] = 4000,
["Dmbox"] = 462000,
["Dmbox/styles.css"] = 462000,
["Do_not_move_to_Commons"] = 16000,
["Doc"] = 3600,
["Documentation"] = 121000,
["Documentation_subpage"] = 95000,
["Dog_opentask"] = 3500,
["Doi"] = 26000,
["Doing"] = 3600,
["Don't_edit_this_line"] = 108000,
["Don't_edit_this_line_always_display"] = 481000,
["Don't_edit_this_line_extinct"] = 481000,
["Don't_edit_this_line_link_target"] = 481000,
["Don't_edit_this_line_link_text"] = 481000,
["Don't_edit_this_line_parent"] = 481000,
["Don't_edit_this_line_rank"] = 481000,
["Don't_edit_this_line_refs"] = 108000,
["Don't_edit_this_line_same_as"] = 481000,
["Done"] = 103000,
["Doppelganger"] = 2800,
["Double+single"] = 2900,
["Double-dagger"] = 20000,
["Dr"] = 3400,
["Dr-logno"] = 3400,
["Dr-make"] = 3500,
["Dr-yr"] = 3400,
["Draft"] = 4300,
["Draft_article"] = 6400,
["Draft_article_check"] = 6500,
["Draft_categories"] = 8400,
["Draft_other"] = 111000,
["Draft_topics"] = 24000,
["Drafts_moved_from_mainspace"] = 8700,
["Draw"] = 3900,
["Draw_key"] = 18000,
["Draw_links"] = 13000,
["Drep"] = 3500,
["DriverDB_driver"] = 2200,
["Drugbankcite"] = 4300,
["Drugbox"] = 7600,
["Drugs.com"] = 3800,
["Ds/talk_notice"] = 6400,
["Dts"] = 38000,
["Dubious"] = 8200,
["Duck"] = 2900,
["Dummytab"] = 5000,
["Duration"] = 38000,
["Dutch_municipality"] = 2700,
["Dyktalk"] = 42000,
["Dynamic_list"] = 10000,
["Module:DYK_checklist"] = 14000,
["Module:DYK_checklist/data"] = 14000,
["Module:DYK_nompage_links"] = 79000,
["Module:Data"] = 149000,
["Module:Date"] = 1380000,
["Module:DateI18n"] = 66000,
["Module:Date_table_sorting"] = 39000,
["Module:DecodeEncode"] = 117000,
["Module:Delink"] = 2090000,
["Module:Detect_singular"] = 1530000,
["Module:Disambiguation"] = 15900000,
["Module:Disambiguation/templates"] = 15800000,
["Module:Distinguish"] = 98000,
["Module:Documentation"] = 168000,
["Module:Documentation/config"] = 168000,
["Module:Documentation/styles.css"] = 167000,
["Module:Draft_topics"] = 24000,
["Module:Duration"] = 239000,
}
ac0a990e962d53ead1be53dc1d121ce12083c33a
Template:Distinguish/doc
10
111
318
317
2023-10-17T17:54:37Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Distinguish/doc]]
wikitext
text/x-wiki
{{Documentation subpage}}
{{tsh|dist}}
<!-- Please add categories at the bottom of this page, and interwikis at Wikidata (see Wikipedia:Wikidata) -->
{{High-use| 65005 }}
{{Lua|Module:distinguish}}
== Description ==
The "distinguish" template produces a [[WP:HAT|hatnote]] to point out to our readers the existence of one or more articles whose title(s) is, or are, similar to the page in question. It is used in cases where the distinction between the titles is generally obvious and does not need further explanation.
For those cases where an explanation is required, please use the templates {{tl|For}} and {{tl|About}}. For use on category pages, the corresponding template is {{Tl|Category distinguish}}.
== Usage ==
Here is an example of its standard usage (used, for purposes of this example, with the placeholder article "Foo"; the following could be placed on a theoretical article named "Foo (song)", or perhaps one named "Fou" or "Fu"):
{{tlx|distinguish|Foo}} → {{Distinguish|Foo}}
This hatnote can be used to distinguish the topic from multiple other topics:
{{tlx|distinguish|Foo|Bar}} → {{Distinguish|Foo|Bar}}
{{tlx|distinguish|Foo|Bar|Baz}} → {{Distinguish|Foo|Bar|Baz}}
The {{para|text}} parameter can be used to create customized text, in case context is required. An example is on the article [[Phobos (mythology)]], which contains a customized hatnote to distinguish it and "[[Phoebus]]" (a redirect of [[Apollo]]). Both links lead to topics about Greek gods, so the [[WP:NCDAB|parenthetical disambiguation]] in "Phobos (mythology)" is insufficient to disambiguate the two. Since it [[WP:HNR|is typically not preferable to link a redirect]] in a hatnote, the article "Apollo" is linked to directly and a short explanation fills in the necessary context:
{{tlx|distinguish|text {{=}} Phoebus, an epithet of the Greek god [[Apollo]]}} → {{Distinguish|text = Phoebus, an epithet of the Greek god [[Apollo]] }}
Note that a final period is automatically added at the end of the sentence, and that only one blue link is used per disambiguated topic (i.e, do not type <code><nowiki>...an [[epithet]] of the [[Greek]] god [[Apollo]].</nowiki></code>
When the target is a disambiguation page, display of the parentheses may be avoided by escaping the vertical bar using the [[Help:Magic words|magic word]] {{Tl|!}}:
{{Tick}}{{tlx|distinguish|Crossfire (disambiguation){{!}}Crossfire}} → {{Distinguish|Crossfire (disambiguation){{!}}Crossfire}}
The escape is necessary, otherwise the template will read the next text as another topic:
{{Cross}}{{tlx|distinguish|Crossfire (disambiguation)|Crossfire}} → {{Distinguish|Crossfire (disambiguation)|Crossfire}}
== When to use ==
This hatnote is generally used when readers have misspelled their desired title, and the error would be apparent by simply displaying the alternative term without further explanation. For example, consider a reader looking for the punctuation mark who instead ends up at [[coma]]:
: [[Coma]]
: {{Distinguish|Comma}}
Readers are presumed to recognize that they actually wanted ''comma'' by merely looking at the spelling, and this case generally requires no further explanation.
However, {{tlx|distinguish}} is not suitable when the difference is not readily apparent without additional details. Consider a reader looking for a game they believe is named Reversi:
: {{cross}} [[Reversi]]
: {{Distinguish|Reversis}}
In the above hatnote, it is not generally apparent how the suggested Reversis is different from Reversi, which is also a game.
In this case you should use {{tlx|about}} instead of {{tlc|distinguish}}. The difference is to provide explanation upfront without requiring the reader to click through and differentiate the terms on their own.
: {{tick}} [[Reversi]]
:: ''This article is about the board game. For the card game, see [[Reversis]].''
{{tlc|Distinguish}} should only be used when the ambiguity exists for a portion of the readership that is sufficient to warrant a hatnote. Care should be taken to [[WP:TRHAT|avoid trivial uses]].
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"params": {
"1": {
"label": "Name of article",
"description": "Name of article that you want to link to",
"type": "wiki-page-name",
"suggested": true
},
"2": {
"label": "Optional additional article to link (2)",
"description": "Optional additional article to link",
"type": "wiki-page-name"
},
"3": {
"label": "Optional additional article to link (3)",
"description": "Optional additional article to link",
"type": "wiki-page-name"
},
"4": {
"label": "Optional additional article to link (4)",
"description": "Optional additional article to link",
"type": "wiki-page-name"
},
"text": {
"label": "Custom text",
"description": "Custom message in wikitext; e.g. \"[[foo]] and [[Bar (computer science)|bar]]\" produces \"Not to be confused with [[foo]] and [[Bar (computer science)|bar]].\"",
"type": "string"
},
"selfref": {
"label": "Self reference",
"description": "If set, marks note as being a self reference, to not be shown when content is reused",
"type": "boolean"
}
},
"description": "A hatnote used when there is an ambiguity in an article's title.",
"paramOrder": [
"1",
"2",
"3",
"4",
"text",
"selfref"
],
"format": "inline"
}
</templatedata>
== Redirects ==
* {{tl|Confused}}
* {{tl|Confuse}}
* {{tl|Misspelling}}
* {{tl|Nottobeconfusedwith}}
* {{tl|Ntbcw}}
== See also ==
* {{tl|About}}
* {{tl|Category distinguish}}
* {{tl|For}}
* {{tl|Redirect}}
* {{tl|R from misspelling}}
{{Hatnote templates}}
<includeonly>{{sandbox other||
<!-- Add categories below this line, and interwikis at Wikidata -->
[[Category:Disambiguation and redirection templates]]
[[Category:Hatnote templates]]
}}</includeonly>
86c325ae7de845d5db3beba07711e598cc2c1092
Template:Plainlist/styles.css
10
112
320
319
2023-10-17T17:54:38Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Plainlist/styles.css]]
sanitized-css
text/css
/* {{pp-template|small=yes}} */
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none;
margin: 0;
padding: 0; /* Reset Minerva default */
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
51706efa229ff8794c0d94f260a208e7c5e6ec30
Module:Shortcut/styles.css
828
113
322
321
2023-10-17T17:54:38Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Shortcut/styles.css]]
sanitized-css
text/css
/* {{pp-template}} */
.module-shortcutboxplain {
float: right;
margin: 0 0 0 1em;
border: 1px solid #aaa;
background: #fff;
padding: 0.3em 0.6em 0.2em 0.6em;
text-align: center;
font-size: 85%;
}
.module-shortcutboxleft {
float: left;
margin: 0 1em 0 0;
}
.module-shortcutlist {
display: inline-block;
border-bottom: 1px solid #aaa;
margin-bottom: 0.2em;
}
.module-shortcutboxplain ul {
font-weight: bold;
}
.module-shortcutanchordiv {
position: relative;
top: -3em;
}
li .module-shortcutanchordiv {
float: right; /* IE/Edge in list items */
}
.mbox-imageright .module-shortcutboxplain {
padding: 0.4em 1em 0.4em 1em;
line-height: 1.3;
margin: 0;
}
ccf3877e4b14726147d3b1d8a297fbecacdb2cf8
Template:Userbox
10
114
324
323
2023-10-17T18:02:53Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Userbox]]
wikitext
text/x-wiki
{{#invoke:userbox|userbox}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
43f31821f815f586868b4e5ea3e7116d7b972f58
Module:Namespace detect/data
828
115
326
325
2023-10-17T18:02:55Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Namespace_detect/data]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect data --
-- This module holds data for [[Module:Namespace detect]] to be loaded per --
-- page, rather than per #invoke, for performance reasons. --
--------------------------------------------------------------------------------
local cfg = require('Module:Namespace detect/config')
local function addKey(t, key, defaultKey)
if key ~= defaultKey then
t[#t + 1] = key
end
end
-- Get a table of parameters to query for each default parameter name.
-- This allows wikis to customise parameter names in the cfg table while
-- ensuring that default parameter names will always work. The cfg table
-- values can be added as a string, or as an array of strings.
local defaultKeys = {
'main',
'talk',
'other',
'subjectns',
'demospace',
'demopage'
}
local argKeys = {}
for i, defaultKey in ipairs(defaultKeys) do
argKeys[defaultKey] = {defaultKey}
end
for defaultKey, t in pairs(argKeys) do
local cfgValue = cfg[defaultKey]
local cfgValueType = type(cfgValue)
if cfgValueType == 'string' then
addKey(t, cfgValue, defaultKey)
elseif cfgValueType == 'table' then
for i, key in ipairs(cfgValue) do
addKey(t, key, defaultKey)
end
end
cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.
end
local function getParamMappings()
--[[
-- Returns a table of how parameter names map to namespace names. The keys
-- are the actual namespace names, in lower case, and the values are the
-- possible parameter names for that namespace, also in lower case. The
-- table entries are structured like this:
-- {
-- [''] = {'main'},
-- ['wikipedia'] = {'wikipedia', 'project', 'wp'},
-- ...
-- }
--]]
local mappings = {}
local mainNsName = mw.site.subjectNamespaces[0].name
mainNsName = mw.ustring.lower(mainNsName)
mappings[mainNsName] = mw.clone(argKeys.main)
mappings['talk'] = mw.clone(argKeys.talk)
for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lower(ns.name)
local canonicalName = mw.ustring.lower(ns.canonicalName)
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
table.insert(mappings[nsname], canonicalName)
end
for _, alias in ipairs(ns.aliases) do
table.insert(mappings[nsname], mw.ustring.lower(alias))
end
end
end
return mappings
end
return {
argKeys = argKeys,
cfg = cfg,
mappings = getParamMappings()
}
d224f42a258bc308ef3ad8cc8686cd7a4f47d005
Module:Namespace detect/config
828
116
328
327
2023-10-17T18:02:55Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Namespace_detect/config]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect configuration data --
-- --
-- This module stores configuration data for Module:Namespace detect. Here --
-- you can localise the module to your wiki's language. --
-- --
-- To activate a configuration item, you need to uncomment it. This means --
-- that you need to remove the text "-- " at the start of the line. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. Values added --
-- here will work in addition to the default English parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- cfg.foo = 'parameter name' --
-- --
-- To add multiple names, you can use this format: --
-- --
-- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} --
--------------------------------------------------------------------------------
---- This parameter displays content for the main namespace:
-- cfg.main = 'main'
---- This parameter displays in talk namespaces:
-- cfg.talk = 'talk'
---- This parameter displays content for "other" namespaces (namespaces for which
---- parameters have not been specified):
-- cfg.other = 'other'
---- This parameter makes talk pages behave as though they are the corresponding
---- subject namespace. Note that this parameter is used with [[Module:Yesno]].
---- Edit that module to change the default values of "yes", "no", etc.
-- cfg.subjectns = 'subjectns'
---- This parameter sets a demonstration namespace:
-- cfg.demospace = 'demospace'
---- This parameter sets a specific page to compare:
cfg.demopage = 'page'
--------------------------------------------------------------------------------
-- Table configuration --
-- These configuration items allow customisation of the "table" function, --
-- used to generate a table of possible parameters in the module --
-- documentation. --
--------------------------------------------------------------------------------
---- The header for the namespace column in the wikitable containing the list of
---- possible subject-space parameters.
-- cfg.wikitableNamespaceHeader = 'Namespace'
---- The header for the wikitable containing the list of possible subject-space
---- parameters.
-- cfg.wikitableAliasesHeader = 'Aliases'
--------------------------------------------------------------------------------
-- End of configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.
0e4ff08d13c4b664d66b32c232deb129b77c1a56
Module:Category handler
828
117
330
329
2023-10-17T18:02:57Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Category_handler]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- --
-- CATEGORY HANDLER --
-- --
-- This module implements the {{category handler}} template in Lua, --
-- with a few improvements: all namespaces and all namespace aliases --
-- are supported, and namespace names are detected automatically for --
-- the local wiki. This module requires [[Module:Namespace detect]] --
-- and [[Module:Yesno]] to be available on the local wiki. It can be --
-- configured for different wikis by altering the values in --
-- [[Module:Category handler/config]], and pages can be blacklisted --
-- from categorisation by using [[Module:Category handler/blacklist]]. --
-- --
--------------------------------------------------------------------------------
-- Load required modules
local yesno = require('Module:Yesno')
-- Lazily load things we don't always need
local mShared, mappings
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function trimWhitespace(s, removeBlanks)
if type(s) ~= 'string' then
return s
end
s = s:match('^%s*(.-)%s*$')
if removeBlanks then
if s ~= '' then
return s
else
return nil
end
else
return s
end
end
--------------------------------------------------------------------------------
-- CategoryHandler class
--------------------------------------------------------------------------------
local CategoryHandler = {}
CategoryHandler.__index = CategoryHandler
function CategoryHandler.new(data, args)
local obj = setmetatable({ _data = data, _args = args }, CategoryHandler)
-- Set the title object
do
local pagename = obj:parameter('demopage')
local success, titleObj
if pagename then
success, titleObj = pcall(mw.title.new, pagename)
end
if success and titleObj then
obj.title = titleObj
if titleObj == mw.title.getCurrentTitle() then
obj._usesCurrentTitle = true
end
else
obj.title = mw.title.getCurrentTitle()
obj._usesCurrentTitle = true
end
end
-- Set suppression parameter values
for _, key in ipairs{'nocat', 'categories'} do
local value = obj:parameter(key)
value = trimWhitespace(value, true)
obj['_' .. key] = yesno(value)
end
do
local subpage = obj:parameter('subpage')
local category2 = obj:parameter('category2')
if type(subpage) == 'string' then
subpage = mw.ustring.lower(subpage)
end
if type(category2) == 'string' then
subpage = mw.ustring.lower(category2)
end
obj._subpage = trimWhitespace(subpage, true)
obj._category2 = trimWhitespace(category2) -- don't remove blank values
end
return obj
end
function CategoryHandler:parameter(key)
local parameterNames = self._data.parameters[key]
local pntype = type(parameterNames)
if pntype == 'string' or pntype == 'number' then
return self._args[parameterNames]
elseif pntype == 'table' then
for _, name in ipairs(parameterNames) do
local value = self._args[name]
if value ~= nil then
return value
end
end
return nil
else
error(string.format(
'invalid config key "%s"',
tostring(key)
), 2)
end
end
function CategoryHandler:isSuppressedByArguments()
return
-- See if a category suppression argument has been set.
self._nocat == true
or self._categories == false
or (
self._category2
and self._category2 ~= self._data.category2Yes
and self._category2 ~= self._data.category2Negative
)
-- Check whether we are on a subpage, and see if categories are
-- suppressed based on our subpage status.
or self._subpage == self._data.subpageNo and self.title.isSubpage
or self._subpage == self._data.subpageOnly and not self.title.isSubpage
end
function CategoryHandler:shouldSkipBlacklistCheck()
-- Check whether the category suppression arguments indicate we
-- should skip the blacklist check.
return self._nocat == false
or self._categories == true
or self._category2 == self._data.category2Yes
end
function CategoryHandler:matchesBlacklist()
if self._usesCurrentTitle then
return self._data.currentTitleMatchesBlacklist
else
mShared = mShared or require('Module:Category handler/shared')
return mShared.matchesBlacklist(
self.title.prefixedText,
mw.loadData('Module:Category handler/blacklist')
)
end
end
function CategoryHandler:isSuppressed()
-- Find if categories are suppressed by either the arguments or by
-- matching the blacklist.
return self:isSuppressedByArguments()
or not self:shouldSkipBlacklistCheck() and self:matchesBlacklist()
end
function CategoryHandler:getNamespaceParameters()
if self._usesCurrentTitle then
return self._data.currentTitleNamespaceParameters
else
if not mappings then
mShared = mShared or require('Module:Category handler/shared')
mappings = mShared.getParamMappings(true) -- gets mappings with mw.loadData
end
return mShared.getNamespaceParameters(
self.title,
mappings
)
end
end
function CategoryHandler:namespaceParametersExist()
-- Find whether any namespace parameters have been specified.
-- We use the order "all" --> namespace params --> "other" as this is what
-- the old template did.
if self:parameter('all') then
return true
end
if not mappings then
mShared = mShared or require('Module:Category handler/shared')
mappings = mShared.getParamMappings(true) -- gets mappings with mw.loadData
end
for ns, params in pairs(mappings) do
for i, param in ipairs(params) do
if self._args[param] then
return true
end
end
end
if self:parameter('other') then
return true
end
return false
end
function CategoryHandler:getCategories()
local params = self:getNamespaceParameters()
local nsCategory
for i, param in ipairs(params) do
local value = self._args[param]
if value ~= nil then
nsCategory = value
break
end
end
if nsCategory ~= nil or self:namespaceParametersExist() then
-- Namespace parameters exist - advanced usage.
if nsCategory == nil then
nsCategory = self:parameter('other')
end
local ret = {self:parameter('all')}
local numParam = tonumber(nsCategory)
if numParam and numParam >= 1 and math.floor(numParam) == numParam then
-- nsCategory is an integer
ret[#ret + 1] = self._args[numParam]
else
ret[#ret + 1] = nsCategory
end
if #ret < 1 then
return nil
else
return table.concat(ret)
end
elseif self._data.defaultNamespaces[self.title.namespace] then
-- Namespace parameters don't exist, simple usage.
return self._args[1]
end
return nil
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p = {}
function p._exportClasses()
-- Used for testing purposes.
return {
CategoryHandler = CategoryHandler
}
end
function p._main(args, data)
data = data or mw.loadData('Module:Category handler/data')
local handler = CategoryHandler.new(data, args)
if handler:isSuppressed() then
return nil
end
return handler:getCategories()
end
function p.main(frame, data)
data = data or mw.loadData('Module:Category handler/data')
local args = require('Module:Arguments').getArgs(frame, {
wrappers = data.wrappers,
valueFunc = function (k, v)
v = trimWhitespace(v)
if type(k) == 'number' then
if v ~= '' then
return v
else
return nil
end
else
return v
end
end
})
return p._main(args, data)
end
return p
b74dd63857b24904ac452429b11213f18647471f
Module:Category handler/data
828
118
332
331
2023-10-17T18:02:57Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Category_handler/data]]
Scribunto
text/plain
-- This module assembles data to be passed to [[Module:Category handler]] using
-- mw.loadData. This includes the configuration data and whether the current
-- page matches the title blacklist.
local data = require('Module:Category handler/config')
local mShared = require('Module:Category handler/shared')
local blacklist = require('Module:Category handler/blacklist')
local title = mw.title.getCurrentTitle()
data.currentTitleMatchesBlacklist = mShared.matchesBlacklist(
title.prefixedText,
blacklist
)
data.currentTitleNamespaceParameters = mShared.getNamespaceParameters(
title,
mShared.getParamMappings()
)
return data
abbc68048ff698e88dda06b64ecf384bbf583120
Module:Category handler/config
828
119
334
333
2023-10-17T18:02:58Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Category_handler/config]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- [[Module:Category handler]] configuration data --
-- Language-specific parameter names and values can be set here. --
-- For blacklist config, see [[Module:Category handler/blacklist]]. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- foo = 'parameter name', --
-- --
-- To add multiple names, you can use this format: --
-- --
-- foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'}, --
--------------------------------------------------------------------------------
cfg.parameters = {
-- The nocat and categories parameter suppress
-- categorisation. They are used with Module:Yesno, and work as follows:
--
-- cfg.nocat:
-- Result of yesno() Effect
-- true Categorisation is suppressed
-- false Categorisation is allowed, and
-- the blacklist check is skipped
-- nil Categorisation is allowed
--
-- cfg.categories:
-- Result of yesno() Effect
-- true Categorisation is allowed, and
-- the blacklist check is skipped
-- false Categorisation is suppressed
-- nil Categorisation is allowed
nocat = 'nocat',
categories = 'categories',
-- The parameter name for the legacy "category2" parameter. This skips the
-- blacklist if set to the cfg.category2Yes value, and suppresses
-- categorisation if present but equal to anything other than
-- cfg.category2Yes or cfg.category2Negative.
category2 = 'category2',
-- cfg.subpage is the parameter name to specify how to behave on subpages.
subpage = 'subpage',
-- The parameter for data to return in all namespaces.
all = 'all',
-- The parameter name for data to return if no data is specified for the
-- namespace that is detected.
other = 'other',
-- The parameter name used to specify a page other than the current page;
-- used for testing and demonstration.
demopage = 'page',
}
--------------------------------------------------------------------------------
-- Parameter values --
-- These are set values that can be used with certain parameters. Only one --
-- value can be specified, like this: --
-- --
-- cfg.foo = 'value name' -- --
--------------------------------------------------------------------------------
-- The following settings are used with the cfg.category2 parameter. Setting
-- cfg.category2 to cfg.category2Yes skips the blacklist, and if cfg.category2
-- is present but equal to anything other than cfg.category2Yes or
-- cfg.category2Negative then it supresses cateogrisation.
cfg.category2Yes = 'yes'
cfg.category2Negative = '¬'
-- The following settings are used with the cfg.subpage parameter.
-- cfg.subpageNo is the value to specify to not categorise on subpages;
-- cfg.subpageOnly is the value to specify to only categorise on subpages.
cfg.subpageNo = 'no'
cfg.subpageOnly = 'only'
--------------------------------------------------------------------------------
-- Default namespaces --
-- This is a table of namespaces to categorise by default. The keys are the --
-- namespace numbers. --
--------------------------------------------------------------------------------
cfg.defaultNamespaces = {
[ 0] = true, -- main
[ 6] = true, -- file
[ 12] = true, -- help
[ 14] = true, -- category
[100] = true, -- portal
[108] = true, -- book
}
--------------------------------------------------------------------------------
-- Wrappers --
-- This is a wrapper template or a list of wrapper templates to be passed to --
-- [[Module:Arguments]]. --
--------------------------------------------------------------------------------
cfg.wrappers = 'Template:Category handler'
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.
373cd107b13a5b00e6a1b7e66a749f12502c849d
Module:Category handler/shared
828
120
336
335
2023-10-17T18:02:58Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Category_handler/shared]]
Scribunto
text/plain
-- This module contains shared functions used by [[Module:Category handler]]
-- and its submodules.
local p = {}
function p.matchesBlacklist(page, blacklist)
for i, pattern in ipairs(blacklist) do
local match = mw.ustring.match(page, pattern)
if match then
return true
end
end
return false
end
function p.getParamMappings(useLoadData)
local dataPage = 'Module:Namespace detect/data'
if useLoadData then
return mw.loadData(dataPage).mappings
else
return require(dataPage).mappings
end
end
function p.getNamespaceParameters(titleObj, mappings)
-- We don't use title.nsText for the namespace name because it adds
-- underscores.
local mappingsKey
if titleObj.isTalkPage then
mappingsKey = 'talk'
else
mappingsKey = mw.site.namespaces[titleObj.namespace].name
end
mappingsKey = mw.ustring.lower(mappingsKey)
return mappings[mappingsKey] or {}
end
return p
d2d5de1a031e6ce97c242cbfa8afe7a92cb9eca5
Module:Category handler/blacklist
828
121
338
337
2023-10-17T18:02:59Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Category_handler/blacklist]]
Scribunto
text/plain
-- This module contains the blacklist used by [[Module:Category handler]].
-- Pages that match Lua patterns in this list will not be categorised unless
-- categorisation is explicitly requested.
return {
'^Main Page$', -- don't categorise the main page.
-- Don't categorise the following pages or their subpages.
-- "%f[/\0]" matches if the next character is "/" or the end of the string.
'^Wikipedia:Cascade%-protected items%f[/\0]',
'^User:UBX%f[/\0]', -- The userbox "template" space.
'^User talk:UBX%f[/\0]',
-- Don't categorise subpages of these pages, but allow
-- categorisation of the base page.
'^Wikipedia:Template index/.*$',
-- Don't categorise archives.
'/[aA]rchive',
"^Wikipedia:Administrators' noticeboard/IncidentArchive%d+$",
}
87469d7a9ef2a3c41b2bf04ae18f7c59a18fb855
Template:Navbar
10
33
340
79
2023-10-17T18:03:03Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Navbar]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Template translation{{{sandbox|}}}|renderTranslatedTemplate|uselang={{{uselang|}}}|tntns={{{namespace|{{{tntns|}}}}}}|template={{#if:{{{noshift|}}}|{{{template}}}|{{{1}}}}}|noshift={{{noshift|}}}<!-- all other numbered or named parameters are found by the module using the parent frame -->}}</includeonly><noinclude>{{documentation}}</noinclude>
639aa3ce6c91c67b8151f8394f92cd2a44bb7a4b
Module:Userbox
828
122
342
341
2023-10-17T18:03:05Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Userbox]]
Scribunto
text/plain
-- This module implements {{userbox}}.
local categoryHandler = require('Module:Category handler').main
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function checkNum(val, default)
-- Checks whether a value is a number greater than or equal to zero. If so,
-- returns it as a number. If not, returns a default value.
val = tonumber(val)
if val and val >= 0 then
return val
else
return default
end
end
local function addSuffix(num, suffix)
-- Turns a number into a string and adds a suffix.
if num then
return tostring(num) .. suffix
else
return nil
end
end
local function checkNumAndAddSuffix(num, default, suffix)
-- Checks a value with checkNum and adds a suffix.
num = checkNum(num, default)
return addSuffix(num, suffix)
end
local function makeCat(cat, sort)
-- Makes a category link.
if sort then
return mw.ustring.format('[[Category:%s|%s]]', cat, sort)
else
return mw.ustring.format('[[Category:%s]]', cat)
end
end
--------------------------------------------------------------------------------
-- Argument processing
--------------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local origArgs = require('Module:Arguments').getArgs(frame)
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.main(funcName, args)
end
end
p.userbox = makeInvokeFunc('_userbox')
p['userbox-2'] = makeInvokeFunc('_userbox-2')
p['userbox-r'] = makeInvokeFunc('_userbox-r')
--------------------------------------------------------------------------------
-- Main functions
--------------------------------------------------------------------------------
function p.main(funcName, args)
local userboxData = p[funcName](args)
local userbox = p.render(userboxData)
local cats = p.categories(args)
return userbox .. (cats or '')
end
function p._userbox(args)
-- Does argument processing for {{userbox}}.
local data = {}
-- Get div tag values.
data.float = args.float or 'left'
local borderWidthNum = checkNum(args['border-width'] or args['border-s'], 1) -- Used to calculate width.
data.borderWidth = addSuffix(borderWidthNum, 'px')
data.borderColor = args['border-color'] or args['border-c'] or args[1] or args['id-c'] or '#999'
data.width = addSuffix(240 - 2 * borderWidthNum, 'px') -- Also used in the table tag.
data.bodyClass = args.bodyclass
-- Get table tag values.
data.backgroundColor = args['info-background'] or args[2] or args['info-c'] or '#eee'
-- Get info values.
data.info = args.info or args[4] or "<code>{{{info}}}</code>"
data.infoTextAlign = args['info-a'] or 'left'
data.infoFontSize = checkNumAndAddSuffix(args['info-size'] or args['info-s'], 8, 'pt')
data.infoHeight = checkNumAndAddSuffix(args['logo-height'] or args['id-h'], 45, 'px')
data.infoPadding = args['info-padding'] or args['info-p'] or '0 4px 0 4px'
data.infoLineHeight = args['info-line-height'] or args['info-lh'] or '1.25em'
data.infoColor = args['info-color'] or args['info-fc'] or 'black'
data.infoOtherParams = args['info-other-param'] or args['info-op']
data.infoClass = args['info-class']
-- Get id values.
local id = args.logo or args[3] or args.id
data.id = id
data.showId = id and true or false
data.idWidth = checkNumAndAddSuffix(args['logo-width'] or args['id-w'], 45, 'px')
data.idHeight = checkNumAndAddSuffix(args['logo-height'] or args['id-h'], 45, 'px')
data.idBackgroundColor = args['logo-background'] or args[1] or args['id-c'] or '#ddd'
data.idTextAlign = args['id-a'] or 'center'
data.idFontSize = checkNum(args['logo-size'] or args[5] or args['id-s'], 14)
data.idColor = args['logo-color'] or args['id-fc'] or data.infoColor
data.idPadding = args['logo-padding'] or args['id-p'] or '0 1px 0 0'
data.idLineHeight = args['logo-line-height'] or args['id-lh'] or '1.25em'
data.idOtherParams = args['logo-other-param'] or args['id-op']
data.idClass = args['id-class']
return data
end
p['_userbox-2'] = function (args)
-- Does argument processing for {{userbox-2}}.
local data = {}
-- Get div tag values.
data.float = args.float or 'left'
local borderWidthNum = checkNum(args['border-s'] or args[9], 1) -- Used to calculate width.
data.borderWidth = addSuffix(borderWidthNum, 'px')
data.borderColor = args['border-c'] or args[6] or args['id1-c'] or args[1] or '#999999'
data.width = addSuffix(240 - 2 * borderWidthNum, 'px') -- Also used in the table tag.
data.bodyClass = args.bodyclass
-- Get table tag values.
data.backgroundColor = args['info-c'] or args[2] or '#eeeeee'
-- Get info values.
data.info = args.info or args[4] or "<code>{{{info}}}</code>"
data.infoTextAlign = args['info-a'] or 'left'
data.infoFontSize = checkNumAndAddSuffix(args['info-s'], 8, 'pt')
data.infoColor = args['info-fc'] or args[8] or 'black'
data.infoPadding = args['info-p'] or '0 4px 0 4px'
data.infoLineHeight = args['info-lh'] or '1.25em'
data.infoOtherParams = args['info-op']
-- Get id values.
data.showId = true
data.id = args.logo or args[3] or args.id1 or 'id1'
data.idWidth = checkNumAndAddSuffix(args['id1-w'], 45, 'px')
data.idHeight = checkNumAndAddSuffix(args['id-h'], 45, 'px')
data.idBackgroundColor = args['id1-c'] or args[1] or '#dddddd'
data.idTextAlign = 'center'
data.idFontSize = checkNum(args['id1-s'], 14)
data.idLineHeight = args['id1-lh'] or '1.25em'
data.idColor = args['id1-fc'] or data.infoColor
data.idPadding = args['id1-p'] or '0 1px 0 0'
data.idOtherParams = args['id1-op']
-- Get id2 values.
data.showId2 = true
data.id2 = args.logo or args[5] or args.id2 or 'id2'
data.id2Width = checkNumAndAddSuffix(args['id2-w'], 45, 'px')
data.id2Height = data.idHeight
data.id2BackgroundColor = args['id2-c'] or args[7] or args[1] or '#dddddd'
data.id2TextAlign = 'center'
data.id2FontSize = checkNum(args['id2-s'], 14)
data.id2LineHeight = args['id2-lh'] or '1.25em'
data.id2Color = args['id2-fc'] or data.infoColor
data.id2Padding = args['id2-p'] or '0 0 0 1px'
data.id2OtherParams = args['id2-op']
return data
end
p['_userbox-r'] = function (args)
-- Does argument processing for {{userbox-r}}.
local data = {}
-- Get div tag values.
data.float = args.float or 'left'
local borderWidthNum = checkNum(args['border-width'] or args['border-s'], 1) -- Used to calculate width.
data.borderWidth = addSuffix(borderWidthNum, 'px')
data.borderColor = args['border-color'] or args['border-c'] or args[1] or args['id-c'] or '#999'
data.width = addSuffix(240 - 2 * borderWidthNum, 'px') -- Also used in the table tag.
data.bodyClass = args.bodyclass
-- Get table tag values.
data.backgroundColor = args['info-background'] or args[2] or args['info-c'] or '#eee'
-- Get id values.
data.showId = false -- We only show id2 in userbox-r.
-- Get info values.
data.info = args.info or args[4] or "<code>{{{info}}}</code>"
data.infoTextAlign = args['info-align'] or args['info-a'] or 'left'
data.infoFontSize = checkNumAndAddSuffix(args['info-size'] or args['info-s'], 8, 'pt')
data.infoPadding = args['info-padding'] or args['info-p'] or '0 4px 0 4px'
data.infoLineHeight = args['info-line-height'] or args['info-lh'] or '1.25em'
data.infoColor = args['info-color'] or args['info-fc'] or 'black'
data.infoOtherParams = args['info-other-param'] or args['info-op']
-- Get id2 values.
data.showId2 = true
data.id2 = args.logo or args[3] or args.id or 'id'
data.id2Width = checkNumAndAddSuffix(args['logo-width'] or args['id-w'], 45, 'px')
data.id2Height = checkNumAndAddSuffix(args['logo-height'] or args['id-h'], 45, 'px')
data.id2BackgroundColor = args['logo-background'] or args[1] or args['id-c'] or '#ddd'
data.id2TextAlign = args['id-a'] or 'center'
data.id2FontSize = checkNum(args['logo-size'] or args[5] or args['id-s'], 14)
data.id2Color = args['logo-color'] or args['id-fc'] or data.infoColor
data.id2Padding = args['logo-padding'] or args['id-p'] or '0 0 0 1px'
data.id2LineHeight = args['logo-line-height'] or args['id-lh'] or '1.25em'
data.id2OtherParams = args['logo-other-param'] or args['id-op']
return data
end
function p.render(data)
-- Renders the userbox html using the content of the data table.
-- Render the div tag html.
local root = mw.html.create('div')
root
:css('float', data.float)
:css('border', (data.borderWidth or '') .. ' solid ' .. (data.borderColor or ''))
:css('margin', '1px')
:css('width', data.width)
:addClass('wikipediauserbox')
:addClass(data.bodyClass)
-- Render the table tag html.
local tableroot = root:tag('table')
tableroot
:attr('role', 'presentation')
:css('border-collapse', 'collapse')
:css('width', data.width)
:css('margin-bottom', '0')
:css('margin-top', '0')
:css('background', data.backgroundColor)
-- Render the id html.
local tablerow = tableroot:tag('tr')
if data.showId then
tablerow:tag('td')
:css('border', '0')
:css('width', data.idWidth)
:css('height', data.idHeight)
:css('background', data.idBackgroundColor)
:css('text-align', data.idTextAlign)
:css('font-size', data.idFontSize .. 'pt')
:css('font-weight', 'bold')
:css('color', data.idColor)
:css('padding', data.idPadding)
:css('line-height', data.idLineHeight)
:css('vertical-align', 'middle')
:cssText(data.idOtherParams)
:addClass(data.idClass)
:wikitext(data.id)
end
-- Render the info html.
tablerow:tag('td')
:css('border', '0')
:css('text-align', data.infoTextAlign)
:css('font-size', data.infoFontSize)
:css('padding', data.infoPadding)
:css('height', data.infoHeight)
:css('line-height', data.infoLineHeight)
:css('color', data.infoColor)
:css('vertical-align', 'middle')
:cssText(data.infoOtherParams)
:addClass(data.infoClass)
:wikitext(data.info)
-- Render the second id html.
if data.showId2 then
tablerow:tag('td')
:css('border', '0')
:css('width', data.id2Width)
:css('height', data.id2Height)
:css('background', data.id2BackgroundColor)
:css('text-align', data.id2TextAlign)
:css('font-size', data.id2FontSize .. 'pt')
:css('font-weight', 'bold')
:css('color', data.id2Color)
:css('padding', data.id2Padding)
:css('line-height', data.id2LineHeight)
:css('vertical-align', 'middle')
:cssText(data.id2OtherParams)
:wikitext(data.id2)
end
local title = mw.title.getCurrentTitle()
if (title.namespace == 2) and not title.text:match("/") then
return tostring(root) -- regular user page
elseif title.namespace == 14 then
return tostring(root) -- category
elseif title.isTalkPage then
return tostring(root) -- talk page
end
local legible = true
local contrast = require('Module:Color contrast')._ratio
local function has_text(wikitext)
wikitext = wikitext:gsub("]]", "|]]")
wikitext = wikitext:gsub("%[%[%s*[Mm][Ee][Dd][Ii][Aa]%s*:[^|]-(|.-)]]", "")
wikitext = wikitext:gsub("%[%[%s*[Ii][Mm][Aa][Gg][Ee]%s*:[^|]-(|.-)]]", "")
wikitext = wikitext:gsub("%[%[%s*[Ff][Ii][Ll][Ee]%s*:[^|]-(|.-)]]", "")
return mw.text.trim(wikitext) ~= ""
end
if contrast { data.infoColor, data.backgroundColor, error = 0 } < 4.5 then
legible = false
end
-- For bold text >= 14pt, requirement is only 3.
local idContrastThreshold = 4.5
local id2ContrastThreshold = 4.5
if (data.idFontSize or 0) >= 14 then
idContrastThreshold = 3
end
if (data.id2FontSize or 0) >= 14 then
id2ContrastThreshold = 3
end
if data.showId and contrast { data.idColor, data.idBackgroundColor, error = 0 } < idContrastThreshold then
if has_text(data.id or "") then
legible = false
end
end
if data.showId2 and contrast { data.id2Color, data.id2BackgroundColor, error = 0 } < id2ContrastThreshold then
if has_text(data.id2 or "") then
legible = false
end
end
if not legible then
root:wikitext('[[Category:Userboxes with insufficient color contrast]]')
end
return tostring(root)
end
function p.categories(args, page)
-- Gets categories from [[Module:Category handler]].
-- The page parameter makes the function act as though the module was being called from that page.
-- It is included for testing purposes.
local cats = {}
cats[#cats + 1] = args.usercategory
cats[#cats + 1] = args.usercategory2
cats[#cats + 1] = args.usercategory3
cats[#cats + 1] = args.usercategory4
cats[#cats + 1] = args.usercategory5
-- Get the title object
local title
if page then
title = mw.title.new(page)
else
title = mw.title.getCurrentTitle()
end
-- Build category handler arguments.
local chargs = {}
chargs.page = page
chargs.nocat = args.nocat
chargs.main = '[[Category:Pages with templates in the wrong namespace]]'
if args.notcatsubpages then
chargs.subpage = 'no'
end
-- User namespace.
local user = ''
for i, cat in ipairs(cats) do
user = user .. makeCat(cat)
end
chargs.user = user
-- Template namespace.
local basepage = title.baseText
local template = ''
for i, cat in ipairs(cats) do
template = template .. makeCat(cat, ' ' .. basepage)
end
chargs.template = template
return categoryHandler(chargs)
end
return p
3afddd38f65cb302185911fa9957526a85855673
Template:Template link universal
10
123
344
343
2023-10-17T18:03:06Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Template_link_universal]]
wikitext
text/x-wiki
<nowiki>{{</nowiki>{{#if:{{{subst|}}}|
[[WP:SUBST|subst]]:|}}[[{{{1}}}]]<!--
-->{{#if:{{{2|}}}|
|{{{2}}}
}}<!--
-->{{#if:{{{3|}}}|
|{{{3}}}
}}<!--
-->{{#if:{{{4|}}}|
|{{{4}}}
}}<!--
-->{{#if:{{{5|}}}|
|{{{5}}}
}}<!--
-->{{#if:{{{6|}}}|
|{{{6}}}
}}<!--
-->{{#if:{{{7|}}}|
|{{{7}}}
}}<!--
-->{{#if:{{{8|}}}|
|{{{8}}}
}}<!--
-->{{#if:{{{9|}}}|
|{{{9}}}
}}<!--
-->{{#if:{{{10|}}}|
|{{{10}}}
}}<!--
-->{{#if:{{{11|}}}|
|{{{11}}}
}}<!--
-->{{#if:{{{12|}}}|
|''...''
}}<nowiki>}}</nowiki><noinclude>
<!-- Add categories and interwikis to the /doc page, not here, thanks -->
{{documentation}}
</noinclude>
19d8c858c879767a664244fb4a452011a27bc735
Template:Tlu
10
124
346
345
2023-10-17T18:03:06Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Tlu]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link universal]]
{{Redirect category shell|
{{R from move}}
{{R from template shortcut}}
}}
cd6da651fe58a4e8bce3c186eeedcc0056f11937
Module:Transclusion count/data/U
828
125
348
347
2023-10-17T18:03:08Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Transclusion_count/data/U]]
Scribunto
text/plain
return {
["U"] = 234000,
["U.S._Roads_WikiProject"] = 11000,
["UAF_player"] = 2500,
["UEFA_player"] = 5100,
["UK"] = 4400,
["UKR"] = 12000,
["UK_legislation"] = 2300,
["URL"] = 380000,
["URL2"] = 10000,
["URS"] = 7100,
["URY"] = 2100,
["US$"] = 11000,
["US50_Invite"] = 3700,
["USA"] = 41000,
["USBill"] = 2300,
["USCGC"] = 2600,
["USCongRep-end"] = 5000,
["USCongRep-row"] = 5500,
["USCongRep-start"] = 5000,
["USCongressOrdinal"] = 6000,
["USCongressOrdinal/code"] = 6000,
["USD"] = 5100,
["USGS_gazetteer"] = 11000,
["USNS"] = 2800,
["USN_flag"] = 10000,
["USPL"] = 2000,
["USRD"] = 5000,
["USS"] = 36000,
["USSR"] = 2200,
["USStat"] = 2300,
["US_Census_population"] = 38000,
["US_Census_population/styles.css"] = 38000,
["US_House_succession_box"] = 8700,
["US_State_Abbrev"] = 16000,
["US_county_navigation_box"] = 99000,
["US_government_sources"] = 2500,
["US_patent"] = 2700,
["US_state_navigation_box"] = 16000,
["UTRS"] = 8000,
["UTRS-unblock-user"] = 4900,
["UTZ"] = 2600,
["UZB"] = 2400,
["Ubl"] = 137000,
["Ublist"] = 4900,
["Ubx"] = 12000,
["Ucat"] = 38000,
["Ucfirstletter"] = 5100,
["Uir"] = 28000,
["Ukrainian_oblast"] = 2100,
["Ul"] = 5500,
["Ulist"] = 6500,
["Umbox"] = 78000,
["Unassessed-Class"] = 12000,
["Unblock-auto_reviewed"] = 5300,
["Unblock-spamun_reviewed"] = 2900,
["Unblock-un_reviewed"] = 16000,
["Unblock_reviewed"] = 68000,
["Unbulleted_list"] = 1230000,
["Uncategorized"] = 2800,
["Under_construction"] = 2400,
["Underline"] = 3600,
["Undisclosed_paid"] = 2900,
["Unindent"] = 4300,
["UnitedStatesCode"] = 3400,
["United_States_presidential_election_results_table_footer"] = 2900,
["United_States_presidential_election_results_table_header"] = 3300,
["United_States_presidential_election_results_table_row"] = 3300,
["United_States_topic"] = 6000,
["Unknown"] = 2700,
["Unknown-Class"] = 9900,
["Unlink"] = 21000,
["Unreferenced"] = 162000,
["Unreferenced_section"] = 36000,
["Unreferenced_stub"] = 2100,
["Unrelated"] = 5500,
["Unreliable_source?"] = 11000,
["Unreliable_sources"] = 8100,
["Unsourced"] = 5000,
["Update"] = 30000,
["Update_after"] = 5100,
["Update_inline"] = 5900,
["Update_inline_span"] = 2500,
["Update_section"] = 3900,
["Update_span"] = 2500,
["Updated"] = 57000,
["UploadCampaignLink"] = 2100,
["Uploader_information"] = 222000,
["Url"] = 83000,
["Use_American_English"] = 74000,
["Use_Australian_English"] = 125000,
["Use_Bangladeshi_English"] = 3000,
["Use_British_English"] = 258000,
["Use_Canadian_English"] = 37000,
["Use_Ghanaian_English"] = 2400,
["Use_Hiberno-English"] = 32000,
["Use_Hong_Kong_English"] = 4000,
["Use_Indian_English"] = 158000,
["Use_Irish_English"] = 17000,
["Use_Kenyan_English"] = 2400,
["Use_New_Zealand_English"] = 21000,
["Use_Nigerian_English"] = 4800,
["Use_Oxford_spelling"] = 2400,
["Use_Pakistani_English"] = 5600,
["Use_Philippine_English"] = 9500,
["Use_South_African_English"] = 9100,
["Use_dmy_dates"] = 1670000,
["Use_first_nonempty"] = 16000,
["Use_list-defined_references"] = 4000,
["Use_mdy_dates"] = 554000,
["Use_shortened_footnotes"] = 2300,
["User"] = 559000,
["User-generated_source"] = 5600,
["User-multi"] = 336000,
["User0"] = 18000,
["User19"] = 11000,
["User2"] = 3900,
["User21"] = 53000,
["User3"] = 242000,
["User4"] = 3200,
["User5"] = 7000,
["UserSummary"] = 115000,
["User_American"] = 2400,
["User_COI"] = 28000,
["User_Copy_Edit"] = 2200,
["User_Firefox"] = 5900,
["User_HTML"] = 3000,
["User_OS:Dos/style.css"] = 2100,
["User_QAIbox"] = 5700,
["User_QAIbox/auto"] = 3800,
["User_Translator"] = 2400,
["User_UN"] = 2400,
["User_WP"] = 19000,
["User_WP/switch"] = 19000,
["User_Wikipedia"] = 2300,
["User_Wikipedia_reference"] = 2900,
["User_Wikipedian_For"] = 10000,
["User_Wikipedian_for"] = 15000,
["User_Wikipediholic"] = 2200,
["User_category_header"] = 2200,
["User_committed_identity"] = 2400,
["User_contrib"] = 5100,
["User_current_age"] = 2500,
["User_current_age/days"] = 2500,
["User_current_age/months"] = 2500,
["User_current_age/years"] = 2500,
["User_de"] = 5600,
["User_de-1"] = 7700,
["User_de-2"] = 4400,
["User_de-3"] = 2300,
["User_en"] = 39000,
["User_en-1"] = 2500,
["User_en-2"] = 7700,
["User_en-3"] = 16000,
["User_en-4"] = 8900,
["User_en-5"] = 6600,
["User_en-N"] = 4900,
["User_es"] = 3800,
["User_es-1"] = 7200,
["User_es-2"] = 4700,
["User_es-3"] = 2600,
["User_fr"] = 4000,
["User_fr-1"] = 9100,
["User_fr-2"] = 6500,
["User_fr-3"] = 3800,
["User_html"] = 2700,
["User_in_region"] = 28000,
["User_in_the_United_Kingdom"] = 2000,
["User_in_the_United_States"] = 4200,
["User_infobox"] = 3000,
["User_instrument"] = 2800,
["User_invitation"] = 5800,
["User_iso15924"] = 2300,
["User_iso15924/level-text"] = 2800,
["User_iso15924/user_script_catlink"] = 2700,
["User_it-1"] = 2800,
["User_ja-1"] = 2900,
["User_la-1"] = 2800,
["User_link"] = 239000,
["User_lives_in"] = 7000,
["User_male"] = 2300,
["User_oops"] = 2100,
["User_other"] = 592000,
["User_page"] = 44000,
["User_proud"] = 5100,
["User_rights"] = 5000,
["User_ru"] = 3000,
["User_ru-1"] = 2100,
["User_sandbox"] = 293000,
["User_summary"] = 116000,
["User_talk_other"] = 68000,
["User_time_zone"] = 4100,
["User_visited"] = 6400,
["User_wikipedia"] = 2000,
["User_wikipedia/RC_Patrol"] = 3700,
["User_wikipedia/Rollback"] = 2300,
["User_wikipedia/WikiGnome"] = 2700,
["User_wishes_to_visit"] = 6000,
["User_zh"] = 2200,
["Userbox"] = 302000,
["Userbox-2"] = 34000,
["Userbox-level"] = 102000,
["Userbox-r"] = 6100,
["UserboxCOI"] = 28000,
["Userbox_table_bottom"] = 11000,
["Userbox_table_category"] = 2400,
["Userbox_table_top"] = 11000,
["Userbox_table_userbox"] = 11000,
["Userboxbottom"] = 52000,
["Userboxtop"] = 57000,
["Usercheck-short"] = 3600,
["Userlinks"] = 29000,
["Userpage"] = 30000,
["Userpage_blanked"] = 8400,
["Userspace_draft"] = 41000,
["Usgs-gazetteer"] = 11000,
["Ushr"] = 15000,
["Ussc"] = 5200,
["Usurped"] = 5300,
["Utrs"] = 5200,
["Module:URL"] = 578000,
["Module:Unicode_data"] = 1470000,
["Module:Unicode_data/scripts"] = 487000,
["Module:Unstrip"] = 45000,
["Module:Unsubst"] = 11800000,
["Module:Unsubst-infobox"] = 191000,
["Module:Urldecode"] = 4400,
["Module:User"] = 559000,
["Module:UserLinks"] = 878000,
["Module:UserLinks/config"] = 878000,
["Module:UserLinks/extra"] = 23000,
["Module:UserLinks/shared"] = 878000,
["Module:User_contrib"] = 5100,
["Module:Userbox"] = 307000,
["Module:Uses_Wikidata"] = 3200,
["Module:Ustring"] = 743000,
}
06f5148a1affefe308e74a456445bf5b6d799987
Template:UBT
10
126
350
349
2023-10-17T18:03:09Z
LamayII
2
1 revision imported from [[:wikipedia:Template:UBT]]
wikitext
text/x-wiki
#REDIRECT [[Template:Userbox templates]]
{{Redirect category shell|
{{R from move}}
}}
a3c8d6912211b05645707bddac0cb744e45a0136
Template:Userbox/doc
10
127
352
351
2023-10-17T18:03:10Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Userbox/doc]]
wikitext
text/x-wiki
{{Documentation subpage}}
{{Lua|Module:Userbox}}
{{High-use}}
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
This template can be used to quickly create a [[Wikipedia:Userboxes|userbox]] for display on a user's [[Wikipedia:User pages|user page]] without having to know HTML or Wikitable syntax.
'''''[[WP:NFCC|Nonfree]] images must not be displayed in userboxes, and are subject to summary removal by any editor without any notice being required.'''''
== Sandbox reminder==
* Always practice or experiment in the [[Template:Userbox/sandbox]] or [[Template:Userbox/testcases]]
* Once you are satisfied: Copy your code!
* In your Browser's address bar, change "sandbox" or "testcases" to the name of your new Userbox.
** Example:
** '''CHANGE''' [{{Fullurl:Template:Userbox/sandbox}} http://en.wikipedia.org/wiki/Template:Userbox/sandbox]<!--Display http://, but allow possibility of https:// access.-->
** '''TO''' [{{Fullurl:Template:Userbox/sandbox}} https://en.wikipedia.org/wiki/Template:Userbox/WhateverYourNewBoxNameIs]
** If the name of your new Userbox is taken, create a different name.
* You will be prompted to Start or Create your new Template Userbox!
* Paste your code into the space provided.
== Usage ==
<!-- Abstract usage of the template, one variable per row. -->
<syntaxhighlight lang="wikitext" style="overflow: auto">
{{userbox
| bodyclass = <!--Adds an HTML class attribute to the entire template's HTML table, to allow for styling, emission of microformats, etc.-->
| border-c = <!--border color (default=id-c or #999999)-->
| border-s = <!--border width in pixels (default=1)-->
| float = <!--left|right|none (default=left)-->
| id = <!--id image or text (image size should normally not exceed 90x45px)-->
| id-a = <!--id horizontal alignment left/center/right/justify (default=center)-->
| id-c = <!--id background color (default=#DDDDDD)-->
| id-fc = <!--id font color (default=info-fc or black)-->
| id-h = <!--id box height in pixels (default=45)-->
| id-lh = <!--id line height (default=1.25em)-->
| id-op = <!--id other CSS parameters-->
| id-p = <!--id cell padding (default=0 1px 0 0)-->
| id-s = <!--id text size in points (default=14)-->
| id-w = <!--id box width in pixels (default=45)-->
| info-class = <!--Adds an HTML class attribute to the "info" HTML table-row, to allow for styling, emission of microformats, etc.-->
| info = <!--info text or image-->
| info-a = <!--info horizontal alignment left/center/right/justify (default=left)-->
| info-c = <!--info background color (default=#EEEEEE)-->
| info-fc = <!--info font color (default=black)-->
| info-lh = <!--info line height (default=1.25em)-->
| info-op = <!--info other CSS parameters-->
| info-p = <!--info padding (default=0 4px 0 4px)-->
| info-s = <!--info text size in points (default=8)-->
| nocat = <!--block page category declarations; see [[WP:NOCAT]] (default=false)-->
| usercategory = <!--user category (optional, unlinked and without the "Category:" part)-->
| usercategory2 = <!--user category (optional)-->
| usercategory3 = <!--user category (optional)-->
| usercategory4 = <!--user category (optional)-->
| usercategory5 = <!--user category (optional)-->
}}
</syntaxhighlight>
* All parameters are optional.
* Images should normally be scaled to x45px or less.
<!-- Explain what this template's parameters do -- if no params, delete the definition. -->
Most HTML-based tables use only a handful of these attributes. The following subset can be used to quickly convert an HTML userbox into the format used here:
<syntaxhighlight lang="wikitext">
{{userbox
| border-c =
| id =
| id-c =
| id-fc =
| id-s =
| info =
| info-c =
| info-fc =
| info-lh =
| info-s =
}}</syntaxhighlight>
== Examples ==
{|
! style="width: 300px;" | Code
! Result
|-
| <syntaxhighlight lang="wikitext">{{userbox
| border-c = #aaffaa
| border-s = 2
| id = foo
| id-c = #ffffee
| id-s = 20
| info = ''foo bar''
| info-c = #ffeeff
| info-s = 12
}}</syntaxhighlight> || {{userbox|id=foo|id-s=20|id-c=#ffffee|info=''foo bar''|info-c=#ffeeff|info-s=12|border-c=#aaffaa|border-s=2}}
|-
| colspan="2"| Below example shows the default appearance of a userbox, which is (much) higher than the 45px.<br>Compare the height of the one below with the above userbox.
|-
| <syntaxhighlight lang="wikitext">{{userbox
| border-c = #aaffaa
| border-s = 2
| id = foo logo
| id-c = #ffffee
| info = ''We are trying to see
default distance in between text
lines, see the distance in
between cell content and its border,
and also see total height.''
| info-c = #ffeeff
}}</syntaxhighlight> || {{userbox|id=foo logo|id-c=#ffffee|info=''We are trying to see default distance in between text lines, see the distance in between cell content and its border, and also see total height.''|info-c=#ffeeff|border-c=#aaffaa|border-s=2}}
|-
| colspan="2"| Below example shows how we can change that userbox and further specify parameters to bring down<br>the overall height of the userbox to the recommended height of 45px, even with four text lines.<br>Cell padding parameter "''info-p''" can also be set at "''1pt 1pt 1pt 2pt''", or "''1pt 2pt''" for better appearance,<br>when there are 4 text lines.
|-
| <syntaxhighlight lang="wikitext">{{userbox
| border-c = #aaffaa
| border-s = 1
| id = foo logo
| id-c = #ffffee
| id-lh = 1.1em
| id-s = 14
| info = ''We have specified values
to lessen the distance between
text lines and padding space between
cell content and its border.''
| info-c = #ffeeff
| info-lh = 1.05em
| info-p = 1pt
| info-s = 8
}}</syntaxhighlight> || {{userbox|id=foo logo|id-s=14|id-lh=1.1em|id-c=#ffffee|info=''We have specified values to lessen the distance between text lines and padding space between cell content and its border.''|info-c=#ffeeff|info-s=8|info-p=1pt|info-lh=1.05em|border-c=#aaffaa|border-s=1}}
|-
| colspan="2"| Below example is for advanced users, showing how we can specify other [[Cascading Style Sheets|CSS]] properties,for example, "''font-family''",<br>to change the font or "''text-decoration''" to add lines around the text. Below, on the right side are two userboxes:<br>the top one is displayed without either parameters; and the bottom userbox is displayed by using the below code,<br>with the help of the "''info-op''" field.
|-
| <syntaxhighlight lang="wikitext">{{userbox
| border-c = #afa
| border-s = 2
| id = foo logo
| id-c = #ffe
| id-lh = 1.1em
| id-s = 14
| info = foo bar
| info-c = #fef
| info-op = font-family: 'Courier New', monospace; text-decoration: wavy overline green;
| info-s = 14
}}</syntaxhighlight> || colspan="2"| {{Userbox|id=foo logo|id-s=14|id-lh=1.1em|id-c=#ffe|info=foo bar|info-c=#fef|info-s=14|border-c=#afa|border-s=2}} <br style="clear:both"> <br /> {{Userbox|id=foo logo|id-s=14|id-lh=1.1em|id-c=#ffe|info=foo bar|info-c=#fef|info-s=14|info-op=font-family: 'Courier New', monospace; text-decoration: wavy overline green;|border-c=#afa|border-s=2}}
|}
==Microformats==
; bodyclass : This parameter is inserted into the "class" attribute for the userbox as a whole.
; info-class : This parameter is inserted into the "class" attribute for the info component.
This template supports the addition of [[microformat]] information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. To flag a userbox as containing [[hCard]] information about a person, for example, add the following parameter:
<syntaxhighlight lang="wikitext">
| bodyclass = vcard
</syntaxhighlight>
''or''
<syntaxhighlight lang="wikitext">
| info-class = vcard
</syntaxhighlight>
''then'' (for example):
<syntaxhighlight lang="wikitext"><nowiki>
| title = …the books of <span class="fn">[[Iain Banks]]</span>
</nowiki></syntaxhighlight>
...and so forth.
Examples include:
* <code>{{tlu|User:UBX/Iain Banks}}</code> - person
* {{tlx|User Microformats}} - group (WikiProject Microformats)
* {{tlx|User Brum}} - place (Birmingham)
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia.
== Template Data ==
{{TemplateData header}}
<TemplateData>{
"description": "This template can be used to quickly create a userbox for display on a user's user page without having to know HTML or Wikitable syntax.",
"params": {
"bodyclass": {
"label": "Body class",
"description": "Adds an HTML class attribute to the entire template's HTML table, to allow for styling, emission of microformats, etc.",
"type": "string",
"required": false
},
"border-c": {
"label": "Border color",
"description": "Color of the outer border",
"type": "string",
"default": "#999",
"required": false,
"aliases": [
"border-color"
]
},
"border-s": {
"label": "Border width",
"description": "border width in pixels",
"type": "number",
"default": "1",
"required": false,
"aliases": [
"border-width"
]
},
"float": {
"label": "Float",
"description": "left|right|none",
"type": "string",
"default": "left",
"required": false,
"suggestedvalues": [
"left",
"right",
"none"
]
},
"id": {
"label": "Logo",
"description": "id image or text",
"type": "content",
"required": false,
"aliases": [
"3",
"logo"
],
"suggested": true
},
"id-a": {
"label": "Logo content horizontal alignment",
"description": "Horizontal alignment of logo content; left/center/right/justify",
"type": "string",
"default": "center",
"required": false,
"suggestedvalues": [
"left",
"center",
"right",
"justify"
]
},
"id-c": {
"label": "id-c",
"description": "Two-in-one alias for border color and logo background color. Lower priority than border-c and logo-background",
"type": "string",
"required": false,
"aliases": [
"1"
],
"example": "#d0d0d0"
},
"id-fc": {
"label": "Logo font color",
"description": "Logo font color; if not specified, defaults to info font color",
"type": "string",
"default": "black",
"required": false,
"aliases": [
"logo-color"
]
},
"id-h": {
"label": "Logo height",
"description": "Logo box height in pixels",
"type": "number",
"default": "45",
"required": false,
"aliases": [
"logo-height"
]
},
"id-lh": {
"label": "Logo line height",
"description": "Logo line height",
"type": "string",
"default": "1.25em",
"required": false,
"aliases": [
"logo-line-height"
]
},
"id-op": {
"label": "Extra logo styling",
"description": "Add additional arbitrary CSS styling to the logo",
"type": "string",
"required": false,
"aliases": [
"logo-other-param"
],
"example": "opacity: 0.25"
},
"id-p": {
"label": "Logo padding",
"description": "Logo cell padding",
"type": "string",
"default": "0 1px 0 0",
"required": false,
"aliases": [
"logo-padding"
]
},
"id-s": {
"label": "Logo font size",
"description": "Logo text size in points",
"type": "string",
"default": "14",
"required": false,
"aliases": [
"5",
"logo-size"
]
},
"id-w": {
"label": "Logo width",
"description": "id box width in pixels",
"type": "number",
"default": "45",
"required": false,
"aliases": [
"logo-width"
]
},
"info-class": {
"label": "Info CSS classes",
"description": "Adds an HTML class attribute to the \"info\" HTML table-row, to allow for styling, emission of microformats, etc.",
"type": "string",
"required": false
},
"info": {
"label": "Info",
"description": "info text or image",
"type": "content",
"required": true,
"aliases": [
"4"
]
},
"info-a": {
"label": "Info content horizontal alignment",
"description": "Horizontal alignment of info content; left/center/right/justify",
"type": "string",
"default": "left",
"required": false,
"suggestedvalues": [
"left",
"center",
"right",
"justify"
]
},
"info-c": {
"label": "Info background color",
"description": "Info background color",
"type": "string",
"default": "#e0e0e0",
"required": false,
"aliases": [
"2",
"info-background"
]
},
"info-fc": {
"label": "Info font color",
"description": "info font color",
"type": "string",
"default": "black",
"required": false,
"aliases": [
"info-color"
]
},
"info-lh": {
"label": "Info line height",
"description": "Info line height",
"type": "string",
"default": "1.25em",
"required": false,
"aliases": [
"info-line-height"
]
},
"info-op": {
"label": "Extra info styling",
"description": "Add additional arbitrary CSS styling to the info",
"type": "string",
"required": false,
"aliases": [
"info-other-param"
],
"example": "opacity: 0.25"
},
"info-p": {
"label": "Info padding",
"description": "info padding",
"type": "string",
"default": "0 4px 0 4px",
"required": false,
"aliases": [
"info-padding"
]
},
"info-s": {
"label": "Info font size",
"description": "info text size in points",
"type": "number",
"default": "8",
"required": false,
"aliases": [
"info-size"
]
},
"nocat": {
"label": "nocat",
"description": "block page category declarations (see WP:NOCAT)",
"type": "string",
"default": "false",
"required": false
},
"usercategory": {
"label": "usercategory",
"description": "user category (optional)",
"type": "string",
"required": false
},
"usercategory2": {
"label": "usercategory2",
"description": "user category (optional)",
"type": "string",
"required": false
},
"usercategory3": {
"label": "usercategory3",
"description": "user category (optional)",
"type": "string",
"required": false
},
"usercategory4": {
"label": "usercategory4",
"description": "user category (optional)",
"type": "string",
"required": false
},
"usercategory5": {
"label": "usercategory5",
"description": "user category (optional)",
"type": "string",
"required": false
},
"logo-background": {
"label": "Logo background color",
"description": "Background color of logo",
"type": "string",
"default": "#ddd"
},
"id-class": {
"label": "Logo CSS classes",
"description": "CSS class or classes for the logo; optional",
"type": "string",
"default": "(none)"
}
},
"format": "block",
"paramOrder": [
"bodyclass",
"float",
"border-c",
"border-s",
"id",
"id-a",
"logo-background",
"id-c",
"id-fc",
"id-h",
"id-s",
"id-lh",
"id-p",
"id-w",
"id-class",
"id-op",
"info",
"info-a",
"info-c",
"info-fc",
"info-lh",
"info-p",
"info-s",
"info-class",
"info-op",
"nocat",
"usercategory",
"usercategory2",
"usercategory3",
"usercategory4",
"usercategory5"
]
}</TemplateData>
==See also==
{{UBT}}
<includeonly>{{Sandbox other||
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Userboxes|*]]
[[Category:User namespace templates]]
[[Category:Wikipedia metatemplates]]
}}</includeonly>
3b4eea4f8fc3ef69464386f3c3e9a0e08f76f0f6
Template:Userbox templates
10
128
354
353
2023-10-17T18:03:11Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Userbox_templates]]
wikitext
text/x-wiki
{| class="wikitable"
|+
! {{navbar|Template:Userbox templates|mini=y}}
! Userbox metatemplates
|-
! Left
|vertical-align:top;"|
*{{tlx|Userbox}}
*{{tlx|Userbox-w}} — wide variation
----
*{{tlx|Userbox-flag}} — for location-related userboxes
*{{tlx|Userbox-level}} — for skill-related userboxes
|-
! Right
|
*{{tlx|Userbox-r}}
*{{tlx|Userbox-w-r}} — wide variation
----
*{{tlx|userbox-flag-r}} — for location-related userboxes
*{{tlx|Userbox-level-r}} — for skill-related userboxes
|-
! Left and Right
|style="vertical-align:top;"|
*{{tlx|Userbox-2}}
|-
! None
|style="vertical-align:top;"|
*{{tlx|Userbox-m}}
|-
!colspan="4" style="font-weight:normal;"|
'''See also:''' [[Module:Userbox]], [[Wikipedia:Userboxes]], [[Wikipedia:Userboxes/Userboxes]]
|}<noinclude>{{documentation|content=
This template provides easy links and usage of the basic userbox templates.
[[Category:Documentation shared content templates|Userboxes]]
}}</noinclude>
7a85ee55ea563fd7267355e3618f1a3493840b5d
Template:Infobox law enforcement agency
10
2
356
83
2023-10-17T19:51:06Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_law_enforcement_agency]]
wikitext
text/x-wiki
<includeonly>
{{Infobox
|agencyname = {{{Agency Name}}}
|commonname = {{{Common Name}}}
|motto = {{{Motto}}}
}}
<noinclude>
<templatedata>
{
"params": {
"Agency Name": {
"label": "Agency Name",
"required": true
}
},
"paramOrder": [
"Agency Name"
]
}
</templatedata>
</noinclude>
7a6ca3ad46563e2308e457c6144299cf83c547cd
389
356
2023-10-17T19:54:48Z
LamayII
2
wikitext
text/x-wiki
{{Infobox
| child = {{{embed|}}}
| abovestyle = background-color: #EFEFEF;
| above = {{Br separated entries
|1={{{agencyname|<includeonly>{{PAGENAMEBASE}}</includeonly>}}}
|2={{{nativename|}}}
|3={{{nativenamea|}}}
|4={{{nativenamer|}}}
}}
| headerstyle= background-color: #EFEFEF;
| subheaderstyle = background-color: #EFEFEF; font-size:120%; font-weight:bold;
| autoheaders = yes
| subheader = {{#if:{{{fictional|}}}|This is a fictional organisation}}
| image1 = {{#invoke:InfoboxImage|InfoboxImage|image={{{patch|}}}|alt={{{patchcaption}}}|size={{#if:{{{image_size|}}}|{{{image_size|}}}|140px}}|sizedefault=frameless|suppressplaceholder=yes}}
| caption1 = {{{patchcaption|}}}
| image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{{logo|}}}|alt={{{logocaption}}}|size={{#if:{{{image_size|}}}|{{{image_size|}}}|140px}}|sizedefault=frameless|suppressplaceholder=yes}}
| caption2 = {{{logocaption|}}}
| image3 = {{#invoke:InfoboxImage|InfoboxImage|image={{{badge|}}}|alt={{{badgecaption}}}|size={{#if:{{{image_size|}}}|{{{image_size|}}}|140px}}|sizedefault=frameless|suppressplaceholder=yes}}
| caption3 = {{{badgecaption|}}}
| image4 = {{#invoke:InfoboxImage|InfoboxImage|image={{{flag|}}}|alt={{{flagcaption}}}|size={{#if:{{{image_size|}}}|{{{image_size|}}}|140px}}|sizedefault=frameless|suppressplaceholder=yes}}
| caption4 = {{{flagcaption|}}}
| label2 = Common name
| data2 = {{{commonname|}}}
| label3 = Abbreviation
| data3 = {{{abbreviation|}}}
| label4 = Motto
| data4 = {{Br separated entries
|1={{{motto|}}}
|2={{{mottotranslated|}}}
}}
| header5 = Agency overview
| label6 = Formed
| data6 = {{#if:{{{formedyear|}}}|{{#if:{{{formedmonthday|}}}|{{{formedmonthday}}},}} {{{formedyear}}}|{{{formed|}}}}}
| label7 = Preceding {{#if:{{{preceding2|}}}{{{preceding3|}}}{{{preceding4|}}}{{{preceding5|}}}{{{preceding6|}}}|agencies|agency}}
| data7 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{#if:{{{preceding1|}}}|{{{preceding1|}}}|{{{preceding1|}}}}}
|2={{#if:{{{preceding2|}}}|{{{preceding2|}}}|{{{preceding2|}}}}}
|3={{#if:{{{preceding3|}}}|{{{preceding3|}}}|{{{preceding3|}}}}}
|4={{#if:{{{preceding4|}}}|{{{preceding4|}}}|{{{preceding4|}}}}}
|5={{#if:{{{preceding5|}}}|{{{preceding5|}}}|{{{preceding5|}}}}}
|6={{#if:{{{preceding6|}}}|{{{preceding6|}}}|{{{preceding6|}}}}}
}}
| label8 = Dissolved
| data8 = {{{dissolved|}}}
| label9 = Superseding agency
| data9 = {{{superseding|}}}
| label10 = Employees
| data10 = {{{employees|}}}
| label11 = Volunteers
| data11 = {{{volunteers|}}}
| label12 = Annual budget
| data12 = {{{budget|}}}
| label13 = Legal personality
| data13 = {{#switch:{{lc:{{{legalpersonality|}}}}}
|=
|government agency|government-owned corporation|government ministry = Governmental: [[{{Trim brackets|{{ucfirst:{{{legalpersonality}}}}}}}]]
|partnership|privately-held company|cooperative|body corporate = Non-governmental: [[{{Trim brackets|{{ucfirst:{{{legalpersonality}}}}}}}]]
|#default = [[{{Trim brackets|{{ucfirst:{{{legalpersonality}}}}}}}]]
}}
| header14 = Jurisdictional structure
| label15 = [[Law enforcement agency#natlea|National agency]]{{#if:{{{legaljuris|}}}|<br>{{nobold|(Operations jurisdiction)}}}}
| data15 = {{#if:{{{national|}}}| {{#if: {{{country|}}}| {{#if:{{{countryabbr|}}} |[[{{{country}}}|{{{countryabbr}}}]]|[[{{{country}}}]]}} }}<nowiki />}}
| label16 = [[Law enforcement agency#fedlea|Federal agency]]{{#if: {{{legaljuris|}}} | <br>{{nobold|(Operations jurisdiction)}} }}
| data16 = {{#if:{{{federal|}}} | {{#if: {{{country|}}}| {{#if:{{{countryabbr|}}} |[[{{{country}}}|{{{countryabbr}}}]]|[[{{{country}}}]]}} }}<nowiki />}}
| label17 = [[Law enforcement agency#internat|International agency]]
| data17 = {{#if:{{{international|}}}| {{#if: {{{country|}}}| {{#if:{{{countryabbr|}}} |[[{{{country}}}|{{{countryabbr}}}]]|[[{{{country}}}]]}} }}<nowiki />}}
| label18 = Countries
| data18 = {{{international|}}}
| label19 = Operations jurisdiction
| data19 = {{comma separated entries
|1={{{subdivname|}}}
|2={{{divname|}}}
|3={{#if:{{{countryabbr|}}} | [[{{{country}}}|{{{countryabbr}}}]] |{{#if:{{{country|}}}|[[{{{country}}}]]}}}}
}}
| data20 = {{#invoke:InfoboxImage|InfoboxImage|image={{{map|}}}|size=250x250px}}
| data21 = {{{dmap|}}}
| data22 = {{#if:{{{map|}}}|{{#if:{{{mapcaption|}}}|{{{mapcaption}}}|Map of {{{agencyname}}}'s jurisdiction}}}}
| label23 = Size
| data23 = {{{sizearea|}}}
| label24 = Population
| data24 = {{{sizepopulation|}}}
| label25 = Legal jurisdiction
| data25 = {{#ifeq:{{{legaljuris}}}|opsjuris|As per operations jurisdiction|{{{legaljuris|}}}}}
| label26 = {{#if:{{{governingbodyscnd|}}}|Primary governing body|Governing body}}
| data26 = {{#if:{{{governingbody|}}}|[[{{Trim brackets|{{{governingbody}}}}}]]}}
| label27 = Secondary governing body
| data27 = {{#if:{{{governingbodyscnd|}}}| [[{{Trim brackets|{{{governingbodyscnd}}}}}]] }}
| label28 = {{#if:{{{constitution2|}}}{{{constitution3|}}}{{{constitution4|}}}{{{constitution5|}}}{{{constitution6|}}}|Constituting instruments|Constituting instrument}}
| data28 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{constitution1|}}}
|2={{{constitution2|}}}
|3={{{constitution3|}}}
|4={{{constitution4|}}}
|5={{{constitution5|}}}
|6={{{constitution6|}}}
}}
| label29 = General nature
| data29 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
| 1 = {{#if:{{{federal|}}}|[[Law enforcement agency#fedlea|Federal law enforcement]]}}
| 2 = {{#if:{{{gendarmerie|}}}
| [[Gendarmerie]]
|{{#if:{{{provost|}}}
| [[Law enforcement agency#provost|Military provost]]
| {{#if:{{{military|}}}|[[Law enforcement agency#milpol|Military police]]}}
}}
}}
| 3 = {{#if:{{{police|}}}
|{{#if:{{{local|}}}
| [[Law enforcement agency#locpol|Local civilian police]]{{main other|[[Category:Pages using law enforcement agency with local civilian police general nature]]}}
| [[Law enforcement agency#civpol|Civilian police]]{{main other|[[Category:Pages using law enforcement agency with civilian police general nature]]}}
}}
}}
| 4 = {{#if:{{{secret|}}}|[[Secret police]]}}
| 5 = {{#if:{{{religious|}}}|[[Law enforcement agency#relpol|Religious police]]}}
}}<!-- end general nature -->
| label30 = {{#if:{{{speciality2|}}}{{{speciality3|}}}{{{speciality4|}}}{{{speciality5|}}}{{{speciality6|}}}|Specialist jurisdictions|Specialist jurisdiction}}
| data30 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{#if:{{{speciality1|}}}|{{Specialist lea type descr|1={{lc:{{{speciality1|}}}}}}}|}}
|2={{#if:{{{speciality2|}}}|{{Specialist lea type descr|1={{lc:{{{speciality2|}}}}}}}|}}
|3={{#if:{{{speciality3|}}}|{{Specialist lea type descr|1={{lc:{{{speciality3|}}}}}}}|}}
|4={{#if:{{{speciality4|}}}|{{Specialist lea type descr|1={{lc:{{{speciality4|}}}}}}}|}}
|5={{#if:{{{speciality5|}}}|{{Specialist lea type descr|1={{lc:{{{speciality5|}}}}}}}|}}
|6={{#if:{{{speciality6|}}}|{{Specialist lea type descr|1={{lc:{{{speciality6|}}}}}}}|}}
}}
| header31 = Operational structure
| label32 = Overviewed by {{#if:{{{overviewtype|}}}|{{{overviewtype}}}}}
| data32 = {{{overviewbody|}}}
| label33 = Headquarters
| data33 = {{{headquarters|}}}
| data34 = <includeonly>{{#invoke:InfoboxImage|InfoboxImage|image={{{hqlocmap|}}}|size={{{hqlocmapsize|}}}}}{{#if:{{{hqlocmappoptitle|}}}|<br/>{{{hqlocmappoptitle|}}}}}</includeonly>
| label35 = {{#if: {{{sworntype|}}} | {{#invoke:string|replace|{{{sworntype}}}|s$||plain=false}} |Sworn member}}s
| data35 = {{{sworn|}}}
| label36 = {{#if:{{{unsworntype|}}}|{{#invoke:string|replace|{{{unsworntype}}}|s$||plain=false}}|Unsworn member}}s
| data36 = {{{unsworn|}}}
| label37 = [[Law enforcement agency#multinat|Multinational agency]]
| data37 = {{#if: {{{multinational|}}} | {{#if: {{{country|}}}| {{#if:{{{countryabbr|}}} |[[{{{country}}}|{{{countryabbr}}}]]|[[{{{country}}}]]}} }}<nowiki />}}
| label38 = Nationalities of personnel
| data38 = {{{multinational|}}}
| label39 = {{#if:{{{electeetype|}}} | {{{electeetype}}} | Elected officer}}{{#if:{{{minister2name|}}}{{{minister3name|}}}{{{minister4name|}}}{{{minister5name|}}}{{{minister6name|}}}|s}} responsible
| data39 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{#if:{{{minister1name|}}} | {{{minister1name}}}{{#if:{{{minister1pfo|}}}|, {{{minister1pfo}}}}} }}
|2={{#if:{{{minister2name|}}} | {{{minister2name}}}{{#if:{{{minister2pfo|}}}|, {{{minister2pfo}}}}} }}
|3={{#if:{{{minister3name|}}} | {{{minister3name}}}{{#if:{{{minister3pfo|}}}|, {{{minister3pfo}}}}} }}
|4={{#if:{{{minister4name|}}} | {{{minister4name}}}{{#if:{{{minister4pfo|}}}|, {{{minister4pfo}}}}} }}
|5={{#if:{{{minister5name|}}} | {{{minister5name}}}{{#if:{{{minister5pfo|}}}|, {{{minister5pfo}}}}} }}
|6={{#if:{{{minister6name|}}} | {{{minister6name}}}{{#if:{{{minister6pfo|}}}|, {{{minister6pfo}}}}} }}
}}
| label40 = Agency executive{{#if:{{{chief2name|}}}{{{chief3name|}}}{{{chief4name|}}}{{{chief5name|}}}{{{chief6name|}}} |s}}
| data40 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{#if:{{{chief1name|}}} | {{{chief1name}}}{{#if:{{{chief1position|}}}|, {{{chief1position}}}}} }}
|2={{#if:{{{chief2name|}}} | {{{chief2name}}}{{#if:{{{chief2position|}}}|, {{{chief2position}}}}} }}
|3={{#if:{{{chief3name|}}} | {{{chief3name}}}{{#if:{{{chief3position|}}}|, {{{chief3position}}}}} }}
|4={{#if:{{{chief4name|}}} | {{{chief4name}}}{{#if:{{{chief4position|}}}|, {{{chief4position}}}}} }}
|5={{#if:{{{chief5name|}}} | {{{chief5name}}}{{#if:{{{chief5position|}}}|, {{{chief5position}}}}} }}
|6={{#if:{{{chief6name|}}} | {{{chief6name}}}{{#if:{{{chief6position|}}}|, {{{chief6position}}}}} }}
}}
| label41 = Parent agency
| data41 = {{{parentagency|}}}
| label42 = Child {{#if:{{{child2agency|}}}{{{child3agency|}}}{{{child4agency|}}}{{{child5agency|}}}{{{child6agency|}}}{{{child7agency|}}} |agencies|agency}}
| data42 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{child1agency|}}}
|2={{{child2agency|}}}
|3={{{child3agency|}}}
|4={{{child4agency|}}}
|5={{{child5agency|}}}
|6={{{child6agency|}}}
|7={{{child7agency|}}}
}}
| label43 = {{#if: {{{unittype|}}} | {{#invoke:string|replace|{{{unittype}}}|s$||plain=false}} |Unit }}s
| data43 = {{{unitname|}}}
| label44 = {{#if: {{{officetype|}}} | {{#invoke:string|replace|{{{officetype}}}|s$||plain=false}} |Command }}s
| data44 = {{{officename|}}}
| label45 = Services provided by
| data45 = {{{provideragency|}}}
| label46 = Uniformed as
| data46 = {{#if: {{{provideragency|}}} | {{#if: {{{uniformedas|}}} | {{{uniformedas}}} | {{{agencyname}}} }} }}
| header47 = Facilities
| label48 = {{#if: {{{stationtype|}}} | {{#invoke:string|replace|{{{stationtype}}}|s$||plain=false}} |Station }}s
| data48 = {{{stations|}}}
| label49 = Airbases
| data49 = {{{airbases|}}}
| label50 = {{#if: {{{lockuptype|}}} | {{#invoke:string|replace|{{{lockuptype}}}|s$||plain=false}} |Lockup }}s
| data50 = {{{lockups|}}}
| label51 = {{#if: {{{vehicle1type|}}} | {{#invoke:string|replace|{{{vehicle1type}}}|s$||plain=false}} |Patrol car }}s
| data51 = {{{vehicles1|}}}
| label52 = {{#if: {{{vehicle2type|}}} | {{#invoke:string|replace|{{{vehicle2type}}}|s$||plain=false}} |Patrol car }}s
| data52 = {{{vehicles2|}}}
| label53 = {{#if: {{{vehicle3type|}}} | {{#invoke:string|replace|{{{vehicle3type}}}|s$||plain=false}} |Patrol car }}s
| data53 = {{{vehicles3|}}}
| label54 = {{#if: {{{boat1type|}}} | {{#invoke:string|replace|{{{boat1type}}}|s$||plain=false}} |Boat }}s
| data54 = {{{boats1|}}}
| label55 = {{#if: {{{boat2type|}}} | {{#invoke:string|replace|{{{boat2type}}}|s$||plain=false}} |Boat }}s
| data55 = {{{boats2|}}}
| label56 = {{#if: {{{boat3type|}}} | {{#invoke:string|replace|{{{boat3type}}}|s$||plain=false}} |Boat }}s
| data56 = {{{boats3|}}}
| label57 = {{#if:{{{aircraft1type|}}}|{{#ifeq:{{#invoke:string|replace|{{{aircraft1type|}}}|^.*ircraft$|aircraft|plain=false}}|aircraft|{{{aircraft1type}}}|{{#invoke:string|replace|{{{aircraft1type}}}|s$||plain=false}}s}}|Planes}}
| data57 = {{{aircraft1|}}}
| label58 = {{#if:{{{aircraft2type|}}}|{{#ifeq:{{#invoke:string|replace|{{{aircraft2type|}}}|^.*ircraft$|aircraft|plain=false}}|aircraft|{{{aircraft2type}}}|{{#invoke:string|replace|{{{aircraft2type}}}|s$||plain=false}}s}}|Planes}}
| data58 = {{{aircraft2|}}}
| label59 = {{#if:{{{aircraft3type|}}}|{{#ifeq:{{#invoke:string|replace|{{{aircraft3type|}}}|^.*ircraft$|aircraft|plain=false}}|aircraft|{{{aircraft3type}}}|{{#invoke:string|replace|{{{aircraft3type}}}|s$||plain=false}}s}}|Planes}}
| data59 = {{{aircraft3|}}}
| label60 = {{#if: {{{animal1type|}}} | {{#invoke:string|replace|{{{animal1type}}}|s$||plain=false}} |Dog }}s
| data60 = {{{animals1|}}}
| label61 = {{#if: {{{animal2type|}}} | {{#invoke:string|replace|{{{animal2type}}}|s$||plain=false}} |Dog }}s
| data61 = {{{animals2|}}}
| label62 = {{#if: {{{animal3type|}}} | {{#invoke:string|replace|{{{animal3type}}}|s$||plain=false}} |Dog }}s
| data62 = {{{animals3|}}}
| header63 = Notables
| label64 = {{#if:{{{person2name|}}}{{{person3name|}}}{{{person4name|}}}{{{person5name|}}}{{{person6name|}}}|People|Person}}
| data64 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{#if:{{{person1name|}}} | {{{person1name}}}{{#if:{{{person1type|}}}|, {{{person1type}}}}}{{#if:{{{person1reason|}}}|, for {{{person1reason}}}}} }}
|2={{#if:{{{person2name|}}} | {{{person2name}}}{{#if:{{{person2type|}}}|, {{{person2type}}}}}{{#if:{{{person2reason|}}}|, for {{{person2reason}}}}} }}
|3={{#if:{{{person3name|}}} | {{{person3name}}}{{#if:{{{person3type|}}}|, {{{person3type}}}}}{{#if:{{{person3reason|}}}|, for {{{person3reason}}}}} }}
|4={{#if:{{{person4name|}}} | {{{person4name}}}{{#if:{{{person4type|}}}|, {{{person4type}}}}}{{#if:{{{person4reason|}}}|, for {{{person4reason}}}}} }}
|5={{#if:{{{person5name|}}} | {{{person5name}}}{{#if:{{{person5type|}}}|, {{{person5type}}}}}{{#if:{{{person5reason|}}}|, for {{{person5reason}}}}} }}
|6={{#if:{{{person6name|}}} | {{{person6name}}}{{#if:{{{person6type|}}}|, {{{person6type}}}}}{{#if:{{{person6reason|}}}|, for {{{person6reason}}}}} }}
}}
| label65 = {{#if:{{{programme1|}}}{{{programme2|}}}{{{programme3|}}}{{{programme5|}}}{{{programme6|}}}
|Programme{{#if:{{{programme2|}}}{{{programme3|}}}{{{programme4|}}}{{{programme5|}}}{{{programme6|}}}|s}}
|Program{{#if:{{{program2|}}}{{{program3|}}}{{{program4|}}}{{{program5|}}}{{{program6|}}}|s}}
}}
| data65 = {{#if:{{{programme1|}}}{{{programme2|}}}{{{programme3|}}}{{{programme5|}}}{{{programme6|}}}
|{{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{programme1|}}}
|2={{{programme2|}}}
|3={{{programme3|}}}
|4={{{programme4|}}}
|5={{{programme5|}}}
|6={{{programme6|}}}
}}
|{{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{program1|}}}
|2={{{program2|}}}
|3={{{program3|}}}
|4={{{program4|}}}
|5={{{program5|}}}
|6={{{program6|}}}
}}
}}
| label66 = {{#if:{{{activity1name|}}} | Significant {{#if: {{{activitytype|}}} |{{{activitytype}}} |operation}}}}{{#if:{{{activity2name|}}}{{{activity3name|}}}{{{activity4name|}}}{{{activity5name|}}}{{{activity6name|}}}|s}}
| data66 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{activity1name|}}}
|2={{{activity2name|}}}
|3={{{activity3name|}}}
|4={{{activity4name|}}}
|5={{{activity5name|}}}
|6={{{activity6name|}}}
}}
| label67 = Anniversar{{#if:{{{anniversary2|}}}{{{anniversary3|}}}{{{anniversary4|}}}{{{anniversary5|}}}{{{anniversary6|}}}|ies|y}}
| data67 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{anniversary1|}}}
|2={{{anniversary2|}}}
|3={{{anniversary3|}}}
|4={{{anniversary4|}}}
|5={{{anniversary5|}}}
|6={{{anniversary6|}}}
}}
| label68 = Award{{#if:{{{award2|}}}{{{award3|}}}{{{award4|}}}{{{award5|}}}{{{award6|}}}|s}}
| data68 = {{Unbulleted list|item_style=text-indent: -1em; padding-left: 1em;
|1={{{award1|}}}
|2={{{award2|}}}
|3={{{award3|}}}
|4={{{award4|}}}
|5={{{award5|}}}
|6={{{award6|}}}
}}
| header69 = Website
| data70 = {{{website|}}}
| below = {{{footnotes|}}}
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox law enforcement agency with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox law enforcement agency]] with unknown parameter "_VALUE_"|ignoreblank=y| abbreviation | activity1name | activity2name | activity3name | activity4name | activity5name | activity6name | activitytype | actvity1name | agencyclass | agencyname | airbases | aircraft1 | aircraft1type | aircraft2 | aircraft2type | aircraft3 | aircraft3type | animal1type | animal2type | animal3type | animals1 | animals2 | animals3 | anniversary1 | anniversary2 | anniversary3 | anniversary4 | anniversary5 | anniversary6 | award1 | award2 | award3 | award4 | award5 | award6 | badge | badgecaption | boat1type | boat2type | boat3type | boats1 | boats2 | boats3 | budget | chief1name | chief1position | chief2name | chief2position | chief3name | chief3position | chief4name | chief4position | chief5name | chief5position | chief6name | chief6position | child1agency | child2agency | child3agency | child4agency | child5agency | child6agency | child7agency | commonname | constitution1 | constitution2 | constitution3 | constitution4 | constitution5 | constitution6 | country | countryabbr | dissolved | divname | divtype | dmap | electeetype | embed | employees | federal | fictional | flag | flagcaption | footnotes | {{#if:{{{formedyear|}}}|¶|}}formed | {{#if:{{{formedyear|}}}||¶}}formedmonthday | formedyear | gendarmerie | governingbody | governingbodyscnd | headquarters | hqlocmap | hqlocmappoptitle | hqlocmapsize | image_size | international | legaljuris | legalpersonality | local | lockups | lockuptype | logo | logocaption | map | mapcaption | military | minister1name | minister1pfo | minister2name | minister2pfo | minister3name | minister3pfo | minister4name | minister4pfo | minister5name | minister5pfo | minister6name | minister6pfo | motto | mottotranslated | multinational | national | nativename | nativenamea | nativenamer | officename | officetype | overviewbody | overviewtype | parentagency | patch | patchcaption | person1name | person1reason | person1type | person2name | person2reason | person2type | person3name | person3reason | person3type | person4name | person4reason | person4type | person5name | person5reason | person5type | person6name | person6reason | person6type | police | preceding1 | preceding2 | preceding3 | preceding4 | preceding5 | preceding6 | program1 | program2 | program3 | program4 | program5 | program6 | programme1 | programme2 | programme3 | programme4 | programme5 | programme6 | provideragency | provost | religious | secret | sizearea | sizepopulation | speciality1 | speciality2 | speciality3 | speciality4 | speciality5 | speciality6 | stations | stationtype | subdivname | subdivtype | superseding | sworn | sworntype | uniformedas | unitname | unittype | unsworn | unsworntype | vehicle1type | vehicle2type | vehicle3type | vehicles1 | vehicles2 | vehicles3 | volunteers | website | paramilitary}}{{main other|{{#if:{{{paramilitary|}}}|{{main other|[[Category:Pages using infobox law enforcement agency with paramilitary parameter]]}}
}}}}<noinclude>
{{documentation}}
</noinclude>
5ec196daed8ada045d245db5613daaa547b7fafe
Template:Br separated entries
10
129
358
357
2023-10-17T19:51:09Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Br_separated_entries]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|br}}<noinclude>
{{documentation}}
</noinclude>
2019f7fc383259e70d66e43cbd97a43d20889f1b
Template:Unbulleted list
10
130
360
359
2023-10-17T19:51:10Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Unbulleted_list]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|unbulleted}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
89815a491d3e05b20af446e34cda13f13c25fb4f
Module:InfoboxImage
828
131
362
361
2023-10-17T19:51:12Z
LamayII
2
1 revision imported from [[:wikipedia:Module:InfoboxImage]]
Scribunto
text/plain
-- Inputs:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
-- page - page to display for multipage images (DjVu)
-- size - size to display the image
-- maxsize - maximum size for image
-- sizedefault - default size to display the image if size param is blank
-- alt - alt text for image
-- title - title text for image
-- border - set to yes if border
-- center - set to yes, if the image has to be centered
-- upright - upright image param
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
-- link - page to visit when clicking on image
-- class - HTML classes to add to the image
-- Outputs:
-- Formatted image.
-- More details available at the "Module:InfoboxImage/doc" page
local i = {};
local placeholder_image = {
"Blue - Replace this image female.svg",
"Blue - Replace this image male.svg",
"Female no free image yet.png",
"Flag of None (square).svg",
"Flag of None.svg",
"Flag of.svg",
"Green - Replace this image female.svg",
"Green - Replace this image male.svg",
"Image is needed female.svg",
"Image is needed male.svg",
"Location map of None.svg",
"Male no free image yet.png",
"Missing flag.png",
"No flag.svg",
"No free portrait.svg",
"No portrait (female).svg",
"No portrait (male).svg",
"Red - Replace this image female.svg",
"Red - Replace this image male.svg",
"Replace this image female (blue).svg",
"Replace this image female.svg",
"Replace this image male (blue).svg",
"Replace this image male.svg",
"Silver - Replace this image female.svg",
"Silver - Replace this image male.svg",
"Replace this image.svg",
"Cricket no pic.png",
"CarersLogo.gif",
"Diagram Needed.svg",
"Example.jpg",
"Image placeholder.png",
"No male portrait.svg",
"Nocover-upload.png",
"NoDVDcover copy.png",
"Noribbon.svg",
"No portrait-BFD-test.svg",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Sin bandera.svg",
"Sin escudo.svg",
"Replace this image - temple.png",
"Replace this image butterfly.png",
"Replace this image.svg",
"Replace this image1.svg",
"Resolution angle.png",
"Image-No portrait-text-BFD-test.svg",
"Insert image here.svg",
"No image available.png",
"NO IMAGE YET square.png",
"NO IMAGE YET.png",
"No Photo Available.svg",
"No Screenshot.svg",
"No-image-available.jpg",
"Null.png",
"PictureNeeded.gif",
"Place holder.jpg",
"Unbenannt.JPG",
"UploadACopyrightFreeImage.svg",
"UploadAnImage.gif",
"UploadAnImage.svg",
"UploadAnImageShort.svg",
"CarersLogo.gif",
"Diagram Needed.svg",
"No male portrait.svg",
"NoDVDcover copy.png",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Noimage.gif",
}
function i.IsPlaceholder(image)
-- change underscores to spaces
image = mw.ustring.gsub(image, "_", " ");
assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')
-- if image starts with [[ then remove that and anything after |
if mw.ustring.sub(image,1,2) == "[[" then
image = mw.ustring.sub(image,3);
image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");
assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
-- capitalise first letter
image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
for i,j in pairs(placeholder_image) do
if image == j then
return true
end
end
return false
end
function i.InfoboxImage(frame)
local image = frame.args["image"];
if image == "" or image == nil then
return "";
end
if image == " " then
return image;
end
if frame.args["suppressplaceholder"] ~= "no" then
if i.IsPlaceholder(image) == true then
return "";
end
end
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then
return "";
end
if mw.ustring.sub(image,1,2) == "[[" then
-- search for thumbnail images and add to tracking cat if found
local cat = "";
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
cat = "[[Category:Pages using infoboxes with thumbnail images]]";
end
return image .. cat;
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then
return image;
elseif mw.ustring.sub(image,1,1) == "<" then
return image;
elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then
-- Found strip marker at begining, so pass don't process at all
return image;
elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then
-- Found strip marker at begining, so pass don't process at all
return image;
else
local result = "";
local page = frame.args["page"];
local size = frame.args["size"];
local maxsize = frame.args["maxsize"];
local sizedefault = frame.args["sizedefault"];
local alt = frame.args["alt"];
local link = frame.args["link"];
local title = frame.args["title"];
local border = frame.args["border"];
local upright = frame.args["upright"] or "";
local thumbtime = frame.args["thumbtime"] or "";
local center = frame.args["center"];
local class = frame.args["class"];
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
if maxsize ~= "" and maxsize ~= nil then
-- if no sizedefault then set to maxsize
if sizedefault == "" or sizedefault == nil then
sizedefault = maxsize
end
-- check to see if size bigger than maxsize
if size ~= "" and size ~= nil then
local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;
local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;
if sizenumber>maxsizenumber and maxsizenumber>0 then
size = maxsize;
end
end
end
-- add px to size if just a number
if (tonumber(size) or 0) > 0 then
size = size .. "px";
end
-- add px to sizedefault if just a number
if (tonumber(sizedefault) or 0) > 0 then
sizedefault = sizedefault .. "px";
end
result = "[[File:" .. image;
if page ~= "" and page ~= nil then
result = result .. "|page=" .. page;
end
if size ~= "" and size ~= nil then
result = result .. "|" .. size;
elseif sizedefault ~= "" and sizedefault ~= nil then
result = result .. "|" .. sizedefault;
else
result = result .. "|frameless";
end
if center == "yes" then
result = result .. "|center"
end
if alt ~= "" and alt ~= nil then
result = result .. "|alt=" .. alt;
end
if link ~= "" and link ~= nil then
result = result .. "|link=" .. link;
end
if border == "yes" then
result = result .. "|border";
end
if upright == "yes" then
result = result .. "|upright";
elseif upright ~= "" then
result = result .. "|upright=" .. upright;
end
if thumbtime ~= "" then
result = result .. "|thumbtime=" .. thumbtime;
end
if class ~= nil and class ~= "" then
result = result .. "|class=" .. class;
end
-- if alt value is a keyword then do not use as a description
if alt == "thumbnail" or alt == "thumb" or alt == "frameless" or alt == "left" or alt == "center" or alt == "right" or alt == "upright" or alt == "border" or mw.ustring.match(alt or "", '^[0-9]*px$', 1) ~= nil then
alt = nil;
end
if title ~= "" and title ~= nil then
-- does title param contain any templatestyles? If yes then set to blank.
if mw.ustring.match(frame:preprocess(title), 'UNIQ%-%-templatestyles', 1) ~= nil then
title = nil;
end
end
if title ~= "" and title ~= nil then
result = result .. "|" .. title;
end
result = result .. "]]";
return result;
end
end
return i;
0ee5fe75ba239fc5c9cedc81ca11bdc0be068542
Module:Separated entries
828
132
364
363
2023-10-17T19:51:13Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Separated_entries]]
Scribunto
text/plain
-- This module takes positional parameters as input and concatenates them with
-- an optional separator. The final separator (the "conjunction") can be
-- specified independently, enabling natural-language lists like
-- "foo, bar, baz and qux". The starting parameter can also be specified.
local compressSparseArray = require('Module:TableTools').compressSparseArray
local p = {}
function p._main(args)
local separator = args.separator
-- Decode (convert to Unicode) HTML escape sequences, such as " " for space.
and mw.text.decode(args.separator) or ''
local conjunction = args.conjunction and mw.text.decode(args.conjunction) or separator
-- Discard values before the starting parameter.
local start = tonumber(args.start)
if start then
for i = 1, start - 1 do args[i] = nil end
end
-- Discard named parameters.
local values = compressSparseArray(args)
return mw.text.listToText(values, separator, conjunction)
end
local function makeInvokeFunction(separator, conjunction, first)
return function (frame)
local args = require('Module:Arguments').getArgs(frame)
args.separator = separator or args.separator
args.conjunction = conjunction or args.conjunction
args.first = first or args.first
return p._main(args)
end
end
p.main = makeInvokeFunction()
p.br = makeInvokeFunction('<br />')
p.comma = makeInvokeFunction(mw.message.new('comma-separator'):plain())
return p
e80231ff3de01afd7f62a94e0a34dc1e67504085
Template:Longitem
10
133
366
365
2023-10-17T19:51:14Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Longitem]]
wikitext
text/x-wiki
<noinclude>{{#tag: code|
</noinclude>{{#ifeq: {{{1|+}}} | {{{1|-}}} | <div style="}}display: inline-block; line-height: 1.2em; padding: .1em 0; {{#ifeq: {{{1|+}}} | {{{1|-}}} | {{{style|}}}">{{{1|}}}</div> | <includeonly>width: 100%;</includeonly> }}<includeonly>{{#if:{{{2|}}}|[[Category:Pages using Template:Longitem with unnamed style parameter]]}}</includeonly><noinclude>
|lang=wikitext}}
{{documentation}}
</noinclude>
2919b818deb36b243e9f9517917cbcfaa2c8d4ec
Template:Comma separated entries
10
134
368
367
2023-10-17T19:51:17Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Comma_separated_entries]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|comma}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
f9811ed089bab742e4aad8b8463eddcc7607f062
Template:Smallsup
10
135
370
369
2023-10-17T19:51:17Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Smallsup]]
wikitext
text/x-wiki
<includeonly><sup><small>{{{1}}}</small></sup></includeonly><noinclude>
{{Documentation}}
</noinclude>
c174fb3247218273210500118556feb9f3c76d5a
Template:Str left
10
136
372
371
2023-10-17T19:51:18Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Str_left]]
wikitext
text/x-wiki
<includeonly>{{safesubst:padleft:|{{{2|1}}}|{{{1}}}}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
2048b0d7b35e156528655b1d090e8b5ffab3f400
Template:Remove first word
10
137
374
373
2023-10-17T19:51:19Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Remove_first_word]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:String|replace|source={{{1}}}|pattern=^[^{{{sep|%s}}}]*{{{sep|%s}}}*|replace=|plain=false}}<noinclude>{{Documentation}}</noinclude>
df7a9e692f68be1581be06af5f51eaed5483b4c8
Template:Collapse top
10
138
376
375
2023-10-17T19:51:19Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Collapse_top]]
wikitext
text/x-wiki
<div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section -->
{| <!-- Template:Collapse top --> class="mw-collapsible mw-archivedtalk {{<includeonly>safesubst:</includeonly>#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}} {{{class|}}}" style="background: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|Silver}}}; margin: 0.2em auto auto; width:{{<includeonly>safesubst:</includeonly>#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}; padding: 1px;"
|-
! style="background: {{{bg|#{{main other|F0F2F5|CCFFCC}}}}}; font-size:87%; padding:0.2em 0.3em; text-align:{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}|left|{{<includeonly>safesubst:</includeonly>#if:{{{align|}}}|left|center}}}}; {{<includeonly>safesubst:</includeonly>#if:{{{fc|}}}|color: {{{fc}}};|}}" | <div style="font-size:115%;{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}||margin:0 4em}}">{{{1|{{{title|{{{reason|{{{header|{{{heading|{{{result|Extended content}}}}}}}}}}}}}}}}}}</div>
{{<includeonly>safesubst:</includeonly>#if:{{{warning|{{{2|}}}}}}
|{{<includeonly>safesubst:</includeonly>!}}-
{{<includeonly>safesubst:</includeonly>!}} style="text-align:center; font-style:italic;" {{<includeonly>safesubst:</includeonly>!}} {{{2|The following is a closed discussion. {{strongbad|Please do not modify it.}} }}} }}
|-
| style="border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|White}}};" {{<includeonly>safesubst:</includeonly>!}}<noinclude>
{{lorem ipsum|3}}
{{Collapse bottom}}
{{Documentation}}
</noinclude>
247cc43d5198baf8804d0926529cbbdd7be91113
Template:Collapse bottom
10
139
378
377
2023-10-17T19:51:19Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Collapse_bottom]]
wikitext
text/x-wiki
<includeonly>|}</div></includeonly><noinclude>
{{Documentation|Template:Collapse top/doc}}
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
64b210e8ab0882b262da50e9fbccf2132bc34fab
Template:Specialist lea type descr
10
140
380
379
2023-10-17T19:51:22Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Specialist_lea_type_descr]]
wikitext
text/x-wiki
<noinclude>
==Usage==
1 == specialist agency template code value - mandatory<br>
The specialist agency type descriptions can be edited here.
Do not change the specialist agency type code values here only. All [[:Category:Specialist law enforcement agency codified templates|other related templates]] must be edited too if the specialist agency type code values are changed.
==Encyclopedic content==
{{Tempmore |Specialist law enforcement agency}}
</noinclude><!--
Return specialist agency type description
--><includeonly>{{#switch: {{lc:{{{1|}}}}}
</includeonly><noinclude>{|class="wikitable"
!Code!!Description
|-</noinclude>
| border <includeonly>=</includeonly><noinclude>||</noinclude> National border patrol, security, and integrity.<noinclude>
|-</noinclude>
| coast <includeonly>=</includeonly><noinclude>||</noinclude> Coastal patrol, marine border protection, marine search and rescue.<noinclude>
|-</noinclude>
| corruption <includeonly>=</includeonly><noinclude>||</noinclude> [[Anti-corruption]]<noinclude>
|-</noinclude>
| customs <includeonly>=</includeonly><noinclude>||</noinclude> [[Customs]], [[excise]] and [[gaming law|gambling]].<noinclude>
|-</noinclude>
| diplomatic <includeonly>=</includeonly><noinclude>||</noinclude> Diplomatic personnel and facilities.<noinclude>
|-</noinclude>
| education<noinclude><br></noinclude><includeonly>
| </includeonly>nontertiary<noinclude><br></noinclude><includeonly>
| </includeonly>primary<noinclude><br></noinclude><includeonly>
| </includeonly>secondary<noinclude><br></noinclude><includeonly>
| </includeonly>tertiary <includeonly>=</includeonly><noinclude>||</noinclude> Buildings and lands occupied or explicitly controlled by the educational institution and the institution's personnel, and public entering the buildings and immediate precincts of the institution.<noinclude>
|-</noinclude>
| envher <includeonly>=</includeonly><noinclude>||</noinclude> Environment, parks, and/or heritage property.<noinclude>
|-</noinclude>
| fraud <includeonly>=</includeonly><noinclude>||</noinclude> Serious or complex fraud, commercial crime, fraud covering multiple lower level jurisdictions.<noinclude>
|-</noinclude>
| immigration <includeonly>=</includeonly><noinclude>||</noinclude> [[Immigration]]<noinclude>
|-</noinclude>
| institution <includeonly>=</includeonly><noinclude>||</noinclude> Buildings and lands occupied or explicitly controlled by the institution and the institution's personnel, and public entering the buildings and precincts of the institution.<noinclude>
|-</noinclude>
| paramilitary <includeonly>=</includeonly><noinclude>||</noinclude> Paramilitary law enforcement, counter insurgency, and [[riot control]].<noinclude>
|-</noinclude>
| specops <includeonly>=</includeonly><noinclude>||</noinclude> Counter terrorism, [[police tactical unit|special weapons operations]]. Protection of internationally protected persons, other very important persons, and/or of state property of significance.<noinclude>
|-</noinclude>
| postal <includeonly>=</includeonly><noinclude>||</noinclude> Property, personnel, and/or postal items of a postal service. <noinclude>
|-</noinclude>
| property <includeonly>=</includeonly><noinclude>||</noinclude> Buildings and other fixed assets.<noinclude>
|-</noinclude>
| protection <includeonly>=</includeonly><noinclude>||</noinclude> Protection of international or domestic [[Very Important Person|VIPs]], protection of significant state assets.<noinclude>
|-</noinclude>
| rail <includeonly>=</includeonly><noinclude>||</noinclude> Railways, tramways, and/or rail transit systems.<noinclude>
|-</noinclude>
| road <includeonly>=</includeonly><noinclude>||</noinclude> Highways, roads, and/or traffic.<noinclude>
|-</noinclude>
| tax <includeonly>=</includeonly><noinclude>||</noinclude> Taxation<noinclude>
|-</noinclude>
| transit <includeonly>=</includeonly><noinclude>||</noinclude> Commuter transit systems and immediate environs, rail, tram, ferry, bus, etc.<noinclude>
|-</noinclude>
| vehicle <includeonly>=</includeonly><noinclude>||</noinclude> Vehicle safety and hazardous material transport laws and regulations, licensing, registration, insurance, etc.<noinclude>
|-</noinclude>
| water <includeonly>=</includeonly><noinclude>||</noinclude> Water ways and bodies and/or coastal areas.<noinclude>
|}</noinclude><includeonly>
}}</includeonly><noinclude>
[[Category:Specialist law enforcement agency codified templates|Specialist lea type descr]]
</noinclude>
a8a70873252b5433544a1d0962d0ca83d2d51c9e
Template:Clc
10
141
382
381
2023-10-17T19:51:23Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Clc]]
wikitext
text/x-wiki
#REDIRECT [[Template:Category link with count]]
02280e2ab57b544236e11f913e3759c5781ca9d5
Template:Trim brackets
10
142
384
383
2023-10-17T19:51:24Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Trim_brackets]]
wikitext
text/x-wiki
{{safesubst<noinclude/>:#invoke:String|replace|source={{{1|}}}|pattern=^(%s*)(%[*)(.-)(%]*)(%s*)$|replace=%3|plain=false}}<noinclude>
{{documentation}}
</noinclude>
e8eca21321bdba7db6eece11b7155600db7623c1
Template:Organization infoboxes
10
143
386
385
2023-10-17T19:51:25Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Organization_infoboxes]]
wikitext
text/x-wiki
{{Navbox
| name = Organization infoboxes
| state = {{{state<includeonly>|expanded</includeonly>}}}
| bodyclass = hlist
| title = [[Wikipedia:Template index|Wikipedia templates]]: [[organization]] [[Template:Infobox|infoboxes]]
| above = [[Wikipedia:Manual of Style/Infoboxes]]
| group1 = General
| list1 =
* {{Tl|Infobox organization}}
* {{Tl|Infobox official post}}
* {{tl|Infobox criminal organization}}
* {{tl|Infobox fictional organisation}}
| group2 = {{longitem|Government<br/>and politics}}
| list2 =
* {{Tl|Infobox government}}
* {{Tl|Infobox government agency}}
* {{Tl|Infobox legislature}}
* {{Tl|Infobox political party}}
* {{Tl|Infobox court}}
* {{Tl|Infobox detention facility}}
* {{tl|Infobox fire department}}
* {{Tl|Infobox law enforcement agency}}
* {{Tl|Infobox space agency}}
| group3 = Military
| list3 =
* {{Tl|Infobox national military}}
* {{Tl|Infobox military unit}}
* {{tl|Infobox military rank}}
* {{Tl|Infobox military gear}}
| group4 = Religion
| list4 =
* {{Tl|Infobox religious group}}
* {{Tl|Infobox religion}}
* {{Tl|Infobox diocese}}
* {{Tl|Infobox church}}
* {{Tl|Infobox monastery}}
| group5 = People
| list5 =
* {{Tl|Infobox ethnic group}}
* {{Tl|Infobox caste}}
* {{Tl|Infobox clan}}
* {{Tl|Infobox family}}
* {{Tl|Infobox iwi}}
* {{Tl|Infobox hereditary title}}
* {{Tl|Infobox monarchy}}
* {{Tl|Infobox officeholder}}
* {{Tl|Infobox tribe}}
| group6 = {{longitem|Typically<br/>non-profit}}
| list6 =
* {{tl|Infobox hospital}}
* {{Tl|Infobox institute}}
* {{Tl|Infobox laboratory}}{{smallsup|1}}
* {{tl|Infobox museum}}
* {{Tl|Infobox observatory}}
* {{Tl|Infobox school}}
* {{tl|Infobox school district}}
* {{Tl|Infobox university}}{{smallsup|2}}
| group7 = Publications
| list7 =
* {{Tl|Infobox journal}}
* {{Tl|Infobox magazine}}
* {{Tl|Infobox newspaper}}
* {{Tl|Infobox publisher}}
| group8 = Business
| list8 =
* {{Tl|Infobox company}}
* {{tl|Infobox brewery}}
* {{Tl|Infobox law firm}}
* {{tl|Infobox restaurant}}
* {{tl|Infobox website}} – ''type of business or publication''
| group9 = Distinctions
| list9 =
* {{Tl|Infobox order}}
* {{Tl|Infobox fraternity}}
* {{Tl|Infobox Grand Lodge}}
| group10 = Subtemplates
| list10 =
* '''Coordinates''' {{Tl|coord}}
* '''Dates'''
** {{Tl|start date}}}—for {{para|established}}, {{para|founded}}, {{para|opened}} etc.
** {{Tl|end date}}}—for {{para|dissolved}}, {{para|defunct}}
* '''Lists'''
**{{tl|plainlist}}
** {{tl|flatlist}}
** {{tl|unbulleted list}}
* '''Non-English text''' {{Tl|lang}}
* '''Website'''
** {{tl|URL}}
** {{tl|Official URL}}
** {{tl|Official website}}
* '''Documentation'''
** {{Tl|mf-adr}}}—Address
** {{Tl|UF-hcard-org}}—[[Microformat]]/metadata
| below =
* {{smallsup|1}} or research institution
* {{smallsup|2}} or college
* [[:Category:Infobox templates|Category]]
* [[Help:Infobox|Help]]
* [[Wikipedia:List of infoboxes|List of infoboxes]]
}}<noinclude>{{documentation}}</noinclude>
8e81fe7179216c1823e098fa600be889f26cbeba
Template:Infobox law enforcement agency/doc
10
144
388
387
2023-10-17T19:51:26Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_law_enforcement_agency/doc]]
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
{{tlc|{{BASEPAGENAME}}}} is an infobox template for use in articles on individual [[Law enforcement agency|law enforcement agencies]]. See also: [[Wikipedia:Naming conventions (law enforcement agency categories)|Naming conventions (law enforcement agency categories)]].
== Usage ==
{{Parameter names example | agencyname | nativename | nativenamea | nativenamer | fictional | patch | patchcaption | logo | logocaption | badge | badgecaption | flag | flagcaption | image_size | commonname | abbreviation | motto | mottotranslated | formed | preceding1 | preceding2 | preceding3 | preceding4 | preceding5 | preceding6 | dissolved | superseding | employees | volunteers | budget | legalpersonality | legaljuris | national | country | countryabbr | federal | international | divname | subdivname | map | mapcaption | dmap | sizearea | sizepopulation | governingbody | governingbodyscnd | constitution1 | constitution2 | constitution3 | constitution4 | constitution5 | constitution6 | gendarmerie | provost | military | police | local | secret | religious | speciality1 | speciality2 | speciality3 | speciality4 | speciality5 | speciality6 | overviewtype | overviewbody | headquarters | hqlocmap | hqlocmapsize | hqlocmappoptitle | sworntype | sworn | unsworntype | unsworn | multinational | electeetype | minister1name | minister1pfo | minister2name | minister2pfo | minister3name | minister3pfo | minister4name | minister4pfo | minister5name | minister5pfo | minister6name | minister6pfo | chief1name | chief1position | chief2name | chief2position | chief3name | chief3position | chief4name | chief4position | chief5name | chief5position | chief6name | chief6position | parentagency | child1agency | child2agency | child3agency | child4agency | child5agency | child6agency | child7agency | unittype | unitname | officetype | officename | provideragency | uniformedas | stationtype | stations | airbases | lockuptype | lockups | vehicle1type | vehicles1 | vehicle2type | vehicles2 | vehicle3type | vehicles3 | boat1type | boats1 | boat2type | boats2 | boat3type | boats3 | aircraft1type | aircraft1 | aircraft2type | aircraft2 | aircraft3type | aircraft3 | animal1type | animals1 | animal2type | animals2 | animal3type | animals3 | person1name | person1reason | person1type | person2name | person2reason | person2type | person3name | person3reason | person3type | person4name | person4reason | person4type | person5name | person5reason | person5type | person6name | person6reason | person6type | programme1 | programme2 | programme3 | programme4 | programme5 | programme6 | activitytype| activity1name | activity2name | activity3name | activity4name | activity5name | activity6name | anniversary1 | anniversary2 | anniversary3 | anniversary4 | anniversary5 | anniversary6 | award1 | award2 | award3 | award4 | award5 | award6 | website | footnotes }}
<syntaxhighlight lang="wikitext" style="overflow: hidden; background: unset;">
{{Infobox law enforcement agency
| agencyname =
| nativename =
| nativenamea =
| nativenamer =
| fictional =
| patch =
| patchcaption =
| logo =
| logocaption =
| badge =
| badgecaption =
| flag =
| flagcaption =
| image_size =
| commonname =
| abbreviation =
| motto =
| mottotranslated =
| formed =
| preceding1 = <!-- up to | preceding6 = -->
| dissolved =
| superseding =
| employees =
| volunteers =
| budget =
| legalpersonality =
| legaljuris =
| national =
| country =
| countryabbr =
| federal =
| international = <!-- NNN or {{collapsible list |title=NNN |[[country1]] . . |[[countryNNN]]}} -->
| divname =
| subdivname =
| map =
| mapcaption =
| dmap =
| sizearea =
| sizepopulation =
| governingbody =
| governingbodyscnd =
| constitution1 = <!-- up to | constitution6 = -->
| gendarmerie =
| provost =
| military =
| police =
| local =
| secret =
| religious =
| speciality1 = <!-- up to | speciality6 = -->
| overviewtype =
| overviewbody =
| headquarters =
| hqlocmap =
| hqlocmapsize =
| hqlocmappoptitle =
| sworntype =
| sworn =
| unsworntype =
| unsworn =
| multinational = <!-- NNN or {{collapsible list |title=NNN |[[country1]] . . |[[countryNNN]]}} -->
| electeetype =
| minister1name = <!-- up to | minister6name = -->
| minister1pfo = <!-- up to | minister6pfo = -->
| chief1name = <!-- up to | chief6name = -->
| chief1position = <!-- up to | chief6position = -->
| parentagency =
| child1agency = <!-- up to | child7agency = -->
| unittype =
| unitname = <!-- NNN or {{collapsible list |title=NNN |[[Unit1]] . . |[[UnitNNN]]}} -->
| officetype =
| officename = <!-- NNN or {{collapsible list |title=NNN |[[Office1]] . . |[[OfficeNNN]]}} -->
| provideragency =
| uniformedas =
| stationtype =
| stations = <!-- NNN or {{collapsible list |title=NNN |[[Station1]] . . |[[StationNNN]]}} -->
| airbases = <!-- NNN or {{collapsible list |title=NNN |[[Airbase1]] . . |[[AirbaseNNN]]}} -->
| lockuptype =
| lockups = <!-- NNN or {{collapsible list |title=NNN |[[Lockup1]] . . |[[LockupNNN]]}} -->
| vehicle1type = <!-- up to | vehicle3type = -->
| vehicles1 = <!-- NNN or {{collapsible list |title=NNN |[[Vehicle1]] . . |[[VehicleNNN]]}} --><!-- up to | vehicles3 = -->
| boat1type = <!-- up to | boat3type = -->
| boats1 = <!-- NNN or {{collapsible list |title=NNN |[[Boat1]] . . |[[BoatNNN]]}} --><!-- up to | boats3 = -->
| aircraft1type = <!-- up to | aircraft3type = -->
| aircraft1 = <!-- NNN or {{collapsible list |title=NNN |[[Aircraft1]] . . |[[AircraftNNN]]}} --><!-- up to | aircraft3 = -->
| animal1type = <!-- up to | animal3type = -->
| animals1 = <!-- NNN or {{collapsible list |title=NNN |[[Animal1]] . . |[[AnimalNNN]]}} --><!-- up to | animals3 = -->
| person1name = <!-- up to | person6name = -->
| person1reason = <!-- up to | person6reason = -->
| person1type = <!-- up to |person6type = -->
| programme1 = <!-- or | program1 = --><!-- up to | programme6 = or | program6 = -->
| activitytype =
| activity1name = <!-- up to | activity6name = -->
| anniversary1 = <!-- up to | anniversary6 = -->
| award1 = <!-- up to | award6 = -->
| website =
| footnotes =
}}
</syntaxhighlight>
{{Clear}}
== Parameter names and description ==
{| class="wikitable" style="background-color:white"
! Parameter name
! Required
! Description
! Values
|- style="background-color:#ddd"
| '''Agency header''' || yes || agencyname is provided automatically based on PAGENAME if not provided. ||
|-
| agencyname || no || Name of the agency. Defaults to the name of the current page. || Text. Do not link.
|-
| nativename || no || Agency name in a native language using Western characters (French, German, Spanish, etc.), such as Port Lotniczy im. Fryderyka Chopina. Can also be used for two different names in the same language. || Text.
|-
| nativenamea || no || Agency name in a native language with non-Western characters (Chinese, Japanese, Korean, Arabic, etc.), such as 北京首都国际机场. || Text.
|-
| nativenamer || no || Use in conjunction with nativenamea for Romanized name of the agency, such as Běijīng Shǒudū Guójì Jīcháng. || Text.
|-
| fictional || no || 'Yes' if the agency is a fictional agency || Text == Yes.
|-
| patch || no || Patch for the agency. || Image file name.
|-
| patchcaption || no || Caption for the agency patch. || Optionally linked text.
|-
| logo || no || Logo for the agency. || Image file name.
|-
| logocaption || no || Caption for the agency logo. || Optionally linked text.
|-
| badge || no || Badge for the agency. || Image file name.
|-
| badgecaption || no || Caption for the agency badge. || Optionally linked text.
|-
| flag || no || Flag for the agency. || Image file name.
|-
| flagcaption || no || Caption for the agency flag. || Optionally linked text.
|-
| image_size || no || Size in px of the images for patch, logo, badge, flag. Defaults to 140. || Single number.
|-
| commonname || no || Common name for the agency. || Text. Do not link.
|-
| abbreviation || no || Abbreviation of the agency name. || Text.
|-
| motto || no || The motto of the agency. || Optionally linked text.
|-
| mottotranslated || no || The English translation of the motto of the agency. || Optionally linked text.
|- style="background-color:#ddd"
| '''Agency overview''' || yes || At least one parameter should be provided. ||
|-
| formed || no || Date of formation of the agency. || Linked text, for example, 25 July 2005, or 1876..
|-
| <s>formedmonthday</s> || no || The month and day of month the agency was formed. Ignored if formedyear not set. This parameter has been deprecated by formed. || Month name followed by day of month number. [[Wikipedia:Manual of Style (dates and numbers)#Date autoformatting|Do not link]].
|-
| <s>formedyear</s> || no || The year the agency was formed. This parameter has been deprecated by formed. || yyyy. [[Wikipedia:Manual of Style (dates and numbers)#Date autoformatting|Do not link]]
|-
| preceding1 || no || Name of preceding agency. Can be repeated up to preceding6.<br>'''Note:''' Title of box will automatically pluralise upon use of preceding2. || Text. Do not link. The template will link.
|-
| dissolved || no || Date of dissolution of the agency. || Text, for example, 25 July 2005, or 1876].
|-
| superseding || no || Name of superseding agency. || Optionally linked text.
|-
| employees || no || Number of employees of the agency. || Number with optional citation or comment.
|-
| volunteers || no || Number of volunteers to the agency. || Number with optional citation or comment.
|-
| budget || no || Annual budget of the agency || Linked and referenced text, for example, <nowiki>$95M [[USD]] (2006)</nowiki>.
|-
| legalpersonality || no || The legal personality of the agency either Governmental or Non-governmental. Governmental examples: [[government agency]]; [[government-owned corporation]]; [[government ministry]]. Non-governmental examples: [[partnership]]; [[privately-held company]]; [[cooperative]]; [[body corporate]].|| Text. Do not link. The template will link.
|- style="background-color:#ddd"
| '''Jurisdictional structure''' || yes || At least one parameter should be provided. ||
|-
| legaljuris || no || Name of area in which the agency is legally empowered to act. If the same as the operational area then set value to 'opsjuris'. || Optionally linked text, or Text == opsjuris.
|-
| country || yes || Name of the country or name of the group of countries the agency operates in or across. || Text. Do not link. The template will link.
|-
| countryabbr || no || Abbreviation for the country. || Text. Do not link. The template will link.
|-
| [[Law enforcement agency#natlea|national]] || no || 'Yes' if the agency services a single national jurisdiction. || Text == Yes.
|-
| [[Law enforcement agency#fedlea|federal]] || no || 'Yes' if the agency services a jurisdiction established by a [[Federation]]. || Text == Yes.
|-
| [[Law enforcement agency#internat|international]] || no || Number of, or optionally linked list of, the countries the agency has jurisdiction in or across. || Number or template reference with parameters.
|-
| divname|| no || Name of a division of a country, for example, [[Queensland]], [[Pennsylvania]], etc. The template will attempt to [[#Automatic disambiguation|disambiguate]] if required. || Text. Do not link. The template will link.
|-
| subdivname || no || Name of a sub-division of a country, for example, [[Sydney]], [[Buckinghamshire|Bucks]], etc. The template will attempt to [[#Automatic disambiguation|disambiguate]] if required. || Text. Do not link. The template will link.
|-
| map || no || Map of jurisdiction of the agency. || Image file name.
|-
| mapcaption || no || Caption for the agency map. Linking is recommended to a more detailed description of the geography of the jurisdiction. Defaults to 'Map of the agencyname's jurisdiction.'. It is recommended that this parameter and its corresponding image file name NOT be overridden to another image type. || Optionally linked text.
|-
| dmap || no || Location Map of jurisdiction of the agency. || Use [[Template:Location map]] to get image.
|-
| sizearea || no || Size of geographic area covered by the jurisdiction. || Number and area unit, preferably metric.
|-
| sizepopulation || no || Size of the population covered by the jurisdiction. || Number.
|-
| governingbody || no || Name of the governing body which is responsible for the agency, the law making body. Do not confuse with the overviewbody parameter below. The title will change from 'Governing body' to 'Primary governing body' if the governingbodyscnd parameter is set. || Text, for example, Government of Western Australia or United States Government. Do not link. The template will link.
|-
| governingbodyscnd || no || Name of a secondary governing body which is responsible for the agency, for example, a local or state government versus as state of federal government respectively, and a law making body. Do not confuse with the overviewbody or overview_body parameter below. || Text. Do not link. The template will link.
|-
| constitution1 || no || Titles and references to the instruments of the governing body which constitute and create the agency. Can be repeated up to constitution6.<br>'''Note:''' Title of box will automatically pluralise upon use of constitution2. || Text, linked and-or referenced.
|-
| [[Gendarmerie|gendarmerie]] || no || 'Yes' if the agency is a [[gendarmerie]]. Forces military parameter to 'Yes'. || Text == Yes.
|-
| [[Law enforcement agency#provost|provost]] || no || 'Yes' if the agency is a [[Provost (military police)|military provost]]. Forces military parameter to 'Yes'. || Text == Yes.
|-
| [[Law enforcement agency#milpol|military]] || no || 'Yes' if the agency is a [[military police]] agency. || Text == Yes.
|-
| [[Law enforcement agency#police|police]] || no || 'Yes' if the agency also provides services related to general social order and public safety. Displays "Civilian police" in infobox. '''Note:''' if used in combination with {{para|local}} changes to "Local civilian police". 'footnote' if qualified provision and use footnotes below.|| Text == Yes, or Text == footnote.
|-
| [[Law enforcement agency#locpol|local]] || no || 'Yes' if the agency is [[police]] and for the type of services provided is a local or territorial police. '''Note:''' For use in combination with {{para|police}}.'footnote' if qualified provision and use footnoes below. || Text == Yes, or Text == footnote.
|-
| [[Secret police|secret]] || no || A (robust) source reference for the fact that the organisation is known as a [[secret police]] organisation. || Optionally templated and-or linked text.
|-
| [[Law enforcement agency#relpol|religious]] || no || 'Yes' if the agency is involved in enforcing religious law. || Text == Yes, or Text == footnote.
|-
| [[Specialist law enforcement agency|speciality1]] || no || Identifies the specialist roles of the agency. The [[Template:Specialist lea type descr|Specialist roles template]] has a table of specialist role descriptions with corresponding codes. Entering a code, for example "institution", will display the description in the infobox. Can be repeated up to speciality6.
|| Enumerated text value, one of: institution, education, primary, secondary, nontertiary, tertiary, water, envher, postal, property, road, customs, corruption, rail, vehicle, protection, specops, fraud, paramilitary, diplomatic, border, coast.
|- style="background-color:#ddd"
| '''Operational structure''' || yes || At least one parameter value should be provided. ||
|-
| overviewtype || no || Type of overview authority for the operations of and community engagement by the agency. Defaults to 'Overviewed by', and becomes 'Overviewed by overviewtype'. || Optionally linked text.
|-
| overviewbody || no || Name of the overview body. || Optionally linked text.
|-
| headquarters || no || Location of the agencies's headquarters. || Text, for example, <nowiki>[[Sydney, New South Wales]], [[Australia]]</nowiki>
|-
| hqlocmap || no || Map containing location of the headquarters. || Image file name.
|-
| hqlocmappoptitle || no || Pop up title on mouse over map. Defaults to 'Map indicating the location of the headquarters'. || Text.
|-
| hqlocmapsize || no || Size of headquarters map. || Number.
|-
| sworntype || no || Type or title of sworn members, for example 'Police officer', 'Federal agent'. Defaults to 'Sworn member'. The 's' is added by the template. || Optionally linked text.
|-
| sworn || no || Number of sworn members of the agency. || Number with optional citation or comment.
|-
| unsworntype || no || Type or title of unsworn members, for example 'Staff member', 'Civilian'. Defaults to 'Unsworn member'. The 's' is added by the template. || Optionally linked text.
|-
| unsworn || no || Number of unsworn members of the agency. || Number with optional citation or comment.
|-
| [[Law enforcement agency#multinat|multinational]] || no || Number of, or optionally linked list of, the countries the agency draws personnel from. Note that an international agency does not necessarily draw personnel from all countries in its jurisdiction. || Number or template reference with parameters.
|-
| electeetype || no || Type of governing body official overseeing the agency, example is 'Minister' for "Minister responsible". Defaults to "Elected officer responsible". '''Note:''' will automatically pluralise governing body official type with an 's' upon use of minister2name.|| Optionally linked text.
|-
| minister1name || no || Elected or overseeing governing body member. For [[Westminster system]]s: Name of current minister responsible for the agency. Can be repeated up to minister6name.<br/> || Optionally linked text.
|-
| minister1pfo || no || Elected or overseeing governing body member. For Westminster systems: Portfolio title of responsible minister. Can be repeated up to minister6pfo. || Optionally linked text.
|-
| chief1name || no || Name of current agency chief/director/executive director. Can be repeated up to chief6name.<br>'''Note:''' Title of box will automatically pluralise upon use of chief2name. || Text.
|-
| chief1position || no || Position title of current agency chief/director/executive director. Can be repeated up to chief6position. || Optionally linked text.
|-
| parentagency || no || Parent agency of this agency || Optionally linked text.
|-
| child1agency || no || List of current child agencies reporting to this agency. Can be repeated up to child7agency.<br>'''Note:''' Title of box will automatically pluralise upon use of child2agency. || Optionally linked text.
|-
| unittype || no || Generic name or title of a unit if the agency, for example, Function, Division, Command. Defaults to 'Unit'. || Optionally linked text.
|-
| unitname || no || Optionally linked list of the units in the agency, for example, Crime Stoppers, Counter Terrorism. The intent here is to list operations, and operations support units, for example Crimes Scenes, Forensics, and not administration units. || Number or template reference with parameters.
|-
| officetype || no || Generic name or title of the operation area of the agency, for example, Office, Precinct, District. Defaults to 'Command'. || Text.
|-
| officename || no || Optionally linked list of the operation areas of the agency. || Number or template reference with parameters.
|-
| provideragency || no || Name of the agency to which the services are outsourced to. || Optionally linked text.
|-
| uniformedas || no || Name of agency if not uniformed as the 'agencyname'. Defaults to agencyname || Optionally linked text.
|- style="background-color:#ddd"
| '''Facilities''' || no || Each of the following facilities can be "type" overridden but will still display in the set order. For example, lockuptype/lockups can be used as vehicle0type/vehicle0s, boat1type/boats1 can be used as vehicle4type/vehicles4, boat2type/boats2 can be used vehicle5type/vehicles5, etc. There are up to 14 facilities which can be typed as required. ||
|-
| stationtype || no || Generic name or title of a work location of the agency, for example, Station, Office, Precinct. Defaults to 'Station'. || Optionally linked text.
|-
| stations || no || Number of or optionally linked list of the work locations of the agency. || Number or template reference with parameters.
|-
| airbases || no || Number of or optionally linked list of the airbases of the agency. || Number or template reference with parameters.
|-
| lockuptype || no || Generic name or title of a temporary detention centre of the agency, for example, Lockup, Watch house, Remand centre. Defaults to 'Lockup'. || Optionally linked text.
|-
| lockups || no || Number of or optionally linked list of the temporary detention centres of the agency. || Number or template reference with parameters.
|-
| vehicle1type || no || Generic name or title of a vehicle of the agency, for example, Patrol car, Forward command vehicle, Tactical vehicle. Defaults to 'Patrol car'. Can be repeated up to vehicle3type. || Optionally linked text.
|-
| vehicles1 || no || Number of or optionally linked list of the vehicles of the agency. Can be repeated up to vehicles3. || Number or template reference with parameters.
|-
| boat1type || no || Generic name or title of a water craft of the agency, for example, Boat, Patrol craft. Defaults to 'Boat'. Can be repeated up to boat3type. || Optionally linked text.
|-
| boats1 || no || Number of or optionally linked list of the water craft of the agency. Can be repeated up to boats3. || Number or template reference with parameters.
|-
| aircraft1type || no || Generic name or title of an air craft of the agency, for example, Plane, Helicopter. Defaults to 'Plane'. Can be repeated up to aircraft3type. || Optionally linked text.
|-
| aircraft1 || no || Number of or optionally linked list of the air craft of the agency. Can be repeated up to aircraft3. || Number or template reference with parameters.
|-
| animal1type || no || Generic name or title of an animal of the agency, for example, Dog, Horse. Defaults to 'Dog'. Can be repeated up to animal3type. || Optionally linked text.
|-
| animal1 || no || Number of or optionally linked list of the animals of the agency. Can be repeated up to animal3. || Number or template reference with parameters.
|- style="background-color:#ddd"
| '''Notables''' || no || Key significant notables for the agency. These and other, more numerous, notables should appear in article sections or even separate supporting articles. || Show / Hide collapsible only if more than one item.
|-
| person1name || no || Name of agency member notable for special reason. Can be repeated up to person6name. || Optionally linked text.
|-
| person1type || no || Type of peson, for example 'Inspector', 'Federal agent', 'Director', 'Commissioner'. Can be repeated up to person6type. || Optionally linked text.
|-
| person1reason || no || Reason the agency is notable, for example, bravery, reform, corruption (yes the bad too). Can be repeated up to person6reason. || Optionally linked text.
|-
| programme1 || no || Name of a key agency programme, or campaign, for example, [[most wanted]]. Can be repeated up to programme6. For American English spelling, use <code>program1</code>, <code>program2</code>, ...|| Optionally linked text.
|-
| activitytype || no || Type of 'Significant' activity or event, example is 'investigation' for "Significant investigation". Default is 'operation' for "Significant operation". '''Note:''' will automatically pluralise with an 's' upon use of activity2name. || Optionally linked text.
|-
| activity1name || no || Name of an activity or event which is notable. Can be repeated up to activity6name. || Optionally linked text.
|-
| anniversary1 || no || Name of notable event to be commemorated. Can be repeated up to anniversary6. || Optionally linked text. Recommended format: <nowiki>[[optionally piped text]] ([[Year]], [[dd Month]])</nowiki>
|-
| award1 || no || Name of award, decoration, honour, or other significant recognition. Can be repeated up to award6. || Optionally linked text. Recommended format: <nowiki>[[optionally piped text]] ([[Year]], [[dd Month]])</nowiki>
|- style="background-color:#ddd"
| '''Website and footnotes''' || no || ||
|-
| website || no || Web address for agency website || WWW address. Use <nowiki>{{URL|example.com}}</nowiki>
|-
| footnotes || no || Footnotes or references for included information || Text.
|}
==TemplateData==
{{collapse top|[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": "Infobox law enforcement agency is an infobox template for use in articles on individual law enforcement agencies.",
"format": "{{_\n| _________________ = _\n}}\n",
"params": {
"agencyname": {
"label": "Agency name",
"description": "Name of the agency defaults to {{PAGENAME}} if not provided.",
"type": "string",
"required": false
},
"nativename": {
"label": "Native name",
"description": "Agency name in a native language using Western characters (French, German, Spanish, etc.), such as Port Lotniczy im. Fryderyka Chopina. Can also be used for two different names in the same language.",
"example": "{{lang|pl|Port Lotniczy im}}",
"type": "string",
"required": false
},
"nativenamea": {
"label": "Direct native name",
"description": "Agency name in a native language with non-Western characters (Chinese, Japanese, Korean, Arabic, etc.)",
"example": "{{lang|zh|北京首都国际机场}}",
"type": "string",
"required": false
},
"nativenamer": {
"label": "Romanised native name",
"description": "Use in conjunction with nativenamea or native_name_a for Romanized name of the agency.",
"example": "{{lang|zh-p|Běijīng Shǒudū Guójì Jīcháng}}",
"type": "string",
"required": false
},
"fictional": {
"label": "Fictional",
"description": "'Yes' if the agency is a fictional agency",
"type": "string",
"required": false
},
"patch": {
"label": "Patch",
"description": "Patch for the agency.",
"type": "wiki-file-name",
"required": false
},
"patchcaption": {
"label": "Patch caption",
"description": "Caption for the agency patch.",
"type": "string",
"default": "Patch of the agencyname",
"example": "coat of arms",
"required": false
},
"logo": {
"label": "Logo",
"description": "Logo for the agency.",
"type": "wiki-file-name",
"required": false
},
"logocaption": {
"label": "Logo caption",
"description": "Caption for the agency logo.",
"type": "string",
"default": "Logo of the agencyname",
"example": "coat of arms",
"required": false
},
"badge": {
"label": "Badge",
"description": "Badge for the agency.",
"type": "wiki-file-name",
"required": false
},
"badgecaption": {
"label": "Badge Caption",
"description": "Caption for the agency badge.",
"type": "string",
"default": "Badge of the agencyname",
"example": "coat of arms",
"required": false
},
"flag": {
"label": "Flag",
"description": "Flag for the agency.",
"type": "wiki-file-name",
"required": false
},
"flagcaption": {
"label": "Flag caption",
"description": "Caption for the agency flag.",
"type": "string",
"default": "Flag of the agencyname",
"example": "coat of arms",
"required": false
},
"image_size": {
"label": "Image sizes",
"description": "Size in px of the images for patch, logo, badge, flag.",
"type": "number",
"default": "140",
"required": false
},
"commonname": {
"label": "Common Name",
"description": "Common name for the agency.",
"type": "string",
"required": false
},
"abbreviation": {
"label": "Abbreviation",
"description": "Abbreviation of the agency name.",
"type": "string",
"required": false
},
"motto": {
"label": "Motto",
"description": "The motto of the agency.",
"type": "string",
"required": false
},
"mottotranslated": {
"label": "Motto translated",
"description": "The English translation of the motto of the agency.",
"type": "string",
"required": false
},
"formed": {
"label": "Formed",
"description": "Date of formation of the agency.",
"type": "string",
"example": "25 July 2005, or 1876.",
"required": false
},
"formedmonthday": {
"label": "Formed",
"description": "The month and day of month the agency was formed. Ignored if formedyear not set. This parameter has been deprecated by formed.",
"type": "string",
"example": "Month name followed by day of month number.",
"deprecated": true,
"required": false
},
"formedyear": {
"label": "Formed",
"description": "The year the agency was formed. This parameter has been deprecated by formed.",
"type": "string",
"example": "yyyy.",
"deprecated": true,
"required": false
},
"preceding1": {
"label": "Preceding agency 1",
"description": "Name of a preceding agency. Title of box will automatically pluralise upon use of more than one.",
"type": "string"
},
"preceding2": {
"label": "Preceding agency 2",
"inherits": "preceding1"
},
"preceding3": {
"label": "Preceding agency 3",
"inherits": "preceding1"
},
"preceding4": {
"label": "Preceding agency 4",
"inherits": "preceding1"
},
"preceding5": {
"label": "Preceding agency 5",
"inherits": "preceding1"
},
"preceding6": {
"label": "Preceding agency 6",
"inherits": "preceding1"
},
"dissolved": {
"label": "Date dissolved",
"description": "Date of dissolution of the agency.",
"type": "string",
"example": "{{end date|1782}}",
"required": false
},
"superseding": {
"label": "Superseding agency",
"description": "Name of superseding agency.",
"type": "string",
"required": false
},
"employees": {
"label": "Employees",
"description": "Number of employees of the agency.",
"type": "number",
"required": false
},
"volunteers": {
"label": "Volunteers",
"description": "Number of volunteers to the agency.",
"type": "number",
"required": false
},
"budget": {
"label": "Annual budget",
"description": "Annual budget of the agency.",
"type": "string",
"example": "$95 m [[United States dollar|USD]] (2006)",
"required": false
},
"legalpersonality": {
"label": "Legal personality",
"description": "The legal personality of the agency.",
"type": "string",
"example": "government agency; government-owned corporation; government ministry; partnership; privately-held company; cooperative; body corporate; or, the full legal name of organisation if the type of organisation is not known.",
"required": false
},
"country": {
"label": "Country",
"description": "Name of the country or name of the group of countries the agency operates in or across.",
"type": "string",
"required": true
},
"countryabbr": {
"label": "Country Abbreviation",
"description": "Abbreviation for the country.",
"type": "string",
"required": false
},
"national": {
"label": "National",
"description": "'Yes' if the agency services a single national jurisdiction.",
"type": "string",
"required": false
},
"federal": {
"label": "Federal",
"description": "'Yes' if the agency services a jurisdiction established by a Federation.",
"type": "string",
"required": false
},
"international": {
"label": "International",
"description": "Number of, or optionally linked list of, the countries the agency has jurisdiction in or across.",
"type": "string",
"required": false
},
"divtype": {
"label": "divtype",
"description": "Title of a division of a country.",
"type": "string",
"example": "State, Territory, etc., or 'Police area' if the jurisdiction is specifically constructed.",
"required": false,
"deprecated": true
},
"divname": {
"label": "divname",
"description": "Name of a division of a country.",
"type": "string",
"example": "Queensland, Pennsylvania",
"required": false
},
"subdivtype": {
"label": "subdivtype",
"description": "Title of a sub-division of a country.",
"type": "string",
"example": "City, County, etc., or 'Police area' if the jurisdiction is specifically constructed.",
"required": false,
"deprecated": true
},
"subdivname": {
"label": "subdivname",
"description": "Name of a sub-division of a country.",
"type": "string",
"example": "Sydney, Bucks",
"required": false
},
"map": {
"label": "map",
"description": "Map of jurisdiction of the agency.",
"type": "wiki-file-name",
"required": false
},
"dmap": {
"label": "dmap",
"description": "Location Map of jurisdiction of the agency. Use Template:Location map to get image.",
"type": "unknown",
"required": false
},
"mapcaption": {
"label": "mapcaption",
"description": "Caption for the agency map.",
"type": "string",
"default": "Map of the agencyname's jurisdiction",
"required": false
},
"sizearea": {
"label": "sizearea",
"description": "Size of geographic area covered by the jurisdiction.",
"type": "string",
"required": false
},
"sizepopulation": {
"label": "sizepopulation",
"description": "Size of the population covered by the jurisdiction.",
"type": "number",
"required": false
},
"legaljuris": {
"label": "Legal Jurisdiction",
"description": "Name of area in which the agency is legally empowered to act. If the same as the operational area then set value to 'opsjuris'.",
"type": "string",
"required": false
},
"governingbody": {
"label": "Governing Body",
"description": "Name of the governing body which is responsible for the agency, the law making body. Do not confuse with the overviewbody parameter below. The title will change from 'Governing body' to 'Primary governing body' if the governingbodyscnd parameter is set.",
"type": "string",
"example": "Government of Western Australia, United States Government",
"required": false
},
"governingbodyscnd": {
"label": "Secondary Governing Body",
"description": "Name of a secondary governing body which is responsible for the agency. Do not confuse with the overviewbody parameter below.",
"type": "string",
"example": "Local or state government versus as state of federal government respectively, and a law making body.",
"required": false
},
"constitution1": {
"label": "constitution1",
"description": "Titles and references to the instruments of the governing body which constitute and create the agency.",
"type": "string",
"required": false
},
"constitution2": {
"label": "constitution2",
"inherits": "constitution1"
},
"constitution3": {
"label": "constitution3",
"inherits": "constitution1"
},
"constitution4": {
"label": "constitution4",
"inherits": "constitution1"
},
"constitution5": {
"label": "constitution5",
"inherits": "constitution1"
},
"constitution6": {
"label": "constitution6",
"inherits": "constitution1"
},
"gendarmerie": {
"label": "Gendarmerie",
"description": "'Yes' if the agency is a gendarmerie. Forces military parameter to 'Yes'.",
"type": "string",
"required": false
},
"provost": {
"label": "Provost",
"description": "'Yes' if the agency is a military provost. Forces military parameter to 'Yes'.",
"type": "string",
"required": false
},
"police": {
"label": "Police",
"description": "'Yes' if the agency also provides services related to general social order and public safety.",
"type": "string",
"required": false
},
"local": {
"label": "Local",
"description": "'Yes' if the agency is the local or territorial agency for the type of services provided.",
"type": "string",
"required": false
},
"military": {
"label": "Military",
"description": "'Yes' if the agency is a military police agency.",
"type": "string",
"required": false
},
"secret": {
"label": "Secret",
"description": "Yes' if the agency is known as a secret police organisation.",
"type": "string",
"required": false
},
"religious": {
"label": "Religious",
"description": "Yes' if the agency is involved in enforcing religious law.",
"type": "string",
"required": false
},
"speciality1": {
"label": "speciality1",
"description": "Identifies the agency as having a specialist jurisdiction of particular types of geography, property, etc.",
"type": "string",
"required": false
},
"speciality2": {
"label": "speciality2",
"inherits": "speciality1"
},
"speciality3": {
"label": "speciality3",
"inherits": "speciality1"
},
"speciality4": {
"label": "speciality4",
"inherits": "speciality1"
},
"speciality5": {
"label": "speciality5",
"inherits": "speciality1"
},
"speciality6": {
"label": "speciality6",
"inherits": "speciality1"
},
"overviewtype": {
"label": "Overview Type",
"description": "Type of overview authority for the operations of and community engagement by the agency.",
"type": "string",
"default": "Overviewed by', and becomes 'Overviewed by overview type'.",
"required": false
},
"overviewbody": {
"label": "Overview Body",
"description": "Name of the overview body.",
"type": "string",
"required": false
},
"headquarters": {
"label": "Headquarters",
"description": "Location of the agencies's headquarters.",
"type": "string",
"example": "[[Sydney, New South Wales]], [[Australia]]",
"required": false
},
"hqlocmap": {
"label": "hqlocmap",
"description": "Map containing location of the headquarters.",
"type": "wiki-file-name",
"required": false
},
"hqlocmapsize": {
"label": "hqlocmapsize",
"description": "Size of the map.",
"type": "number",
"required": false
},
"hqlocmappoptitle": {
"label": "hqlocmappoptitle",
"description": "Pop up title on mouse over map.",
"type": "string",
"default": "Map indicating the location of the headquarters",
"required": false
},
"sworntype": {
"label": "Sworn Type",
"description": "Type or title of sworn members.",
"type": "string",
"default": "Sworn member",
"example": "Police officer, Federal agent",
"required": false
},
"sworn": {
"label": "Sworn",
"description": "Number of sworn members of the agency.",
"type": "string",
"required": false
},
"unsworntype": {
"label": "Unsworn Type",
"description": "Type or title of unsworn members.",
"type": "string",
"default": "Unsworn member",
"example": "Staff member, Civilian",
"required": false
},
"unsworn": {
"label": "Unsworn",
"description": "Number of unsworn members of the agency.",
"type": "string",
"required": false
},
"multinational": {
"label": "multinational",
"description": "Number of, or optionally linked list of, the countries the agency draws personnel from. Note that an international agency does not necessarily draw personnel from all countries in its jurisdiction.",
"type": "string",
"required": false
},
"electeetype": {
"label": "Electee Type",
"description": "Generic type of governing body officials overseeing the agency.",
"type": "string",
"default": "Elected officer",
"required": false
},
"minister1name": {
"label": "minister1name",
"description": "Elected or overseeing governing body member.",
"type": "string",
"example": "For Westminster systems: Name of current minister responsible for the agency",
"required": false
},
"minister1pfo": {
"label": "minister1pfo",
"description": "Elected or overseeing governing body member.",
"type": "string",
"example": "For Westminster systems: Portfolio title of responsible minister.",
"required": false
},
"minister2name": {
"label": "minister2name",
"inherits": "minister1name"
},
"minister2pfo": {
"label": "minister2pfo",
"inherits": "minister1pfo"
},
"minister3name": {
"label": "minister3name",
"inherits": "minister1name"
},
"minister3pfo": {
"label": "minister3pfo",
"inherits": "minister1pfo"
},
"minister4name": {
"label": "minister4name",
"inherits": "minister1name"
},
"minister4pfo": {
"label": "minister4pfo",
"inherits": "minister1pfo"
},
"minister5name": {
"label": "minister5name",
"inherits": "minister1name"
},
"minister5pfo": {
"label": "minister5pfo",
"inherits": "minister1pfo"
},
"minister6name": {
"label": "minister6name",
"inherits": "minister1name"
},
"minister6pfo": {
"label": "minister6pfo",
"inherits": "minister1pfo"
},
"chief1name": {
"label": "chief1name",
"description": "Name of current agency chief/director/executive director.",
"type": "string",
"required": false
},
"chief1position": {
"label": "chief1position",
"description": "Position title of current agency chief/director/executive director.",
"type": "string",
"required": false
},
"chief2name": {
"label": "chief2name",
"inherits": "chief1name"
},
"chief2position": {
"label": "chief2position",
"inherits": "chief1position"
},
"chief3name": {
"label": "chief3name",
"inherits": "chief1name"
},
"chief3position": {
"label": "chief3position",
"inherits": "chief1position"
},
"chief4name": {
"label": "chief4name",
"inherits": "chief1name"
},
"chief4position": {
"label": "chief4position",
"inherits": "chief1position"
},
"chief5name": {
"label": "chief5name",
"inherits": "chief1name"
},
"chief5position": {
"label": "chief5position",
"inherits": "chief1position"
},
"chief6name": {
"label": "chief6name",
"inherits": "chief1name"
},
"chief6position": {
"label": "chief6position",
"inherits": "chief1position"
},
"parentagency": {
"label": "Parent Agency",
"description": "Parent agency of this agency.",
"type": "string",
"required": false
},
"child1agency": {
"label": "child1agency",
"description": "List of current child agencies reporting to this agency.",
"type": "string",
"required": false
},
"child2agency": {
"label": "child2agency",
"inherits": "child1agency"
},
"child3agency": {
"label": "child3agency",
"inherits": "child1agency"
},
"child4agency": {
"label": "child4agency",
"inherits": "child1agency"
},
"child5agency": {
"label": "child5agency",
"inherits": "child1agency"
},
"child6agency": {
"label": "child6agency",
"inherits": "child1agency"
},
"child7agency": {
"label": "child7agency",
"inherits": "child1agency"
},
"unittype": {
"label": "Unit Type",
"description": "Generic name or title of a unit if the agency.",
"type": "string",
"default": "Unit",
"example": "Function, Division, Command",
"required": false
},
"unitname": {
"label": "Unit Name",
"description": "Optionally linked list of the units in the agency.",
"type": "string",
"example": "Crime Stoppers, Counter Terrorism. The intent here is to list operations, and operations support units, for example Crimes Scenes, Forensics, and not administration units.",
"required": false
},
"officetype": {
"label": "Office Type",
"description": "Generic name or title of the operation area of the agency.",
"type": "string",
"default": "Command",
"example": "Office, Precinct, District",
"required": false
},
"officename": {
"label": "Office Name",
"description": "Optionally linked list of the operation areas of the agency.",
"type": "string",
"required": false
},
"provideragency": {
"label": "Provider Agency",
"description": "Name of the agency to which the services are outsourced to.",
"type": "string",
"required": false
},
"uniformedas": {
"label": "Uniformed as",
"description": "Name of agency if not uniformed as the Agency Name.",
"type": "string",
"default": "Agency Name",
"required": false
},
"stationtype": {
"label": "Station Type",
"description": "Generic name or title of a work location of the agency.",
"type": "string",
"example": "Station, Office, Precinct.",
"default": "Station",
"required": false
},
"stations": {
"label": "Stations",
"description": "Number of or optionally linked list of the work locations of the agency.",
"type": "string",
"required": false
},
"airbases": {
"label": "Airbases",
"description": "Number of or optionally linked list of the airbases of the agency.",
"type": "string",
"required": false
},
"lockuptype": {
"label": "Lockup Type",
"description": "Generic name or title of a temporary detention centre of the agency.",
"type": "string",
"example": "Lockup, Watch house, Remand centre.",
"default": "Lockup",
"required": false
},
"lockups": {
"label": "Lockups",
"description": "Number of or optionally linked list of the temporary detention centres of the agency.",
"type": "string",
"required": false
},
"vehicle1type": {
"label": "vehicle1type",
"description": "Generic name or title of a vehicle of the agency.",
"type": "string",
"example": "Patrol car, Forward command vehicle, Tactical vehicle.",
"default": "Patrol car",
"required": false
},
"vehicles1": {
"label": "vehicles1",
"description": "Number of or optionally linked list of the vehicles of the agency.",
"type": "string",
"required": false
},
"vehicle2type": {
"label": "vehicle2type",
"inherits": "vehicle1type"
},
"vehicles2": {
"label": "vehicles2",
"inherits": "vehicles1"
},
"vehicle3type": {
"label": "vehicle3type",
"inherits": "vehicle1type"
},
"vehicles3": {
"label": "vehicles3",
"inherits": "vehicles1"
},
"boat1type": {
"label": "boat1type",
"description": "Generic name or title of a water craft of the agency.",
"type": "string",
"example": "Boat, Patrol craft.",
"default": "Boat",
"required": false
},
"boats1": {
"label": "boats1",
"description": "Number of or optionally linked list of the water craft of the agency.",
"type": "string",
"required": false
},
"boat2type": {
"label": "boat2type",
"inherits": "boat1type"
},
"boats2": {
"label": "boats2",
"inherits": "boats1"
},
"boat3type": {
"label": "boat3type",
"inherits": "boat1type"
},
"boats3": {
"label": "boats3",
"inherits": "boats1"
},
"aircraft1type": {
"label": "aircraft1type",
"description": "Generic name or title of an air craft of the agency, for example.",
"type": "string",
"example": "Plane, helicopter.",
"default": "Plane",
"required": false
},
"aircraft1": {
"label": "aircraft1",
"description": "Number of or optionally linked list of the air craft of the agency.",
"type": "string",
"required": false
},
"aircraft2type": {
"label": "aircraft2type",
"inherits": "aircraft1type"
},
"aircraft2": {
"label": "aircraft2",
"inherits": "aircraft1"
},
"aircraft3type": {
"label": "aircraft3type",
"inherits": "aircraft1type"
},
"aircraft3": {
"label": "aircraft3",
"inherits": "aircraft1"
},
"animal1type": {
"label": "animal1type",
"description": "Generic name or title of an animal of the agency.",
"type": "string",
"example": "Dog, Horse.",
"default": "Dog",
"required": false
},
"animals1": {
"label": "animals1",
"description": "Number of or optionally linked list of the animals of the agency.",
"type": "string",
"required": false
},
"animal2type": {
"label": "animal2type",
"inherits": "animal1type"
},
"animals2": {
"label": "animals2",
"inherits": "animals1"
},
"animal3type": {
"label": "animal3type",
"inherits": "animal1type"
},
"animals3": {
"label": "animals3",
"inherits": "animals1"
},
"person1name": {
"label": "person1name",
"description": "Name of agency person notable for special reason.",
"type": "string",
"required": false
},
"person1type": {
"label": "person1type",
"description": "Type of person.",
"type": "string",
"example": "Inspector, Federal agent, Director, Commissioner",
"required": false
},
"person1reason": {
"label": "person1reason",
"description": "Reason the agency person is notable.",
"type": "string",
"example": "Bravery, reform, corruption (yes the bad too)",
"required": false
},
"person2name": {
"label": "person2name",
"inherits": "person1name"
},
"person2type": {
"label": "person2type",
"inherits": "person1type"
},
"person2reason": {
"label": "person2reason",
"inherits": "person1reason"
},
"person3name": {
"label": "person3name",
"inherits": "person1name"
},
"person3type": {
"label": "person3type",
"inherits": "person1type"
},
"person3reason": {
"label": "person3reason",
"inherits": "person1reason"
},
"person4name": {
"label": "person4name",
"inherits": "person1name"
},
"person4type": {
"label": "person4type",
"inherits": "person1type"
},
"person4reason": {
"label": "person4reason",
"inherits": "person1reason"
},
"person5name": {
"label": "person5name",
"inherits": "person1name"
},
"person5type": {
"label": "person5type",
"inherits": "person1type"
},
"person5reason": {
"label": "person5reason",
"inherits": "person1reason"
},
"person6name": {
"label": "person6name",
"inherits": "person1name"
},
"person6type": {
"label": "person6type",
"inherits": "person1type"
},
"person6reason": {
"label": "person6reason",
"inherits": "person1reason"
},
"programme1": {
"label": "programme1",
"description": "Name of a key agency programme, or campaign.",
"type": "string",
"example": "Most wanted",
"required": false,
"aliases": [
"program1"
]
},
"programme2": {
"label": "programme2",
"inherits": "programme1",
"aliases": [
"program2"
]
},
"programme3": {
"label": "programme3",
"inherits": "programme1",
"aliases": [
"program3"
]
},
"programme4": {
"label": "programme4",
"inherits": "programme1",
"aliases": [
"program4"
]
},
"programme5": {
"label": "programme5",
"inherits": "programme1",
"aliases": [
"program5"
]
},
"programme6": {
"label": "programme6",
"inherits": "programme1",
"aliases": [
"program6"
]
},
"activitytype": {
"label": "activitytype",
"description": "Type of activity or event.",
"type": "string",
"default": "Operation",
"example": "Investigation",
"required": false
},
"activity1name": {
"label": "activity1name",
"description": "Name of an activity or event which is notable.",
"type": "string",
"required": false
},
"activity2name": {
"label": "activity2name",
"inherits": "activity1name"
},
"activity3name": {
"label": "activity3name",
"inherits": "activity1name"
},
"activity4name": {
"label": "activity4name",
"inherits": "activity1name"
},
"activity5name": {
"label": "activity5name",
"inherits": "activity1name"
},
"activity6name": {
"label": "activity6name",
"inherits": "activity1name"
},
"anniversary1": {
"label": "anniversary1",
"description": "Name of notable event to be commemorated.",
"type": "string",
"example": "[[optionally piped text]] ([[Year]], [[dd Month]])",
"required": false
},
"anniversary2": {
"label": "anniversary2",
"inherits": "anniversary1"
},
"anniversary3": {
"label": "anniversary3",
"inherits": "anniversary1"
},
"anniversary4": {
"label": "anniversary4",
"inherits": "anniversary1"
},
"anniversary5": {
"label": "anniversary5",
"inherits": "anniversary1"
},
"anniversary6": {
"label": "anniversary6",
"inherits": "anniversary1"
},
"award1": {
"label": "award1",
"description": "Name of award, decoration, honour, or other significant recognition.",
"type": "string",
"example": "[[optionally piped text]] ([[Year]], [[dd Month]])",
"required": false
},
"award2": {
"label": "award2",
"inherits": "award1"
},
"award3": {
"label": "award3",
"inherits": "award1"
},
"award4": {
"label": "award4",
"inherits": "award1"
},
"award5": {
"label": "award5",
"inherits": "award1"
},
"award6": {
"label": "award6",
"inherits": "award1"
},
"website": {
"label": "Website",
"description": "Web address for agency website.",
"type": "url",
"example": "WWW address",
"required": false
},
"footnotes": {
"label": "Footnotes",
"description": "Footnotes or references for included information.",
"type": "string",
"required": false
},
"embed": {},
"paramilitary": {
"deprecated": true
}
},
"paramOrder": [
"agencyname",
"nativename",
"nativenamea",
"nativenamer",
"fictional",
"patch",
"patchcaption",
"logo",
"logocaption",
"badge",
"badgecaption",
"flag",
"flagcaption",
"image_size",
"commonname",
"abbreviation",
"motto",
"mottotranslated",
"formed",
"formedmonthday",
"formedyear",
"preceding1",
"preceding2",
"preceding3",
"preceding4",
"preceding5",
"preceding6",
"dissolved",
"superseding",
"employees",
"volunteers",
"budget",
"legalpersonality",
"country",
"countryabbr",
"national",
"federal",
"international",
"divtype",
"divname",
"subdivtype",
"subdivname",
"map",
"dmap",
"mapcaption",
"sizearea",
"sizepopulation",
"legaljuris",
"governingbody",
"governingbodyscnd",
"constitution1",
"constitution2",
"constitution3",
"constitution4",
"constitution5",
"constitution6",
"gendarmerie",
"provost",
"police",
"local",
"military",
"secret",
"religious",
"speciality1",
"speciality2",
"speciality3",
"speciality4",
"speciality5",
"speciality6",
"overviewtype",
"overviewbody",
"headquarters",
"hqlocmap",
"hqlocmapsize",
"hqlocmappoptitle",
"sworntype",
"sworn",
"unsworntype",
"unsworn",
"multinational",
"electeetype",
"minister1name",
"minister1pfo",
"minister2name",
"minister2pfo",
"minister3name",
"minister3pfo",
"minister4name",
"minister4pfo",
"minister5name",
"minister5pfo",
"minister6name",
"minister6pfo",
"chief1name",
"chief1position",
"chief2name",
"chief2position",
"chief3name",
"chief3position",
"chief4name",
"chief4position",
"chief5name",
"chief5position",
"chief6name",
"chief6position",
"parentagency",
"child1agency",
"child2agency",
"child3agency",
"child4agency",
"child5agency",
"child6agency",
"child7agency",
"unittype",
"unitname",
"officetype",
"officename",
"provideragency",
"uniformedas",
"stationtype",
"stations",
"airbases",
"lockuptype",
"lockups",
"vehicle1type",
"vehicles1",
"vehicle2type",
"vehicles2",
"vehicle3type",
"vehicles3",
"boat1type",
"boats1",
"boat2type",
"boats2",
"boat3type",
"boats3",
"aircraft1type",
"aircraft1",
"aircraft2type",
"aircraft2",
"aircraft3type",
"aircraft3",
"animal1type",
"animals1",
"animal2type",
"animals2",
"animal3type",
"animals3",
"person1name",
"person1type",
"person1reason",
"person2name",
"person2type",
"person2reason",
"person3name",
"person3type",
"person3reason",
"person4name",
"person4type",
"person4reason",
"person5name",
"person5type",
"person5reason",
"person6name",
"person6type",
"person6reason",
"programme1",
"programme2",
"programme3",
"programme4",
"programme5",
"programme6",
"activitytype",
"activity1name",
"activity2name",
"activity3name",
"activity4name",
"activity5name",
"activity6name",
"anniversary1",
"anniversary2",
"anniversary3",
"anniversary4",
"anniversary5",
"anniversary6",
"award1",
"award2",
"award3",
"award4",
"award5",
"award6",
"website",
"footnotes",
"embed",
"paramilitary"
]
}
</templatedata>
{{collapse bottom}}
== Tracking categories ==
* {{clc|Pages using law enforcement agency with local civilian police general nature}}
* {{clc|Pages using law enforcement agency with civilian police general nature}}
* {{Category link with count|Pages using infobox law enforcement agency with unknown parameters}}
* {{clc|Pages using infobox law enforcement agency with paramilitary parameter}}
== See also ==
{{Organization infoboxes}}
<includeonly>{{Sandbox other||
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Law enforcement infobox templates|Law Enforcement Agency]]
[[Category:Organization infobox templates|Law Enforcement Agency]]
[[Category:Politics and government infobox templates|Law Enforcement Agency]]
[[Category:Embeddable templates]]
}}</includeonly>
57fd62e2a5d1ae90f274a57c083507399108dfa0
Los Alameda County Sheriff's Department
0
8
390
84
2023-10-17T20:03:44Z
LamayII
2
LASD Infobox
wikitext
text/x-wiki
{{Infobox law enforcement agency
|agencyname=Los Alameda County Sheriff's Department
|motto="A tradition of service."
|formedyear=1850
|budget=>~ 100 Employees
|legaljuris=County law enforcement
|headquarters=Carrington
|chief1name=Canada_Enforcer|chief1position=Sheriff
}}
The '''Los Alameda County Sheriff's Department (LASD)''', officially the '''County of Los Alameda Sheriff's Department''' is a law enforcement agency within the State of Santa Modesta serving Los Alameda County. LASD is the largest law enforcement agency in the state. Since the department’s formation in 1850, the County of Los Alameda Sheriff’s Department has taken the responsibilities of providing contracted municipal police services within unincorporated communities of Los Alameda County, provide courthouse security for the Superior Court of Los Alameda County, and regulate the housing and transportation services of inmates within the county jail system.
== History ==
0b5e609e380321c6e6bdd7aedff79515f6eb1657
File:Lapd badge.png
6
145
391
2023-10-17T20:13:04Z
LamayII
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Los Alameda Police Department
0
146
392
2023-10-17T20:14:44Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
{{Infobox law enforcement agency|agencyname=Los Alameda Police Department|abbreviation=LAPD|motto=''To Protect and To Serve''|formed=December 13, 1869|legaljuris=Municipal law enforcement|chief1name=Richard MacPherson Smith II|chief1position=Chief of Police|budget=>~ 100 Employees|badge=Lapd_badge.png}}
The '''Los Angeles Police Department''' ('''LAPD'''), officially known as the '''City of Los Angeles Police Department''', is the primary law enforcement agency of Los Angeles, California, United States. It is the largest municipal police department in the State of Santa Modesta.
== History ==
Following the rise of violence, gambling, and vice, the Los Alameda Rangers and Los Alameda City Guards proved insufficient in quelling unruly behavior within the municipality. By 1869, the two volunteer forces were amalgamated by the City Marshal, whom of which appointed six officers to serve under, eventually growing to become the first paid municipal police service in the city. To this day the department expands its resources and capabilities in serving all districts within the City of Los Alameda.
938498849414dbcd137624a340455cd3a0de9992
Template:Infobox state
10
147
393
2023-10-17T20:28:47Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
<includeonly>{{Infobox settlement
| name = {{{name|}}}
| official_name = {{{official_name|}}}
| native_name = {{{native_name|}}}
| settlement_type = {{#if: {{{type|}}}|{{{type}}}|[[U.S. state|State]]}}
<!-- images, nickname, motto -->
| image_flag = {{{image_flag|}}}
| flag_border = {{{flag_border|}}}
| flag_size = {{{flag_size|125}}}
| flag_alt = {{{flag_alt|}}}
| flag_link = {{{flag_link|Flag of {{{name|}}}}}}
| image_seal = {{{image_seal|}}}
| seal_size = {{{seal_size|}}}
| seal_alt = {{{seal_alt|}}}
| seal_link = {{{seal_link|Seal of {{{name|}}}}}}
| etymology = {{{etymology|}}}
| nickname_link = List of U.S. state and territory nicknames
| nickname = {{{nickname|}}}
| nicknames = {{{nicknames|}}}
| motto_link = List of U.S. state and territory mottos
| motto = {{{motto|}}}
| mottoes =
| anthem_link = List of U.S. state songs
| anthem = {{{anthem|}}}
<!-- maps and coordinates -->
| image_map = {{{image_map|}}}
| mapsize = 300
| map_alt = {{{map_alt|}}}
| map_caption = Map of the United States with {{{name|}}} highlighted
<!-- location -->
| subdivision_type = Country
| subdivision_name = United States<!-- the name of the country -->
<!-- established -->
| established_title1 = Before statehood
| established_date1 = {{#ifexist:{{{Former|}}}|[[{{{Former|}}}]]|{{{Former|}}}}}
| established_title2 = [[List of U.S. states by date of admission to the Union|Admitted to the Union]]<!-- Founded -->
| established_date2 = {{{AdmittanceDate|}}} ({{{AdmittanceOrder|}}})<!-- requires established_title= -->
<!-- seat, smaller parts -->
| seat_type = {{#ifeq:{{{LargestCity}}}|capital|[[List of capitals in the United States|Capital]]<br/>{{nobold|([[List of largest cities of U.S. states and territories by population|and largest city]])}}|[[List of capitals in the United States|Capital]]}}
| seat = {{{seat|{{{Capital|}}}}}}
| seat1_type = [[List of largest cities of U.S. states and territories by population|Largest city]]
| seat2_type = [[List of the most populous counties by U.S. state|Largest county or equivalent]]
| seat2 = {{{LargestCounty|}}}
| seat1 = {{#ifeq:{{{LargestCity}}}|capital||{{{LargestCity}}}}}
| parts_type = [[statistical area (United States)|Largest metro]] and [[List of United States urban areas|urban]] areas
| parts_style = <!-- list, coll (collapsed list), para (paragraph format) -->
| parts = {{{LargestMetro|}}}
<!-- government type, leaders -->
| government_footnotes = {{{government_footnotes|}}}
| government_type =
| governing_body =
| leader_party =
| leader_title = [[Governor of {{{name|}}}|Governor]]
| leader_name = {{{Governor|}}}<!-- add (no-break space) to disable automatic links -->
| leader_title1 = [[Lieutenant Governor of {{{name|}}}|{{{Lieutenant Governor_alt|Lieutenant Governor}}}]]
| leader_name1 = {{{Lieutenant Governor|}}}<!-- etc., up to leader_title4 / leader_name4 -->
| government_blank1_title = [[Legislature]]
| government_blank1 = {{{Legislature|}}}
| government_blank2_title = • [[Upper house]]
| government_blank2 = {{{Upperhouse}}}
| government_blank3_title = • [[Lower house]]
| government_blank3 = {{{Lowerhouse}}}
| government_blank4_title = [[Judiciary]]
| government_blank4 = {{{Judiciary|}}}
| government_blank5_title = [[List of United States senators from {{{name|}}}|U.S. senators]]
| government_blank5 = {{{Senators}}}
| government_blank6_title = [[List of United States representatives from {{{name|}}}|U.S. House delegation]]
| government_blank6 = {{#if:{{{Representative|}}}
| {{{Representative}}} ([[United States congressional delegations from {{{name|}}}|list]])
}}
| government_blank7_title =
| government_blank7 =
<!-- display settings -->
| unit_pref = Imperial<!-- enter: Imperial, to display imperial before metric -->
<!-- area -->
| area_footnotes = {{{area_footnotes|}}}
| area_magnitude = <!-- use only to set a special wikilink -->
| area_total_km2 = {{{area_total_km2|}}}
| area_total_sq_mi = {{{area_total_sq_mi|}}}<!-- see table @ Template:Infobox settlement for details -->
| area_land_km2 = {{{area_land_km2|}}}
| area_land_sq_mi = {{{area_land_sq_mi|}}}
| area_water_km2 = {{{area_water_km2|}}}
| area_water_sq_mi = {{{area_water_sq_mi|}}}
| area_water_percent = {{{area_water_percent|}}}
| area_rank = {{#if:{{{area_rank|}}}|[[List of U.S. states and territories by area|{{{area_rank|}}}]]}}
<!-- dimensions -->
| dimensions_footnotes = {{{dimensions_footnotes|}}}
| length_km = {{{length_km|}}}
| length_mi = {{{length_mi|}}}
| width_km = {{{width_km|}}}
| width_mi = {{{width_mi|}}}
<!-- elevation -->
| elevation_footnotes = {{{elevation_footnotes|}}}
| elevation_m = {{{elevation_m|}}}
| elevation_ft = {{{elevation_ft|}}}
| elevation_point = <!-- for denoting the measurement point -->
| elevation_max_footnotes = {{{elevation_max_footnotes|}}}
| elevation_max_m = {{{elevation_max_m|}}}
| elevation_max_ft = {{{elevation_max_ft|}}}
| elevation_max_point = {{{elevation_max_point|}}}<!-- for denoting the measurement point -->
| elevation_max_rank =
| elevation_min_m = {{{elevation_min_m|}}}
| elevation_min_ft = {{{elevation_min_ft|}}}
| elevation_min_point = {{{elevation_min_point|}}}<!-- for denoting the measurement point -->
| elevation_min_rank =
<!-- population -->
| population_total = {{{2020Pop|{{{2010Pop|{{{2000Pop}}}}}}}}}
| population_as_of = {{{population_as_of|}}}
| population_rank = {{#if:{{{population_rank|}}}|[[List of U.S. states and territories by population|{{{population_rank|}}}]]}}
| population_density_km2 = {{{2020Density|{{{2010Density|{{{2000Density|auto}}}}}}}}}
| population_density_sq_mi = {{{2020DensityUS|{{{2010DensityUS|{{{2000DensityUS|auto}}}}}}}}}
| population_density_rank = {{#if:{{{population_density_rank|}}}|[[List of states and territories of the United States by population density|{{{population_density_rank|}}}]]}}
| population_blank1_title = [[Household income in the United States|Median household income]]
| population_blank1 = {{{MedianHouseholdIncome|}}}
| population_blank2_title = Income rank
| population_blank2 = {{{IncomeRank|}}}
| population_demonym = {{{population_demonym|}}}<!-- demonym, e.g. Liverpudlian for someone from Liverpool -->
<!-- demographics (section 1) -->
| demographics_type1 = Language
| demographics1_title1 = [[Languages of the United States|Official language]]{{#if:{{{OfficialLangs|}}}|s}}
| demographics1_info1 = {{{OfficialLang|{{{OfficialLangs|}}}}}}
| demographics1_title2 = [[Languages of the United States|Spoken language]]
| demographics1_info2 = {{{Languages|}}}
<!-- time zone(s) -->
| timezone1 = {{{timezone1|}}}
| utc_offset1 = {{{utc_offset1|}}}
| timezone1_DST = {{{timezone1_DST|}}}
| utc_offset1_DST = {{{utc_offset1_DST|}}}
| timezone1_location = {{{timezone1_location|}}}
| timezone2 = {{{timezone2|}}}
| utc_offset2 = {{{utc_offset2|}}}
| timezone2_DST = {{{timezone2_DST|}}}
| utc_offset2_DST = {{{utc_offset2_DST|}}}
| timezone2_location = {{{timezone2_location|}}}
<!-- postal codes, area code -->
| postal_code_type = [[List of U.S. state and territory abbreviations|USPS abbreviation]]<!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal_code = {{{postal_code|}}}
| iso_code = {{#if:{{{iso_code|}}}| [[ISO 3166-2:US|{{{iso_code|}}}]]}}
| code1_name = [[List of U.S. state and territory abbreviations|Traditional abbreviation]]
| code1_info = {{{TradAbbreviation|}}}
<!-- blank fields (section 1) -->
| blank_name_sec1 = Latitude
| blank_info_sec1 = {{{Latitude|}}}
| blank1_name_sec1 = Longitude
| blank1_info_sec1 = {{{Longitude|}}}
<!-- website, footnotes -->
| website = {{#if:{{{website|}}}|{{URL|1={{{website|}}}}}}}
| footnotes = {{{footnotes|}}}
| module = {{{module|}}}
}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox U.S. state with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox U.S. state]] with unknown parameter "_VALUE_"|ignoreblank=y| 2000Density | 2000DensityUS | 2000Pop | 2010Density | 2010DensityUS | 2010Pop | 2020Density | 2020DensityUS | 2020Pop | AdmittanceDate | AdmittanceOrder | anthem | area_footnotes | area_land_km2 | area_land_sq_mi | area_rank | area_total_km2 | area_total_sq_mi | area_water_km2 | area_water_percent | area_water_sq_mi | Capital | dimensions_footnotes | elevation_footnotes | elevation_ft | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_min_ft | elevation_min_m | elevation_min_point | etymology | flag_alt | flag_border | flag_link | flag_size | footnotes | Former | government_footnotes | Governor | image_flag | image_map | image_seal | IncomeRank | iso_code | Judiciary | Languages | LargestCity | LargestCounty | LargestMetro | Latitude | Legislature | length_km | length_mi | Lieutenant Governor | Lieutenant Governor_alt | Longitude | Lowerhouse | map_alt | MedianHouseholdIncome | module | motto | name | native_name | nickname | nicknames | official_name | OfficialLang | OfficialLangs | population_as_of | population_demonym | population_density_rank | population_rank | postal_code | Representative | seal_alt | seal_link | seal_size | seat | Senators | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | TradAbbreviation | type | Upperhouse | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | website | width_km | width_mi }}<noinclude>{{documentation}}</noinclude>
9513e228da58e3070a37876071bdd8da1894878e
394
393
2023-10-17T20:30:49Z
LamayII
2
Fixed variable
wikitext
text/x-wiki
<includeonly>{{Infobox state
| name = {{{name|}}}
| official_name = {{{official_name|}}}
| native_name = {{{native_name|}}}
| settlement_type = {{#if: {{{type|}}}|{{{type}}}|[[U.S. state|State]]}}
<!-- images, nickname, motto -->
| image_flag = {{{image_flag|}}}
| flag_border = {{{flag_border|}}}
| flag_size = {{{flag_size|125}}}
| flag_alt = {{{flag_alt|}}}
| flag_link = {{{flag_link|Flag of {{{name|}}}}}}
| image_seal = {{{image_seal|}}}
| seal_size = {{{seal_size|}}}
| seal_alt = {{{seal_alt|}}}
| seal_link = {{{seal_link|Seal of {{{name|}}}}}}
| etymology = {{{etymology|}}}
| nickname_link = List of U.S. state and territory nicknames
| nickname = {{{nickname|}}}
| nicknames = {{{nicknames|}}}
| motto_link = List of U.S. state and territory mottos
| motto = {{{motto|}}}
| mottoes =
| anthem_link = List of U.S. state songs
| anthem = {{{anthem|}}}
<!-- maps and coordinates -->
| image_map = {{{image_map|}}}
| mapsize = 300
| map_alt = {{{map_alt|}}}
| map_caption = Map of the United States with {{{name|}}} highlighted
<!-- location -->
| subdivision_type = Country
| subdivision_name = United States<!-- the name of the country -->
<!-- established -->
| established_title1 = Before statehood
| established_date1 = {{#ifexist:{{{Former|}}}|[[{{{Former|}}}]]|{{{Former|}}}}}
| established_title2 = [[List of U.S. states by date of admission to the Union|Admitted to the Union]]<!-- Founded -->
| established_date2 = {{{AdmittanceDate|}}} ({{{AdmittanceOrder|}}})<!-- requires established_title= -->
<!-- seat, smaller parts -->
| seat_type = {{#ifeq:{{{LargestCity}}}|capital|[[List of capitals in the United States|Capital]]<br/>{{nobold|([[List of largest cities of U.S. states and territories by population|and largest city]])}}|[[List of capitals in the United States|Capital]]}}
| seat = {{{seat|{{{Capital|}}}}}}
| seat1_type = [[List of largest cities of U.S. states and territories by population|Largest city]]
| seat2_type = [[List of the most populous counties by U.S. state|Largest county or equivalent]]
| seat2 = {{{LargestCounty|}}}
| seat1 = {{#ifeq:{{{LargestCity}}}|capital||{{{LargestCity}}}}}
| parts_type = [[statistical area (United States)|Largest metro]] and [[List of United States urban areas|urban]] areas
| parts_style = <!-- list, coll (collapsed list), para (paragraph format) -->
| parts = {{{LargestMetro|}}}
<!-- government type, leaders -->
| government_footnotes = {{{government_footnotes|}}}
| government_type =
| governing_body =
| leader_party =
| leader_title = [[Governor of {{{name|}}}|Governor]]
| leader_name = {{{Governor|}}}<!-- add (no-break space) to disable automatic links -->
| leader_title1 = [[Lieutenant Governor of {{{name|}}}|{{{Lieutenant Governor_alt|Lieutenant Governor}}}]]
| leader_name1 = {{{Lieutenant Governor|}}}<!-- etc., up to leader_title4 / leader_name4 -->
| government_blank1_title = [[Legislature]]
| government_blank1 = {{{Legislature|}}}
| government_blank2_title = • [[Upper house]]
| government_blank2 = {{{Upperhouse}}}
| government_blank3_title = • [[Lower house]]
| government_blank3 = {{{Lowerhouse}}}
| government_blank4_title = [[Judiciary]]
| government_blank4 = {{{Judiciary|}}}
| government_blank5_title = [[List of United States senators from {{{name|}}}|U.S. senators]]
| government_blank5 = {{{Senators}}}
| government_blank6_title = [[List of United States representatives from {{{name|}}}|U.S. House delegation]]
| government_blank6 = {{#if:{{{Representative|}}}
| {{{Representative}}} ([[United States congressional delegations from {{{name|}}}|list]])
}}
| government_blank7_title =
| government_blank7 =
<!-- display settings -->
| unit_pref = Imperial<!-- enter: Imperial, to display imperial before metric -->
<!-- area -->
| area_footnotes = {{{area_footnotes|}}}
| area_magnitude = <!-- use only to set a special wikilink -->
| area_total_km2 = {{{area_total_km2|}}}
| area_total_sq_mi = {{{area_total_sq_mi|}}}<!-- see table @ Template:Infobox settlement for details -->
| area_land_km2 = {{{area_land_km2|}}}
| area_land_sq_mi = {{{area_land_sq_mi|}}}
| area_water_km2 = {{{area_water_km2|}}}
| area_water_sq_mi = {{{area_water_sq_mi|}}}
| area_water_percent = {{{area_water_percent|}}}
| area_rank = {{#if:{{{area_rank|}}}|[[List of U.S. states and territories by area|{{{area_rank|}}}]]}}
<!-- dimensions -->
| dimensions_footnotes = {{{dimensions_footnotes|}}}
| length_km = {{{length_km|}}}
| length_mi = {{{length_mi|}}}
| width_km = {{{width_km|}}}
| width_mi = {{{width_mi|}}}
<!-- elevation -->
| elevation_footnotes = {{{elevation_footnotes|}}}
| elevation_m = {{{elevation_m|}}}
| elevation_ft = {{{elevation_ft|}}}
| elevation_point = <!-- for denoting the measurement point -->
| elevation_max_footnotes = {{{elevation_max_footnotes|}}}
| elevation_max_m = {{{elevation_max_m|}}}
| elevation_max_ft = {{{elevation_max_ft|}}}
| elevation_max_point = {{{elevation_max_point|}}}<!-- for denoting the measurement point -->
| elevation_max_rank =
| elevation_min_m = {{{elevation_min_m|}}}
| elevation_min_ft = {{{elevation_min_ft|}}}
| elevation_min_point = {{{elevation_min_point|}}}<!-- for denoting the measurement point -->
| elevation_min_rank =
<!-- population -->
| population_total = {{{2020Pop|{{{2010Pop|{{{2000Pop}}}}}}}}}
| population_as_of = {{{population_as_of|}}}
| population_rank = {{#if:{{{population_rank|}}}|[[List of U.S. states and territories by population|{{{population_rank|}}}]]}}
| population_density_km2 = {{{2020Density|{{{2010Density|{{{2000Density|auto}}}}}}}}}
| population_density_sq_mi = {{{2020DensityUS|{{{2010DensityUS|{{{2000DensityUS|auto}}}}}}}}}
| population_density_rank = {{#if:{{{population_density_rank|}}}|[[List of states and territories of the United States by population density|{{{population_density_rank|}}}]]}}
| population_blank1_title = [[Household income in the United States|Median household income]]
| population_blank1 = {{{MedianHouseholdIncome|}}}
| population_blank2_title = Income rank
| population_blank2 = {{{IncomeRank|}}}
| population_demonym = {{{population_demonym|}}}<!-- demonym, e.g. Liverpudlian for someone from Liverpool -->
<!-- demographics (section 1) -->
| demographics_type1 = Language
| demographics1_title1 = [[Languages of the United States|Official language]]{{#if:{{{OfficialLangs|}}}|s}}
| demographics1_info1 = {{{OfficialLang|{{{OfficialLangs|}}}}}}
| demographics1_title2 = [[Languages of the United States|Spoken language]]
| demographics1_info2 = {{{Languages|}}}
<!-- time zone(s) -->
| timezone1 = {{{timezone1|}}}
| utc_offset1 = {{{utc_offset1|}}}
| timezone1_DST = {{{timezone1_DST|}}}
| utc_offset1_DST = {{{utc_offset1_DST|}}}
| timezone1_location = {{{timezone1_location|}}}
| timezone2 = {{{timezone2|}}}
| utc_offset2 = {{{utc_offset2|}}}
| timezone2_DST = {{{timezone2_DST|}}}
| utc_offset2_DST = {{{utc_offset2_DST|}}}
| timezone2_location = {{{timezone2_location|}}}
<!-- postal codes, area code -->
| postal_code_type = [[List of U.S. state and territory abbreviations|USPS abbreviation]]<!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal_code = {{{postal_code|}}}
| iso_code = {{#if:{{{iso_code|}}}| [[ISO 3166-2:US|{{{iso_code|}}}]]}}
| code1_name = [[List of U.S. state and territory abbreviations|Traditional abbreviation]]
| code1_info = {{{TradAbbreviation|}}}
<!-- blank fields (section 1) -->
| blank_name_sec1 = Latitude
| blank_info_sec1 = {{{Latitude|}}}
| blank1_name_sec1 = Longitude
| blank1_info_sec1 = {{{Longitude|}}}
<!-- website, footnotes -->
| website = {{#if:{{{website|}}}|{{URL|1={{{website|}}}}}}}
| footnotes = {{{footnotes|}}}
| module = {{{module|}}}
}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox U.S. state with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox U.S. state]] with unknown parameter "_VALUE_"|ignoreblank=y| 2000Density | 2000DensityUS | 2000Pop | 2010Density | 2010DensityUS | 2010Pop | 2020Density | 2020DensityUS | 2020Pop | AdmittanceDate | AdmittanceOrder | anthem | area_footnotes | area_land_km2 | area_land_sq_mi | area_rank | area_total_km2 | area_total_sq_mi | area_water_km2 | area_water_percent | area_water_sq_mi | Capital | dimensions_footnotes | elevation_footnotes | elevation_ft | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_min_ft | elevation_min_m | elevation_min_point | etymology | flag_alt | flag_border | flag_link | flag_size | footnotes | Former | government_footnotes | Governor | image_flag | image_map | image_seal | IncomeRank | iso_code | Judiciary | Languages | LargestCity | LargestCounty | LargestMetro | Latitude | Legislature | length_km | length_mi | Lieutenant Governor | Lieutenant Governor_alt | Longitude | Lowerhouse | map_alt | MedianHouseholdIncome | module | motto | name | native_name | nickname | nicknames | official_name | OfficialLang | OfficialLangs | population_as_of | population_demonym | population_density_rank | population_rank | postal_code | Representative | seal_alt | seal_link | seal_size | seat | Senators | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | TradAbbreviation | type | Upperhouse | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | website | width_km | width_mi }}<noinclude>{{documentation}}</noinclude>
de41be6bfd0c7977e6c33fbe8858029d48fbdf9b
395
394
2023-10-17T20:32:06Z
LamayII
2
wikitext
text/x-wiki
<includeonly>{{Infobox settlement
| name = {{{name|}}}
| official_name = {{{official_name|}}}
| native_name = {{{native_name|}}}
| settlement_type = {{#if: {{{type|}}}|{{{type}}}|[[U.S. state|State]]}}
<!-- images, nickname, motto -->
| image_flag = {{{image_flag|}}}
| flag_border = {{{flag_border|}}}
| flag_size = {{{flag_size|125}}}
| flag_alt = {{{flag_alt|}}}
| flag_link = {{{flag_link|Flag of {{{name|}}}}}}
| image_seal = {{{image_seal|}}}
| seal_size = {{{seal_size|}}}
| seal_alt = {{{seal_alt|}}}
| seal_link = {{{seal_link|Seal of {{{name|}}}}}}
| etymology = {{{etymology|}}}
| nickname_link = List of U.S. state and territory nicknames
| nickname = {{{nickname|}}}
| nicknames = {{{nicknames|}}}
| motto_link = List of U.S. state and territory mottos
| motto = {{{motto|}}}
| mottoes =
| anthem_link = List of U.S. state songs
| anthem = {{{anthem|}}}
<!-- maps and coordinates -->
| image_map = {{{image_map|}}}
| mapsize = 300
| map_alt = {{{map_alt|}}}
| map_caption = Map of the United States with {{{name|}}} highlighted
<!-- location -->
| subdivision_type = Country
| subdivision_name = United States<!-- the name of the country -->
<!-- established -->
| established_title1 = Before statehood
| established_date1 = {{#ifexist:{{{Former|}}}|[[{{{Former|}}}]]|{{{Former|}}}}}
| established_title2 = [[List of U.S. states by date of admission to the Union|Admitted to the Union]]<!-- Founded -->
| established_date2 = {{{AdmittanceDate|}}} ({{{AdmittanceOrder|}}})<!-- requires established_title= -->
<!-- seat, smaller parts -->
| seat_type = {{#ifeq:{{{LargestCity}}}|capital|[[List of capitals in the United States|Capital]]<br/>{{nobold|([[List of largest cities of U.S. states and territories by population|and largest city]])}}|[[List of capitals in the United States|Capital]]}}
| seat = {{{seat|{{{Capital|}}}}}}
| seat1_type = [[List of largest cities of U.S. states and territories by population|Largest city]]
| seat2_type = [[List of the most populous counties by U.S. state|Largest county or equivalent]]
| seat2 = {{{LargestCounty|}}}
| seat1 = {{#ifeq:{{{LargestCity}}}|capital||{{{LargestCity}}}}}
| parts_type = [[statistical area (United States)|Largest metro]] and [[List of United States urban areas|urban]] areas
| parts_style = <!-- list, coll (collapsed list), para (paragraph format) -->
| parts = {{{LargestMetro|}}}
<!-- government type, leaders -->
| government_footnotes = {{{government_footnotes|}}}
| government_type =
| governing_body =
| leader_party =
| leader_title = [[Governor of {{{name|}}}|Governor]]
| leader_name = {{{Governor|}}}<!-- add (no-break space) to disable automatic links -->
| leader_title1 = [[Lieutenant Governor of {{{name|}}}|{{{Lieutenant Governor_alt|Lieutenant Governor}}}]]
| leader_name1 = {{{Lieutenant Governor|}}}<!-- etc., up to leader_title4 / leader_name4 -->
| government_blank1_title = [[Legislature]]
| government_blank1 = {{{Legislature|}}}
| government_blank2_title = • [[Upper house]]
| government_blank2 = {{{Upperhouse}}}
| government_blank3_title = • [[Lower house]]
| government_blank3 = {{{Lowerhouse}}}
| government_blank4_title = [[Judiciary]]
| government_blank4 = {{{Judiciary|}}}
| government_blank5_title = [[List of United States senators from {{{name|}}}|U.S. senators]]
| government_blank5 = {{{Senators}}}
| government_blank6_title = [[List of United States representatives from {{{name|}}}|U.S. House delegation]]
| government_blank6 = {{#if:{{{Representative|}}}
| {{{Representative}}} ([[United States congressional delegations from {{{name|}}}|list]])
}}
| government_blank7_title =
| government_blank7 =
<!-- display settings -->
| unit_pref = Imperial<!-- enter: Imperial, to display imperial before metric -->
<!-- area -->
| area_footnotes = {{{area_footnotes|}}}
| area_magnitude = <!-- use only to set a special wikilink -->
| area_total_km2 = {{{area_total_km2|}}}
| area_total_sq_mi = {{{area_total_sq_mi|}}}<!-- see table @ Template:Infobox settlement for details -->
| area_land_km2 = {{{area_land_km2|}}}
| area_land_sq_mi = {{{area_land_sq_mi|}}}
| area_water_km2 = {{{area_water_km2|}}}
| area_water_sq_mi = {{{area_water_sq_mi|}}}
| area_water_percent = {{{area_water_percent|}}}
| area_rank = {{#if:{{{area_rank|}}}|[[List of U.S. states and territories by area|{{{area_rank|}}}]]}}
<!-- dimensions -->
| dimensions_footnotes = {{{dimensions_footnotes|}}}
| length_km = {{{length_km|}}}
| length_mi = {{{length_mi|}}}
| width_km = {{{width_km|}}}
| width_mi = {{{width_mi|}}}
<!-- elevation -->
| elevation_footnotes = {{{elevation_footnotes|}}}
| elevation_m = {{{elevation_m|}}}
| elevation_ft = {{{elevation_ft|}}}
| elevation_point = <!-- for denoting the measurement point -->
| elevation_max_footnotes = {{{elevation_max_footnotes|}}}
| elevation_max_m = {{{elevation_max_m|}}}
| elevation_max_ft = {{{elevation_max_ft|}}}
| elevation_max_point = {{{elevation_max_point|}}}<!-- for denoting the measurement point -->
| elevation_max_rank =
| elevation_min_m = {{{elevation_min_m|}}}
| elevation_min_ft = {{{elevation_min_ft|}}}
| elevation_min_point = {{{elevation_min_point|}}}<!-- for denoting the measurement point -->
| elevation_min_rank =
<!-- population -->
| population_total = {{{2020Pop|{{{2010Pop|{{{2000Pop}}}}}}}}}
| population_as_of = {{{population_as_of|}}}
| population_rank = {{#if:{{{population_rank|}}}|[[List of U.S. states and territories by population|{{{population_rank|}}}]]}}
| population_density_km2 = {{{2020Density|{{{2010Density|{{{2000Density|auto}}}}}}}}}
| population_density_sq_mi = {{{2020DensityUS|{{{2010DensityUS|{{{2000DensityUS|auto}}}}}}}}}
| population_density_rank = {{#if:{{{population_density_rank|}}}|[[List of states and territories of the United States by population density|{{{population_density_rank|}}}]]}}
| population_blank1_title = [[Household income in the United States|Median household income]]
| population_blank1 = {{{MedianHouseholdIncome|}}}
| population_blank2_title = Income rank
| population_blank2 = {{{IncomeRank|}}}
| population_demonym = {{{population_demonym|}}}<!-- demonym, e.g. Liverpudlian for someone from Liverpool -->
<!-- demographics (section 1) -->
| demographics_type1 = Language
| demographics1_title1 = [[Languages of the United States|Official language]]{{#if:{{{OfficialLangs|}}}|s}}
| demographics1_info1 = {{{OfficialLang|{{{OfficialLangs|}}}}}}
| demographics1_title2 = [[Languages of the United States|Spoken language]]
| demographics1_info2 = {{{Languages|}}}
<!-- time zone(s) -->
| timezone1 = {{{timezone1|}}}
| utc_offset1 = {{{utc_offset1|}}}
| timezone1_DST = {{{timezone1_DST|}}}
| utc_offset1_DST = {{{utc_offset1_DST|}}}
| timezone1_location = {{{timezone1_location|}}}
| timezone2 = {{{timezone2|}}}
| utc_offset2 = {{{utc_offset2|}}}
| timezone2_DST = {{{timezone2_DST|}}}
| utc_offset2_DST = {{{utc_offset2_DST|}}}
| timezone2_location = {{{timezone2_location|}}}
<!-- postal codes, area code -->
| postal_code_type = [[List of U.S. state and territory abbreviations|USPS abbreviation]]<!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal_code = {{{postal_code|}}}
| iso_code = {{#if:{{{iso_code|}}}| [[ISO 3166-2:US|{{{iso_code|}}}]]}}
| code1_name = [[List of U.S. state and territory abbreviations|Traditional abbreviation]]
| code1_info = {{{TradAbbreviation|}}}
<!-- blank fields (section 1) -->
| blank_name_sec1 = Latitude
| blank_info_sec1 = {{{Latitude|}}}
| blank1_name_sec1 = Longitude
| blank1_info_sec1 = {{{Longitude|}}}
<!-- website, footnotes -->
| website = {{#if:{{{website|}}}|{{URL|1={{{website|}}}}}}}
| footnotes = {{{footnotes|}}}
| module = {{{module|}}}
}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox state with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox state]] with unknown parameter "_VALUE_"|ignoreblank=y| 2000Density | 2000DensityUS | 2000Pop | 2010Density | 2010DensityUS | 2010Pop | 2020Density | 2020DensityUS | 2020Pop | AdmittanceDate | AdmittanceOrder | anthem | area_footnotes | area_land_km2 | area_land_sq_mi | area_rank | area_total_km2 | area_total_sq_mi | area_water_km2 | area_water_percent | area_water_sq_mi | Capital | dimensions_footnotes | elevation_footnotes | elevation_ft | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_min_ft | elevation_min_m | elevation_min_point | etymology | flag_alt | flag_border | flag_link | flag_size | footnotes | Former | government_footnotes | Governor | image_flag | image_map | image_seal | IncomeRank | iso_code | Judiciary | Languages | LargestCity | LargestCounty | LargestMetro | Latitude | Legislature | length_km | length_mi | Lieutenant Governor | Lieutenant Governor_alt | Longitude | Lowerhouse | map_alt | MedianHouseholdIncome | module | motto | name | native_name | nickname | nicknames | official_name | OfficialLang | OfficialLangs | population_as_of | population_demonym | population_density_rank | population_rank | postal_code | Representative | seal_alt | seal_link | seal_size | seat | Senators | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | TradAbbreviation | type | Upperhouse | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | website | width_km | width_mi }}<noinclude>{{documentation}}</noinclude>
66999c863eb5c25afac9dc6b65474e11c8072c24
Template:Infobox settlement
10
148
397
396
2023-10-17T20:36:06Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_settlement]]
wikitext
text/x-wiki
<includeonly>{{main other|{{#invoke:Settlement short description|main}}|}}{{Infobox
| child = {{yesno|{{{embed|}}}}}
| templatestyles = Infobox settlement/styles.css
| bodyclass = ib-settlement vcard
<!--** names, type, and transliterations ** -->
| above = <div class="fn org">{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}</div>
{{#if:{{{native_name|}}}|<div class="nickname ib-settlement-native" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</div>}}{{#if:{{{other_name|}}}|<div class="nickname ib-settlement-other-name">{{{other_name}}}</div>}}
| subheader = {{#if:{{{settlement_type|{{{type|}}}}}}|<div class="category">{{{settlement_type|{{{type}}}}}}</div>}}
| rowclass1 = mergedtoprow ib-settlement-official
| data1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
<!-- ***Transliteration language 1*** -->
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|{{{translit_lang1}}} transcription(s)}}
| rowclass3 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
| label3 = • {{{translit_lang1_type}}}
| data3 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}}}
| rowclass4 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
| label4 = • {{{translit_lang1_type1}}}
| data4 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}}}
| rowclass5 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
| label5 = • {{{translit_lang1_type2}}}
| data5 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}}}
| rowclass6 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
| label6 = • {{{translit_lang1_type3}}}
| data6 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}}}
| rowclass7 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
| label7 = • {{{translit_lang1_type4}}}
| data7 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}}}
| rowclass8 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
| label8 = • {{{translit_lang1_type5}}}
| data8 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}}}
| rowclass9 = mergedbottomrow
| label9 = • {{{translit_lang1_type6}}}
| data9 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}}}}}}
<!-- ***Transliteration language 2*** -->
| rowclass10 = mergedtoprow
| header10 = {{#if:{{{translit_lang2|}}}|{{{translit_lang2}}} transcription(s)}}
| rowclass11 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
| label11 = • {{{translit_lang2_type}}}
| data11 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}}}
| rowclass12 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
| label12 = • {{{translit_lang2_type1}}}
| data12 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}}}
| rowclass13 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
| label13 = • {{{translit_lang2_type2}}}
| data13 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}}}
| rowclass14 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
| label14 = • {{{translit_lang2_type3}}}
| data14 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}}}
| rowclass15 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
| label15 = • {{{translit_lang2_type4}}}
| data15 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}}}
| rowclass16 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
| label16 = • {{{translit_lang2_type5}}}
| data16 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}}}
| rowclass17 = mergedbottomrow
| label17 = • {{{translit_lang2_type6}}}
| data17 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}}}}}}
<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| rowclass18 = mergedtoprow
| data18 = {{#if:{{{image_skyline|}}}|<!--
-->{{#invoke:InfoboxImage|InfoboxImage<!--
-->|image={{{image_skyline|}}}<!--
-->|size={{if empty|{{{image_size|}}}|{{{imagesize|}}}}}|sizedefault=250px<!--
-->|alt={{if empty|{{{image_alt|}}}|{{{alt|}}}}}<!--
-->|title={{if empty|{{{image_caption|}}}|{{{caption|}}}|{{{image_alt|}}}|{{{alt|}}}}}}}<!--
-->{{#if:{{{image_caption|}}}{{{caption|}}}|<div class="ib-settlement-caption">{{if empty|{{{image_caption|}}}|{{{caption|}}}}}</div>}} }}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass19 = mergedtoprow
| class19 = maptable
| data19 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|125px|100x100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Flag of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Flag|link={{{flag_link|}}}|name={{{official_name}}}}}</div>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{seal_alt|}}}|title=Official seal of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Seal}}|link={{{seal_link|}}}|name={{{official_name}}}}}</div>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{shield_alt|}}}|title=Coat of arms of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Coat of arms|link={{{shield_link|}}}|name={{{official_name}}}}}</div>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}</div>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100x100px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption-link">{{{map_caption}}}</div>}}}}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{{map_caption}}}}}}}}}
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
}} }}
<!-- ***Etymology*** -->
| rowclass20 = mergedtoprow
| data20 = {{#if:{{{etymology|}}}|Etymology: {{{etymology}}} }}
<!-- ***Nickname*** -->
| rowclass21 = {{#if:{{{etymology|}}}|mergedrow|mergedtoprow}}
| data21 = {{#if:{{{nickname|}}}{{{nicknames|}}}|<!--
-->{{Pluralize from text|parse_links=1|{{if empty|{{{nickname|}}}|{{{nicknames|}}}{{force plural}}}}|<!--
-->link={{{nickname_link|}}}|singular=Nickname|likely=Nickname(s)|plural=Nicknames}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{nickname|}}}|{{{nicknames|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|parse_links=1|{{{nickname|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible nickname list]]}}}}}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}{{{mottoes|}}}|<!--
-->{{Pluralize from text|{{if empty|{{{motto|}}}|{{{mottoes|}}}{{force plural}}}}|<!--
-->link={{{motto_link|}}}|singular=Motto|likely=Motto(s)|plural=Mottoes}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{motto|}}}|{{{mottoes|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|{{{motto|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible motto list]]}}}}}}
<!-- ***Anthem*** -->
| rowclass23 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}{{{motto|}}}{{{mottoes|}}}|mergedrow|mergedtoprow}}
| data23 = {{#if:{{{anthem|}}}|{{#if:{{{anthem_link|}}}|[[{{{anthem_link|}}}|Anthem:]]|Anthem:}} {{{anthem}}}}}
<!-- ***Map*** -->
| rowclass24 = mergedtoprow
| data24 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption">{{{map_caption}}}</div>}}
}}}}
| rowclass25 = mergedrow
| data25 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<div class="ib-settlement-caption">{{{map_caption1}}}</div>}} }}
<!-- ***Pushpin Map*** -->
| rowclass26 = mergedtoprow
| data26 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{#if:{{{image_map|}}}||{{{map_caption}}}}}}}}}}}
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| rowclass27 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|{{#if:{{{grid_position|}}}|mergedrow|mergedbottomrow}}}}
| data27 = {{#if:{{{coordinates|}}}
|Coordinates{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})}}: {{#invoke:ISO 3166|geocoordinsert|nocat=true|1={{{coordinates|}}}|country={{{subdivision_name|}}}|subdivision1={{{subdivision_name1|}}}|subdivision2={{{subdivision_name2|}}}|subdivision3={{{subdivision_name3|}}}|type=city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{replace|{{{population_total}}}|,|}}|R}})}}}} }}{{{coordinates_footnotes|}}} }}
| rowclass28 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label28 = {{if empty|{{{grid_name|}}}|Grid position}}
| data28 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass29 = mergedtoprow
| label29 = {{{subdivision_type}}}
| data29 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass30 = mergedrow
| label30 = {{{subdivision_type1}}}
| data30 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass31 = mergedrow
| label31 = {{{subdivision_type2}}}
| data31 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type3}}}
| data32 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type4}}}
| data33 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type5}}}
| data34 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type6}}}
| data35 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass36 = mergedtoprow
| label36 = {{{established_title}}}
| data36 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass37 = mergedrow
| label37 = {{{established_title1}}}
| data37 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass38 = mergedrow
| label38 = {{{established_title2}}}
| data38 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass39 = mergedrow
| label39 = {{{established_title3}}}
| data39 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title4}}}
| data40 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title5}}}
| data41 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title6}}}
| data42 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title7}}}
| data43 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass44 = mergedrow
| label44 = {{{extinct_title}}}
| data44 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass45 = mergedrow
| label45 = Founded by
| data45 = {{{founder|}}}
| rowclass46 = mergedrow
| label46 = [[Namesake|Named for]]
| data46 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass47 = mergedtoprow
| label47 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Seat}}
| data47 = {{{seat|}}}
| rowclass48 = mergedrow
| label48 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Former seat}}
| data48 = {{{seat1|}}}
| rowclass49 = mergedrow
| label49 = {{#if:{{{seat2_type|}}}|{{{seat2_type}}}|Former seat}}
| data49 = {{{seat2|}}}
| rowclass51 = {{#if:{{{seat|}}}{{{seat1|}}}{{{seat2|}}}|mergedrow|mergedtoprow}}
| label51 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|Boroughs}}
| data51 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass52 = mergedtoprow
| header52 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Government<div class="ib-settlement-fn">{{{government_footnotes|}}}</div>}}
<!-- ***Government*** -->
| rowclass53 = mergedrow
| label53 = • Type
| data53 = {{{government_type|}}}
| rowclass54 = mergedrow
| label54 = • Body
| class54 = agent
| data54 = {{{governing_body|}}}
| rowclass55 = mergedrow
| label55 = • {{{leader_title}}}
| data55 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title1}}}
| data56 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title2}}}
| data57 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass58 = mergedrow
| label58 = • {{{leader_title3}}}
| data58 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass59 = mergedrow
| label59 = • {{{leader_title4}}}
| data59 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
| rowclass60 = mergedrow
| label60 = {{{government_blank1_title}}}
| data60 = {{#if:{{{government_blank1|}}}|{{{government_blank1|}}}}}
| rowclass61 = mergedrow
| label61 = {{{government_blank2_title}}}
| data61 = {{#if:{{{government_blank2|}}}|{{{government_blank2|}}}}}
| rowclass62 = mergedrow
| label62 = {{{government_blank3_title}}}
| data62 = {{#if:{{{government_blank3|}}}|{{{government_blank3|}}}}}
| rowclass63 = mergedrow
| label63 = {{{government_blank4_title}}}
| data63 = {{#if:{{{government_blank4|}}}|{{{government_blank4|}}}}}
| rowclass64 = mergedrow
| label64 = {{{government_blank5_title}}}
| data64 = {{#if:{{{government_blank5|}}}|{{{government_blank5|}}}}}
| rowclass65 = mergedrow
| label65 = {{{government_blank6_title}}}
| data65 = {{#if:{{{government_blank6|}}}|{{{government_blank6|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass66 = mergedtoprow
| header66 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
}}
}}
| rowclass67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
}}
| data67 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass68 = mergedrow
| label68 = • Land
| data68 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass69 = mergedrow
| label69 = • Water
| data69 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}{{#ifeq:%|{{#invoke:string|sub|{{{area_water_percent|}}}|-1}}||%}}}}}}
| rowclass70 = mergedrow
| label70 = • Urban<div class="ib-settlement-fn">{{{area_urban_footnotes|}}}</div>
| data70 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass71 = mergedrow
| label71 = • Rural<div class="ib-settlement-fn">{{{area_rural_footnotes|}}}</div>
| data71 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass72 = mergedrow
| label72 = • Metro<div class="ib-settlement-fn">{{{area_metro_footnotes|}}}</div>
| data72 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass73 = mergedrow
| label73 = • Rank
| data73 = {{{area_rank|}}}
| rowclass74 = mergedrow
| label74 = • {{{area_blank1_title}}}
| data74 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass75 = mergedrow
| label75 = • {{{area_blank2_title}}}
| data75 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass76 = mergedrow
| label76 =
| data76 = {{{area_note|}}}
<!-- ***Dimensions*** -->
| rowclass77 = mergedtoprow
| header77 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<div class="ib-settlement-fn">{{{dimensions_footnotes|}}}</div>}}
| rowclass78 = mergedrow
| label78 = • Length
| data78 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass79 = mergedrow
| label79 = • Width
| data79 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass80 = mergedtoprow
| label80 = {{#if:{{{elevation_link|}}}|[[{{{elevation_link|}}}|Elevation]]|Elevation}}<div class="ib-settlement-fn">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</div>
| data80 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass81 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}|mergedrow|mergedtoprow}}
| label81 = Highest elevation<div class="ib-settlement-fn">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</div>
| data81 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass82 = mergedrow
| label82 = • Rank
| data82 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass83 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label83 = Lowest elevation<div class="ib-settlement-fn">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</div>
| data83 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass84 = mergedrow
| label84 = • Rank
| data84 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass85 = mergedtoprow
| label85 = Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
| data85 = {{fix comma category|{{#if:{{{population|}}}
| {{formatnum:{{replace|{{{population}}}|,|}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{replace|{{{population_total}}}|,|}}}}
}}
}}
}}}}
| rowclass86 = mergedtoprow
| header86 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
}}
}}
}}
| rowclass87 = mergedrow
| label87 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
| data87 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{fix comma category|{{formatnum:{{replace|{{{population_total}}}|,|}}}}}}
}}
}}
}}
| rowclass88 = mergedrow
| label88 = • Estimate <div class="ib-settlement-fn">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</div>
| data88 = {{#if:{{{population_est|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_est}}}|,|}}}}}} }}
<!-- ***Population rank*** -->
| rowclass89 = mergedrow
| label89 = • Rank
| data89 = {{{population_rank|}}}
| rowclass90 = mergedrow
| label90 = • Density
| data90 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass91 = mergedrow
| label91 = • Rank
| data91 = {{{population_density_rank|}}}
| rowclass92 = mergedrow
| label92 = • [[Urban area|Urban]]<div class="ib-settlement-fn">{{{population_urban_footnotes|}}}</div>
| data92 = {{#if:{{{population_urban|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_urban}}}|,|}}}}}} }}
| rowclass93 = mergedrow
| label93 = • Urban density
| data93 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass94 = mergedrow
| label94 = • [[Rural area|Rural]]<div class="ib-settlement-fn">{{{population_rural_footnotes|}}}</div>
| data94 = {{#if:{{{population_rural|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_rural}}}|,|}}}}}}}}
| rowclass95 = mergedrow
| label95 = • Rural density
| data95 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass96 = mergedrow
| label96 = • [[Metropolitan area|Metro]]<div class="ib-settlement-fn">{{{population_metro_footnotes|}}}</div>
| data96 = {{#if:{{{population_metro|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_metro}}}|,|}}}}}} }}
| rowclass97 = mergedrow
| label97 = • Metro density
| data97 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass98 = mergedrow
| label98 = • {{{population_blank1_title|}}}<div class="ib-settlement-fn">{{{population_blank1_footnotes|}}}</div>
| data98 = {{#if:{{{population_blank1|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank1}}}|,|}}}}}}}}
| rowclass99 = mergedrow
| label99 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data99 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass100 = mergedrow
| label100 = • {{{population_blank2_title|}}}<div class="ib-settlement-fn">{{{population_blank2_footnotes|}}}</div>
| data100 = {{#if:{{{population_blank2|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank2}}}|,|}}}}}}}}
| rowclass101 = mergedrow
| label101 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data101 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass102 = mergedrow
| label102 =
| data102 = {{{population_note|}}}
| rowclass103 = mergedtoprow
| label103 = {{Pluralize from text|{{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}{{force plural}}}}|<!--
-->link=Demonym|singular=Demonym|likely=Demonym(s)|plural=Demonyms}}
| data103 = {{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}}}{{Main other|{{Pluralize from text|{{{population_demonym|}}}|likely=[[Category:Pages using infobox settlement with possible demonym list]]}}}}
<!-- ***Demographics 1*** -->
| rowclass104 = mergedtoprow
| header104 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<div class="ib-settlement-fn">{{{demographics1_footnotes|}}}</div>}}
| rowclass105 = mergedrow
| label105 = • {{{demographics1_title1}}}
| data105 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass106 = mergedrow
| label106 = • {{{demographics1_title2}}}
| data106 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass107 = mergedrow
| label107 = • {{{demographics1_title3}}}
| data107 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics1_title4}}}
| data108 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics1_title5}}}
| data109 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics1_title6}}}
| data110 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics1_title7}}}
| data111 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
| rowclass112 = mergedrow
| label112 = • {{{demographics1_title8}}}
| data112 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title8|}}}|{{{demographics1_info8|}}}}}}}
| rowclass113 = mergedrow
| label113 = • {{{demographics1_title9}}}
| data113 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title9|}}}|{{{demographics1_info9|}}}}}}}
| rowclass114 = mergedrow
| label114 = • {{{demographics1_title10}}}
| data114 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title10|}}}|{{{demographics1_info10|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass115 = mergedtoprow
| header115 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<div class="ib-settlement-fn">{{{demographics2_footnotes|}}}</div>}}
| rowclass116 = mergedrow
| label116 = • {{{demographics2_title1}}}
| data116 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass117 = mergedrow
| label117 = • {{{demographics2_title2}}}
| data117 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass118 = mergedrow
| label118 = • {{{demographics2_title3}}}
| data118 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass119 = mergedrow
| label119 = • {{{demographics2_title4}}}
| data119 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass120 = mergedrow
| label120 = • {{{demographics2_title5}}}
| data120 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass121 = mergedrow
| label121 = • {{{demographics2_title6}}}
| data121 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass122 = mergedrow
| label122 = • {{{demographics2_title7}}}
| data122 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
| rowclass123 = mergedrow
| label123 = • {{{demographics2_title8}}}
| data123 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title8|}}}|{{{demographics2_info8|}}}}}}}
| rowclass124 = mergedrow
| label124 = • {{{demographics2_title9}}}
| data124 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title9|}}}|{{{demographics2_info9|}}}}}}}
| rowclass125 = mergedrow
| label125 = • {{{demographics2_title10}}}
| data125 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title10|}}}|{{{demographics2_info10|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass126 = mergedtoprow
| header126 = {{#if:{{{timezone1_location|}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}|}}
| rowclass127 = {{#if:{{{timezone1_location|}}}|mergedrow|mergedtoprow}}
| label127 = {{#if:{{{timezone1_location|}}}|{{{timezone1_location}}}|{{#if:{{{timezone2_location|}}}|{{{timezone2_location}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}}}}}
| data127 = {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}
|[[UTC{{{utc_offset1|{{{utc_offset}}}}}}]] {{#if:{{{timezone1|{{{timezone|}}}}}}|({{{timezone1|{{{timezone}}}}}})}}
|{{{timezone1|{{{timezone|}}}}}}
}}
| rowclass128 = mergedrow
| label128 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data128 = {{#if:{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}
|[[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]] {{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|({{{timezone1_DST|{{{timezone_DST}}}}}})}}
|{{{timezone1_DST|{{{timezone_DST|}}}}}}
}}
| rowclass129 = mergedrow
| label129 = {{#if:{{{timezone2_location|}}}| {{{timezone2_location|}}}|<nowiki />}}
| data129 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}
|[[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]] {{#if:{{{timezone2|}}}|({{{timezone2}}})}}
|{{{timezone2|}}}
}}
}}
| rowclass130 = mergedrow
| label130 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data130 = {{#if:{{{utc_offset2_DST|}}}|[[UTC{{{utc_offset2_DST|}}}]] {{#if:{{{timezone2_DST|}}}|({{{timezone2_DST|}}})}}
|{{{timezone2_DST|}}}
}}
| rowclass131 = mergedrow
| label131 = {{#if:{{{timezone3_location|}}}| {{{timezone3_location|}}}|<nowiki />}}
| data131 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset3|{{{utc_offset3|}}} }}}
|[[UTC{{{utc_offset3|{{{utc_offset3}}}}}}]] {{#if:{{{timezone3|}}}|({{{timezone3}}})}}
|{{{timezone3|}}}
}}
}}
| rowclass132 = mergedrow
| label132 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data132 = {{#if:{{{utc_offset3_DST|}}}|[[UTC{{{utc_offset3_DST|}}}]] {{#if:{{{timezone3_DST|}}}|({{{timezone3_DST|}}})}}
|{{{timezone3_DST|}}}
}}
| rowclass133 = mergedrow
| label133 = {{#if:{{{timezone4_location|}}}| {{{timezone4_location|}}}|<nowiki />}}
| data133 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset4|{{{utc_offset4|}}} }}}
|[[UTC{{{utc_offset4|{{{utc_offset4}}}}}}]] {{#if:{{{timezone4|}}}|({{{timezone4}}})}}
|{{{timezone4|}}}
}}
}}
| rowclass134 = mergedrow
| label134 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data134 = {{#if:{{{utc_offset4_DST|}}}|[[UTC{{{utc_offset4_DST|}}}]] {{#if:{{{timezone4_DST|}}}|({{{timezone4_DST|}}})}}
|{{{timezone4_DST|}}}
}}
| rowclass135 = mergedrow
| label135 = {{#if:{{{timezone5_location|}}}| {{{timezone5_location|}}}|<nowiki />}}
| data135 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset5|{{{utc_offset5|}}} }}}
|[[UTC{{{utc_offset5|{{{utc_offset5}}}}}}]] {{#if:{{{timezone5|}}}|({{{timezone5}}})}}
|{{{timezone5|}}}
}}
}}
| rowclass136 = mergedrow
| label136 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data136 = {{#if:{{{utc_offset5_DST|}}}|[[UTC{{{utc_offset5_DST|}}}]] {{#if:{{{timezone5_DST|}}}|({{{timezone5_DST|}}})}}
|{{{timezone5_DST|}}}
}}
<!-- ***Postal Code(s)*** -->
| rowclass137 = mergedtoprow
| label137 = {{{postal_code_type}}}
| class137 = adr
| data137 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<div class="postal-code">{{{postal_code}}}</div>}}}}
| rowclass138 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}|mergedbottomrow|mergedtoprow}}
| label138 = {{{postal2_code_type}}}
| class138 = adr
| data138 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<div class="postal-code">{{{postal2_code}}}</div>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass139 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}|mergedrow|mergedtoprow}}
| label139 = {{if empty|{{{area_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{if empty|{{{area_code|}}}|{{{area_codes|}}}{{force plural}}}}|<!--
-->link=Telephone numbering plan|singular=Area code|likely=Area code(s)|plural=Area codes}}}}
| data139 = {{if empty|{{{area_code|}}}|{{{area_codes|}}}}}{{#if:{{{area_code_type|}}}||{{Main other|{{Pluralize from text|any_comma=1|parse_links=1|{{{area_code|}}}|||[[Category:Pages using infobox settlement with possible area code list]]}}}}}}
<!-- Geocode-->
| rowclass140 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label140 = [[Geocode]]
| class140 = nickname
| data140 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass141 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label141 = [[ISO 3166|ISO 3166 code]]
| class141 = nickname
| data141 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass142 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label142 = {{#if:{{{registration_plate_type|}}}|{{{registration_plate_type}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data142 = {{{registration_plate|}}}
<!-- Other codes -->
| rowclass143 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label143 = {{{code1_name|}}}
| class143 = nickname
| data143 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass144 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label144 = {{{code2_name|}}}
| class144 = nickname
| data144 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass145 = mergedtoprow
| label145 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data145 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass146 = mergedrow
| label146 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data146 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass147 = mergedrow
| label147 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data147 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass148 = mergedrow
| label148 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data148 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass149 = mergedrow
| label149 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data149 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass150 = mergedrow
| label150 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data150 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass151 = mergedrow
| label151 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data151 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass152 = mergedrow
| label152 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data152 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass153 = mergedtoprow
| label153 = {{{blank_name_sec2}}}
| data153 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass154 = mergedrow
| label154 = {{{blank1_name_sec2}}}
| data154 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass155 = mergedrow
| label155 = {{{blank2_name_sec2}}}
| data155 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass156 = mergedrow
| label156 = {{{blank3_name_sec2}}}
| data156 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass157 = mergedrow
| label157 = {{{blank4_name_sec2}}}
| data157 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass158 = mergedrow
| label158 = {{{blank5_name_sec2}}}
| data158 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass159 = mergedrow
| label159 = {{{blank6_name_sec2}}}
| data159 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass160 = mergedrow
| label160 = {{{blank7_name_sec2}}}
| data160 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass161 = mergedtoprow
| label161 = Website
| data161 = {{#if:{{{website|}}}|{{{website}}}}}
| class162 = maptable
| data162 = {{#if:{{{module|}}}|{{{module}}}}}
<!-- ***Footnotes*** -->
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!-- Check for unknowns
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox settlement with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox settlement]] with unknown parameter "_VALUE_"|ignoreblank=y
| alt | anthem | anthem_link | area_blank1_acre | area_blank1_dunam | area_blank1_ha | area_blank1_km2 | area_blank1_sq_mi | area_blank1_title | area_blank2_acre | area_blank2_dunam | area_blank2_ha | area_blank2_km2 | area_blank2_sq_mi | area_blank2_title | area_code | area_code_type | area_codes | area_footnotes | area_land_acre | area_land_dunam | area_land_ha | area_land_km2 | area_land_sq_mi | area_metro_acre | area_metro_dunam | area_metro_footnotes | area_metro_ha | area_metro_km2 | area_metro_sq_mi | area_note | area_rank | area_rural_acre | area_rural_dunam | area_rural_footnotes | area_rural_ha | area_rural_km2 | area_rural_sq_mi | area_total_acre | area_total_dunam | area_total_ha | area_total_km2 | area_total_sq_mi | area_urban_acre | area_urban_dunam | area_urban_footnotes | area_urban_ha | area_urban_km2 | area_urban_sq_mi | area_water_acre | area_water_dunam | area_water_ha | area_water_km2 | area_water_percent | area_water_sq_mi | blank_emblem_alt | blank_emblem_link | blank_emblem_size | blank_emblem_type | blank_info | blank_info_sec1 | blank_info_sec2 | blank_name | blank_name_sec1 | blank_name_sec2 | blank1_info | blank1_info_sec1 | blank1_info_sec2 | blank1_name | blank1_name_sec1 | blank1_name_sec2 | blank2_info | blank2_info_sec1 | blank2_info_sec2 | blank2_name | blank2_name_sec1 | blank2_name_sec2 | blank3_info | blank3_info_sec1 | blank3_info_sec2 | blank3_name | blank3_name_sec1 | blank3_name_sec2 | blank4_info | blank4_info_sec1 | blank4_info_sec2 | blank4_name | blank4_name_sec1 | blank4_name_sec2 | blank5_info | blank5_info_sec1 | blank5_info_sec2 | blank5_name | blank5_name_sec1 | blank5_name_sec2 | blank6_info | blank6_info_sec1 | blank6_info_sec2 | blank6_name | blank6_name_sec1 | blank6_name_sec2 | blank7_info | blank7_info_sec1 | blank7_info_sec2 | blank7_name | blank7_name_sec1 | blank7_name_sec2 | caption | code1_info | code1_name | code2_info | code2_name | coor_pinpoint | coor_type | coordinates | coordinates_footnotes | demographics_type1 | demographics_type2 | demographics1_footnotes | demographics1_info1 | demographics1_info10 | demographics1_info2 | demographics1_info3 | demographics1_info4 | demographics1_info5 | demographics1_info6 | demographics1_info7 | demographics1_info8 | demographics1_info9 | demographics1_title1 | demographics1_title10 | demographics1_title2 | demographics1_title3 | demographics1_title4 | demographics1_title5 | demographics1_title6 | demographics1_title7 | demographics1_title8 | demographics1_title9 | demographics2_footnotes | demographics2_info1 | demographics2_info10 | demographics2_info2 | demographics2_info3 | demographics2_info4 | demographics2_info5 | demographics2_info6 | demographics2_info7 | demographics2_info8 | demographics2_info9 | demographics2_title1 | demographics2_title10 | demographics2_title2 | demographics2_title3 | demographics2_title4 | demographics2_title5 | demographics2_title6 | demographics2_title7 | demographics2_title8 | demographics2_title9 | dimensions_footnotes | dunam_link | elevation_footnotes | elevation_ft | elevation_link | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_max_rank | elevation_min_footnotes | elevation_min_ft | elevation_min_m | elevation_min_point | elevation_min_rank | elevation_point | embed | established_date | established_date1 | established_date2 | established_date3 | established_date4 | established_date5 | established_date6 | established_date7 | established_title | established_title1 | established_title2 | established_title3 | established_title4 | established_title5 | established_title6 | established_title7 | etymology | extinct_date | extinct_title | flag_alt | flag_border | flag_link | flag_size | footnotes | founder | geocode | governing_body | government_footnotes | government_type | government_blank1_title | government_blank1 | government_blank2_title | government_blank2 | government_blank2_title | government_blank3 | government_blank3_title | government_blank3 | government_blank4_title | government_blank4 | government_blank5_title | government_blank5 | government_blank6_title | government_blank6 | grid_name | grid_position | image_alt | image_blank_emblem | image_caption | image_flag | image_map | image_map1 | image_seal | image_shield | image_size | image_skyline | imagesize | iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | length_km | length_mi | map_alt | map_alt1 | map_caption | map_caption1 | mapsize | mapsize1 | module | motto | motto_link | mottoes | name | named_for | native_name | native_name_lang | nickname | nickname_link | nicknames | official_name | other_name | p1 | p10 | p11 | p12 | p13 | p14 | p15 | p16 | p17 | p18 | p19 | p2 | p20 | p21 | p22 | p23 | p24 | p25 | p26 | p27 | p28 | p29 | p3 | p30 | p31 | p32 | p33 | p34 | p35 | p36 | p37 | p38 | p39 | p4 | p40 | p41 | p42 | p43 | p44 | p45 | p46 | p47 | p48 | p49 | p5 | p50 | p6 | p7 | p8 | p9 | parts | parts_style | parts_type | pop_est_as_of | pop_est_footnotes | population | population_as_of | population_blank1 | population_blank1_footnotes | population_blank1_title | population_blank2 | population_blank2_footnotes | population_blank2_title | population_demonym | population_demonyms | population_density_blank1_km2 | population_density_blank1_sq_mi | population_density_blank2_km2 | population_density_blank2_sq_mi | population_density_km2 | population_density_metro_km2 | population_density_metro_sq_mi | population_density_rank | population_density_rural_km2 | population_density_rural_sq_mi | population_density_sq_mi | population_density_urban_km2 | population_density_urban_sq_mi | population_est | population_footnotes | population_metro | population_metro_footnotes | population_note | population_rank | population_rural | population_rural_footnotes | population_total | population_urban | population_urban_footnotes | postal_code | postal_code_type | postal2_code | postal2_code_type | pushpin_image | pushpin_label | pushpin_label_position | pushpin_map | pushpin_map_alt | pushpin_map_caption | pushpin_map_caption_notsmall | pushpin_map_narrow | pushpin_mapsize | pushpin_outside | pushpin_overlay | pushpin_relief | registration_plate | registration_plate_type | seal_alt | seal_link | seal_size | seal_type | seat | seat_type | seat1 | seat1_type | seat2 | seat2_type | settlement_type | shield_alt | shield_link | shield_size | short_description | subdivision_name | subdivision_name1 | subdivision_name2 | subdivision_name3 | subdivision_name4 | subdivision_name5 | subdivision_name6 | subdivision_type | subdivision_type1 | subdivision_type2 | subdivision_type3 | subdivision_type4 | subdivision_type5 | subdivision_type6 | timezone | timezone_DST | timezone_link | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | timezone3 | timezone3_DST | timezone3_location | timezone4 | timezone4_DST | timezone4_location | timezone5 | timezone5_DST | timezone5_location | total_type | translit_lang1 | translit_lang1_info | translit_lang1_info1 | translit_lang1_info2 | translit_lang1_info3 | translit_lang1_info4 | translit_lang1_info5 | translit_lang1_info6 | translit_lang1_type | translit_lang1_type1 | translit_lang1_type2 | translit_lang1_type3 | translit_lang1_type4 | translit_lang1_type5 | translit_lang1_type6 | translit_lang2 | translit_lang2_info | translit_lang2_info1 | translit_lang2_info2 | translit_lang2_info3 | translit_lang2_info4 | translit_lang2_info5 | translit_lang2_info6 | translit_lang2_type | translit_lang2_type1 | translit_lang2_type2 | translit_lang2_type3 | translit_lang2_type4 | translit_lang2_type5 | translit_lang2_type6 | type | unit_pref | utc_offset | utc_offset_DST | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | utc_offset3 | utc_offset3_DST | utc_offset4 | utc_offset4_DST | utc_offset5 | utc_offset5_DST | website | width_km | width_mi
}}<!--
-->{{#invoke:Check for clobbered parameters|check
| template = Infobox settlement
| cat = {{main other|Category:Pages using infobox settlement with conflicting parameters}}
| population; population_total
| image_size; imagesize
| image_alt; alt
| image_caption; caption
}}<!-- Wikidata
-->{{#if:{{{coordinates_wikidata|}}}{{{wikidata|}}}
|[[Category:Pages using infobox settlement with the wikidata parameter]]
}}{{main other|<!-- Missing country
-->{{#if:{{{subdivision_name|}}}||[[Category:Pages using infobox settlement with missing country]]}}<!-- No map
-->{{#if:{{{pushpin_map|}}}{{{image_map|}}}{{{image_map1|}}}||[[Category:Pages using infobox settlement with no map]]}}<!-- Image_map1 without image_map
-->{{#if:{{{image_map1|}}}|{{#if:{{{image_map|}}}||[[Category:Pages using infobox settlement with image_map1 but not image_map]]}}}}<!-- No coordinates
-->{{#if:{{{coordinates|}}}||[[Category:Pages using infobox settlement with no coordinates]]}}<!--
-->{{#if:{{{type|}}}|{{#ifeq:{{{settlement_type|a}}}|{{{settlement_type|b}}}|[[Category:Pages using infobox settlement with ignored type]]|}}|}}<!-- Ignored type parameter
-->{{#if:{{{embed|}}}|[[Category:Pages using infobox settlement with embed]]}}
}}</includeonly><noinclude>
{{documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
f793562757697511bcbaf05e1a004a887ca760f8
Module:Lang
828
149
399
398
2023-10-17T20:36:07Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Lang]]
Scribunto
text/plain
--[=[
Lua support for the {{lang}}, {{lang-xx}}, and {{transliteration}} templates and replacement of various supporting templates.
]=]
require('strict');
local getArgs = require ('Module:Arguments').getArgs;
local unicode = require ("Module:Unicode data"); -- for is_latin() and is_rtl()
local yesno = require ('Module:Yesno');
local lang_data = mw.loadData ('Module:Lang/data'); -- language name override and transliteration tool-tip tables
local lang_name_table = lang_data.lang_name_table; -- language codes, names, regions, scripts, suppressed scripts
local lang_table = lang_data.lang_name_table.lang;
local lang_dep_table = lang_data.lang_name_table.lang_dep;
local script_table = lang_data.lang_name_table.script;
local region_table = lang_data.lang_name_table.region;
local variant_table = lang_data.lang_name_table.variant;
local suppressed_table = lang_data.lang_name_table.suppressed;
local override_table = lang_data.override;
local synonym_table = mw.loadData ('Module:Lang/ISO 639 synonyms'); -- ISO 639-2/639-2T code translation to 639-1 code
local namespace = mw.title.getCurrentTitle().namespace; -- used for categorization
local content_lang = mw.language.getContentLanguage();
local this_wiki_lang_tag = content_lang.code; -- get this wiki's language tag
local this_wiki_lang_dir = content_lang:getDir(); -- get this wiki's language direction
local initial_style_state; -- set by lang_xx_normal() and lang_xx_italic()
local maint_cats = {}; -- maintenance categories go here
local maint_msgs = {}; -- and their messages go here
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set( var )
return not (var == nil or var == '');
end
--[[--------------------------< I N V E R T _ I T A L I C S >-------------------------------------------------
This function attempts to invert the italic markup a args.text by adding/removing leading/trailing italic markup
in args.text. Like |italic=unset, |italic=invert disables automatic italic markup. Individual leading/trailing
apostrophes are converted to their html numeric entity equivalent so that the new italic markup doesn't become
bold markup inadvertently.
Leading and trailing wiki markup is extracted from args.text into separate table elements. Addition, removal,
replacement of wiki markup is handled by a string.gsub() replacement table operating only on these separate elements.
In the string.gsub() matching pattern, '.*' matches empty string as well as the three expected wiki markup patterns.
This function expects that markup in args.text is complete and correct; if it is not, oddness may result.
]]
local function invert_italics (source)
local invert_pattern_table = { -- leading/trailing markup add/remove/replace patterns
[""]="\'\'", -- empty string becomes italic markup
["\'\'"]="", -- italic markup becomes empty string
["\'\'\'"]="\'\'\'\'\'", -- bold becomes bold italic
["\'\'\'\'\'"]="\'\'\'", -- bold italic become bold
};
local seg = {};
source = source:gsub ("%f[\']\'%f[^\']", '''); -- protect single quote marks from being interpreted as bold markup
seg[1] = source:match ('^(\'\'+%f[^\']).+') or ''; -- get leading markup, if any; ignore single quote
seg[3] = source:match ('.+(%f[\']\'\'+)$') or ''; -- get trailing markup, if any; ignore single quote
if '' ~= seg[1] and '' ~= seg[3] then -- extract the 'text'
seg[2] = source:match ('^\'\'+%f[^\'](.+)%f[\']\'\'+$') -- from between leading and trailing markup
elseif '' ~= seg[1] then
seg[2] = source:match ('^\'\'+%f[^\'](.+)') -- following leading markup
elseif '' ~= seg[3] then
seg[2] = source:match ('(.+)%f[\']\'\'+$') -- preceding trailing markup
else
seg[2] = source -- when there is no markup
end
seg[1] = invert_pattern_table[seg[1]] or seg[1]; -- replace leading markup according to pattern table
seg[3] = invert_pattern_table[seg[3]] or seg[3]; -- replace leading markup according to pattern table
return table.concat (seg); -- put it all back together and done
end
--[[--------------------------< V A L I D A T E _ I T A L I C >------------------------------------------------
validates |italic= or |italics= assigned values.
When |italic= is set and has an acceptible assigned value, return the matching css font-style property value or,
for the special case 'default', return nil.
When |italic= is not set, or has an unacceptible assigned value, return nil and a nil error message.
When both |italic= and |italics= are set, returns nil and a 'conflicting' error message.
The return value nil causes the calling lang, lang_xx, or transl function to set args.italic according to the template's
defined default ('inherit' for {{lang}}, 'inherit' or 'italic' for {{lang-xx}} depending on
the individual template's requirements, 'italic' for {{transliteration}}) or to the value appropriate to |script=, if set ({{lang}}
and {{lang-xx}} only).
Accepted values and the values that this function returns are are:
nil - when |italic= absent or not set; returns nil
default - for completeness, should rarely if ever be used; returns nil
yes - force args.text to be rendered in italic font; returns 'italic'
no - force args.text to be rendered in normal font; returns 'normal'
unset - disables font control so that font-style applied to text is dictated by markup inside or outside the template; returns 'inherit'
invert - disables font control so that font-style applied to text is dictated by markup outside or inverted inside the template; returns 'invert'
]]
local function validate_italic (args)
local properties = {['yes'] = 'italic', ['no'] = 'normal', ['unset'] = 'inherit', ['invert'] = 'invert', ['default'] = nil};
local count = 0
for _, arg in pairs {'italic', 'italics', 'i'} do
if args[arg] then
count = count + 1
end
end
if count > 1 then -- return nil and an error message if more than one is set
return nil, 'only one of |italic=, |italics=, or |i= can be specified';
end
return properties[args.italic or args.italics or args.i], nil; -- return an appropriate value and a nil error message
end
--[=[--------------------------< V A L I D A T E _ C A T _ A R G S >----------------------------------------------------------
Default behavior of the {{lang}} and {{lang-xx}} templates is to add categorization when the templates are used in mainspace.
This default functionality may be suppressed by setting |nocat=yes or |cat=no. This function selects one of these two parameters
to control categorization.
Because having two parameters with 'opposite' names and 'opposite' values is confusing, this function accepts only affirmative
values for |nocat= and only negative values for |cat=; in both cases the 'other' sense (and non-sense) is not accepted and the
parameter is treated as if it were not set in the template.
Sets args.nocat to true if categorization is to be turned off; to nil if the default behavior should apply.
Accepted values for |nocat= are the text strings:
'yes', 'y', 'true', 't', on, '1' -- [[Module:Yesno]] returns logical true for all of these; false or nil else
for |cat=
'no', 'n', 'false', 'f', 'off', '0' -- [[Module:Yesno]] returns logical false for all of these; true or nil else
]=]
local function validate_cat_args (args)
if not (args.nocat or args.cat) then -- both are nil, so categorize
return;
end
if false == yesno (args.cat) or true == yesno (args.nocat) then
args.nocat = true; -- set to true when args.nocat is affirmative; nil else (as if the parameter were not set in the template)
else -- args.nocat is the parameter actually used.
args.nocat = nil;
end
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array ( needle, haystack )
if needle == nil then
return false;
end
for n,v in ipairs( haystack ) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< F O R M A T _ I E T F _ T A G >------------------------------------------------
prettify ietf tags to use recommended subtag formats:
code: lower case
script: sentence case
region: upper case
variant: lower case
private: lower case prefixed with -x-
]]
local function format_ietf_tag (code, script, region, variant, private)
local out = {};
if is_set (private) then
return table.concat ({code:lower(), 'x', private:lower()}, '-'); -- if private, all other tags ignored
end
table.insert (out, code:lower());
if is_set (script) then
script = script:lower():gsub ('^%a', string.upper);
table.insert (out, script);
end
if is_set (region) then
table.insert (out, region:upper());
end
if is_set (variant) then
table.insert (out, variant:lower());
end
return table.concat (out, '-');
end
--[[--------------------------< G E T _ I E T F _ P A R T S >--------------------------------------------------
extracts and returns IETF language tag parts:
primary language subtag (required) - 2 or 3 character IANA language code
script subtag - four character IANA script code
region subtag - two-letter or three digit IANA region code
variant subtag - four digit or 5-8 alnum variant code; only one variant subtag supported
private subtag - x- followed by 1-8 alnum private code; only supported with the primary language tag
in any one of these forms
lang lang-variant
lang-script lang-script-variant
lang-region lang-region-variant
lang-script-region lang-script-region-variant
lang-x-private
each of lang, script, region, variant, and private, when used, must be valid
Languages with both two- and three-character code synonyms are promoted to the two-character synonym because
the IANA registry file omits the synonymous three-character code; we cannot depend on browsers understanding
the synonymous three-character codes in the lang= attribute.
For {{lang-xx}} templates, the parameters |script=, |region=, and |variant= are supported (not supported in {{lang}}
because those parameters are superfluous to the IETF subtags in |code=)
returns six values; all lower case. Valid parts are returned as themselves; omitted parts are returned as empty strings, invalid
parts are returned as nil; the sixth returned item is an error message (if an error detected) or nil.
see http://www.rfc-editor.org/rfc/bcp/bcp47.txt section 2.1
]]
local function get_ietf_parts (source, args_script, args_region, args_variant)
local code, script, region, variant, private; -- ietf tag parts
if not is_set (source) then
return nil, nil, nil, nil, nil, 'missing language tag';
end
local pattern = { -- table of tables holding acceptibe ietf tag patterns and short names of the ietf part captured by the pattern
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)%-(%d%d%d%d)$', 's', 'r', 'v'}, -- 1 - ll-Ssss-RR-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)%-(%d%d%d%d)$', 's', 'r', 'v'}, -- 2 - ll-Ssss-DDD-variant (where region is 3 digits; variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'r', 'v'}, -- 3 - ll-Ssss-RR-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'r', 'v'}, -- 4 - ll-Ssss-DDD-variant (where region is 3 digits; variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d%d)$', 's', 'v'}, -- 5 - ll-Ssss-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'v'}, -- 6 - ll-Ssss-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a)%-(%d%d%d%d)$', 'r', 'v'}, -- 7 - ll-RR-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%d%d%d)%-(%d%d%d%d)$', 'r', 'v'}, -- 8 - ll-DDD-variant (where region is 3 digits; variant is 4 digits)
{'^(%a%a%a?)%-(%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 'r', 'v'}, -- 9 - ll-RR-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%d%d%d)%-(%w%w%w%w%w%w?%w?%w?)$', 'r', 'v'}, -- 10 - ll-DDD-variant (where region is 3 digits; variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%d%d%d%d)$', 'v'}, -- 11 - ll-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%w%w%w%w%w%w?%w?%w?)$', 'v'}, -- 12 - ll-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)$', 's', 'r'}, -- 13 - ll-Ssss-RR
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)$', 's', 'r'}, -- 14 - ll-Ssss-DDD (region is 3 digits)
{'^(%a%a%a?)%-(%a%a%a%a)$', 's'}, -- 15 - ll-Ssss
{'^(%a%a%a?)%-(%a%a)$', 'r'}, -- 16 - ll-RR
{'^(%a%a%a?)%-(%d%d%d)$', 'r'}, -- 17 - ll-DDD (region is 3 digits)
{'^(%a%a%a?)$'}, -- 18 - ll
{'^(%a%a%a?)%-x%-(%w%w?%w?%w?%w?%w?%w?%w?)$', 'p'}, -- 19 - ll-x-pppppppp (private is 1-8 alnum characters)
}
local t = {}; -- table of captures; serves as a translator between captured ietf tag parts and named variables
for i, v in ipairs (pattern) do -- spin through the pattern table looking for a match
local c1, c2, c3, c4; -- captures in the 'pattern' from the pattern table go here
c1, c2, c3, c4 = source:match (pattern[i][1]); -- one or more captures set if source matches pattern[i])
if c1 then -- c1 always set on match
code = c1; -- first capture is always code
t = {
[pattern[i][2] or 'x'] = c2, -- fill the table of captures with the rest of the captures
[pattern[i][3] or 'x'] = c3, -- take index names from pattern table and assign sequential captures
[pattern[i][4] or 'x'] = c4, -- index name may be nil in pattern[i] table so "or 'x'" spoofs a name for this index in this table
};
script = t.s or ''; -- translate table contents to named variables;
region = t.r or ''; -- absent table entries are nil so set named ietf parts to empty string for concatenation
variant= t.v or '';
private = t.p or '';
break; -- and done
end
end
if not code then
return nil, nil, nil, nil, nil, table.concat ({'unrecognized language tag: ', source}); -- don't know what we got but it is malformed
end
code = code:lower(); -- ensure that we use and return lower case version of this
if not (override_table[code] or lang_table[code] or synonym_table[code] or lang_dep_table[code]) then
return nil, nil, nil, nil, nil, table.concat ({'unrecognized language code: ', code}); -- invalid language code, don't know about the others (don't care?)
end
if synonym_table[code] then -- if 639-2/639-2T code has a 639-1 synonym
table.insert (maint_cats, table.concat ({'Lang and lang-xx code promoted to ISO 639-1|', code}));
table.insert (maint_msgs, table.concat ({'code: ', code, ' promoted to code: ', synonym_table[code]}));
code = synonym_table[code]; -- use the synonym
end
if is_set (script) then
if is_set (args_script) then
return code, nil, nil, nil, nil, 'redundant script tag'; -- both code with script and |script= not allowed
end
else
script = args_script or ''; -- use args.script if provided
end
if is_set (script) then
script = script:lower(); -- ensure that we use and return lower case version of this
if not script_table[script] then
return code, nil, nil, nil, nil, table.concat ({'unrecognized script: ', script, ' for code: ', code}); -- language code ok, invalid script, don't know about the others (don't care?)
end
end
if suppressed_table[script] then -- ensure that code-script does not use a suppressed script
if in_array (code, suppressed_table[script]) then
return code, nil, nil, nil, nil, table.concat ({'script: ', script, ' not supported for code: ', code}); -- language code ok, script is suppressed for this code
end
end
if is_set (region) then
if is_set (args_region) then
return code, nil, nil, nil, nil, 'redundant region tag'; -- both code with region and |region= not allowed
end
else
region = args_region or ''; -- use args.region if provided
end
if is_set (region) then
region = region:lower(); -- ensure that we use and return lower case version of this
if not region_table[region] then
return code, script, nil, nil, nil, table.concat ({'unrecognized region: ', region, ' for code: ', code});
end
end
if is_set (variant) then
if is_set (args_variant) then
return code, nil, nil, nil, nil, 'redundant variant tag'; -- both code with variant and |variant= not allowed
end
else
variant = args_variant or ''; -- use args.variant if provided
end
if is_set (variant) then
variant = variant:lower(); -- ensure that we use and return lower case version of this
if not variant_table[variant] then -- make sure variant is valid
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant});
end -- does this duplicate/replace tests in lang() and lang_xx()?
if is_set (script) then -- if script set it must be part of the 'prefix'
if not in_array (table.concat ({code, '-', script}), variant_table[variant]['prefixes']) then
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code-script pair: ', code, '-', script});
end
elseif is_set (region) then -- if region set, there are some prefixes that require lang code and region (en-CA-newfound)
if not in_array (code, variant_table[variant]['prefixes']) then -- first see if lang code is all that's required (en-oxendict though en-GB-oxendict is preferred)
if not in_array (table.concat ({code, '-', region}), variant_table[variant]['prefixes']) then -- now try for lang code and region (en-CA-newfound)
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code-region pair: ', code, '-', region});
end
end
else -- cheap way to determine if there are prefixes; fonipa and others don't have prefixes; # operator always returns 0
if variant_table[variant]['prefixes'][1] and not in_array (code, variant_table[variant]['prefixes']) then
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code: ', code});
end
end
end
if is_set (private) then
private = private:lower(); -- ensure that we use and return lower case version of this
if not override_table[table.concat ({code, '-x-', private})] then -- make sure private tag is valid; note that index
return code, script, region, nil, nil, table.concat ({'unrecognized private tag: ', private});
end
end
return code, script, region, variant, private, nil; -- return the good bits; make sure that msg is nil
end
--[[--------------------------< M A K E _ E R R O R _ M S G >--------------------------------------------------
assembles an error message from template name, message text, help link, and error category.
]]
local function make_error_msg (msg, args, template)
local out = {};
local category;
if 'Transliteration' == template then
category = 'Transliteration';
else
category = 'Lang and lang-xx'
end
table.insert (out, table.concat ({'[', args.text or 'undefined', '] '})); -- for error messages output args.text if available
table.insert (out, table.concat ({'<span style=\"color:#d33\">Error: {{', template, '}}: '}));
table.insert (out, msg);
table.insert (out, table.concat ({' ([[:Category:', category, ' template errors|help]])'}));
table.insert (out, '</span>');
if (0 == namespace or 10 == namespace) and not args.nocat then -- categorize in article space (and template space to take care of broken usages)
table.insert (out, table.concat ({'[[Category:', category, ' template errors]]'}));
end
return table.concat (out);
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided, returns a wikilink in the form [[L]]; if neither are provided or link is omitted, returns an
empty string.
]=]
local function make_wikilink (link, display)
if is_set (link) then
if is_set (display) then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
else
return '';
end
end
--[[--------------------------< D I V _ M A R K U P _ A D D >--------------------------------------------------
adds <i> and </i> tags to list-item text or to implied <p>..</p> text. mixed not supported
]]
local function div_markup_add (text, style)
local implied_p = {};
if text:find ('^\n[%*:;#]') then -- look for list markup; list markup must begin at start of text
if 'italic' == style then
return text:gsub ('(\n[%*:;#]+)([^\n]+)', '%1<i>%2</i>'); -- insert italic markup at each list item
else
return text;
end
end
if text:find ('\n+') then -- look for any number of \n characters in text
text = text:gsub ('([^\n])\n([^\n])', '%1 %2'); -- replace single newline characters with a space character which mimics mediawiki
if 'italic' == style then
text = text:gsub('[^\n]+', '<p><i>%1</i></p>'); -- insert p and italic markup tags at each impled p (two or more consecutive '\n\n' sequences)
else
text = text:gsub ('[^\n]+', '<p>%1</p>'); -- insert p markup at each impled p
text = text:gsub ('\n', ''); -- strip newline characters
end
end
return text;
end
--[[--------------------------< T I T L E _ W R A P P E R _ M A K E >------------------------------------------
makes a <span title="<title text>"><content_text></span> or <div title="<title text>"><content_text></div> where
<title text> is in the tool-tip in the wiki's local language and <content_text> is non-local-language text in
html markup. This because the lang= attibute applies to the content of its enclosing tag.
<tag> holds a string 'div' or 'span' used to choose the correct wrapping tag
]]
local function title_wrapper_make (title_text, content_text, tag)
local wrapper_t = {};
table.insert (wrapper_t, table.concat ({'<', tag})); -- open opening wrapper tag
table.insert (wrapper_t, ' title=\"'); -- begin title attribute
table.insert (wrapper_t, title_text); -- add <title_text>
table.insert (wrapper_t, '\">'); -- end title attribute and close opening wrapper tag
table.insert (wrapper_t, content_text); -- add <content_text>
table.insert (wrapper_t, table.concat ({'</', tag, '>'})); -- add closing wrapper tag
return table.concat (wrapper_t); -- make a big string and done
end
--[[--------------------------< M A K E _ T E X T _ H T M L >--------------------------------------------------
Add the html markup to text according to the type of content that it is: <span> or <i> tags for inline content or
<div> tags for block content
The lang= attribute also applies to the content of the tag where it is placed so this is wrong because 'Spanish
language text' is English:
<i lang="es" title="Spanish language text">casa</i>
should be:
<span title="Spanish language text"><i lang="es">casa</i></span>
or for <div>...</div>:
<div title="Spanish language text"><div lang="es"><spanish-language-text></div></div>
]]
local function make_text_html (code, text, tag, rtl, style, size, language)
local html_t = {};
local style_added = '';
local wrapper_tag = tag; -- <tag> gets modified so save a copy for use when/if we create a wrapper span or div
if text:match ('^%*') then
table.insert (html_t, '*'); -- move proto language text prefix outside of italic markup if any; use numeric entity because plain splat confuses MediaWiki
text = text:gsub ('^%*', ''); -- remove the splat from the text
end
if 'span' == tag then -- default html tag for inline content
if 'italic' == style then -- but if italic
tag = 'i'; -- change to <i> tags
end
else -- must be div so go
text = div_markup_add (text, style); -- handle implied <p>, implied <p> with <i>, and list markup (*;:#) with <i>
end
table.insert (html_t, table.concat ({'<', tag})); -- open the <i>, <span>, or <div> html tag
code = code:gsub ('%-x%-.*', ''); -- strip private use subtag from code tag because meaningless outside of wikipedia
table.insert (html_t, table.concat ({' lang="', code, '\"'})); -- add language attribute
if (rtl or unicode.is_rtl(text)) and ('ltr' == this_wiki_lang_dir) then -- text is right-to-left on a left-to-right wiki
table.insert (html_t, ' dir="rtl"'); -- add direction attribute for right-to-left languages
elseif not (rtl or unicode.is_rtl(text)) and ('rtl' == this_wiki_lang_dir) then -- text is left-to-right on a right-to-left wiki
table.insert (html_t, ' dir="ltr"'); -- add direction attribute for left-to-right languages
end
if 'normal' == style then -- when |italic=no
table.insert (html_t, ' style=\"font-style: normal;'); -- override external markup, if any
style_added = '\"'; -- remember that style attribute added and is not yet closed
end
if is_set (size) then -- when |size=<something>
if is_set (style_added) then
table.insert (html_t, table.concat ({' font-size: ', size, ';'})); -- add when style attribute already inserted
else
table.insert (html_t, table.concat ({' style=\"font-size: ', size, ';'})); -- create style attribute
style_added = '\"'; -- remember that style attribute added and is not yet closed
end
end
table.insert (html_t, table.concat ({style_added, '>'})); -- close the opening html tag
table.insert (html_t, text); -- insert the text
table.insert (html_t, table.concat ({'</', tag, '>'})); -- close the 'text' <i>, <span>, or <div> html tag
if is_set (language) then -- create a <title_text> string for the title= attribute in a wrapper span or div
local title_text;
if 'zxx' == code then -- special case for this tag 'no linguistic content'
title_text = table.concat ({language, ' text'}); -- not a language so don't use 'language' in title text
elseif mw.ustring.find (language, 'languages', 1, true) then
title_text = table.concat ({language, ' collective text'}); -- for collective languages
else
title_text = table.concat ({language, '-language text'}); -- for individual languages
end
return title_wrapper_make (title_text, table.concat (html_t), wrapper_tag);
else
return table.concat (html_t);
end
end
--[=[-------------------------< M A K E _ C A T E G O R Y >----------------------------------------------------
For individual language, <language>, returns:
[[Category:Articles containing <language>-language text]]
for English:
[[Category:Articles containing explicitly cited English-language text]]
for ISO 639-2 collective languages (and for 639-1 bh):
[[Category:Articles with text in <language> languages]]
]=]
local function make_category (code, language_name, nocat, name_get)
local cat = {};
local retval;
if ((0 ~= namespace) or nocat) and not name_get then -- only categorize in article space
return ''; -- return empty string for concatenation
end
if mw.ustring.find (language_name, 'languages', 1, true) then
return table.concat ({'[[Category:Articles with text in ', language_name, ']]'});
end
table.insert (cat, '[[Category:Articles containing ');
if this_wiki_lang_tag == code then
table.insert (cat, 'explicitly cited ' .. language_name); -- unique category name for the local language
else
table.insert (cat, language_name);
end
table.insert (cat, '-language text]]');
return table.concat (cat);
end
--[[--------------------------< M A K E _ T R A N S L I T >----------------------------------------------------
return translit <i lang=xx-Latn>...</i> where xx is the language code; else return empty string
The value |script= is not used in {{transliteration}} for this purpose; instead it uses |code. Because language scripts
are listed in the {{transliteration}} switches they are included in the data tables. The script parameter is introduced
at {{Language with name and transliteration}}. If |script= is set, this function uses it in preference to code.
To avoid confusion, in this module and the templates that use it, the transliteration script parameter is renamed
to be |translit-script= (in this function, tscript)
This function is used by both lang_xx() and transl()
lang_xx() always provides code, language_name, and translit; may provide tscript; never provides style
transl() always provides language_name, translit, and one of code or tscript, never both; always provides style
For {{transliteration}}, style only applies when a language code is provided
]]
local function make_translit (code, language_name, translit, std, tscript, style)
local title;
local out_t = {};
local title_t = lang_data.translit_title_table; -- table of transliteration standards and the language codes and scripts that apply to those standards
local title_text = ''; -- tool tip text for title= attribute
std = std and std:lower(); -- lower case for table indexing
if not is_set (std) and not is_set (tscript) then -- when neither standard nor script specified
title_text = language_name; -- write a generic tool tip
if not mw.ustring.find (language_name, 'languages', 1, true) then -- collective language names (plural 'languages' is part of the name)
title_text = title_text .. '-language'; -- skip this text (individual and macro languages only)
end
title_text = title_text .. ' romanization'; -- finish the tool tip; use romanization when neither script nor standard supplied
elseif is_set (std) and is_set (tscript) then -- when both are specified
if title_t[std] then -- and if standard is legitimate
if title_t[std][tscript] then -- and if script for that standard is legitimate
if script_table[tscript] then
title_text = title_text .. table.concat ({title_t[std][tscript:lower()], ' (', script_table[tscript], ' script) transliteration'}); -- add the appropriate text to the tool tip
else
title_text = title_text .. title_t[std]['default']; -- use the default if script not in std table; TODO: maint cat? error message because script not found for this standard?
end
else
title_text = title_text .. title_t[std]['default']; -- use the default if script not in std table; TODO: maint cat? error message because script not found for this standard?
end
else
return ''; -- invalid standard, setup for error message
end
elseif is_set (std) then -- translit-script not set, use language code
if not title_t[std] then return ''; end -- invalid standard, setup for error message
if title_t[std][code] then -- if language code is in the table (transl may not provide a language code)
title_text = title_text .. table.concat ({title_t[std][code:lower()], ' (', language_name, ' language) transliteration'}); -- add the appropriate text to the tool tip
else -- code doesn't match
title_text = title_text .. title_t[std]['default']; -- so use the standard's default
end
else -- here if translit-script set but translit-std not set
if title_t['no_std'][tscript] then
title_text = title_text .. title_t['no_std'][tscript]; -- use translit-script if set
elseif title_t['no_std'][code] then
title_text = title_text .. title_t['no_std'][code]; -- use language code
else
if is_set (tscript) then
title_text = title_text .. table.concat ({language_name, '-script transliteration'}); -- write a script tool tip
elseif is_set (code) then
if not mw.ustring.find (language_name, 'languages', 1, true) then -- collective language names (plural 'languages' is part of the name)
title_text = title_text .. '-language'; -- skip this text (individual and macro languages only)
end
title_text = title_text .. ' transliteration'; -- finish the tool tip
else
title_text = title_text .. ' transliteration'; -- generic tool tip (can we ever get here?)
end
end
end
local close_tag;
if is_set (code) then -- when a language code is provided (always with {{lang-xx}} templates, not always with {{transliteration}})
code = code:match ('^(%a%a%a?)'); -- strip all subtags leaving only the language subtag
if not style then -- nil for the default italic style
table.insert (out_t, "<i lang=\""); -- so use <i> tag
close_tag = '</i>'; -- tag to be used when closing
else
table.insert (out_t, table.concat ({'<span style=\"font-style: ', style, '\" lang=\"'})); -- non-standard style, construct a span tag for it
close_tag = '</span>'; -- tag to be used when closing
end
table.insert (out_t, code);
table.insert (out_t, "-Latn\">"); -- transliterations are always Latin script
else
table.insert (out_t, "<span>"); -- when no language code: no lang= attribute, not italic ({{transliteration}} only)
close_tag = '</span>';
end
table.insert (out_t, translit); -- add the translit text
table.insert (out_t, close_tag); -- and add the appropriate </i> or </span>
if '' == title_text then -- when there is no need for a tool-tip
return table.concat (out_t); -- make a string and done
else
return title_wrapper_make (title_text, table.concat (out_t), 'span'); -- wrap with a tool-tip span and don
end
end
--[[--------------------------< V A L I D A T E _ T E X T >----------------------------------------------------
This function checks the content of args.text and returns empty string if nothing is amiss else it returns an
error message. The tests are for empty or missing text and for improper or disallowed use of apostrophe markup.
Italic rendering is controlled by the |italic= template parameter so italic markup should never appear in args.text
either as ''itself'' or as '''''bold italic''''' unless |italic=unset or |italic=invert.
]]
local function validate_text (template, args)
if not is_set (args.text) then
return make_error_msg ('no text', args, template);
end
if args.text:find ("%f[\']\'\'\'\'%f[^\']") or args.text:find ("\'\'\'\'\'[\']+") then -- because we're looking, look for 4 appostrophes or 6+ appostrophes
return make_error_msg ('text has malformed markup', args, template);
end
local style = args.italic;
if ('unset' ~= style) and ('invert' ~=style) then
if args.text:find ("%f[\']\'\'%f[^\']") or args.text:find ("%f[\']\'\'\'\'\'%f[^\']") then -- italic but not bold, or bold italic
return make_error_msg ('text has italic markup', args, template);
end
end
end
--[[--------------------------< R E N D E R _ M A I N T >------------------------------------------------------
render mainenance messages and categories
]]
local function render_maint(nocat)
local maint = {};
if 0 < #maint_msgs then -- when there are maintenance messages
table.insert (maint, table.concat ({'<span class="lang-comment" style="font-style: normal; display: none; color: #33aa33; margin-left: 0.3em;">'})); -- opening <span> tag
for _, msg in ipairs (maint_msgs) do
table.insert (maint, table.concat ({msg, ' '})); -- add message strings
end
table.insert (maint, '</span>'); -- close the span
end
if (0 < #maint_cats) and (0 == namespace) and not nocat then -- when there are maintenance categories; article namespace only
for _, cat in ipairs (maint_cats) do
table.insert (maint, table.concat ({'[[Category:', cat, ']]'})); -- format and add the categories
end
end
return table.concat (maint);
end
--[[--------------------------< P R O T O _ P R E F I X >------------------------------------------------------
for proto languages, text is prefixed with a splat. We do that here as a flag for make_text_html() so that a splat
will be rendered outside of italic markup (if used). If the first character in text here is already a splat, we
do nothing
proto_param is boolean or nil; true adds splat prefix regardless of language name; false removes and / or inhibits
regardless of language name; nil does nothing; presumes that the value in text is correct but removes extra splac
]]
local function proto_prefix (text, language_name, proto_param)
if false == proto_param then -- when forced by |proto=no
return text:gsub ('^%**', ''); -- return text without splat prefix regardless of language name or existing splat prefix in text
elseif (language_name:find ('^Proto%-') or (true == proto_param)) then -- language is a proto or forced by |proto=yes
return text:gsub ('^%**', '*'); -- prefix proto-language text with a splat; also removes duplicate prefixing splats
end
return text:gsub ('^%*+', '*'); -- return text unmolested except multiple splats reduced to one splat
end
--[[--------------------------< H A S _ P O E M _ T A G >------------------------------------------------------
looks for a poem strip marker in text; returns true when found; false else
auto-italic detection disabled when text has poem stripmarker because it is not possible for this code to know
the content that will replace the stripmarker.
]]
local function has_poem_tag (text)
return text:find ('\127[^\127]*UNIQ%-%-poem%-[%a%d]+%-QINU[^\127]*\127') and true or false;
end
--[[--------------------------< H T M L _ T A G _ S E L E C T >------------------------------------------------
Inspects content of and selectively trims text. Returns text and the name of an appropriate html tag for text.
If text contains:
\n\n text has implied <p>..</p> tags - trim leading and trailing whitespace and return
If text begins with list markup:
\n* unordered
\n; definition
\n: definition
\n# ordered
trim all leading whitespace except \n and trim all trailing whitespace
If text contains <poem>...</poem> stripmarker, return text unmodified and choose <div>..</div> tags because
the stripmarker is replaced with text wrapped in <div>..</div> tags.
If the text contains any actual <div>...</div> tags, then it's again returned unmodified and <div>...</div>
tags are used to wrap it, to prevent div/span inversion.
]]
local function html_tag_select (text)
local tag;
if has_poem_tag (text) then -- contains poem stripmarker (we can't know the content of that)
tag = 'div'; -- poem replacement is in div tags so lang must use div tags
elseif text:find ('<div') then -- reductive; if the text contains a div tag, we must use div tags
tag = 'div';
elseif mw.text.trim (text):find ('\n\n+') then -- contains implied p tags
text = mw.text.trim (text); -- trim leading and trailing whitespace characters
tag = 'div'; -- must be div because span may not contain p tags (added later by MediaWiki); poem replacement is in div tags
elseif text:find ('\n[%*:;%#]') then -- if text has list markup
text = text:gsub ('^[\t\r\f ]*', ''):gsub ('%s*$', ''); -- trim all whitespace except leading newline character '\n'
tag = 'div'; -- must be div because span may not contain ul, dd, dl, ol tags (added later by MediaWiki)
else
text = mw.text.trim (text); -- plain text
tag = 'span'; -- so span is fine
end
return text, tag;
end
--[[--------------------------< V A L I D A T E _ P R O T O >--------------------------------------------------
validates value assigned to |proto=; permitted values are yes and no; yes returns as true, no returns as false,
empty string (or parameter omitted) returns as nil; any other value returns as nil with a second return value of
true indicating that some other value has been assigned to |proto=
]]
local function validate_proto (proto_param)
if 'yes' == proto_param then
return true;
elseif 'no' == proto_param then
return false;
elseif is_set (proto_param) then
return nil, true; -- |proto= something other than 'yes' or 'no'
else
return nil; -- missing or empty
end
end
--[[--------------------------< L A N G U A G E _ N A M E _ G E T >--------------------------------------------
common function to return language name from the data set according to IETF tag
returns language name if found in data tables; nil else
]]
local function language_name_get (ietf, code, cat)
ietf = ietf:lower(); -- ietf:lower() because format_ietf_tag() returns mixed case
local name; -- remains nil if not found
if override_table[ietf] then -- look for whole IETF tag in override table
name = override_table[ietf];
elseif override_table[code] then -- not there so try basic language tag
name = override_table[code];
elseif lang_table[code] then -- shift to iana active tag/name table
name = lang_table[code];
elseif lang_dep_table[code] then -- try the iana deprecated tag/name table
name = lang_dep_table[code];
end
if lang_dep_table[code] and cat then -- because deprecated code may have been overridden to en.wiki preferred name
table.insert (maint_cats, table.concat ({'Lang and lang-xx using deprecated ISO 639 codes|', code}));
table.insert (maint_msgs, table.concat ({'code: ', code, ' is deprecated'}));
end
return name; -- name from data tables or nil
end
--[[--------------------------< _ L A N G >--------------------------------------------------------------------
entry point for {{lang}}
there should be no reason to set parameters in the {{lang}} {{#invoke:}}
<includeonly>{{#invoke:lang|lang}}</includeonly>
parameters are received from the template's frame (parent frame)
]]
local function _lang (args)
local out = {};
local language_name; -- used to make category names
local category_name; -- same as language_name except that it retains any parenthetical disambiguators (if any) from the data set
local subtags = {}; -- IETF subtags script, region, variant, and private
local code; -- the language code
local msg; -- for error messages
local tag = 'span'; -- initial value for make_text_html()
local template = args.template or 'Lang';
maint_cats = {}; -- initialize because when this module required into another module, these only declared once so only initialzed once
maint_msgs = {};
validate_cat_args (args); -- determine if categorization should be suppressed
if args[1] and args.code then
return make_error_msg ('conflicting: {{{1}}} and |code=', args, template);
else
args.code = args[1] or args.code; -- prefer args.code
end
if args[2] and args.text then
return make_error_msg ('conflicting: {{{2}}} and |text=', args, template);
else
args.text = args[2] or args.text; -- prefer args.text
end
msg = validate_text (template, args); -- ensure that |text= is set
if is_set (msg) then -- msg is an already-formatted error message
return msg;
end
args.text, tag = html_tag_select (args.text); -- inspects text; returns appropriate html tag with text trimmed accordingly
args.rtl = args.rtl == 'yes'; -- convert to boolean: 'yes' -> true, other values -> false
args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag
if msg then
return make_error_msg (table.concat ({'invalid |proto=: ', args.proto}), args, template);
end
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (args.code); -- |script=, |region=, |variant= not supported because they should be part of args.code ({{{1}}} in {{lang}})
if msg then
return make_error_msg ( msg, args, template);
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, template);
end
if nil == args.italic then -- nil when |italic= absent or not set or |italic=default; args.italic controls
if ('latn' == subtags.script) or -- script is latn
(this_wiki_lang_tag ~= code and not is_set (subtags.script) and not has_poem_tag (args.text) and unicode.is_Latin (args.text)) then -- text not this wiki's language, no script specified and not in poem markup but is wholly latn script (auto-italics)
args.italic = 'italic'; -- DEFAULT for {{lang}} templates is upright; but if latn script set for font-style:italic
else
args.italic = 'inherit'; -- italic not set; script not latn; inherit current style
end
end
if is_set (subtags.script) then -- if script set, override rtl setting
if in_array (subtags.script, lang_data.rtl_scripts) then
args.rtl = true; -- script is an rtl script
else
args.rtl = false; -- script is not an rtl script
end
end
args.code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles
language_name = language_name_get (args.code, code, true); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
if 'invert' == args.italic and 'span' == tag then -- invert only supported for in-line content
args.text = invert_italics (args.text)
end
args.text = proto_prefix (args.text, language_name, args.proto); -- prefix proto-language text with a splat
table.insert (out, make_text_html (args.code, args.text, tag, args.rtl, args.italic, args.size, language_name));
table.insert (out, make_category (code, language_name, args.nocat));
table.insert (out, render_maint(args.nocat)); -- maintenance messages and categories
return table.concat (out); -- put it all together and done
end
--[[--------------------------< L A N G >----------------------------------------------------------------------
entry point for {{lang}}
there should be no reason to set parameters in the {{lang}} {{#invoke:}}
<includeonly>{{#invoke:lang|lang}}</includeonly>
parameters are received from the template's frame (parent frame)
]]
local function lang (frame)
local args = getArgs (frame, { -- this code so that we can detect and handle wiki list markup in text
valueFunc = function (key, value)
if 2 == key or 'text' == key then -- the 'text' parameter; do not trim wite space
return value; -- return untrimmed 'text'
elseif value then -- all other values: if the value is not nil
value = mw.text.trim (value); -- trim whitespace
if '' ~= value then -- empty string when value was only whitespace
return value;
end
end
return nil; -- value was empty or contained only whitespace
end -- end of valueFunc
});
return _lang (args);
end
--[[--------------------------< T R A N S L A T I O N _ M A K E >----------------------------------------------
stand-alone function to create literal translation of main text
Also used by {{lang-x2}}
]]
local function translation_make (args_t)
local translation_t = {', '}; -- initialize output
if 'none' ~= args_t.label then -- if we want a label
table.insert (translation_t, '<small>'); -- open the <small> html tag
if 'no' == args_t.link then
table.insert (translation_t, '<abbr title="literal translation">lit.</abbr>'); -- unlinked form
else
table.insert (translation_t, make_wikilink ('Literal translation', 'lit.')); -- linked form
end
table.insert (translation_t, " </small>"); -- close the <small> html tag
end
table.insert (translation_t, table.concat ({''', args_t.translation, '''})); -- use html entities to avoid wiki markup confusion
return table.concat (translation_t); -- make a big string and done
end
--[[--------------------------< L A N G _ X X >----------------------------------------------------------------
For the {{lang-xx}} templates, the only parameter required to be set in the template is the language code. All
other parameters can, usually should, be written in the template call. For {{lang-xx}} templates for languages
that can have multiple writing systems, it may be appropriate to set |script= as well.
For each {{lang-xx}} template choose the appropriate entry-point function so that this function knows the default
styling that should be applied to text.
For normal, upright style:
<includeonly>{{#invoke:lang|lang_xx_inherit|code=xx}}</includeonly>
For italic style:
<includeonly>{{#invoke:lang|lang_xx_italic|code=xx}}</includeonly>
All other parameters should be received from the template's frame (parent frame)
Supported parameters are:
|code = (required) the IANA language code
|script = IANA script code; especially for use with languages that use multiple writing systems
|region = IANA region code
|variant = IANA variant code
|text = (required) the displayed text in language specified by code
|link = boolean false ('no') does not link code-spcified language name to associated language article
|rtl = boolean true ('yes') identifies the language specified by code as a right-to-left language
|nocat = boolean true ('yes') inhibits normal categorization; error categories are not affected
|cat = boolian false ('no') opposite form of |nocat=
|italic = boolean true ('yes') renders displayed text in italic font; boolean false ('no') renders displayed text in normal font; not set renders according to initial_style_state
|lit = text that is a literal translation of text
|label = 'none' to suppress all labeling (language name, 'translit.', 'lit.')
any other text replaces language-name label - automatic wikilinking disabled
for those {{lang-xx}} templates that support transliteration (those templates where |text= is not entirely latn script):
|translit = text that is a transliteration of text
|translit-std = the standard that applies to the transliteration
|translit-script = ISO 15924 script name; falls back to code
For {{lang-xx}}, the positional parameters are:
{{{1}}} text
{{{2}}} transliterated text
{{{3}}} literal translation text
no other positional parameters are allowed
]]
local function _lang_xx (args)
local out = {};
local language_name; -- used to make display text, article links
local category_name; -- same as language_name except that it retains any parenthetical disambiguators (if any) from the data set
local subtags = {}; -- IETF subtags script, region, and variant
local code; -- the language code
local translit_script_name; -- name associated with IANA (ISO 15924) script code
local translit;
local translit_title;
local msg; -- for error messages
local tag = 'span'; -- initial value for make_text_html()
local template = args.template or 'Lang-xx';
maint_cats = {}; -- initialize because when this module required into another module, these only declared once so only initialzed once
maint_msgs = {};
if args[1] and args.text then
return make_error_msg ('conflicting: {{{1}}} and |text=', args, template);
else
args.text = args[1] or args.text; -- prefer args.text
end
msg = validate_text (template, args); -- ensure that |text= is set, does not contain italic markup and is protected from improper bolding
if is_set (msg) then
return msg;
end
args.text, tag = html_tag_select (args.text); -- inspects text; returns appropriate html tag with text trimmed accordingly
if args[2] and args.translit then
return make_error_msg ('conflicting: {{{2}}} and |translit=', args, template);
else
args.translit = args[2] or args.translit -- prefer args.translit
end
if args[3] and (args.translation or args.lit) then
return make_error_msg ('conflicting: {{{3}}} and |lit= or |translation=', args, template);
elseif args.translation and args.lit then
return make_error_msg ('conflicting: |lit= and |translation=', args, template);
else
args.translation = args[3] or args.translation or args.lit; -- prefer args.translation
end
if args.links and args.link then
return make_error_msg ('conflicting: |links= and |link=', args, template);
else
args.link = args.link or args.links; -- prefer args.link
end
validate_cat_args (args); -- determine if categorization should be suppressed
args.rtl = args.rtl == 'yes'; -- convert to boolean: 'yes' -> true, other values -> false
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (args.code, args.script, args.region, args.variant); -- private omitted because private
if msg then -- if an error detected then there is an error message
return make_error_msg (msg, args, template);
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, template);
end
if nil == args.italic then -- args.italic controls
if is_set (subtags.script) then
if 'latn' == subtags.script then
args.italic = 'italic'; -- |script=Latn; set for font-style:italic
else
args.italic = initial_style_state; -- italic not set; script is not latn; set for font-style:<initial_style_state>
end
else
args.italic = initial_style_state; -- here when |italic= and |script= not set; set for font-style:<initial_style_state>
end
end
if is_set (subtags.script) then -- if script set override rtl setting
if in_array (subtags.script, lang_data.rtl_scripts) then
args.rtl = true; -- script is an rtl script
else
args.rtl = false; -- script is not an rtl script
end
end
args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag
if msg then
return make_error_msg (table.concat ({'invalid |proto=: ', args.proto}), args, template);
end
args.code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles
language_name = language_name_get (args.code, code, true); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
category_name = language_name; -- category names retain IANA parenthetical diambiguators (if any)
language_name = language_name:gsub ('%s+%b()', ''); -- remove IANA parenthetical disambiguators or qualifiers from names that have them
if args.label then
if 'none' ~= args.label then
table.insert (out, table.concat ({args.label, ': '})); -- custom label
end
else
if 'no' == args.link then
table.insert (out, language_name); -- language name without wikilink
else
if mw.ustring.find (language_name, 'languages', 1, true) then
table.insert (out, make_wikilink (language_name)); -- collective language name uses simple wikilink
elseif lang_data.article_name[code] then
table.insert (out, make_wikilink (lang_data.article_name[code], language_name)); -- language name with wikilink from override data
else
table.insert (out, make_wikilink (language_name .. ' language', language_name)); -- language name with wikilink
end
end
table.insert (out, ': '); -- separator
end
if 'invert' == args.italic then
args.text = invert_italics (args.text)
end
args.text = proto_prefix (args.text, language_name, args.proto); -- prefix proto-language text with a splat
table.insert (out, make_text_html (args.code, args.text, tag, args.rtl, args.italic, args.size, ('none' == args.label) and language_name or nil))
if is_set (args.translit) and not unicode.is_Latin (args.text) then -- transliteration (not supported in {{lang}}); not supported when args.text is wholly latn text (this is an imperfect test)
table.insert (out, ', '); -- comma to separate text from translit
if 'none' ~= args.label then
table.insert (out, '<small>');
if script_table[args['translit-script']] then -- when |translit-script= is set, try to use the script's name
translit_script_name = script_table[args['translit-script']];
else
translit_script_name = language_name; -- fall back on language name
end
translit_title = mw.title.makeTitle (0, table.concat ({'Romanization of ', translit_script_name})); -- make a title object
if translit_title.exists and ('no' ~= args.link) then
table.insert (out, make_wikilink ('Romanization of ' .. translit_script_name or language_name, 'romanized') .. ':'); -- make a wikilink if there is an article to link to
else
table.insert (out, 'romanized:'); -- else plain text
end
table.insert (out, ' </small>'); -- close the small tag
end
translit = make_translit (args.code, language_name, args.translit, args['translit-std'], args['translit-script'])
if is_set (translit) then
table.insert (out, translit);
else
return make_error_msg (table.concat ({'invalid translit-std: \'', args['translit-std'] or '[missing]'}), args, template);
end
end
if is_set (args.translation) then -- translation (not supported in {{lang}})
table.insert (out, translation_make (args));
end
table.insert (out, make_category (code, category_name, args.nocat));
table.insert (out, render_maint(args.nocat)); -- maintenance messages and categories
return table.concat (out); -- put it all together and done
end
--[[--------------------------< L A N G _ X X _ A R G S _ G E T >----------------------------------------------
common function to get args table from {{lang-??}} templates
returns table of args
]]
local function lang_xx_args_get (frame)
local args = getArgs(frame,
{
parentFirst= true, -- parameters in the template override parameters set in the {{#invoke:}}
valueFunc = function (key, value)
if 1 == key then -- the 'text' parameter; do not trim wite space
return value; -- return untrimmed 'text'
elseif value then -- all other values: if the value is not nil
value = mw.text.trim (value); -- trim whitespace
if '' ~= value then -- empty string when value was only whitespace
return value;
end
end
return nil; -- value was empty or contained only whitespace
end -- end of valueFunc
});
return args;
end
--[[--------------------------< L A N G _ X X _ I T A L I C >--------------------------------------------------
Entry point for those {{lang-xx}} templates that call lang_xx_italic(). Sets the initial style state to italic.
]]
local function lang_xx_italic (frame)
local args = lang_xx_args_get (frame);
initial_style_state = 'italic';
return _lang_xx (args);
end
--[[--------------------------< _ L A N G _ X X _ I T A L I C >------------------------------------------------
Entry point ffrom another module. Sets the initial style state to italic.
]]
local function _lang_xx_italic (args)
initial_style_state = 'italic';
return _lang_xx (args);
end
--[[--------------------------< L A N G _ X X _ I N H E R I T >------------------------------------------------
Entry point for those {{lang-xx}} templates that call lang_xx_inherit(). Sets the initial style state to inherit.
]]
local function lang_xx_inherit (frame)
local args = lang_xx_args_get (frame);
initial_style_state = 'inherit';
return _lang_xx (args);
end
--[[--------------------------< _ L A N G _ X X _ I N H E R I T >----------------------------------------------
Entry point from another module. Sets the initial style state to inherit.
]]
local function _lang_xx_inherit (args)
initial_style_state = 'inherit';
return _lang_xx (args);
end
--[[--------------------------< _ I S _ I E T F _ T A G >------------------------------------------------------
Returns true when a language name associated with IETF language tag exists; nil else. IETF language tag must be valid.
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Module entry point from another module
]]
local function _is_ietf_tag (tag) -- entry point when this module is require()d into another
local c, s, r, v, p, err; -- code, script, region, variant, private, error message
c, s, r, v, p, err = get_ietf_parts (tag); -- disassemble tag into constituent part and validate
return ((c and not err) and true) or nil; -- return true when code portion has a value without error message; nil else
end
--[[--------------------------< I S _ I E T F _ T A G >--------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function is_ietf_tag (frame)
return _is_ietf_tag (getArgs (frame)[1]); -- args[1] is the ietf language tag to be tested; also get parent frame
end
--[[--------------------------< I S _ I E T F _ T A G _ F R A M E >--------------------------------------------
Module entry point from an {{#invoke:}}; same as is_ietf_tag() except does not get parameters from the parent
(template) frame. This function not useful when called by {{lang|fn=is_ietf_tag_frame|<tag>}} because <tag>
is in the parent frame.
]]
local function is_ietf_tag_frame (frame)
return _is_ietf_tag (getArgs (frame, {frameOnly = true,})[1]); -- args[1] is the ietf language tag to be tested; do not get parent frame
end
--[[--------------------------< _ N A M E _ F R O M _ T A G >--------------------------------------------------
Returns language name associated with IETF language tag if valid; error message else.
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Set invoke's |link= parameter to yes to get wikilinked version of the language name.
Module entry point from another module
]]
local function _name_from_tag (args)
local subtags = {}; -- IETF subtags script, region, variant, and private
local raw_code = args[1]; -- save a copy of the input IETF subtag
local link = 'yes' == args['link']; -- make a boolean
local label = args.label;
local code; -- the language code
local msg; -- gets an error message if IETF language tag is malformed or invalid
local language_name = '';
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (raw_code);
if msg then
local template = (args['template'] and table.concat ({'{{', args['template'], '}}: '})) or ''; -- make template name (if provided by the template)
return table.concat ({'<span style=\"color:#d33\">Error: ', template, msg, '</span>'});
end
raw_code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles; private omitted because private
language_name = language_name_get (raw_code, code); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
language_name = language_name:gsub ('%s+%b()', ''); -- remove IANA parenthetical disambiguators or qualifiers from names that have them
if link then -- when |link=yes, wikilink the language name
if mw.ustring.find (language_name, 'languages', 1, true) then
language_name = make_wikilink (language_name, label); -- collective language name uses simple wikilink
elseif lang_data.article_name[code] then
language_name = make_wikilink (lang_data.article_name[code], label or language_name); -- language name with wikilink from override data
else
language_name = make_wikilink (language_name .. ' language', label or language_name); -- language name with wikilink
end
end
return language_name;
end
--[[--------------------------< N A M E _ F R O M _ T A G >----------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function name_from_tag (frame) -- entry point from an {{#invoke:Lang|name_from_tag|<ietf tag>|link=<yes>|template=<template name>}}
return _name_from_tag (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame
end
--[[--------------------------< _ T A G _ F R O M _ N A M E >--------------------------------------------------
Returns the ietf language tag associated with the language name. Spelling of language name must be correct
according to the spelling in the source tables. When a standard language name has a parenthetical disambiguator,
that disambiguator must be omitted (they are not present in the data name-to-tag tables).
Module entry point from another module
]]
local function _tag_from_name (args) -- entry point from another module
local msg;
if args[1] and '' ~= args[1] then
local data = mw.loadData ('Module:Lang/tag from name'); -- get the reversed data tables TODO: change when going live
local lang = args[1]:lower(); -- allow any-case for the language name (speeling must till be correct)
local tag = data.rev_override_table[lang] or data.rev_lang_table[lang] or data.rev_lang_dep_table[lang]; -- get the code; look first in the override then in the standard
if tag then
return tag, true; -- language name found so return tag and done; second return used by is_lang_name()
else
msg = 'language: ' .. args[1] .. ' not found' -- language name not found, error message
end
else
msg = 'missing language name' -- language name not provided, error message
end
local template = '';
if args.template and '' ~= args.template then
template = table.concat ({'{{', args['template'], '}}: '}); -- make template name (if provided by the template)
end
return table.concat ({'<span style=\"color:#d33\">Error: ', template, msg, '</span>'});
end
--[[--------------------------< T A G _ F R O M _ N A M E >----------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function tag_from_name (frame) -- entry point from an {{#invoke:Lang|tag_from_name|<language name>|link=<yes>|template=<template name>}}
local result, _ = _tag_from_name (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame; supress second return used by is_lang_name()
return result;
end
--[[--------------------------< I S _ L A N G _ N A M E >------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function is_lang_name (frame)
local _, result = _tag_from_name (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame; supress second return used by tag_from_name()
return result and true or nil;
end
--[[--------------------------< _ T R A N S L >----------------------------------------------------------------
Module entry point from another module
]]
local function _transl (args)
local title_table = lang_data.translit_title_table; -- table of transliteration standards and the language codes and scripts that apply to those standards
local language_name; -- language name that matches language code; used for tool tip
local translit; -- transliterated text to display
local script; -- IANA script
local msg; -- for when called functions return an error message
maint_cats = {}; -- initialize because when this module required into another module, these only declared once so only initialzed once
maint_msgs = {};
if is_set (args[3]) then -- [3] set when {{transliteration|code|standard|text}}
args.text = args[3]; -- get the transliterated text
args.translit_std = args[2] and args[2]:lower(); -- get the standard; lower case for table indexing
if not title_table[args.translit_std] then
return make_error_msg (table.concat ({'unrecognized transliteration standard: ', args.translit_std}), args, 'Transliteration');
end
else
if is_set (args[2]) then -- [2] set when {{transliteration|code|text}}
args.text = args[2]; -- get the transliterated text
else
if args[1] and (args[1]:match ('^%a%a%a?%a?$') or -- args[2] missing; is args[1] a language or script tag or is it the transliterated text?
args[1]:match ('^%a%a%a?%-x%-')) then -- or is args[1] a private-use tag
return make_error_msg ('no text', args, 'Transliteration'); -- args[1] is a code so we're missing text
else
args.text = args[1]; -- args[1] is not a code so we're missing that; assign args.text for error message
return make_error_msg ('missing language / script code', args, 'Transliteration');
end
end
end
if is_set (args[1]) then -- IANA language code used for html lang= attribute; or ISO 15924 script code
if args[1]:match ('^%a%a%a?%a?$') or args[1]:match ('^%a%a%a?%-x%-') then -- args[1] has correct form?
args.code = args[1]:lower(); -- use the language/script code; only (2, 3, or 4 alpha characters) or private-use; lower case because table indexes are lower case
else
return make_error_msg (table.concat ({'unrecognized language / script code: ', args[1]}), args, 'Transliteration'); -- invalid language / script code
end
else
return make_error_msg ('missing language / script code', args, 'Transliteration'); -- missing language / script code so quit
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, 'Transliteration');
end
if 'italic' == args.italic then -- 'italic' when |italic=yes; because that is same as absent or not set and |italic=default
args.italic = nil; -- set to nil;
end
if override_table[args.code] then -- is code a language code defined in the override table?
language_name = override_table[args.code];
args.code = args.code:match ('^%a%a%a?'); -- if private use, strip all but language subtag
elseif lang_table[args.code] then -- is code a language code defined in the standard language code tables?
language_name = lang_table[args.code];
elseif lang_dep_table[args.code] then -- is code a language code defined in the deprecated language code tables?
language_name = lang_dep_table[args.code];
elseif script_table[args.code] then -- if here, code is not a language code; is it a script code?
language_name = script_table[args.code];
script = args.code; -- code was an ISO 15924 script so use that instead
args.code = ''; -- unset because not a language code
else
return make_error_msg (table.concat ({'unrecognized language / script code: ', args.code}), args, 'Transliteration'); -- invalid language / script code
end
-- here only when all parameters passed to make_translit() are valid
return make_translit (args.code, language_name, args.text, args.translit_std, script, args.italic);
end
--[[--------------------------< T R A N S L >------------------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function transl (frame)
return _transl (getArgs(frame));
end
--[[--------------------------< C A T E G O R Y _ F R O M _ T A G >--------------------------------------------
Returns category name associated with IETF language tag if valid; error message else
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Module entry point from another module
]]
local function _category_from_tag (args_t)
local subtags = {}; -- IETF subtags script, region, variant, and private
local raw_code = args_t[1]; -- save a copy of the input IETF subtag
local link = 'yes' == args_t.link; -- make a boolean
local label = args_t.label;
local code; -- the language code
local msg; -- gets an error message if IETF language tag is malformed or invalid
local category_name = '';
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (raw_code);
if msg then
local template = (args_t.template and table.concat ({'{{', args_t.template, '}}: '})) or ''; -- make template name (if provided by the template)
return table.concat ({'<span style=\"color:#d33\">Error: ', template, msg, '</span>'});
end
raw_code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles; private omitted because private
category_name = language_name_get (raw_code, code); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
category_name = make_category (code, category_name, nil, true):gsub ('[%[%]]', '');
if link then
return table.concat ({'[[:', category_name, ']]'});
else
return category_name;
end
end
--[[--------------------------< C A T E G O R Y _ F R O M _ T A G >--------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function category_from_tag (frame) -- entry point from an {{#invoke:Lang|category_from_tag|<ietf tag>|template=<template name>}}
return _category_from_tag (getArgs (frame)); -- pass-on the args table, nothing else; getArgs() so we also get parent frame
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
category_from_tag = category_from_tag,
lang = lang, -- entry point for {{lang}}
lang_xx_inherit = lang_xx_inherit, -- entry points for {{lang-??}}
lang_xx_italic = lang_xx_italic,
is_ietf_tag = is_ietf_tag,
is_ietf_tag_frame = is_ietf_tag_frame,
is_lang_name = is_lang_name,
tag_from_name = tag_from_name, -- returns ietf tag associated with language name
name_from_tag = name_from_tag, -- used for template documentation; possible use in ISO 639 name from code templates
transl = transl, -- entry point for {{transliteration}}
_category_from_tag = _category_from_tag, -- entry points when this module is require()d into other modules
_lang = _lang,
_lang_xx_inherit = _lang_xx_inherit,
_lang_xx_italic = _lang_xx_italic,
_is_ietf_tag = _is_ietf_tag,
get_ietf_parts = get_ietf_parts,
_tag_from_name = _tag_from_name,
_name_from_tag = _name_from_tag,
_transl = _transl,
_translation_make = translation_make,
};
b4bf37fa610695625e5f1ff5d33471dfaaf8af34
Module:Unicode data
828
150
401
400
2023-10-17T20:36:07Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Unicode_data]]
Scribunto
text/plain
local p = {}
local floor = math.floor
local function errorf(level, ...)
if type(level) == "number" then
return error(string.format(...), level + 1)
else -- level is actually the format string.
return error(string.format(level, ...), 2)
end
end
local function binary_range_search(codepoint, ranges)
local low, mid, high
low, high = 1, ranges.length or require "Module:TableTools".length(ranges)
while low <= high do
mid = floor((low + high) / 2)
local range = ranges[mid]
if codepoint < range[1] then
high = mid - 1
elseif codepoint <= range[2] then
return range, mid
else
low = mid + 1
end
end
return nil, mid
end
p.binary_range_search = binary_range_search
--[[
local function linear_range_search(codepoint, ranges)
for i, range in ipairs(ranges) do
if range[1] <= codepoint and codepoint <= range[2] then
return range
end
end
end
--]]
-- Load a module by indexing "loader" with the name of the module minus the
-- "Module:Unicode data/" part. For instance, loader.blocks returns
-- [[Module:Unicode data/blocks]]. If a module cannot be loaded, false will be
-- returned.
local loader = setmetatable({}, {
__index = function (self, key)
local success, data = pcall(mw.loadData, "Module:Unicode data/" .. key)
if not success then
data = false
end
self[key] = data
return data
end
})
-- For the algorithm used to generate Hangul Syllable names,
-- see "Hangul Syllable Name Generation" in section 3.12 of the
-- Unicode Specification:
-- https://www.unicode.org/versions/Unicode11.0.0/ch03.pdf
local name_hooks = {
{ 0x00, 0x1F, "<control-%04X>" }, -- C0 control characters
{ 0x7F, 0x9F, "<control-%04X>" }, -- DEL and C1 control characters
{ 0x3400, 0x4DBF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension A
{ 0x4E00, 0x9FFF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph
{ 0xAC00, 0xD7A3, function (codepoint) -- Hangul Syllables
local Hangul_data = loader.Hangul
local syllable_index = codepoint - 0xAC00
return ("HANGUL SYLLABLE %s%s%s"):format(
Hangul_data.leads[floor(syllable_index / Hangul_data.final_count)],
Hangul_data.vowels[floor((syllable_index % Hangul_data.final_count)
/ Hangul_data.trail_count)],
Hangul_data.trails[syllable_index % Hangul_data.trail_count]
)
end },
-- High Surrogates, High Private Use Surrogates, Low Surrogates
{ 0xD800, 0xDFFF, "<surrogate-%04X>" },
{ 0xE000, 0xF8FF, "<private-use-%04X>" }, -- Private Use
-- CJK Compatibility Ideographs
{ 0xF900, 0xFA6D, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xFA70, 0xFAD9, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0x17000, 0x187F7, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph
{ 0x18800, 0x18AFF, function (codepoint)
return ("TANGUT COMPONENT-%03d"):format(codepoint - 0x187FF)
end },
{ 0x18D00, 0x18D08, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph Supplement
{ 0x1B170, 0x1B2FB, "NUSHU CHARACTER-%04X" }, -- Nushu
{ 0x20000, 0x2A6DF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension B
{ 0x2A700, 0x2B739, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension C
{ 0x2B740, 0x2B81D, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension D
{ 0x2B820, 0x2CEA1, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension E
{ 0x2CEB0, 0x2EBE0, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension F
-- CJK Compatibility Ideographs Supplement (Supplementary Ideographic Plane)
{ 0x2F800, 0x2FA1D, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xE0100, 0xE01EF, function (codepoint) -- Variation Selectors Supplement
return ("VARIATION SELECTOR-%d"):format(codepoint - 0xE0100 + 17)
end},
{ 0x30000, 0x3134A, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension G
{ 0x31350, 0x323AF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension H
{ 0x2EBF0, 0x2EE5D, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension I
{ 0xF0000, 0xFFFFD, "<private-use-%04X>" }, -- Plane 15 Private Use
{ 0x100000, 0x10FFFD, "<private-use-%04X>" } -- Plane 16 Private Use
}
name_hooks.length = #name_hooks
local name_range_cache
local function generate_name(data, codepoint)
if type(data) == "string" then
return data:format(codepoint)
else
return data(codepoint)
end
end
--[[
-- Checks that the code point is a number and in range.
-- Does not check whether code point is an integer.
-- Not used
local function check_codepoint(funcName, argIdx, val)
require 'libraryUtil'.checkType(funcName, argIdx, val, 'number')
if codepoint < 0 or 0x10FFFF < codepoint then
errorf("Codepoint %04X out of range", codepoint)
end
end
--]]
-- https://www.unicode.org/versions/Unicode11.0.0/ch04.pdf, section 4.8
function p.lookup_name(codepoint)
-- U+FDD0-U+FDEF and all code points ending in FFFE or FFFF are Unassigned
-- (Cn) and specifically noncharacters:
-- https://www.unicode.org/faq/private_use.html#nonchar4
if 0xFDD0 <= codepoint and (codepoint <= 0xFDEF
or floor(codepoint % 0x10000) >= 0xFFFE) then
return ("<noncharacter-%04X>"):format(codepoint)
end
if name_range_cache -- Check if previously used "name hook" applies to this code point.
and codepoint >= name_range_cache[1]
and codepoint <= name_range_cache[2] then
return generate_name(name_range_cache[3], codepoint)
end
local range = binary_range_search(codepoint, name_hooks)
if range then
name_range_cache = range
return generate_name(range[3], codepoint)
end
local data = loader[('names/%03X'):format(codepoint / 0x1000)]
if data and data[codepoint] then
return data[codepoint]
-- Unassigned (Cn) consists of noncharacters and reserved characters.
-- The character has been established not to be a noncharacter,
-- and if it were assigned, its name would already been retrieved,
-- so it must be reserved.
else
return ("<reserved-%04X>"):format(codepoint)
end
end
--[[
-- No image data modules on Wikipedia yet.
function p.lookup_image(codepoint)
local data = loader[('images/%03X'):format(codepoint / 0x1000)]
if data then
return data[codepoint]
end
end
--]]
local planes = {
[ 0] = "Basic Multilingual Plane";
[ 1] = "Supplementary Multilingual Plane";
[ 2] = "Supplementary Ideographic Plane";
[ 3] = "Tertiary Ideographic Plane";
[14] = "Supplementary Special-purpose Plane";
[15] = "Supplementary Private Use Area-A";
[16] = "Supplementary Private Use Area-B";
}
-- Load [[Module:Unicode data/blocks]] if needed and assign it to this variable.
local blocks
local function block_iter(blocks, i)
i = i + 1
local data = blocks[i]
if data then
-- Unpack doesn't work on tables loaded with mw.loadData.
return i, data[1], data[2], data[3]
end
end
-- An ipairs-type iterator generator for the list of blocks.
function p.enum_blocks()
local blocks = loader.blocks
return block_iter, blocks, 0
end
function p.lookup_plane(codepoint)
local i = floor(codepoint / 0x10000)
return planes[i] or ("Plane %u"):format(i)
end
function p.lookup_block(codepoint)
local blocks = loader.blocks
local range = binary_range_search(codepoint, blocks)
if range then
return range[3]
else
return "No Block"
end
end
function p.get_block_info(name)
for i, block in ipairs(loader.blocks) do
if block[3] == name then
return block
end
end
end
function p.is_valid_pagename(pagename)
local has_nonws = false
for cp in mw.ustring.gcodepoint(pagename) do
if (cp == 0x0023) -- #
or (cp == 0x005B) -- [
or (cp == 0x005D) -- ]
or (cp == 0x007B) -- {
or (cp == 0x007C) -- |
or (cp == 0x007D) -- }
or (cp == 0x180E) -- MONGOLIAN VOWEL SEPARATOR
or ((cp >= 0x2000) and (cp <= 0x200A)) -- spaces in General Punctuation block
or (cp == 0xFFFD) -- REPLACEMENT CHARACTER
then
return false
end
local printable, result = p.is_printable(cp)
if not printable then
return false
end
if result ~= "space-separator" then
has_nonws = true
end
end
return has_nonws
end
local function manual_unpack(what, from)
if what[from + 1] == nil then
return what[from]
end
local result = {}
from = from or 1
for i, item in ipairs(what) do
if i >= from then
table.insert(result, item)
end
end
return unpack(result)
end
local function compare_ranges(range1, range2)
return range1[1] < range2[1]
end
-- Creates a function to look up data in a module that contains "singles" (a
-- code point-to-data map) and "ranges" (an array containing arrays that contain
-- the low and high code points of a range and the data associated with that
-- range).
-- "loader" loads and returns the "singles" and "ranges" tables.
-- "match_func" is passed the code point and either the data or the "dots", and
-- generates the final result of the function.
-- The varargs ("dots") describes the default data to be returned if there wasn't
-- a match.
-- In case the function is used more than once, "cache" saves ranges that have
-- already been found to match, or a range whose data is the default if there
-- was no match.
local function memo_lookup(data_module_subpage, match_func, ...)
local dots = { ... }
local cache = {}
local singles, ranges
return function (codepoint)
if not singles then
local data_module = loader[data_module_subpage]
singles, ranges = data_module.singles, data_module.ranges
end
if singles[codepoint] then
return match_func(codepoint, singles[codepoint])
end
local range = binary_range_search(codepoint, cache)
if range then
return match_func(codepoint, manual_unpack(range, 3))
end
local range, index = binary_range_search(codepoint, ranges)
if range then
table.insert(cache, range)
table.sort(cache, compare_ranges)
return match_func(codepoint, manual_unpack(range, 3))
end
if ranges[index] then
local dots_range
if codepoint > ranges[index][2] then
dots_range = {
ranges[index][2] + 1,
ranges[index + 1] and ranges[index + 1][1] - 1 or 0x10FFFF,
unpack(dots)
}
else -- codepoint < range[index][1]
dots_range = {
ranges[index - 1] and ranges[index - 1][2] + 1 or 0,
ranges[index][1] - 1,
unpack(dots)
}
end
table.sort(cache, compare_ranges)
end
return match_func(codepoint)
end
end
-- Get a code point's combining class value in [[Module:Unicode data/combining]],
-- and return whether this value is not zero. Zero is assigned as the default
-- if the combining class value is not found in this data module.
-- That is, return true if character is combining, or false if it is not.
-- See https://www.unicode.org/reports/tr44/#Canonical_Combining_Class_Values for
-- more information.
p.is_combining = memo_lookup(
"combining",
function (codepoint, combining_class)
return combining_class and combining_class ~= 0 or false
end,
0)
function p.add_dotted_circle(str)
return (mw.ustring.gsub(str, ".",
function(char)
if p.is_combining(mw.ustring.codepoint(char)) then
return '◌' .. char
end
end))
end
local lookup_control = memo_lookup(
"control",
function (codepoint, ccc)
return ccc or "assigned"
end,
"assigned")
p.lookup_control = lookup_control
function p.is_assigned(codepoint)
return lookup_control(codepoint) ~= "unassigned"
end
function p.is_printable(codepoint)
local result = lookup_control(codepoint)
return (result == "assigned") or (result == "space-separator"), result
end
function p.is_whitespace(codepoint)
local result = lookup_control(codepoint)
return (result == "space-separator"), result
end
p.lookup_category = memo_lookup(
"category",
function (codepoint, category)
return category
end,
"Cn")
local lookup_script = memo_lookup(
"scripts",
function (codepoint, script_code)
return script_code or 'Zzzz'
end,
"Zzzz")
p.lookup_script = lookup_script
function p.get_best_script(str)
-- Check type of argument, because mw.text.decode coerces numbers to strings!
require "libraryUtil".checkType("get_best_script", 1, str, "string")
-- Convert HTML character references (including named character references,
-- or character entities) to characters.
str = mw.text.decode(str, true)
local scripts = {}
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
-- Ignore "Inherited", "Undetermined", or "Uncoded" scripts.
if not (script == "Zyyy" or script == "Zinh" or script == "Zzzz") then
scripts[script] = true
end
end
-- If scripts does not contain two or more keys,
-- return first and only key (script code) in table.
if not next(scripts, next(scripts)) then
return next(scripts)
end -- else return majority script, or else "Zzzz"?
end
function p.is_Latin(str)
require "libraryUtil".checkType("get_best_script", 1, str, "string")
str = mw.text.decode(str, true)
-- Search for the leading bytes that introduce the UTF-8 encoding of the
-- code points U+0340-U+10FFFF. If they are not found and there is at least
-- one Latin-script character, the string counts as Latin, because the rest
-- of the characters can only be Zyyy, Zinh, and Zzzz.
-- The only scripts found below U+0370 (the first code point of the Greek
-- and Coptic block) are Latn, Zyyy, Zinh, and Zzzz.
-- See the codepage in the [[UTF-8]] article.
if not str:find "[\205-\244]" then
for codepoint in mw.ustring.gcodepoint(str) do
if lookup_script(codepoint) == "Latn" then
return true
end
end
end
local Latn = false
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
if script == "Latn" then
Latn = true
elseif not (script == "Zyyy" or script == "Zinh"
or script == "Zzzz") then
return false
end
end
return Latn
end
-- Checks that a string contains only characters belonging to right-to-left
-- scripts, or characters of ignorable scripts.
function p.is_rtl(str)
require "libraryUtil".checkType("get_best_script", 1, str, "string")
str = mw.text.decode(str, true)
-- Search for the leading bytes that introduce the UTF-8 encoding of the
-- code points U+0580-U+10FFFF. If they are not found, the string can only
-- have characters from a left-to-right script, because the first code point
-- in a right-to-left script is U+0591, in the Hebrew block.
if not str:find "[\214-\244]" then
return false
end
local result = false
local rtl = loader.scripts.rtl
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
if rtl[script] then
result = true
elseif not (script == "Zyyy" or script == "Zinh"
or script == "Zzzz") then
return false
end
end
return result
end
--[[--------------------------< I S _ R T L _ F R A M E >------------------------------------------------------
external entry from an {{#invoke:}} to determine if a string of text is rtl. Strips html and html-like tags so
that those tags don't corrupt the is-rtl-is-not-rtl determination; this added for the cases where the rtl text
has <br /> tags.
]]
function p.is_rtl_frame (frame)
local str = frame.args[1]; -- get the string from the {{#invoke:}} frame
str = str:gsub ('%b<>', ''); -- strip any html and html-like tags
return p.is_rtl (str); -- return if whatever remains rtl; false else
end
local function get_codepoint(args, arg)
local codepoint_string = args[arg]
or errorf(2, "Parameter %s is required", tostring(arg))
local codepoint = tonumber(codepoint_string, 16)
or errorf(2, "Parameter %s is not a code point in hexadecimal base",
tostring(arg))
if not (0 <= codepoint and codepoint <= 0x10FFFF) then
errorf(2, "code point in parameter %s out of range", tostring(arg))
end
return codepoint
end
local function get_func(args, arg, prefix)
local suffix = args[arg]
or errorf(2, "Parameter %s is required", tostring(arg))
suffix = mw.text.trim(suffix)
local func_name = prefix .. suffix
local func = p[func_name]
or errorf(2, "There is no function '%s'", func_name)
return func
end
-- This function allows any of the "lookup" functions to be invoked. The first
-- parameter is the word after "lookup_"; the second parameter is the code point
-- in hexadecimal base.
function p.lookup(frame)
local func = get_func(frame.args, 1, "lookup_")
local codepoint = get_codepoint(frame.args, 2)
local result = func(codepoint)
if func == p.lookup_name then
-- Prevent code point labels such as <control-0000> from being
-- interpreted as HTML tags.
result = result:gsub("<", "<")
end
return result
end
function p.is(frame)
local func = get_func(frame.args, 1, "is_")
-- is_Latin and is_valid_pagename take strings.
if func == p.is_Latin or func == p.is_valid_pagename or func == p.is_rtl then
return (func(frame.args[2]))
else -- The rest take code points.
local codepoint = get_codepoint(frame.args, 2)
return (func(codepoint)) -- Adjust to one result.
end
end
return p
898b5f0689e2646f633acbbd08143920c87abef2
Module:Lang/data
828
151
403
402
2023-10-17T20:36:08Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Lang/data]]
Scribunto
text/plain
local lang_obj = mw.language.getContentLanguage();
local this_wiki_lang_tag = lang_obj.code; -- get this wiki's language tag
--[[--------------------------< L A N G _ N A M E _ T A B L E >------------------------------------------------
primary table of tables that decode:
lang -> language tags and names
script -> ISO 15924 script tags
region -> ISO 3166 region tags
variant -> iana registered variant tags
suppressed -> map of scripts tags and their associated language tags
all of these data come from separate modules that are derived from the IANA language-subtag-registry file
key_to_lower() avoids the metatable trap and sets all keys in the subtables to lowercase. Many language codes
have multiple associated names; Module:lang is only concerned with the first name so key_to_lower() only fetches
the first name.
]]
local function key_to_lower (module, src_type)
local out = {};
local source = (('var_sup' == src_type) and require (module)) or mw.loadData (module); -- fetch data from this module; require() avoids metatable trap for variant data
if 'var_sup' == src_type then
for k, v in pairs (source) do
out[k:lower()] = v; -- for variant and suppressed everything is needed
end
elseif 'lang' == src_type and source.active then -- for ~/iana_languages (active)
for k, v in pairs (source.active) do
out[k:lower()] = v[1]; -- ignore multiple names; take first name only
end
elseif 'lang_dep' == src_type and source.deprecated then -- for ~/iana_languages (deprecated)
for k, v in pairs (source.deprecated) do
out[k:lower()] = v[1]; -- ignore multiple names; take first name only
end
else -- here for all other sources
for k, v in pairs (source) do
out[k:lower()] = v[1]; -- ignore multiple names; take first name only
end
end
return out;
end
local lang_name_table_t = {
lang = key_to_lower ('Module:Language/data/iana languages', 'lang'),
lang_dep = key_to_lower ('Module:Language/data/iana languages', 'lang_dep'),
script = key_to_lower ('Module:Language/data/iana scripts'), -- script keys are capitalized; set to lower
region = key_to_lower ('Module:Language/data/iana regions'), -- region keys are uppercase; set to lower
variant = key_to_lower ('Module:Language/data/iana variants', 'var_sup'),
suppressed = key_to_lower ('Module:Language/data/iana suppressed scripts', 'var_sup'), -- script keys are capitalized; set to lower
}
--[[--------------------------< I 1 8 N M E D I A W I K I O V E R R I D E >--------------------------------
For internationalization; not used at en.wiki
The language names taken from the IANA language-subtag-registry file are given in English. That may not be ideal.
Translating ~8,000 language names is also not ideal. MediaWiki maintains (much) shorter lists of language names
in most languages for which there is a Wikipedia edition. When desired, Module:Lang can use the MediaWiki
language list for the local language.
Caveat lector: the list of MediaWiki language names for your language may not be complete or may not exist at all.
When incomplete, MediaWiki's list will 'fall back' to another language (typically English). When that happens
add an appropriate entry to the override table below.
Caveat lector: the list of MediaWiki language names for your language may not be correct. At en.wiki, the
MediaWiki language names do not agree with the IANA language names for these ISO 639-1 tags. Often it is simply
spelling differences:
bh: IANA: Bihari languages MW: Bhojpuri – the ISO 639-3 tag for Bhojpuri is bho
bn: IANA: Bengali MW: Bangla – Bengali is the exonym, Bangla is the endonym
dv: IANA: Dhivehi MW: Divehi
el: IANA: Modern Greek MW: Greek
ht: IANA: Haitian MW: Haitian Creole
ky: IANA: Kirghiz MW: Kyrgyz
li: IANA: Limburgan MW: Limburgish
or: IANA: Oriya MW: Odia
os: IANA: Ossetian MW: Ossetic
"pa: IANA: Panjabi MW: Punjabi
"ps: IANA: Pushto MW: Pashto
"to: IANA: Tonga MW: Tongan
"ug: IANA: Uighur MW: Uyghur
use the override table to override language names that are incorrect for your project
To see the list of names that MediaWiki has for your language, enter this in the Debug colsole:
=mw.dumpObject (mw.language.fetchLanguageNames ('<tag>', 'all'))
(replacing <tag> with the language tag for your language)
Use of the MediaWiki language names lists is enabled when media_wiki_override_enable is set to boolean true.
]]
local media_wiki_override_enable = false; -- set to true to override IANA names with MediaWiki names; always false at en.wiki
-- caveat lector: the list of MediaWiki language names for your language may not be complete or may not exist at all
if true == media_wiki_override_enable then
local mw_languages_by_tag_t = mw.language.fetchLanguageNames (this_wiki_lang_tag, 'all'); -- get a table of language tag/name pairs known to MediaWiki
for tag, name in pairs (mw_languages_by_tag_t) do -- loop through each tag/name pair in the MediaWiki list
if lang_name_table_t.lang[tag] then -- if the tag is in the main list
lang_name_table_t.lang[tag] = name; -- overwrite exisiting name with the name from MediaWiki
end
end
end
--[[--------------------------< O V E R R I D E >--------------------------------------------------------------
Language codes and names in this table override the BCP47 names in lang_name_table.
indexes in this table shall always be lower case
]]
local override = {
------------------------------< I S O _ 6 3 9 - 1 >------------------------------------------------------------
["ab"] = "Abkhaz", -- to match en.wiki article name
["ca-valencia"] = "Valencian",
["cu"] = "Church Slavonic", -- 2nd IANA name;
["de-at"] = "Austrian German", -- these code-region and code-variant tags to match en.wiki article names
["de-ch"] = "Swiss Standard German",
["en-au"] = "Australian English",
["en-ca"] = "Canadian English",
["en-emodeng"] = "Early Modern English",
["en-gb"] = "British English",
["en-ie"] = "Irish English",
["en-in"] = "Indian English",
["en-nz"] = "New Zealand English",
["en-us"] = "American English",
["en-za"] = "South African English",
["fy"] = "West Frisian", -- Western Frisian
["mo"] = "Moldovan", -- Moldavian (deprecated code); to match en.wiki article title
["nl-be"] = "Flemish", -- match MediaWiki
["oc-provenc"] = "Provençal",
["ps"] = "Pashto", -- Pushto
["pt-br"] = "Brazilian Portuguese", -- match MediaWiki
["tw-asante"] = "Asante Twi",
["ug"] = "Uyghur", -- 2nd IANA name; to match en.wiki article name
-- these ISO 639-1 language-name overrides imported from Module:Language/data/wp_languages
--<begin do-not-edit except to comment out>--
["av"] = "Avar", -- Avaric
["bo"] = "Standard Tibetan", -- Tibetan
["el"] = "Greek", -- Modern Greek
-- ["en-SA"] = "South African English", -- English; no; SA is not South Africa it Saudi Arabia; ZA is South Africa
["ff"] = "Fula", -- Fulah
["ht"] = "Haitian Creole", -- Haitian
["hz"] = "Otjiherero", -- Herero
["ii"] = "Yi", -- Sichuan Yi
["ki"] = "Gikuyu", -- Kikuyu
["kl"] = "Greenlandic", -- Kalaallisut
["ky"] = "Kyrgyz", -- Kirghiz
["lg"] = "Luganda", -- Ganda
["li"] = "Limburgish", -- Limburgan
["mi"] = "Māori", -- Maori
["na"] = "Nauruan", -- Nauru
["nb"] = "Bokmål", -- Norwegian Bokmål
["nd"] = "Northern Ndebele", -- North Ndebele
["nn"] = "Nynorsk", -- Norwegian Nynorsk
["nr"] = "Southern Ndebele", -- South Ndebele
["ny"] = "Chichewa", -- Nyanja
["oj"] = "Ojibwe", -- Ojibwa
["or"] = "Odia", -- Oriya
["pa"] = "Punjabi", -- Panjabi
["rn"] = "Kirundi", -- Rundi
["sl"] = "Slovene", -- Slovenian
["ss"] = "Swazi", -- Swati
["st"] = "Sotho", -- Southern Sotho
["to"] = "Tongan", -- Tonga
--<end do-not-edit except to comment out>--
------------------------------< I S O _ 6 3 9 - 2, - 3, - 5 >----------------------------------------------
["alv"] = "Atlantic–Congo languages", -- to match en.wiki article title (endash)
["arc"] = "Imperial Aramaic (700-300 BCE)", -- Official Aramaic (700-300 BCE), Imperial Aramaic (700-300 BCE); to match en.wiki article title uses ISO639-2 'preferred' name
["art"] = "constructed", -- to match en.wiki article; lowercase for category name
["bhd"] = "Bhadarwahi", -- Bhadrawahi; to match en.wiki article title
["bla"] = "Blackfoot", -- Siksika; to match en.wiki article title
["bua"] = "Buryat", -- Buriat; this is a macro language; these four use wp preferred transliteration;
["bxm"] = "Mongolian Buryat", -- Mongolia Buriat; these three all redirect to Buryat
["bxr"] = "Russian Buryat", -- Russia Buriat;
["bxu"] = "Chinese Buryat", -- China Buriat;
["byr"] = "Yipma", -- Baruya, Yipma
["egy"] = "Ancient Egyptian", -- Egyptian (Ancient); distinguish from contemporary arz: Egyptian Arabic
["ems"] = "Alutiiq", -- Pacific Gulf Yupik; to match en.wiki article title
["esx"] = "Eskimo–Aleut languages", -- to match en.wiki article title (endash)
["frr"] = "North Frisian", -- Northern Frisian
["frs"] = "East Frisian Low Saxon", -- Eastern Frisian
["gsw-fr"] = "Alsatian", -- match MediaWiki
["haa"] = "Hän", -- Han; to match en.wiki article title
["hmx"] = "Hmong–Mien languages", -- to match en.wiki article title (endash)
["ilo"] = "Ilocano", -- Iloko; to match en.wiki article title
["jam"] = "Jamaican Patois", -- Jamaican Creole English
["lij-mc"] = "Monégasque", -- Ligurian as spoken in Monaco
["luo"] = "Dholuo", -- IANA (primary) /ISO 639-3: Luo (Kenya and Tanzania); IANA (secondary): Dholuo
["mhr"] = "Meadow Mari", -- Eastern Mari
["mid"] = "Modern Mandaic", -- Mandaic
['mis'] = "uncoded", -- Uncoded languages; capitalization; special scope, not collective scope;
["mkh"] = "Mon–Khmer languages", -- to match en.wiki article title (endash)
["mla"] = "Tamambo", -- Malo
['mte'] = "Mono-Alu", -- Mono (Solomon Islands)
['mul'] = "multiple", -- Multiple languages; capitalization; special scope, not collective scope;
["nan-tw"] = "Taiwanese Hokkien", -- make room for IANA / 639-3 nan Min Nan Chinese; match en.wiki article title
["new"] = "Newar", -- Newari, Nepal Bhasa; to match en,wiki article title
["ngf"] = "Trans–New Guinea languages", -- to match en.wiki article title (endash)
["nic"] = "Niger–Congo languages", -- Niger-Kordofanian languages; to match en,wiki article title
["nrf"] = "Norman", -- not quite a collective - IANA name: Jèrriais + Guernésiais; categorizes to Norman-language text
["nrf-gg"] = "Guernésiais", -- match MediaWiki
["nrf-je"] = "Jèrriais", -- match MediaWiki
["nzi"] = "Nzema", -- Nzima; to match en.wiki article title
["oma"] = "Omaha–Ponca", -- to match en.wiki article title (endash)
["orv"] = "Old East Slavic", -- Old Russian
["pfl"] = "Palatine German", -- Pfaelzisch; to match en.wiki article
["pie"] = "Piro Pueblo", -- Piro; to match en.wiki article
["pms"] = "Piedmontese", -- Piemontese; to match en.wiki article title
["pnb"] = "Punjabi (Western)", -- Western Panjabi; dab added to override import from ~/wp languages and distinguish pnb from pa in reverse look up tag_from_name()
["rop"] = "Australian Kriol", -- Kriol; en.wiki article is a dab; point to correct en.wiki article
["sdo"] = "Bukar–Sadong", -- Bukar-Sadung Bidayuh; to match en.wiki article title
["stq"] = "Saterland Frisian", -- Saterfriesisch
["und"] = "undetermined", -- capitalization to match existing category
["wrg"] = "Warrongo", -- Warungu
["xal-ru"] = "Kalmyk", -- to match en.wiki article title
["xgf"] = "Tongva", -- ISO 639-3 is Gabrielino-Fernandeño
["yuf"] = "Havasupai–Hualapai", -- Havasupai-Walapai-Yavapai; to match en.wiki article title
["zxx"] = "no linguistic content", -- capitalization
-- these ISO 639-2, -3 language-name overrides imported from Module:Language/data/wp_languages
--<begin do-not-edit except to comment out>--
["ace"] = "Acehnese", -- Achinese
["aec"] = "Sa'idi Arabic", -- Saidi Arabic
["akl"] = "Aklan", -- Aklanon
["alt"] = "Altay", -- Southern Altai
["apm"] = "Mescalero-Chiricahua", -- Mescalero-Chiricahua Apache
["bal"] = "Balochi", -- Baluchi
-- ["bcl"] = "Central Bicolano", -- Central Bikol
["bin"] = "Edo", -- Bini
["bpy"] = "Bishnupriya Manipuri", -- Bishnupriya
["chg"] = "Chagatay", -- Chagatai
["ckb"] = "Sorani Kurdish", -- Central Kurdish
["cnu"] = "Shenwa", -- Chenoua
["coc"] = "Cocopah", -- Cocopa
["diq"] = "Zazaki", -- Dimli
["fit"] = "Meänkieli", -- Tornedalen Finnish
["fkv"] = "Kven", -- Kven Finnish
["frk"] = "Old Frankish", -- Frankish
["gez"] = "Ge'ez", -- Geez
["gju"] = "Gujari", -- Gujari
["gsw"] = "Alemannic German", -- Swiss German
["gul"] = "Gullah", -- Sea Island Creole English
["hak"] = "Hakka", -- Hakka Chinese
["hbo"] = "Biblical Hebrew", -- Ancient Hebrew
["hnd"] = "Hindko", -- Southern Hindko
-- ["ikt"] = "Inuvialuk", -- Inuinnaqtun
["kaa"] = "Karakalpak", -- Kara-Kalpak
["khb"] = "Tai Lü", -- Lü
["kmr"] = "Kurmanji Kurdish", -- Northern Kurdish
["kpo"] = "Kposo", -- Ikposo
["krj"] = "Kinaray-a", -- Kinaray-A
["ktz"] = "Juǀ'hoan", -- Juǀʼhoan
["lez"] = "Lezgian", -- Lezghian
["liv"] = "Livonian", -- Liv
["lng"] = "Lombardic", -- Langobardic
["mia"] = "Miami-Illinois", -- Miami
["miq"] = "Miskito", -- Mískito
["mix"] = "Mixtec", -- Mixtepec Mixtec
["mni"] = "Meitei", -- Manipuri
["mrj"] = "Hill Mari", -- Western Mari
["mww"] = "White Hmong", -- Hmong Daw
["nds-nl"] = "Dutch Low Saxon", -- Low German
-- ["new"] = "Nepal Bhasa", -- Newari
["nso"] = "Northern Sotho", -- Pedi
-- ["nwc"] = "Classical Nepal Bhasa", -- Classical Newari, Classical Nepal Bhasa, Old Newari
["ood"] = "O'odham", -- Tohono O'odham
["otk"] = "Old Turkic", -- Old Turkish
["pal"] = "Middle Persian", -- Pahlavi
["pam"] = "Kapampangan", -- Pampanga
["phr"] = "Potwari", -- Pahari-Potwari
["pka"] = "Jain Prakrit", -- Ardhamāgadhī Prākrit
-- ["pnb"] = "Punjabi", -- Western Panjabi
["psu"] = "Shauraseni", -- Sauraseni Prākrit
["rap"] = "Rapa Nui", -- Rapanui
["rar"] = "Cook Islands Māori", -- Rarotongan
["rmu"] = "Scandoromani", -- Tavringer Romani
["rom"] = "Romani", -- Romany
["rup"] = "Aromanian", -- Macedo-Romanian
["ryu"] = "Okinawan", -- Central Okinawan
["sdc"] = "Sassarese", -- Sassarese Sardinian
["sdn"] = "Gallurese", -- Gallurese Sardinian
["shp"] = "Shipibo", -- Shipibo-Conibo
["src"] = "Logudorese", -- Logudorese Sardinian
["sro"] = "Campidanese", -- Campidanese Sardinian
["tkl"] = "Tokelauan", -- Tokelau
["tvl"] = "Tuvaluan", -- Tuvalu
["tyv"] = "Tuvan", -- Tuvinian
["vls"] = "West Flemish", -- Vlaams
["wep"] = "Westphalian", -- Westphalien
["xal"] = "Oirat", -- Kalmyk
["xcl"] = "Old Armenian", -- Classical Armenian
["yua"] = "Yucatec Maya", -- Yucateco
--<end do-not-edit except to comment out>--
------------------------------< P R I V A T E _ U S E _ T A G S >----------------------------------------------
["akk-x-latbabyl"] = "Late Babylonian",
["akk-x-midassyr"] = "Middle Assyrian Akkadian",
["akk-x-midbabyl"] = "Middle Babylonian Akkadian",
["akk-x-neoassyr"] = "Neo-Assyrian Akkadian",
["akk-x-neobabyl"] = "Neo-Babylonian Akkadian",
["akk-x-old"] = "Old Akkadian",
["akk-x-oldassyr"] = "Old Assyrian Akkadian",
["akk-x-oldbabyl"] = "Old Babylonian Akkadian",
["alg-x-proto"] = "Proto-Algonquian", -- alg in IANA is Algonquian languages
["ca-x-old"] = "Old Catalan",
["cel-x-proto"] = "Proto-Celtic", -- cel in IANA is Celtic languages
["egy-x-demotic"] = "Demotic Egyptian",
["egy-x-late"] = "Late Egyptian",
["egy-x-middle"] = "Middle Egyptian",
["egy-x-old"] = "Old Egyptian",
["gem-x-proto"] = "Proto-Germanic", -- gem in IANA is Germanic languages
["gmw-x-ecg"] = "East Central German",
["grc-x-aeolic"] = "Aeolic Greek", -- these grc-x-... codes are preferred alternates to the non-standard catchall code grc-gre
["grc-x-attic"] = "Attic Greek",
["grc-x-biblical"] = "Biblical Greek",
["grc-x-byzant"] = "Byzantine Greek",
["grc-x-classic"] = "Classical Greek",
["grc-x-doric"] = "Doric Greek",
["grc-x-hellen"] = "Hellenistic Greek",
["grc-x-ionic"] = "Ionic Greek",
["grc-x-koine"] = "Koinē Greek",
["grc-x-medieval"] = "Medieval Greek",
["grc-x-patris"] = "Patristic Greek",
["grk-x-proto"] = "Proto-Greek", -- grk in IANA is Greek languages
["iir-x-proto"] = "Proto-Indo-Iranian", -- iir in IANA is Indo-Iranian Languages
["inc-x-mitanni"] = "Mitanni-Aryan", -- inc in IANA is Indic languages
["inc-x-proto"] = "Proto-Indo-Aryan",
["ine-x-proto"] = "Proto-Indo-European",
["ira-x-proto"] = "Proto-Iranian", -- ira in IANA is Iranian languages
["itc-x-proto"] = "Proto-Italic", -- itc in IANA is Italic languages
["ksh-x-colog"] = "Colognian", -- en.wiki article is Colognian; ksh (Kölsch) redirects there
["la-x-medieval"] = "Medieval Latin",
["la-x-new"] = "New Latin",
["lmo-x-milanese"] = "Milanese", -- lmo in IANA is Lombard; Milanese is a dialect
["mis-x-ripuar"] = "Ripuarian", -- replaces improper use of ksh in wp_languages
["prg-x-old"] = "Old Prussian",
["sem-x-ammonite"] = "Ammonite",
["sem-x-aramaic"] = "Aramaic",
["sem-x-canaan"] = "Canaanite languages",
["sem-x-dumaitic"] = "Dumaitic",
["sem-x-egurage"] = "Eastern Gurage",
["sem-x-hatran"] = "Hatran Aramaic",
["sem-x-oldsoara"] = "Old South Arabian",
["sem-x-palmyren"] = "Palmyrene Aramaic",
["sem-x-proto"] = "Proto-Semitic",
["sem-x-taymanit"] = "Taymanitic",
["sla-x-proto"] = "Proto-Slavic", -- sla in IANA is Slavic languages
["yuf-x-hav"] = "Havasupai", -- IANA name for these three is Havasupai-Walapai-Yavapai
["yuf-x-wal"] = "Walapai",
["yuf-x-yav"] = "Yavapai",
["xsc-x-pontic"] = "Pontic Scythian", -- xsc in IANA is Scythian
["xsc-x-saka"] = "Saka",
["xsc-x-sarmat"] = "Sarmatian",
}
--[[--------------------------< A R T I C L E _ L I N K >------------------------------------------------------
for those rare occasions when article titles don't fit with the normal '<language name>-language', this table
maps language code to article title. Use of this table should be avoided and the use of redirects preferred as
that is the long-standing method of handling article names that don't fit with the normal pattern
]]
local article_name = {
['kue'] = "Kuman language (New Guinea)", -- Kuman (Papua New Guinea); to avoid Kuman dab page
["lij"] = "Ligurian (Romance language)", -- Ligurian; see Template_talk:Lang#Ligurian_dab
['mbo'] = "Mbo language (Cameroon)", -- Mbo (Cameroon)
['mnh'] = "Mono language (Congo)", -- Mono (Democratic Republic of Congo); see Template_talk:Lang#Mono_languages
['mnr'] = "Mono language (California)", -- Mono (USA)
['mru'] = "Mono language (Cameroon)", -- Mono (Cameroon)
['qwm'] = "Kuman (Russia)", -- Kuman (Russia); to avoid Kuman dab page
["snq"] = "Sangu language (Gabon)", -- Sangu (Gabon)
["toi"] = "Tonga language (Zambia and Zimbabwe)", -- Tonga (Zambia and Zimbabwe); to avoid Tonga language dab page
["xlg"] = "Ligurian (ancient language)", -- see Template_talk:Lang#Ligurian_dab
["zmw"] = "Mbo language (Congo)", -- Mbo (Democratic Republic of Congo)
}
--[=[-------------------------< R T L _ S C R I P T S >--------------------------------------------------------
ISO 15924 scripts that are written right-to-left. Data in this table taken from [[ISO 15924#List of codes]]
last update to this list: 2017-12-24
]=]
local rtl_scripts = {
'adlm', 'arab', 'aran', 'armi', 'avst', 'cprt', 'egyd', 'egyh', 'hatr', 'hebr',
'hung', 'inds', 'khar', 'lydi', 'mand', 'mani', 'mend', 'merc', 'mero', 'narb',
'nbat', 'nkoo', 'orkh', 'palm', 'phli', 'phlp', 'phlv', 'phnx', 'prti', 'rohg',
'samr', 'sarb', 'sogd', 'sogo', 'syrc', 'syre', 'syrj', 'syrn', 'thaa', 'wole',
};
--[[--------------------------< T R A N S L I T _ T I T L E S >------------------------------------------------
This is a table of tables of transliteration standards and the language codes or language scripts that apply to
those standards. This table is used to create the tool-tip text associated with the transliterated text displayed
by some of the {{lang-??}} templates.
These tables are more-or-less copied directly from {{transl}}. The standard 'NO_STD' is a construct to allow for
the cases when no |std= parameter value is provided.
]]
local translit_title_table = {
['ahl'] = {
['default'] = 'Academy of the Hebrew Language transliteration',
},
['ala'] = {
['default'] = 'American Library Association – Library of Congress transliteration',
},
['ala-lc'] = {
['default'] = 'American Library Association – Library of Congress transliteration',
},
['batr'] = {
['default'] = 'Bikdash Arabic Transliteration Rules',
},
['bgn/pcgn'] = {
['default'] = 'Board on Geographic Names / Permanent Committee on Geographical Names transliteration',
},
['din'] = {
['ar'] = 'DIN 31635 Arabic',
['fa'] = 'DIN 31635 Arabic',
['ku'] = 'DIN 31635 Arabic',
['ps'] = 'DIN 31635 Arabic',
['tg'] = 'DIN 31635 Arabic',
['ug'] = 'DIN 31635 Arabic',
['ur'] = 'DIN 31635 Arabic',
['arab'] = 'DIN 31635 Arabic',
['default'] = 'DIN transliteration',
},
['eae'] = {
['default'] = 'Encyclopaedia Aethiopica transliteration',
},
['hepburn'] = {
['default'] = 'Hepburn transliteration',
},
['hunterian'] = {
['default'] = 'Hunterian transliteration',
},
['iast'] = {
['default'] = 'International Alphabet of Sanskrit transliteration',
},
['iso'] = { -- when a transliteration standard is supplied
['ab'] = 'ISO 9 Cyrillic',
['ba'] = 'ISO 9 Cyrillic',
['be'] = 'ISO 9 Cyrillic',
['bg'] = 'ISO 9 Cyrillic',
['kk'] = 'ISO 9 Cyrillic',
['ky'] = 'ISO 9 Cyrillic',
['mn'] = 'ISO 9 Cyrillic',
['ru'] = 'ISO 9 Cyrillic',
['tg'] = 'ISO 9 Cyrillic',
['uk'] = 'ISO 9 Cyrillic',
['bua'] = 'ISO 9 Cyrillic',
['sah'] = 'ISO 9 Cyrillic',
['tut'] = 'ISO 9 Cyrillic',
['xal'] = 'ISO 9 Cyrillic',
['cyrl'] = 'ISO 9 Cyrillic',
['ar'] = 'ISO 233 Arabic',
['ku'] = 'ISO 233 Arabic',
['ps'] = 'ISO 233 Arabic',
['ug'] = 'ISO 233 Arabic',
['ur'] = 'ISO 233 Arabic',
['arab'] = 'ISO 233 Arabic',
['he'] = 'ISO 259 Hebrew',
['yi'] = 'ISO 259 Hebrew',
['hebr'] = 'ISO 259 Hebrew',
['el'] = 'ISO 843 Greek',
['grc'] = 'ISO 843 Greek',
['ja'] = 'ISO 3602 Japanese',
['hira'] = 'ISO 3602 Japanese',
['hrkt'] = 'ISO 3602 Japanese',
['jpan'] = 'ISO 3602 Japanese',
['kana'] = 'ISO 3602 Japanese',
['zh'] = 'ISO 7098 Chinese',
['chi'] = 'ISO 7098 Chinese',
['pny'] = 'ISO 7098 Chinese',
['zho'] = 'ISO 7098 Chinese',
-- ['han'] = 'ISO 7098 Chinese', -- unicode alias of Hani? doesn't belong here? should be Hani?
['hans'] = 'ISO 7098 Chinese',
['hant'] = 'ISO 7098 Chinese',
['ka'] = 'ISO 9984 Georgian',
['kat'] = 'ISO 9984 Georgian',
['arm'] = 'ISO 9985 Armenian',
['hy'] = 'ISO 9985 Armenian',
['th'] = 'ISO 11940 Thai',
['tha'] = 'ISO 11940 Thai',
['ko'] = 'ISO 11941 Korean',
['kor'] = 'ISO 11941 Korean',
['awa'] = 'ISO 15919 Indic',
['bho'] = 'ISO 15919 Indic',
['bn'] = 'ISO 15919 Indic',
['bra'] = 'ISO 15919 Indic',
['doi'] = 'ISO 15919 Indic',
['dra'] = 'ISO 15919 Indic',
['gon'] = 'ISO 15919 Indic',
['gu'] = 'ISO 15919 Indic',
['hi'] = 'ISO 15919 Indic',
['hno'] = 'ISO 15919 Indic',
['inc'] = 'ISO 15919 Indic',
['kn'] = 'ISO 15919 Indic',
['kok'] = 'ISO 15919 Indic',
['ks'] = 'ISO 15919 Indic',
['mag'] = 'ISO 15919 Indic',
['mai'] = 'ISO 15919 Indic',
['ml'] = 'ISO 15919 Indic',
['mr'] = 'ISO 15919 Indic',
['ne'] = 'ISO 15919 Indic',
['new'] = 'ISO 15919 Indic',
['or'] = 'ISO 15919 Indic',
['pa'] = 'ISO 15919 Indic',
['pnb'] = 'ISO 15919 Indic',
['raj'] = 'ISO 15919 Indic',
['sa'] = 'ISO 15919 Indic',
['sat'] = 'ISO 15919 Indic',
['sd'] = 'ISO 15919 Indic',
['si'] = 'ISO 15919 Indic',
['skr'] = 'ISO 15919 Indic',
['ta'] = 'ISO 15919 Indic',
['tcy'] = 'ISO 15919 Indic',
['te'] = 'ISO 15919 Indic',
['beng'] = 'ISO 15919 Indic',
['brah'] = 'ISO 15919 Indic',
['deva'] = 'ISO 15919 Indic',
['gujr'] = 'ISO 15919 Indic',
['guru'] = 'ISO 15919 Indic',
['knda'] = 'ISO 15919 Indic',
['mlym'] = 'ISO 15919 Indic',
['orya'] = 'ISO 15919 Indic',
['sinh'] = 'ISO 15919 Indic',
['taml'] = 'ISO 15919 Indic',
['telu'] = 'ISO 15919 Indic',
['default'] = 'ISO transliteration',
},
['jyutping'] = {
['default'] = 'Jyutping transliteration',
},
['mlcts'] = {
['default'] = 'Myanmar Language Commission Transcription System',
},
['mr'] = {
['default'] = 'McCune–Reischauer transliteration',
},
['nihon-shiki'] = {
['default'] = 'Nihon-shiki transliteration',
},
['no_std'] = { -- when no transliteration standard is supplied
['akk'] = 'Semitic transliteration',
['sem'] = 'Semitic transliteration',
['phnx'] = 'Semitic transliteration',
['xsux'] = 'Cuneiform transliteration',
},
['pinyin'] = {
['default'] = 'Pinyin transliteration',
},
['rr'] = {
['default'] = 'Revised Romanization of Korean transliteration',
},
['rtgs'] = {
['default'] = 'Royal Thai General System of Transcription',
},
['satts'] = {
['default'] = 'Standard Arabic Technical Transliteration System transliteration',
},
['scientific'] = {
['default'] = 'scientific transliteration',
},
['ukrainian'] = {
['default'] = 'Ukrainian National system of romanization',
},
['ungegn'] = {
['default'] = 'United Nations Group of Experts on Geographical Names transliteration',
},
['wadegile'] = {
['default'] = 'Wade–Giles transliteration',
},
['wehr'] = {
['default'] = 'Hans Wehr transliteration',
},
};
return
{
this_wiki_lang_tag = this_wiki_lang_tag,
this_wiki_lang_dir = lang_obj:getDir(), -- wiki's language direction
article_name = article_name,
lang_name_table = lang_name_table_t,
override = override,
rtl_scripts = rtl_scripts,
special_tags_table = special_tags_table,
translit_title_table = translit_title_table,
};
120387552d6d88bcddb6260de37dcd404c28ccdf
Module:Language/data/iana languages
828
152
405
404
2023-10-17T20:36:08Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Language/data/iana_languages]]
Scribunto
text/plain
-- File-Date: 2023-08-02
local active = {
["aa"] = {"Afar"},
["ab"] = {"Abkhazian"},
["ae"] = {"Avestan"},
["af"] = {"Afrikaans"},
["ak"] = {"Akan"},
["am"] = {"Amharic"},
["an"] = {"Aragonese"},
["ar"] = {"Arabic"},
["as"] = {"Assamese"},
["av"] = {"Avaric"},
["ay"] = {"Aymara"},
["az"] = {"Azerbaijani"},
["ba"] = {"Bashkir"},
["be"] = {"Belarusian"},
["bg"] = {"Bulgarian"},
["bh"] = {"Bihari languages"},
["bi"] = {"Bislama"},
["bm"] = {"Bambara"},
["bn"] = {"Bengali", "Bangla"},
["bo"] = {"Tibetan"},
["br"] = {"Breton"},
["bs"] = {"Bosnian"},
["ca"] = {"Catalan", "Valencian"},
["ce"] = {"Chechen"},
["ch"] = {"Chamorro"},
["co"] = {"Corsican"},
["cr"] = {"Cree"},
["cs"] = {"Czech"},
["cu"] = {"Church Slavic", "Church Slavonic", "Old Bulgarian", "Old Church Slavonic", "Old Slavonic"},
["cv"] = {"Chuvash"},
["cy"] = {"Welsh"},
["da"] = {"Danish"},
["de"] = {"German"},
["dv"] = {"Dhivehi", "Divehi", "Maldivian"},
["dz"] = {"Dzongkha"},
["ee"] = {"Ewe"},
["el"] = {"Modern Greek (1453-)"},
["en"] = {"English"},
["eo"] = {"Esperanto"},
["es"] = {"Spanish", "Castilian"},
["et"] = {"Estonian"},
["eu"] = {"Basque"},
["fa"] = {"Persian"},
["ff"] = {"Fulah"},
["fi"] = {"Finnish"},
["fj"] = {"Fijian"},
["fo"] = {"Faroese"},
["fr"] = {"French"},
["fy"] = {"Western Frisian"},
["ga"] = {"Irish"},
["gd"] = {"Scottish Gaelic", "Gaelic"},
["gl"] = {"Galician"},
["gn"] = {"Guarani"},
["gu"] = {"Gujarati"},
["gv"] = {"Manx"},
["ha"] = {"Hausa"},
["he"] = {"Hebrew"},
["hi"] = {"Hindi"},
["ho"] = {"Hiri Motu"},
["hr"] = {"Croatian"},
["ht"] = {"Haitian", "Haitian Creole"},
["hu"] = {"Hungarian"},
["hy"] = {"Armenian"},
["hz"] = {"Herero"},
["ia"] = {"Interlingua (International Auxiliary Language Association)"},
["id"] = {"Indonesian"},
["ie"] = {"Interlingue", "Occidental"},
["ig"] = {"Igbo"},
["ii"] = {"Sichuan Yi", "Nuosu"},
["ik"] = {"Inupiaq"},
["io"] = {"Ido"},
["is"] = {"Icelandic"},
["it"] = {"Italian"},
["iu"] = {"Inuktitut"},
["ja"] = {"Japanese"},
["jv"] = {"Javanese"},
["ka"] = {"Georgian"},
["kg"] = {"Kongo"},
["ki"] = {"Kikuyu", "Gikuyu"},
["kj"] = {"Kuanyama", "Kwanyama"},
["kk"] = {"Kazakh"},
["kl"] = {"Kalaallisut", "Greenlandic"},
["km"] = {"Khmer", "Central Khmer"},
["kn"] = {"Kannada"},
["ko"] = {"Korean"},
["kr"] = {"Kanuri"},
["ks"] = {"Kashmiri"},
["ku"] = {"Kurdish"},
["kv"] = {"Komi"},
["kw"] = {"Cornish"},
["ky"] = {"Kirghiz", "Kyrgyz"},
["la"] = {"Latin"},
["lb"] = {"Luxembourgish", "Letzeburgesch"},
["lg"] = {"Ganda", "Luganda"},
["li"] = {"Limburgan", "Limburger", "Limburgish"},
["ln"] = {"Lingala"},
["lo"] = {"Lao"},
["lt"] = {"Lithuanian"},
["lu"] = {"Luba-Katanga"},
["lv"] = {"Latvian"},
["mg"] = {"Malagasy"},
["mh"] = {"Marshallese"},
["mi"] = {"Maori"},
["mk"] = {"Macedonian"},
["ml"] = {"Malayalam"},
["mn"] = {"Mongolian"},
["mr"] = {"Marathi"},
["ms"] = {"Malay (macrolanguage)"},
["mt"] = {"Maltese"},
["my"] = {"Burmese"},
["na"] = {"Nauru"},
["nb"] = {"Norwegian Bokmål"},
["nd"] = {"North Ndebele"},
["ne"] = {"Nepali (macrolanguage)"},
["ng"] = {"Ndonga"},
["nl"] = {"Dutch", "Flemish"},
["nn"] = {"Norwegian Nynorsk"},
["no"] = {"Norwegian"},
["nr"] = {"South Ndebele"},
["nv"] = {"Navajo", "Navaho"},
["ny"] = {"Nyanja", "Chewa", "Chichewa"},
["oc"] = {"Occitan (post 1500)"},
["oj"] = {"Ojibwa"},
["om"] = {"Oromo"},
["or"] = {"Oriya (macrolanguage)", "Odia (macrolanguage)"},
["os"] = {"Ossetian", "Ossetic"},
["pa"] = {"Panjabi", "Punjabi"},
["pi"] = {"Pali"},
["pl"] = {"Polish"},
["ps"] = {"Pushto", "Pashto"},
["pt"] = {"Portuguese"},
["qu"] = {"Quechua"},
["rm"] = {"Romansh"},
["rn"] = {"Rundi"},
["ro"] = {"Romanian", "Moldavian", "Moldovan"},
["ru"] = {"Russian"},
["rw"] = {"Kinyarwanda"},
["sa"] = {"Sanskrit"},
["sc"] = {"Sardinian"},
["sd"] = {"Sindhi"},
["se"] = {"Northern Sami"},
["sg"] = {"Sango"},
["sh"] = {"Serbo-Croatian"},
["si"] = {"Sinhala", "Sinhalese"},
["sk"] = {"Slovak"},
["sl"] = {"Slovenian"},
["sm"] = {"Samoan"},
["sn"] = {"Shona"},
["so"] = {"Somali"},
["sq"] = {"Albanian"},
["sr"] = {"Serbian"},
["ss"] = {"Swati"},
["st"] = {"Southern Sotho"},
["su"] = {"Sundanese"},
["sv"] = {"Swedish"},
["sw"] = {"Swahili (macrolanguage)"},
["ta"] = {"Tamil"},
["te"] = {"Telugu"},
["tg"] = {"Tajik"},
["th"] = {"Thai"},
["ti"] = {"Tigrinya"},
["tk"] = {"Turkmen"},
["tl"] = {"Tagalog"},
["tn"] = {"Tswana"},
["to"] = {"Tonga (Tonga Islands)"},
["tr"] = {"Turkish"},
["ts"] = {"Tsonga"},
["tt"] = {"Tatar"},
["tw"] = {"Twi"},
["ty"] = {"Tahitian"},
["ug"] = {"Uighur", "Uyghur"},
["uk"] = {"Ukrainian"},
["ur"] = {"Urdu"},
["uz"] = {"Uzbek"},
["ve"] = {"Venda"},
["vi"] = {"Vietnamese"},
["vo"] = {"Volapük"},
["wa"] = {"Walloon"},
["wo"] = {"Wolof"},
["xh"] = {"Xhosa"},
["yi"] = {"Yiddish"},
["yo"] = {"Yoruba"},
["za"] = {"Zhuang", "Chuang"},
["zh"] = {"Chinese"},
["zu"] = {"Zulu"},
["aaa"] = {"Ghotuo"},
["aab"] = {"Alumu-Tesu"},
["aac"] = {"Ari"},
["aad"] = {"Amal"},
["aae"] = {"Arbëreshë Albanian"},
["aaf"] = {"Aranadan"},
["aag"] = {"Ambrak"},
["aah"] = {"Abu' Arapesh"},
["aai"] = {"Arifama-Miniafia"},
["aak"] = {"Ankave"},
["aal"] = {"Afade"},
["aan"] = {"Anambé"},
["aao"] = {"Algerian Saharan Arabic"},
["aap"] = {"Pará Arára"},
["aaq"] = {"Eastern Abnaki"},
["aas"] = {"Aasáx"},
["aat"] = {"Arvanitika Albanian"},
["aau"] = {"Abau"},
["aav"] = {"Austro-Asiatic languages"},
["aaw"] = {"Solong"},
["aax"] = {"Mandobo Atas"},
["aaz"] = {"Amarasi"},
["aba"] = {"Abé"},
["abb"] = {"Bankon"},
["abc"] = {"Ambala Ayta"},
["abd"] = {"Manide"},
["abe"] = {"Western Abnaki"},
["abf"] = {"Abai Sungai"},
["abg"] = {"Abaga"},
["abh"] = {"Tajiki Arabic"},
["abi"] = {"Abidji"},
["abj"] = {"Aka-Bea"},
["abl"] = {"Lampung Nyo"},
["abm"] = {"Abanyom"},
["abn"] = {"Abua"},
["abo"] = {"Abon"},
["abp"] = {"Abellen Ayta"},
["abq"] = {"Abaza"},
["abr"] = {"Abron"},
["abs"] = {"Ambonese Malay"},
["abt"] = {"Ambulas"},
["abu"] = {"Abure"},
["abv"] = {"Baharna Arabic"},
["abw"] = {"Pal"},
["abx"] = {"Inabaknon"},
["aby"] = {"Aneme Wake"},
["abz"] = {"Abui"},
["aca"] = {"Achagua"},
["acb"] = {"Áncá"},
["acd"] = {"Gikyode"},
["ace"] = {"Achinese"},
["acf"] = {"Saint Lucian Creole French"},
["ach"] = {"Acoli"},
["aci"] = {"Aka-Cari"},
["ack"] = {"Aka-Kora"},
["acl"] = {"Akar-Bale"},
["acm"] = {"Mesopotamian Arabic"},
["acn"] = {"Achang"},
["acp"] = {"Eastern Acipa"},
["acq"] = {"Ta'izzi-Adeni Arabic"},
["acr"] = {"Achi"},
["acs"] = {"Acroá"},
["act"] = {"Achterhoeks"},
["acu"] = {"Achuar-Shiwiar"},
["acv"] = {"Achumawi"},
["acw"] = {"Hijazi Arabic"},
["acx"] = {"Omani Arabic"},
["acy"] = {"Cypriot Arabic"},
["acz"] = {"Acheron"},
["ada"] = {"Adangme"},
["adb"] = {"Atauran"},
["add"] = {"Lidzonka", "Dzodinka"},
["ade"] = {"Adele"},
["adf"] = {"Dhofari Arabic"},
["adg"] = {"Andegerebinha"},
["adh"] = {"Adhola"},
["adi"] = {"Adi"},
["adj"] = {"Adioukrou"},
["adl"] = {"Galo"},
["adn"] = {"Adang"},
["ado"] = {"Abu"},
["adq"] = {"Adangbe"},
["adr"] = {"Adonara"},
["ads"] = {"Adamorobe Sign Language"},
["adt"] = {"Adnyamathanha"},
["adu"] = {"Aduge"},
["adw"] = {"Amundava"},
["adx"] = {"Amdo Tibetan"},
["ady"] = {"Adyghe", "Adygei"},
["adz"] = {"Adzera"},
["aea"] = {"Areba"},
["aeb"] = {"Tunisian Arabic"},
["aec"] = {"Saidi Arabic"},
["aed"] = {"Argentine Sign Language"},
["aee"] = {"Northeast Pashai", "Northeast Pashayi"},
["aek"] = {"Haeke"},
["ael"] = {"Ambele"},
["aem"] = {"Arem"},
["aen"] = {"Armenian Sign Language"},
["aeq"] = {"Aer"},
["aer"] = {"Eastern Arrernte"},
["aes"] = {"Alsea"},
["aeu"] = {"Akeu"},
["aew"] = {"Ambakich"},
["aey"] = {"Amele"},
["aez"] = {"Aeka"},
["afa"] = {"Afro-Asiatic languages"},
["afb"] = {"Gulf Arabic"},
["afd"] = {"Andai"},
["afe"] = {"Putukwam"},
["afg"] = {"Afghan Sign Language"},
["afh"] = {"Afrihili"},
["afi"] = {"Akrukay", "Chini"},
["afk"] = {"Nanubae"},
["afn"] = {"Defaka"},
["afo"] = {"Eloyi"},
["afp"] = {"Tapei"},
["afs"] = {"Afro-Seminole Creole"},
["aft"] = {"Afitti"},
["afu"] = {"Awutu"},
["afz"] = {"Obokuitai"},
["aga"] = {"Aguano"},
["agb"] = {"Legbo"},
["agc"] = {"Agatu"},
["agd"] = {"Agarabi"},
["age"] = {"Angal"},
["agf"] = {"Arguni"},
["agg"] = {"Angor"},
["agh"] = {"Ngelima"},
["agi"] = {"Agariya"},
["agj"] = {"Argobba"},
["agk"] = {"Isarog Agta"},
["agl"] = {"Fembe"},
["agm"] = {"Angaataha"},
["agn"] = {"Agutaynen"},
["ago"] = {"Tainae"},
["agq"] = {"Aghem"},
["agr"] = {"Aguaruna"},
["ags"] = {"Esimbi"},
["agt"] = {"Central Cagayan Agta"},
["agu"] = {"Aguacateco"},
["agv"] = {"Remontado Dumagat"},
["agw"] = {"Kahua"},
["agx"] = {"Aghul"},
["agy"] = {"Southern Alta"},
["agz"] = {"Mt. Iriga Agta"},
["aha"] = {"Ahanta"},
["ahb"] = {"Axamb"},
["ahg"] = {"Qimant"},
["ahh"] = {"Aghu"},
["ahi"] = {"Tiagbamrin Aizi"},
["ahk"] = {"Akha"},
["ahl"] = {"Igo"},
["ahm"] = {"Mobumrin Aizi"},
["ahn"] = {"Àhàn"},
["aho"] = {"Ahom"},
["ahp"] = {"Aproumu Aizi"},
["ahr"] = {"Ahirani"},
["ahs"] = {"Ashe"},
["aht"] = {"Ahtena"},
["aia"] = {"Arosi"},
["aib"] = {"Ainu (China)"},
["aic"] = {"Ainbai"},
["aid"] = {"Alngith"},
["aie"] = {"Amara"},
["aif"] = {"Agi"},
["aig"] = {"Antigua and Barbuda Creole English"},
["aih"] = {"Ai-Cham"},
["aii"] = {"Assyrian Neo-Aramaic"},
["aij"] = {"Lishanid Noshan"},
["aik"] = {"Ake"},
["ail"] = {"Aimele"},
["aim"] = {"Aimol"},
["ain"] = {"Ainu (Japan)"},
["aio"] = {"Aiton"},
["aip"] = {"Burumakok"},
["aiq"] = {"Aimaq"},
["air"] = {"Airoran"},
["ait"] = {"Arikem"},
["aiw"] = {"Aari"},
["aix"] = {"Aighon"},
["aiy"] = {"Ali"},
["aja"] = {"Aja (South Sudan)"},
["ajg"] = {"Aja (Benin)"},
["aji"] = {"Ajië"},
["ajn"] = {"Andajin"},
["ajs"] = {"Algerian Jewish Sign Language"},
["aju"] = {"Judeo-Moroccan Arabic"},
["ajw"] = {"Ajawa"},
["ajz"] = {"Amri Karbi"},
["akb"] = {"Batak Angkola"},
["akc"] = {"Mpur"},
["akd"] = {"Ukpet-Ehom"},
["ake"] = {"Akawaio"},
["akf"] = {"Akpa"},
["akg"] = {"Anakalangu"},
["akh"] = {"Angal Heneng"},
["aki"] = {"Aiome"},
["akj"] = {"Aka-Jeru"},
["akk"] = {"Akkadian"},
["akl"] = {"Aklanon"},
["akm"] = {"Aka-Bo"},
["ako"] = {"Akurio"},
["akp"] = {"Siwu"},
["akq"] = {"Ak"},
["akr"] = {"Araki"},
["aks"] = {"Akaselem"},
["akt"] = {"Akolet"},
["aku"] = {"Akum"},
["akv"] = {"Akhvakh"},
["akw"] = {"Akwa"},
["akx"] = {"Aka-Kede"},
["aky"] = {"Aka-Kol"},
["akz"] = {"Alabama"},
["ala"] = {"Alago"},
["alc"] = {"Qawasqar"},
["ald"] = {"Alladian"},
["ale"] = {"Aleut"},
["alf"] = {"Alege"},
["alg"] = {"Algonquian languages"},
["alh"] = {"Alawa"},
["ali"] = {"Amaimon"},
["alj"] = {"Alangan"},
["alk"] = {"Alak"},
["all"] = {"Allar"},
["alm"] = {"Amblong"},
["aln"] = {"Gheg Albanian"},
["alo"] = {"Larike-Wakasihu"},
["alp"] = {"Alune"},
["alq"] = {"Algonquin"},
["alr"] = {"Alutor"},
["als"] = {"Tosk Albanian"},
["alt"] = {"Southern Altai"},
["alu"] = {"'Are'are"},
["alv"] = {"Atlantic-Congo languages"},
["alw"] = {"Alaba-K’abeena", "Wanbasana"},
["alx"] = {"Amol"},
["aly"] = {"Alyawarr"},
["alz"] = {"Alur"},
["ama"] = {"Amanayé"},
["amb"] = {"Ambo"},
["amc"] = {"Amahuaca"},
["ame"] = {"Yanesha'"},
["amf"] = {"Hamer-Banna"},
["amg"] = {"Amurdak"},
["ami"] = {"Amis"},
["amj"] = {"Amdang"},
["amk"] = {"Ambai"},
["aml"] = {"War-Jaintia"},
["amm"] = {"Ama (Papua New Guinea)"},
["amn"] = {"Amanab"},
["amo"] = {"Amo"},
["amp"] = {"Alamblak"},
["amq"] = {"Amahai"},
["amr"] = {"Amarakaeri"},
["ams"] = {"Southern Amami-Oshima"},
["amt"] = {"Amto"},
["amu"] = {"Guerrero Amuzgo"},
["amv"] = {"Ambelau"},
["amw"] = {"Western Neo-Aramaic"},
["amx"] = {"Anmatyerre"},
["amy"] = {"Ami"},
["amz"] = {"Atampaya"},
["ana"] = {"Andaqui"},
["anb"] = {"Andoa"},
["anc"] = {"Ngas"},
["and"] = {"Ansus"},
["ane"] = {"Xârâcùù"},
["anf"] = {"Animere"},
["ang"] = {"Old English (ca. 450-1100)"},
["anh"] = {"Nend"},
["ani"] = {"Andi"},
["anj"] = {"Anor"},
["ank"] = {"Goemai"},
["anl"] = {"Anu-Hkongso Chin"},
["anm"] = {"Anal"},
["ann"] = {"Obolo"},
["ano"] = {"Andoque"},
["anp"] = {"Angika"},
["anq"] = {"Jarawa (India)"},
["anr"] = {"Andh"},
["ans"] = {"Anserma"},
["ant"] = {"Antakarinya", "Antikarinya"},
["anu"] = {"Anuak"},
["anv"] = {"Denya"},
["anw"] = {"Anaang"},
["anx"] = {"Andra-Hus"},
["any"] = {"Anyin"},
["anz"] = {"Anem"},
["aoa"] = {"Angolar"},
["aob"] = {"Abom"},
["aoc"] = {"Pemon"},
["aod"] = {"Andarum"},
["aoe"] = {"Angal Enen"},
["aof"] = {"Bragat"},
["aog"] = {"Angoram"},
["aoi"] = {"Anindilyakwa"},
["aoj"] = {"Mufian"},
["aok"] = {"Arhö"},
["aol"] = {"Alor"},
["aom"] = {"Ömie"},
["aon"] = {"Bumbita Arapesh"},
["aor"] = {"Aore"},
["aos"] = {"Taikat"},
["aot"] = {"Atong (India)", "A'tong"},
["aou"] = {"A'ou"},
["aox"] = {"Atorada"},
["aoz"] = {"Uab Meto"},
["apa"] = {"Apache languages"},
["apb"] = {"Sa'a"},
["apc"] = {"Levantine Arabic"},
["apd"] = {"Sudanese Arabic"},
["ape"] = {"Bukiyip"},
["apf"] = {"Pahanan Agta"},
["apg"] = {"Ampanang"},
["aph"] = {"Athpariya"},
["api"] = {"Apiaká"},
["apj"] = {"Jicarilla Apache"},
["apk"] = {"Kiowa Apache"},
["apl"] = {"Lipan Apache"},
["apm"] = {"Mescalero-Chiricahua Apache"},
["apn"] = {"Apinayé"},
["apo"] = {"Ambul"},
["app"] = {"Apma"},
["apq"] = {"A-Pucikwar"},
["apr"] = {"Arop-Lokep"},
["aps"] = {"Arop-Sissano"},
["apt"] = {"Apatani"},
["apu"] = {"Apurinã"},
["apv"] = {"Alapmunte"},
["apw"] = {"Western Apache"},
["apx"] = {"Aputai"},
["apy"] = {"Apalaí"},
["apz"] = {"Safeyoka"},
["aqa"] = {"Alacalufan languages"},
["aqc"] = {"Archi"},
["aqd"] = {"Ampari Dogon"},
["aqg"] = {"Arigidi"},
["aqk"] = {"Aninka"},
["aql"] = {"Algic languages"},
["aqm"] = {"Atohwaim"},
["aqn"] = {"Northern Alta"},
["aqp"] = {"Atakapa"},
["aqr"] = {"Arhâ"},
["aqt"] = {"Angaité"},
["aqz"] = {"Akuntsu"},
["arb"] = {"Standard Arabic"},
["arc"] = {"Official Aramaic (700-300 BCE)", "Imperial Aramaic (700-300 BCE)"},
["ard"] = {"Arabana"},
["are"] = {"Western Arrarnta"},
["arh"] = {"Arhuaco"},
["ari"] = {"Arikara"},
["arj"] = {"Arapaso"},
["ark"] = {"Arikapú"},
["arl"] = {"Arabela"},
["arn"] = {"Mapudungun", "Mapuche"},
["aro"] = {"Araona"},
["arp"] = {"Arapaho"},
["arq"] = {"Algerian Arabic"},
["arr"] = {"Karo (Brazil)"},
["ars"] = {"Najdi Arabic"},
["art"] = {"Artificial languages"},
["aru"] = {"Aruá (Amazonas State)", "Arawá"},
["arv"] = {"Arbore"},
["arw"] = {"Arawak"},
["arx"] = {"Aruá (Rodonia State)"},
["ary"] = {"Moroccan Arabic"},
["arz"] = {"Egyptian Arabic"},
["asa"] = {"Asu (Tanzania)"},
["asb"] = {"Assiniboine"},
["asc"] = {"Casuarina Coast Asmat"},
["ase"] = {"American Sign Language"},
["asf"] = {"Auslan", "Australian Sign Language"},
["asg"] = {"Cishingini"},
["ash"] = {"Abishira"},
["asi"] = {"Buruwai"},
["asj"] = {"Sari"},
["ask"] = {"Ashkun"},
["asl"] = {"Asilulu"},
["asn"] = {"Xingú Asuriní"},
["aso"] = {"Dano"},
["asp"] = {"Algerian Sign Language"},
["asq"] = {"Austrian Sign Language"},
["asr"] = {"Asuri"},
["ass"] = {"Ipulo"},
["ast"] = {"Asturian", "Asturleonese", "Bable", "Leonese"},
["asu"] = {"Tocantins Asurini"},
["asv"] = {"Asoa"},
["asw"] = {"Australian Aborigines Sign Language"},
["asx"] = {"Muratayak"},
["asy"] = {"Yaosakor Asmat"},
["asz"] = {"As"},
["ata"] = {"Pele-Ata"},
["atb"] = {"Zaiwa"},
["atc"] = {"Atsahuaca"},
["atd"] = {"Ata Manobo"},
["ate"] = {"Atemble"},
["atg"] = {"Ivbie North-Okpela-Arhe"},
["ath"] = {"Athapascan languages"},
["ati"] = {"Attié"},
["atj"] = {"Atikamekw"},
["atk"] = {"Ati"},
["atl"] = {"Mt. Iraya Agta"},
["atm"] = {"Ata"},
["atn"] = {"Ashtiani"},
["ato"] = {"Atong (Cameroon)"},
["atp"] = {"Pudtol Atta"},
["atq"] = {"Aralle-Tabulahan"},
["atr"] = {"Waimiri-Atroari"},
["ats"] = {"Gros Ventre"},
["att"] = {"Pamplona Atta"},
["atu"] = {"Reel"},
["atv"] = {"Northern Altai"},
["atw"] = {"Atsugewi"},
["atx"] = {"Arutani"},
["aty"] = {"Aneityum"},
["atz"] = {"Arta"},
["aua"] = {"Asumboa"},
["aub"] = {"Alugu"},
["auc"] = {"Waorani"},
["aud"] = {"Anuta"},
["auf"] = {"Arauan languages"},
["aug"] = {"Aguna"},
["auh"] = {"Aushi"},
["aui"] = {"Anuki"},
["auj"] = {"Awjilah"},
["auk"] = {"Heyo"},
["aul"] = {"Aulua"},
["aum"] = {"Asu (Nigeria)"},
["aun"] = {"Molmo One"},
["auo"] = {"Auyokawa"},
["aup"] = {"Makayam"},
["auq"] = {"Anus", "Korur"},
["aur"] = {"Aruek"},
["aus"] = {"Australian languages"},
["aut"] = {"Austral"},
["auu"] = {"Auye"},
["auw"] = {"Awyi"},
["aux"] = {"Aurá"},
["auy"] = {"Awiyaana"},
["auz"] = {"Uzbeki Arabic"},
["avb"] = {"Avau"},
["avd"] = {"Alviri-Vidari"},
["avi"] = {"Avikam"},
["avk"] = {"Kotava"},
["avl"] = {"Eastern Egyptian Bedawi Arabic"},
["avm"] = {"Angkamuthi"},
["avn"] = {"Avatime"},
["avo"] = {"Agavotaguerra"},
["avs"] = {"Aushiri"},
["avt"] = {"Au"},
["avu"] = {"Avokaya"},
["avv"] = {"Avá-Canoeiro"},
["awa"] = {"Awadhi"},
["awb"] = {"Awa (Papua New Guinea)"},
["awc"] = {"Cicipu"},
["awd"] = {"Arawakan languages"},
["awe"] = {"Awetí"},
["awg"] = {"Anguthimri"},
["awh"] = {"Awbono"},
["awi"] = {"Aekyom"},
["awk"] = {"Awabakal"},
["awm"] = {"Arawum"},
["awn"] = {"Awngi"},
["awo"] = {"Awak"},
["awr"] = {"Awera"},
["aws"] = {"South Awyu"},
["awt"] = {"Araweté"},
["awu"] = {"Central Awyu"},
["awv"] = {"Jair Awyu"},
["aww"] = {"Awun"},
["awx"] = {"Awara"},
["awy"] = {"Edera Awyu"},
["axb"] = {"Abipon"},
["axe"] = {"Ayerrerenge"},
["axg"] = {"Mato Grosso Arára"},
["axk"] = {"Yaka (Central African Republic)"},
["axl"] = {"Lower Southern Aranda"},
["axm"] = {"Middle Armenian"},
["axx"] = {"Xârâgurè"},
["aya"] = {"Awar"},
["ayb"] = {"Ayizo Gbe"},
["ayc"] = {"Southern Aymara"},
["ayd"] = {"Ayabadhu"},
["aye"] = {"Ayere"},
["ayg"] = {"Ginyanga"},
["ayh"] = {"Hadrami Arabic"},
["ayi"] = {"Leyigha"},
["ayk"] = {"Akuku"},
["ayl"] = {"Libyan Arabic"},
["ayn"] = {"Sanaani Arabic"},
["ayo"] = {"Ayoreo"},
["ayp"] = {"North Mesopotamian Arabic"},
["ayq"] = {"Ayi (Papua New Guinea)"},
["ayr"] = {"Central Aymara"},
["ays"] = {"Sorsogon Ayta"},
["ayt"] = {"Magbukun Ayta"},
["ayu"] = {"Ayu"},
["ayz"] = {"Mai Brat"},
["aza"] = {"Azha"},
["azb"] = {"South Azerbaijani"},
["azc"] = {"Uto-Aztecan languages"},
["azd"] = {"Eastern Durango Nahuatl"},
["azg"] = {"San Pedro Amuzgos Amuzgo"},
["azj"] = {"North Azerbaijani"},
["azm"] = {"Ipalapa Amuzgo"},
["azn"] = {"Western Durango Nahuatl"},
["azo"] = {"Awing"},
["azt"] = {"Faire Atta"},
["azz"] = {"Highland Puebla Nahuatl"},
["baa"] = {"Babatana"},
["bab"] = {"Bainouk-Gunyuño"},
["bac"] = {"Badui"},
["bad"] = {"Banda languages"},
["bae"] = {"Baré"},
["baf"] = {"Nubaca"},
["bag"] = {"Tuki"},
["bah"] = {"Bahamas Creole English"},
["bai"] = {"Bamileke languages"},
["baj"] = {"Barakai"},
["bal"] = {"Baluchi"},
["ban"] = {"Balinese"},
["bao"] = {"Waimaha"},
["bap"] = {"Bantawa"},
["bar"] = {"Bavarian"},
["bas"] = {"Basa (Cameroon)"},
["bat"] = {"Baltic languages"},
["bau"] = {"Bada (Nigeria)"},
["bav"] = {"Vengo"},
["baw"] = {"Bambili-Bambui"},
["bax"] = {"Bamun"},
["bay"] = {"Batuley"},
["bba"] = {"Baatonum"},
["bbb"] = {"Barai"},
["bbc"] = {"Batak Toba"},
["bbd"] = {"Bau"},
["bbe"] = {"Bangba"},
["bbf"] = {"Baibai"},
["bbg"] = {"Barama"},
["bbh"] = {"Bugan"},
["bbi"] = {"Barombi"},
["bbj"] = {"Ghomálá'"},
["bbk"] = {"Babanki"},
["bbl"] = {"Bats"},
["bbm"] = {"Babango"},
["bbn"] = {"Uneapa"},
["bbo"] = {"Northern Bobo Madaré", "Konabéré"},
["bbp"] = {"West Central Banda"},
["bbq"] = {"Bamali"},
["bbr"] = {"Girawa"},
["bbs"] = {"Bakpinka"},
["bbt"] = {"Mburku"},
["bbu"] = {"Kulung (Nigeria)"},
["bbv"] = {"Karnai"},
["bbw"] = {"Baba"},
["bbx"] = {"Bubia"},
["bby"] = {"Befang"},
["bca"] = {"Central Bai"},
["bcb"] = {"Bainouk-Samik"},
["bcc"] = {"Southern Balochi"},
["bcd"] = {"North Babar"},
["bce"] = {"Bamenyam"},
["bcf"] = {"Bamu"},
["bcg"] = {"Baga Pokur"},
["bch"] = {"Bariai"},
["bci"] = {"Baoulé"},
["bcj"] = {"Bardi"},
["bck"] = {"Bunuba"},
["bcl"] = {"Central Bikol"},
["bcm"] = {"Bannoni"},
["bcn"] = {"Bali (Nigeria)"},
["bco"] = {"Kaluli"},
["bcp"] = {"Bali (Democratic Republic of Congo)"},
["bcq"] = {"Bench"},
["bcr"] = {"Babine"},
["bcs"] = {"Kohumono"},
["bct"] = {"Bendi"},
["bcu"] = {"Awad Bing"},
["bcv"] = {"Shoo-Minda-Nye"},
["bcw"] = {"Bana"},
["bcy"] = {"Bacama"},
["bcz"] = {"Bainouk-Gunyaamolo"},
["bda"] = {"Bayot"},
["bdb"] = {"Basap"},
["bdc"] = {"Emberá-Baudó"},
["bdd"] = {"Bunama"},
["bde"] = {"Bade"},
["bdf"] = {"Biage"},
["bdg"] = {"Bonggi"},
["bdh"] = {"Baka (South Sudan)"},
["bdi"] = {"Burun"},
["bdj"] = {"Bai (South Sudan)", "Bai"},
["bdk"] = {"Budukh"},
["bdl"] = {"Indonesian Bajau"},
["bdm"] = {"Buduma"},
["bdn"] = {"Baldemu"},
["bdo"] = {"Morom"},
["bdp"] = {"Bende"},
["bdq"] = {"Bahnar"},
["bdr"] = {"West Coast Bajau"},
["bds"] = {"Burunge"},
["bdt"] = {"Bokoto"},
["bdu"] = {"Oroko"},
["bdv"] = {"Bodo Parja"},
["bdw"] = {"Baham"},
["bdx"] = {"Budong-Budong"},
["bdy"] = {"Bandjalang"},
["bdz"] = {"Badeshi"},
["bea"] = {"Beaver"},
["beb"] = {"Bebele"},
["bec"] = {"Iceve-Maci"},
["bed"] = {"Bedoanas"},
["bee"] = {"Byangsi"},
["bef"] = {"Benabena"},
["beg"] = {"Belait"},
["beh"] = {"Biali"},
["bei"] = {"Bekati'"},
["bej"] = {"Beja", "Bedawiyet"},
["bek"] = {"Bebeli"},
["bem"] = {"Bemba (Zambia)"},
["beo"] = {"Beami"},
["bep"] = {"Besoa"},
["beq"] = {"Beembe"},
["ber"] = {"Berber languages"},
["bes"] = {"Besme"},
["bet"] = {"Guiberoua Béte"},
["beu"] = {"Blagar"},
["bev"] = {"Daloa Bété"},
["bew"] = {"Betawi"},
["bex"] = {"Jur Modo"},
["bey"] = {"Beli (Papua New Guinea)"},
["bez"] = {"Bena (Tanzania)"},
["bfa"] = {"Bari"},
["bfb"] = {"Pauri Bareli"},
["bfc"] = {"Panyi Bai", "Northern Bai"},
["bfd"] = {"Bafut"},
["bfe"] = {"Betaf", "Tena"},
["bff"] = {"Bofi"},
["bfg"] = {"Busang Kayan"},
["bfh"] = {"Blafe"},
["bfi"] = {"British Sign Language"},
["bfj"] = {"Bafanji"},
["bfk"] = {"Ban Khor Sign Language"},
["bfl"] = {"Banda-Ndélé"},
["bfm"] = {"Mmen"},
["bfn"] = {"Bunak"},
["bfo"] = {"Malba Birifor"},
["bfp"] = {"Beba"},
["bfq"] = {"Badaga"},
["bfr"] = {"Bazigar"},
["bfs"] = {"Southern Bai"},
["bft"] = {"Balti"},
["bfu"] = {"Gahri"},
["bfw"] = {"Bondo"},
["bfx"] = {"Bantayanon"},
["bfy"] = {"Bagheli"},
["bfz"] = {"Mahasu Pahari"},
["bga"] = {"Gwamhi-Wuri"},
["bgb"] = {"Bobongko"},
["bgc"] = {"Haryanvi"},
["bgd"] = {"Rathwi Bareli"},
["bge"] = {"Bauria"},
["bgf"] = {"Bangandu"},
["bgg"] = {"Bugun"},
["bgi"] = {"Giangan"},
["bgj"] = {"Bangolan"},
["bgk"] = {"Bit", "Buxinhua"},
["bgl"] = {"Bo (Laos)"},
["bgn"] = {"Western Balochi"},
["bgo"] = {"Baga Koga"},
["bgp"] = {"Eastern Balochi"},
["bgq"] = {"Bagri"},
["bgr"] = {"Bawm Chin"},
["bgs"] = {"Tagabawa"},
["bgt"] = {"Bughotu"},
["bgu"] = {"Mbongno"},
["bgv"] = {"Warkay-Bipim"},
["bgw"] = {"Bhatri"},
["bgx"] = {"Balkan Gagauz Turkish"},
["bgy"] = {"Benggoi"},
["bgz"] = {"Banggai"},
["bha"] = {"Bharia"},
["bhb"] = {"Bhili"},
["bhc"] = {"Biga"},
["bhd"] = {"Bhadrawahi"},
["bhe"] = {"Bhaya"},
["bhf"] = {"Odiai"},
["bhg"] = {"Binandere"},
["bhh"] = {"Bukharic"},
["bhi"] = {"Bhilali"},
["bhj"] = {"Bahing"},
["bhl"] = {"Bimin"},
["bhm"] = {"Bathari"},
["bhn"] = {"Bohtan Neo-Aramaic"},
["bho"] = {"Bhojpuri"},
["bhp"] = {"Bima"},
["bhq"] = {"Tukang Besi South"},
["bhr"] = {"Bara Malagasy"},
["bhs"] = {"Buwal"},
["bht"] = {"Bhattiyali"},
["bhu"] = {"Bhunjia"},
["bhv"] = {"Bahau"},
["bhw"] = {"Biak"},
["bhx"] = {"Bhalay"},
["bhy"] = {"Bhele"},
["bhz"] = {"Bada (Indonesia)"},
["bia"] = {"Badimaya"},
["bib"] = {"Bissa", "Bisa"},
["bid"] = {"Bidiyo"},
["bie"] = {"Bepour"},
["bif"] = {"Biafada"},
["big"] = {"Biangai"},
["bik"] = {"Bikol"},
["bil"] = {"Bile"},
["bim"] = {"Bimoba"},
["bin"] = {"Bini", "Edo"},
["bio"] = {"Nai"},
["bip"] = {"Bila"},
["biq"] = {"Bipi"},
["bir"] = {"Bisorio"},
["bit"] = {"Berinomo"},
["biu"] = {"Biete"},
["biv"] = {"Southern Birifor"},
["biw"] = {"Kol (Cameroon)"},
["bix"] = {"Bijori"},
["biy"] = {"Birhor"},
["biz"] = {"Baloi"},
["bja"] = {"Budza"},
["bjb"] = {"Banggarla"},
["bjc"] = {"Bariji"},
["bje"] = {"Biao-Jiao Mien"},
["bjf"] = {"Barzani Jewish Neo-Aramaic"},
["bjg"] = {"Bidyogo"},
["bjh"] = {"Bahinemo"},
["bji"] = {"Burji"},
["bjj"] = {"Kanauji"},
["bjk"] = {"Barok"},
["bjl"] = {"Bulu (Papua New Guinea)"},
["bjm"] = {"Bajelani"},
["bjn"] = {"Banjar"},
["bjo"] = {"Mid-Southern Banda"},
["bjp"] = {"Fanamaket"},
["bjr"] = {"Binumarien"},
["bjs"] = {"Bajan"},
["bjt"] = {"Balanta-Ganja"},
["bju"] = {"Busuu"},
["bjv"] = {"Bedjond"},
["bjw"] = {"Bakwé"},
["bjx"] = {"Banao Itneg"},
["bjy"] = {"Bayali"},
["bjz"] = {"Baruga"},
["bka"] = {"Kyak"},
["bkc"] = {"Baka (Cameroon)"},
["bkd"] = {"Binukid", "Talaandig"},
["bkf"] = {"Beeke"},
["bkg"] = {"Buraka"},
["bkh"] = {"Bakoko"},
["bki"] = {"Baki"},
["bkj"] = {"Pande"},
["bkk"] = {"Brokskat"},
["bkl"] = {"Berik"},
["bkm"] = {"Kom (Cameroon)"},
["bkn"] = {"Bukitan"},
["bko"] = {"Kwa'"},
["bkp"] = {"Boko (Democratic Republic of Congo)"},
["bkq"] = {"Bakairí"},
["bkr"] = {"Bakumpai"},
["bks"] = {"Northern Sorsoganon"},
["bkt"] = {"Boloki"},
["bku"] = {"Buhid"},
["bkv"] = {"Bekwarra"},
["bkw"] = {"Bekwel"},
["bkx"] = {"Baikeno"},
["bky"] = {"Bokyi"},
["bkz"] = {"Bungku"},
["bla"] = {"Siksika"},
["blb"] = {"Bilua"},
["blc"] = {"Bella Coola"},
["bld"] = {"Bolango"},
["ble"] = {"Balanta-Kentohe"},
["blf"] = {"Buol"},
["blh"] = {"Kuwaa"},
["bli"] = {"Bolia"},
["blj"] = {"Bolongan"},
["blk"] = {"Pa'o Karen", "Pa'O"},
["bll"] = {"Biloxi"},
["blm"] = {"Beli (South Sudan)"},
["bln"] = {"Southern Catanduanes Bikol"},
["blo"] = {"Anii"},
["blp"] = {"Blablanga"},
["blq"] = {"Baluan-Pam"},
["blr"] = {"Blang"},
["bls"] = {"Balaesang"},
["blt"] = {"Tai Dam"},
["blv"] = {"Kibala", "Bolo"},
["blw"] = {"Balangao"},
["blx"] = {"Mag-Indi Ayta"},
["bly"] = {"Notre"},
["blz"] = {"Balantak"},
["bma"] = {"Lame"},
["bmb"] = {"Bembe"},
["bmc"] = {"Biem"},
["bmd"] = {"Baga Manduri"},
["bme"] = {"Limassa"},
["bmf"] = {"Bom-Kim"},
["bmg"] = {"Bamwe"},
["bmh"] = {"Kein"},
["bmi"] = {"Bagirmi"},
["bmj"] = {"Bote-Majhi"},
["bmk"] = {"Ghayavi"},
["bml"] = {"Bomboli"},
["bmm"] = {"Northern Betsimisaraka Malagasy"},
["bmn"] = {"Bina (Papua New Guinea)"},
["bmo"] = {"Bambalang"},
["bmp"] = {"Bulgebi"},
["bmq"] = {"Bomu"},
["bmr"] = {"Muinane"},
["bms"] = {"Bilma Kanuri"},
["bmt"] = {"Biao Mon"},
["bmu"] = {"Somba-Siawari"},
["bmv"] = {"Bum"},
["bmw"] = {"Bomwali"},
["bmx"] = {"Baimak"},
["bmz"] = {"Baramu"},
["bna"] = {"Bonerate"},
["bnb"] = {"Bookan"},
["bnc"] = {"Bontok"},
["bnd"] = {"Banda (Indonesia)"},
["bne"] = {"Bintauna"},
["bnf"] = {"Masiwang"},
["bng"] = {"Benga"},
["bni"] = {"Bangi"},
["bnj"] = {"Eastern Tawbuid"},
["bnk"] = {"Bierebo"},
["bnl"] = {"Boon"},
["bnm"] = {"Batanga"},
["bnn"] = {"Bunun"},
["bno"] = {"Bantoanon"},
["bnp"] = {"Bola"},
["bnq"] = {"Bantik"},
["bnr"] = {"Butmas-Tur"},
["bns"] = {"Bundeli"},
["bnt"] = {"Bantu languages"},
["bnu"] = {"Bentong"},
["bnv"] = {"Bonerif", "Beneraf", "Edwas"},
["bnw"] = {"Bisis"},
["bnx"] = {"Bangubangu"},
["bny"] = {"Bintulu"},
["bnz"] = {"Beezen"},
["boa"] = {"Bora"},
["bob"] = {"Aweer"},
["boe"] = {"Mundabli"},
["bof"] = {"Bolon"},
["bog"] = {"Bamako Sign Language"},
["boh"] = {"Boma"},
["boi"] = {"Barbareño"},
["boj"] = {"Anjam"},
["bok"] = {"Bonjo"},
["bol"] = {"Bole"},
["bom"] = {"Berom"},
["bon"] = {"Bine"},
["boo"] = {"Tiemacèwè Bozo"},
["bop"] = {"Bonkiman"},
["boq"] = {"Bogaya"},
["bor"] = {"Borôro"},
["bot"] = {"Bongo"},
["bou"] = {"Bondei"},
["bov"] = {"Tuwuli"},
["bow"] = {"Rema"},
["box"] = {"Buamu"},
["boy"] = {"Bodo (Central African Republic)"},
["boz"] = {"Tiéyaxo Bozo"},
["bpa"] = {"Daakaka"},
["bpc"] = {"Mbuk"},
["bpd"] = {"Banda-Banda"},
["bpe"] = {"Bauni"},
["bpg"] = {"Bonggo"},
["bph"] = {"Botlikh"},
["bpi"] = {"Bagupi"},
["bpj"] = {"Binji"},
["bpk"] = {"Orowe", "'Ôrôê"},
["bpl"] = {"Broome Pearling Lugger Pidgin"},
["bpm"] = {"Biyom"},
["bpn"] = {"Dzao Min"},
["bpo"] = {"Anasi"},
["bpp"] = {"Kaure"},
["bpq"] = {"Banda Malay"},
["bpr"] = {"Koronadal Blaan"},
["bps"] = {"Sarangani Blaan"},
["bpt"] = {"Barrow Point"},
["bpu"] = {"Bongu"},
["bpv"] = {"Bian Marind"},
["bpw"] = {"Bo (Papua New Guinea)"},
["bpx"] = {"Palya Bareli"},
["bpy"] = {"Bishnupriya"},
["bpz"] = {"Bilba"},
["bqa"] = {"Tchumbuli"},
["bqb"] = {"Bagusa"},
["bqc"] = {"Boko (Benin)", "Boo"},
["bqd"] = {"Bung"},
["bqf"] = {"Baga Kaloum"},
["bqg"] = {"Bago-Kusuntu"},
["bqh"] = {"Baima"},
["bqi"] = {"Bakhtiari"},
["bqj"] = {"Bandial"},
["bqk"] = {"Banda-Mbrès"},
["bql"] = {"Bilakura"},
["bqm"] = {"Wumboko"},
["bqn"] = {"Bulgarian Sign Language"},
["bqo"] = {"Balo"},
["bqp"] = {"Busa"},
["bqq"] = {"Biritai"},
["bqr"] = {"Burusu"},
["bqs"] = {"Bosngun"},
["bqt"] = {"Bamukumbit"},
["bqu"] = {"Boguru"},
["bqv"] = {"Koro Wachi", "Begbere-Ejar"},
["bqw"] = {"Buru (Nigeria)"},
["bqx"] = {"Baangi"},
["bqy"] = {"Bengkala Sign Language"},
["bqz"] = {"Bakaka"},
["bra"] = {"Braj"},
["brb"] = {"Brao", "Lave"},
["brc"] = {"Berbice Creole Dutch"},
["brd"] = {"Baraamu"},
["brf"] = {"Bira"},
["brg"] = {"Baure"},
["brh"] = {"Brahui"},
["bri"] = {"Mokpwe"},
["brj"] = {"Bieria"},
["brk"] = {"Birked"},
["brl"] = {"Birwa"},
["brm"] = {"Barambu"},
["brn"] = {"Boruca"},
["bro"] = {"Brokkat"},
["brp"] = {"Barapasi"},
["brq"] = {"Breri"},
["brr"] = {"Birao"},
["brs"] = {"Baras"},
["brt"] = {"Bitare"},
["bru"] = {"Eastern Bru"},
["brv"] = {"Western Bru"},
["brw"] = {"Bellari"},
["brx"] = {"Bodo (India)"},
["bry"] = {"Burui"},
["brz"] = {"Bilbil"},
["bsa"] = {"Abinomn"},
["bsb"] = {"Brunei Bisaya"},
["bsc"] = {"Bassari", "Oniyan"},
["bse"] = {"Wushi"},
["bsf"] = {"Bauchi"},
["bsg"] = {"Bashkardi"},
["bsh"] = {"Kati"},
["bsi"] = {"Bassossi"},
["bsj"] = {"Bangwinji"},
["bsk"] = {"Burushaski"},
["bsl"] = {"Basa-Gumna"},
["bsm"] = {"Busami"},
["bsn"] = {"Barasana-Eduria"},
["bso"] = {"Buso"},
["bsp"] = {"Baga Sitemu"},
["bsq"] = {"Bassa"},
["bsr"] = {"Bassa-Kontagora"},
["bss"] = {"Akoose"},
["bst"] = {"Basketo"},
["bsu"] = {"Bahonsuai"},
["bsv"] = {"Baga Sobané"},
["bsw"] = {"Baiso"},
["bsx"] = {"Yangkam"},
["bsy"] = {"Sabah Bisaya"},
["bta"] = {"Bata"},
["btc"] = {"Bati (Cameroon)"},
["btd"] = {"Batak Dairi"},
["bte"] = {"Gamo-Ningi"},
["btf"] = {"Birgit"},
["btg"] = {"Gagnoa Bété"},
["bth"] = {"Biatah Bidayuh"},
["bti"] = {"Burate"},
["btj"] = {"Bacanese Malay"},
["btk"] = {"Batak languages"},
["btm"] = {"Batak Mandailing"},
["btn"] = {"Ratagnon"},
["bto"] = {"Rinconada Bikol"},
["btp"] = {"Budibud"},
["btq"] = {"Batek"},
["btr"] = {"Baetora"},
["bts"] = {"Batak Simalungun"},
["btt"] = {"Bete-Bendi"},
["btu"] = {"Batu"},
["btv"] = {"Bateri"},
["btw"] = {"Butuanon"},
["btx"] = {"Batak Karo"},
["bty"] = {"Bobot"},
["btz"] = {"Batak Alas-Kluet"},
["bua"] = {"Buriat"},
["bub"] = {"Bua"},
["buc"] = {"Bushi"},
["bud"] = {"Ntcham"},
["bue"] = {"Beothuk"},
["buf"] = {"Bushoong"},
["bug"] = {"Buginese"},
["buh"] = {"Younuo Bunu"},
["bui"] = {"Bongili"},
["buj"] = {"Basa-Gurmana"},
["buk"] = {"Bugawac"},
["bum"] = {"Bulu (Cameroon)"},
["bun"] = {"Sherbro"},
["buo"] = {"Terei"},
["bup"] = {"Busoa"},
["buq"] = {"Brem"},
["bus"] = {"Bokobaru"},
["but"] = {"Bungain"},
["buu"] = {"Budu"},
["buv"] = {"Bun"},
["buw"] = {"Bubi"},
["bux"] = {"Boghom"},
["buy"] = {"Bullom So"},
["buz"] = {"Bukwen"},
["bva"] = {"Barein"},
["bvb"] = {"Bube"},
["bvc"] = {"Baelelea"},
["bvd"] = {"Baeggu"},
["bve"] = {"Berau Malay"},
["bvf"] = {"Boor"},
["bvg"] = {"Bonkeng"},
["bvh"] = {"Bure"},
["bvi"] = {"Belanda Viri"},
["bvj"] = {"Baan"},
["bvk"] = {"Bukat"},
["bvl"] = {"Bolivian Sign Language"},
["bvm"] = {"Bamunka"},
["bvn"] = {"Buna"},
["bvo"] = {"Bolgo"},
["bvp"] = {"Bumang"},
["bvq"] = {"Birri"},
["bvr"] = {"Burarra"},
["bvt"] = {"Bati (Indonesia)"},
["bvu"] = {"Bukit Malay"},
["bvv"] = {"Baniva"},
["bvw"] = {"Boga"},
["bvx"] = {"Dibole"},
["bvy"] = {"Baybayanon"},
["bvz"] = {"Bauzi"},
["bwa"] = {"Bwatoo"},
["bwb"] = {"Namosi-Naitasiri-Serua"},
["bwc"] = {"Bwile"},
["bwd"] = {"Bwaidoka"},
["bwe"] = {"Bwe Karen"},
["bwf"] = {"Boselewa"},
["bwg"] = {"Barwe"},
["bwh"] = {"Bishuo"},
["bwi"] = {"Baniwa"},
["bwj"] = {"Láá Láá Bwamu"},
["bwk"] = {"Bauwaki"},
["bwl"] = {"Bwela"},
["bwm"] = {"Biwat"},
["bwn"] = {"Wunai Bunu"},
["bwo"] = {"Boro (Ethiopia)", "Borna (Ethiopia)"},
["bwp"] = {"Mandobo Bawah"},
["bwq"] = {"Southern Bobo Madaré"},
["bwr"] = {"Bura-Pabir"},
["bws"] = {"Bomboma"},
["bwt"] = {"Bafaw-Balong"},
["bwu"] = {"Buli (Ghana)"},
["bww"] = {"Bwa"},
["bwx"] = {"Bu-Nao Bunu"},
["bwy"] = {"Cwi Bwamu"},
["bwz"] = {"Bwisi"},
["bxa"] = {"Tairaha"},
["bxb"] = {"Belanda Bor"},
["bxc"] = {"Molengue"},
["bxd"] = {"Pela"},
["bxe"] = {"Birale"},
["bxf"] = {"Bilur", "Minigir"},
["bxg"] = {"Bangala"},
["bxh"] = {"Buhutu"},
["bxi"] = {"Pirlatapa"},
["bxj"] = {"Bayungu"},
["bxk"] = {"Bukusu", "Lubukusu"},
["bxl"] = {"Jalkunan"},
["bxm"] = {"Mongolia Buriat"},
["bxn"] = {"Burduna"},
["bxo"] = {"Barikanchi"},
["bxp"] = {"Bebil"},
["bxq"] = {"Beele"},
["bxr"] = {"Russia Buriat"},
["bxs"] = {"Busam"},
["bxu"] = {"China Buriat"},
["bxv"] = {"Berakou"},
["bxw"] = {"Bankagooma"},
["bxz"] = {"Binahari"},
["bya"] = {"Batak"},
["byb"] = {"Bikya"},
["byc"] = {"Ubaghara"},
["byd"] = {"Benyadu'"},
["bye"] = {"Pouye"},
["byf"] = {"Bete"},
["byg"] = {"Baygo"},
["byh"] = {"Bhujel"},
["byi"] = {"Buyu"},
["byj"] = {"Bina (Nigeria)"},
["byk"] = {"Biao"},
["byl"] = {"Bayono"},
["bym"] = {"Bidjara"},
["byn"] = {"Bilin", "Blin"},
["byo"] = {"Biyo"},
["byp"] = {"Bumaji"},
["byq"] = {"Basay"},
["byr"] = {"Baruya", "Yipma"},
["bys"] = {"Burak"},
["byt"] = {"Berti"},
["byv"] = {"Medumba"},
["byw"] = {"Belhariya"},
["byx"] = {"Qaqet"},
["byz"] = {"Banaro"},
["bza"] = {"Bandi"},
["bzb"] = {"Andio"},
["bzc"] = {"Southern Betsimisaraka Malagasy"},
["bzd"] = {"Bribri"},
["bze"] = {"Jenaama Bozo"},
["bzf"] = {"Boikin"},
["bzg"] = {"Babuza"},
["bzh"] = {"Mapos Buang"},
["bzi"] = {"Bisu"},
["bzj"] = {"Belize Kriol English"},
["bzk"] = {"Nicaragua Creole English"},
["bzl"] = {"Boano (Sulawesi)"},
["bzm"] = {"Bolondo"},
["bzn"] = {"Boano (Maluku)"},
["bzo"] = {"Bozaba"},
["bzp"] = {"Kemberano"},
["bzq"] = {"Buli (Indonesia)"},
["bzr"] = {"Biri"},
["bzs"] = {"Brazilian Sign Language"},
["bzt"] = {"Brithenig"},
["bzu"] = {"Burmeso"},
["bzv"] = {"Naami"},
["bzw"] = {"Basa (Nigeria)"},
["bzx"] = {"Kɛlɛngaxo Bozo"},
["bzy"] = {"Obanliku"},
["bzz"] = {"Evant"},
["caa"] = {"Chortí"},
["cab"] = {"Garifuna"},
["cac"] = {"Chuj"},
["cad"] = {"Caddo"},
["cae"] = {"Lehar", "Laalaa"},
["caf"] = {"Southern Carrier"},
["cag"] = {"Nivaclé"},
["cah"] = {"Cahuarano"},
["cai"] = {"Central American Indian languages"},
["caj"] = {"Chané"},
["cak"] = {"Kaqchikel", "Cakchiquel"},
["cal"] = {"Carolinian"},
["cam"] = {"Cemuhî"},
["can"] = {"Chambri"},
["cao"] = {"Chácobo"},
["cap"] = {"Chipaya"},
["caq"] = {"Car Nicobarese"},
["car"] = {"Galibi Carib"},
["cas"] = {"Tsimané"},
["cau"] = {"Caucasian languages"},
["cav"] = {"Cavineña"},
["caw"] = {"Callawalla"},
["cax"] = {"Chiquitano"},
["cay"] = {"Cayuga"},
["caz"] = {"Canichana"},
["cba"] = {"Chibchan languages"},
["cbb"] = {"Cabiyarí"},
["cbc"] = {"Carapana"},
["cbd"] = {"Carijona"},
["cbg"] = {"Chimila"},
["cbi"] = {"Chachi"},
["cbj"] = {"Ede Cabe"},
["cbk"] = {"Chavacano"},
["cbl"] = {"Bualkhaw Chin"},
["cbn"] = {"Nyahkur"},
["cbo"] = {"Izora"},
["cbq"] = {"Tsucuba", "Cuba"},
["cbr"] = {"Cashibo-Cacataibo"},
["cbs"] = {"Cashinahua"},
["cbt"] = {"Chayahuita"},
["cbu"] = {"Candoshi-Shapra"},
["cbv"] = {"Cacua"},
["cbw"] = {"Kinabalian"},
["cby"] = {"Carabayo"},
["ccc"] = {"Chamicuro"},
["ccd"] = {"Cafundo Creole"},
["cce"] = {"Chopi"},
["ccg"] = {"Samba Daka"},
["cch"] = {"Atsam"},
["ccj"] = {"Kasanga"},
["ccl"] = {"Cutchi-Swahili"},
["ccm"] = {"Malaccan Creole Malay"},
["ccn"] = {"North Caucasian languages"},
["cco"] = {"Comaltepec Chinantec"},
["ccp"] = {"Chakma"},
["ccr"] = {"Cacaopera"},
["ccs"] = {"South Caucasian languages"},
["cda"] = {"Choni"},
["cdc"] = {"Chadic languages"},
["cdd"] = {"Caddoan languages"},
["cde"] = {"Chenchu"},
["cdf"] = {"Chiru"},
["cdh"] = {"Chambeali"},
["cdi"] = {"Chodri"},
["cdj"] = {"Churahi"},
["cdm"] = {"Chepang"},
["cdn"] = {"Chaudangsi"},
["cdo"] = {"Min Dong Chinese"},
["cdr"] = {"Cinda-Regi-Tiyal"},
["cds"] = {"Chadian Sign Language"},
["cdy"] = {"Chadong"},
["cdz"] = {"Koda"},
["cea"] = {"Lower Chehalis"},
["ceb"] = {"Cebuano"},
["ceg"] = {"Chamacoco"},
["cek"] = {"Eastern Khumi Chin"},
["cel"] = {"Celtic languages"},
["cen"] = {"Cen"},
["cet"] = {"Centúúm"},
["cey"] = {"Ekai Chin"},
["cfa"] = {"Dijim-Bwilim"},
["cfd"] = {"Cara"},
["cfg"] = {"Como Karim"},
["cfm"] = {"Falam Chin"},
["cga"] = {"Changriwa"},
["cgc"] = {"Kagayanen"},
["cgg"] = {"Chiga"},
["cgk"] = {"Chocangacakha"},
["chb"] = {"Chibcha"},
["chc"] = {"Catawba"},
["chd"] = {"Highland Oaxaca Chontal"},
["chf"] = {"Tabasco Chontal"},
["chg"] = {"Chagatai"},
["chh"] = {"Chinook"},
["chj"] = {"Ojitlán Chinantec"},
["chk"] = {"Chuukese"},
["chl"] = {"Cahuilla"},
["chm"] = {"Mari (Russia)"},
["chn"] = {"Chinook jargon"},
["cho"] = {"Choctaw"},
["chp"] = {"Chipewyan", "Dene Suline"},
["chq"] = {"Quiotepec Chinantec"},
["chr"] = {"Cherokee"},
["cht"] = {"Cholón"},
["chw"] = {"Chuwabu"},
["chx"] = {"Chantyal"},
["chy"] = {"Cheyenne"},
["chz"] = {"Ozumacín Chinantec"},
["cia"] = {"Cia-Cia"},
["cib"] = {"Ci Gbe"},
["cic"] = {"Chickasaw"},
["cid"] = {"Chimariko"},
["cie"] = {"Cineni"},
["cih"] = {"Chinali"},
["cik"] = {"Chitkuli Kinnauri"},
["cim"] = {"Cimbrian"},
["cin"] = {"Cinta Larga"},
["cip"] = {"Chiapanec"},
["cir"] = {"Tiri", "Haméa", "Méa"},
["ciw"] = {"Chippewa"},
["ciy"] = {"Chaima"},
["cja"] = {"Western Cham"},
["cje"] = {"Chru"},
["cjh"] = {"Upper Chehalis"},
["cji"] = {"Chamalal"},
["cjk"] = {"Chokwe"},
["cjm"] = {"Eastern Cham"},
["cjn"] = {"Chenapian"},
["cjo"] = {"Ashéninka Pajonal"},
["cjp"] = {"Cabécar"},
["cjs"] = {"Shor"},
["cjv"] = {"Chuave"},
["cjy"] = {"Jinyu Chinese"},
["ckb"] = {"Central Kurdish"},
["ckh"] = {"Chak"},
["ckl"] = {"Cibak"},
["ckm"] = {"Chakavian"},
["ckn"] = {"Kaang Chin"},
["cko"] = {"Anufo"},
["ckq"] = {"Kajakse"},
["ckr"] = {"Kairak"},
["cks"] = {"Tayo"},
["ckt"] = {"Chukot"},
["cku"] = {"Koasati"},
["ckv"] = {"Kavalan"},
["ckx"] = {"Caka"},
["cky"] = {"Cakfem-Mushere"},
["ckz"] = {"Cakchiquel-Quiché Mixed Language"},
["cla"] = {"Ron"},
["clc"] = {"Chilcotin"},
["cld"] = {"Chaldean Neo-Aramaic"},
["cle"] = {"Lealao Chinantec"},
["clh"] = {"Chilisso"},
["cli"] = {"Chakali"},
["clj"] = {"Laitu Chin"},
["clk"] = {"Idu-Mishmi"},
["cll"] = {"Chala"},
["clm"] = {"Clallam"},
["clo"] = {"Lowland Oaxaca Chontal"},
["clt"] = {"Lautu Chin"},
["clu"] = {"Caluyanun"},
["clw"] = {"Chulym"},
["cly"] = {"Eastern Highland Chatino"},
["cma"] = {"Maa"},
["cmc"] = {"Chamic languages"},
["cme"] = {"Cerma"},
["cmg"] = {"Classical Mongolian"},
["cmi"] = {"Emberá-Chamí"},
["cml"] = {"Campalagian"},
["cmm"] = {"Michigamea"},
["cmn"] = {"Mandarin Chinese"},
["cmo"] = {"Central Mnong"},
["cmr"] = {"Mro-Khimi Chin"},
["cms"] = {"Messapic"},
["cmt"] = {"Camtho"},
["cna"] = {"Changthang"},
["cnb"] = {"Chinbon Chin"},
["cnc"] = {"Côông"},
["cng"] = {"Northern Qiang"},
["cnh"] = {"Hakha Chin", "Haka Chin"},
["cni"] = {"Asháninka"},
["cnk"] = {"Khumi Chin"},
["cnl"] = {"Lalana Chinantec"},
["cno"] = {"Con"},
["cnp"] = {"Northern Ping Chinese", "Northern Pinghua"},
["cnq"] = {"Chung"},
["cnr"] = {"Montenegrin"},
["cns"] = {"Central Asmat"},
["cnt"] = {"Tepetotutla Chinantec"},
["cnu"] = {"Chenoua"},
["cnw"] = {"Ngawn Chin"},
["cnx"] = {"Middle Cornish"},
["coa"] = {"Cocos Islands Malay"},
["cob"] = {"Chicomuceltec"},
["coc"] = {"Cocopa"},
["cod"] = {"Cocama-Cocamilla"},
["coe"] = {"Koreguaje"},
["cof"] = {"Colorado"},
["cog"] = {"Chong"},
["coh"] = {"Chonyi-Dzihana-Kauma", "Chichonyi-Chidzihana-Chikauma"},
["coj"] = {"Cochimi"},
["cok"] = {"Santa Teresa Cora"},
["col"] = {"Columbia-Wenatchi"},
["com"] = {"Comanche"},
["con"] = {"Cofán"},
["coo"] = {"Comox"},
["cop"] = {"Coptic"},
["coq"] = {"Coquille"},
["cot"] = {"Caquinte"},
["cou"] = {"Wamey"},
["cov"] = {"Cao Miao"},
["cow"] = {"Cowlitz"},
["cox"] = {"Nanti"},
["coz"] = {"Chochotec"},
["cpa"] = {"Palantla Chinantec"},
["cpb"] = {"Ucayali-Yurúa Ashéninka"},
["cpc"] = {"Ajyíninka Apurucayali"},
["cpe"] = {"English-based creoles and pidgins"},
["cpf"] = {"French-based creoles and pidgins"},
["cpg"] = {"Cappadocian Greek"},
["cpi"] = {"Chinese Pidgin English"},
["cpn"] = {"Cherepon"},
["cpo"] = {"Kpeego"},
["cpp"] = {"Portuguese-based creoles and pidgins"},
["cps"] = {"Capiznon"},
["cpu"] = {"Pichis Ashéninka"},
["cpx"] = {"Pu-Xian Chinese"},
["cpy"] = {"South Ucayali Ashéninka"},
["cqd"] = {"Chuanqiandian Cluster Miao"},
["cra"] = {"Chara"},
["crb"] = {"Island Carib"},
["crc"] = {"Lonwolwol"},
["crd"] = {"Coeur d'Alene"},
["crf"] = {"Caramanta"},
["crg"] = {"Michif"},
["crh"] = {"Crimean Tatar", "Crimean Turkish"},
["cri"] = {"Sãotomense"},
["crj"] = {"Southern East Cree"},
["crk"] = {"Plains Cree"},
["crl"] = {"Northern East Cree"},
["crm"] = {"Moose Cree"},
["crn"] = {"El Nayar Cora"},
["cro"] = {"Crow"},
["crp"] = {"Creoles and pidgins"},
["crq"] = {"Iyo'wujwa Chorote"},
["crr"] = {"Carolina Algonquian"},
["crs"] = {"Seselwa Creole French"},
["crt"] = {"Iyojwa'ja Chorote"},
["crv"] = {"Chaura"},
["crw"] = {"Chrau"},
["crx"] = {"Carrier"},
["cry"] = {"Cori"},
["crz"] = {"Cruzeño"},
["csa"] = {"Chiltepec Chinantec"},
["csb"] = {"Kashubian"},
["csc"] = {"Catalan Sign Language", "Lengua de señas catalana", "Llengua de Signes Catalana"},
["csd"] = {"Chiangmai Sign Language"},
["cse"] = {"Czech Sign Language"},
["csf"] = {"Cuba Sign Language"},
["csg"] = {"Chilean Sign Language"},
["csh"] = {"Asho Chin"},
["csi"] = {"Coast Miwok"},
["csj"] = {"Songlai Chin"},
["csk"] = {"Jola-Kasa"},
["csl"] = {"Chinese Sign Language"},
["csm"] = {"Central Sierra Miwok"},
["csn"] = {"Colombian Sign Language"},
["cso"] = {"Sochiapam Chinantec", "Sochiapan Chinantec"},
["csp"] = {"Southern Ping Chinese", "Southern Pinghua"},
["csq"] = {"Croatia Sign Language"},
["csr"] = {"Costa Rican Sign Language"},
["css"] = {"Southern Ohlone"},
["cst"] = {"Northern Ohlone"},
["csu"] = {"Central Sudanic languages"},
["csv"] = {"Sumtu Chin"},
["csw"] = {"Swampy Cree"},
["csx"] = {"Cambodian Sign Language"},
["csy"] = {"Siyin Chin"},
["csz"] = {"Coos"},
["cta"] = {"Tataltepec Chatino"},
["ctc"] = {"Chetco"},
["ctd"] = {"Tedim Chin"},
["cte"] = {"Tepinapa Chinantec"},
["ctg"] = {"Chittagonian"},
["cth"] = {"Thaiphum Chin"},
["ctl"] = {"Tlacoatzintepec Chinantec"},
["ctm"] = {"Chitimacha"},
["ctn"] = {"Chhintange"},
["cto"] = {"Emberá-Catío"},
["ctp"] = {"Western Highland Chatino"},
["cts"] = {"Northern Catanduanes Bikol"},
["ctt"] = {"Wayanad Chetti"},
["ctu"] = {"Chol"},
["cty"] = {"Moundadan Chetty"},
["ctz"] = {"Zacatepec Chatino"},
["cua"] = {"Cua"},
["cub"] = {"Cubeo"},
["cuc"] = {"Usila Chinantec"},
["cuh"] = {"Chuka", "Gichuka"},
["cui"] = {"Cuiba"},
["cuj"] = {"Mashco Piro"},
["cuk"] = {"San Blas Kuna"},
["cul"] = {"Culina", "Kulina"},
["cuo"] = {"Cumanagoto"},
["cup"] = {"Cupeño"},
["cuq"] = {"Cun"},
["cur"] = {"Chhulung"},
["cus"] = {"Cushitic languages"},
["cut"] = {"Teutila Cuicatec"},
["cuu"] = {"Tai Ya"},
["cuv"] = {"Cuvok"},
["cuw"] = {"Chukwa"},
["cux"] = {"Tepeuxila Cuicatec"},
["cuy"] = {"Cuitlatec"},
["cvg"] = {"Chug"},
["cvn"] = {"Valle Nacional Chinantec"},
["cwa"] = {"Kabwa"},
["cwb"] = {"Maindo"},
["cwd"] = {"Woods Cree"},
["cwe"] = {"Kwere"},
["cwg"] = {"Chewong", "Cheq Wong"},
["cwt"] = {"Kuwaataay"},
["cxh"] = {"Cha'ari"},
["cya"] = {"Nopala Chatino"},
["cyb"] = {"Cayubaba"},
["cyo"] = {"Cuyonon"},
["czh"] = {"Huizhou Chinese"},
["czk"] = {"Knaanic"},
["czn"] = {"Zenzontepec Chatino"},
["czo"] = {"Min Zhong Chinese"},
["czt"] = {"Zotung Chin"},
["daa"] = {"Dangaléat"},
["dac"] = {"Dambi"},
["dad"] = {"Marik"},
["dae"] = {"Duupa"},
["dag"] = {"Dagbani"},
["dah"] = {"Gwahatike"},
["dai"] = {"Day"},
["daj"] = {"Dar Fur Daju"},
["dak"] = {"Dakota"},
["dal"] = {"Dahalo"},
["dam"] = {"Damakawa"},
["dao"] = {"Daai Chin"},
["daq"] = {"Dandami Maria"},
["dar"] = {"Dargwa"},
["das"] = {"Daho-Doo"},
["dau"] = {"Dar Sila Daju"},
["dav"] = {"Taita", "Dawida"},
["daw"] = {"Davawenyo"},
["dax"] = {"Dayi"},
["day"] = {"Land Dayak languages"},
["daz"] = {"Dao"},
["dba"] = {"Bangime"},
["dbb"] = {"Deno"},
["dbd"] = {"Dadiya"},
["dbe"] = {"Dabe"},
["dbf"] = {"Edopi"},
["dbg"] = {"Dogul Dom Dogon"},
["dbi"] = {"Doka"},
["dbj"] = {"Ida'an"},
["dbl"] = {"Dyirbal"},
["dbm"] = {"Duguri"},
["dbn"] = {"Duriankere"},
["dbo"] = {"Dulbu"},
["dbp"] = {"Duwai"},
["dbq"] = {"Daba"},
["dbr"] = {"Dabarre"},
["dbt"] = {"Ben Tey Dogon"},
["dbu"] = {"Bondum Dom Dogon"},
["dbv"] = {"Dungu"},
["dbw"] = {"Bankan Tey Dogon"},
["dby"] = {"Dibiyaso"},
["dcc"] = {"Deccan"},
["dcr"] = {"Negerhollands"},
["dda"] = {"Dadi Dadi"},
["ddd"] = {"Dongotono"},
["dde"] = {"Doondo"},
["ddg"] = {"Fataluku"},
["ddi"] = {"West Goodenough"},
["ddj"] = {"Jaru"},
["ddn"] = {"Dendi (Benin)"},
["ddo"] = {"Dido"},
["ddr"] = {"Dhudhuroa"},
["dds"] = {"Donno So Dogon"},
["ddw"] = {"Dawera-Daweloor"},
["dec"] = {"Dagik"},
["ded"] = {"Dedua"},
["dee"] = {"Dewoin"},
["def"] = {"Dezfuli"},
["deg"] = {"Degema"},
["deh"] = {"Dehwari"},
["dei"] = {"Demisa"},
["dek"] = {"Dek"},
["del"] = {"Delaware"},
["dem"] = {"Dem"},
["den"] = {"Slave (Athapascan)"},
["dep"] = {"Pidgin Delaware"},
["deq"] = {"Dendi (Central African Republic)"},
["der"] = {"Deori"},
["des"] = {"Desano"},
["dev"] = {"Domung"},
["dez"] = {"Dengese"},
["dga"] = {"Southern Dagaare"},
["dgb"] = {"Bunoge Dogon"},
["dgc"] = {"Casiguran Dumagat Agta"},
["dgd"] = {"Dagaari Dioula"},
["dge"] = {"Degenan"},
["dgg"] = {"Doga"},
["dgh"] = {"Dghwede"},
["dgi"] = {"Northern Dagara"},
["dgk"] = {"Dagba"},
["dgl"] = {"Andaandi", "Dongolawi"},
["dgn"] = {"Dagoman"},
["dgo"] = {"Dogri (individual language)"},
["dgr"] = {"Dogrib", "Tłı̨chǫ"},
["dgs"] = {"Dogoso"},
["dgt"] = {"Ndra'ngith"},
["dgw"] = {"Daungwurrung"},
["dgx"] = {"Doghoro"},
["dgz"] = {"Daga"},
["dhd"] = {"Dhundari"},
["dhg"] = {"Dhangu-Djangu", "Dhangu", "Djangu"},
["dhi"] = {"Dhimal"},
["dhl"] = {"Dhalandji"},
["dhm"] = {"Zemba"},
["dhn"] = {"Dhanki"},
["dho"] = {"Dhodia"},
["dhr"] = {"Dhargari"},
["dhs"] = {"Dhaiso"},
["dhu"] = {"Dhurga"},
["dhv"] = {"Dehu", "Drehu"},
["dhw"] = {"Dhanwar (Nepal)"},
["dhx"] = {"Dhungaloo"},
["dia"] = {"Dia"},
["dib"] = {"South Central Dinka"},
["dic"] = {"Lakota Dida"},
["did"] = {"Didinga"},
["dif"] = {"Dieri", "Diyari"},
["dig"] = {"Digo", "Chidigo"},
["dih"] = {"Kumiai"},
["dii"] = {"Dimbong"},
["dij"] = {"Dai"},
["dik"] = {"Southwestern Dinka"},
["dil"] = {"Dilling"},
["dim"] = {"Dime"},
["din"] = {"Dinka"},
["dio"] = {"Dibo"},
["dip"] = {"Northeastern Dinka"},
["diq"] = {"Dimli (individual language)"},
["dir"] = {"Dirim"},
["dis"] = {"Dimasa"},
["diu"] = {"Diriku"},
["diw"] = {"Northwestern Dinka"},
["dix"] = {"Dixon Reef"},
["diy"] = {"Diuwe"},
["diz"] = {"Ding"},
["dja"] = {"Djadjawurrung"},
["djb"] = {"Djinba"},
["djc"] = {"Dar Daju Daju"},
["djd"] = {"Djamindjung", "Ngaliwurru"},
["dje"] = {"Zarma"},
["djf"] = {"Djangun"},
["dji"] = {"Djinang"},
["djj"] = {"Djeebbana"},
["djk"] = {"Eastern Maroon Creole", "Businenge Tongo", "Nenge"},
["djm"] = {"Jamsay Dogon"},
["djn"] = {"Jawoyn", "Djauan"},
["djo"] = {"Jangkang"},
["djr"] = {"Djambarrpuyngu"},
["dju"] = {"Kapriman"},
["djw"] = {"Djawi"},
["dka"] = {"Dakpakha"},
["dkg"] = {"Kadung"},
["dkk"] = {"Dakka"},
["dkr"] = {"Kuijau"},
["dks"] = {"Southeastern Dinka"},
["dkx"] = {"Mazagway"},
["dlg"] = {"Dolgan"},
["dlk"] = {"Dahalik"},
["dlm"] = {"Dalmatian"},
["dln"] = {"Darlong"},
["dma"] = {"Duma"},
["dmb"] = {"Mombo Dogon"},
["dmc"] = {"Gavak"},
["dmd"] = {"Madhi Madhi"},
["dme"] = {"Dugwor"},
["dmf"] = {"Medefaidrin"},
["dmg"] = {"Upper Kinabatangan"},
["dmk"] = {"Domaaki"},
["dml"] = {"Dameli"},
["dmm"] = {"Dama"},
["dmn"] = {"Mande languages"},
["dmo"] = {"Kemedzung"},
["dmr"] = {"East Damar"},
["dms"] = {"Dampelas"},
["dmu"] = {"Dubu", "Tebi"},
["dmv"] = {"Dumpas"},
["dmw"] = {"Mudburra"},
["dmx"] = {"Dema"},
["dmy"] = {"Demta", "Sowari"},
["dna"] = {"Upper Grand Valley Dani"},
["dnd"] = {"Daonda"},
["dne"] = {"Ndendeule"},
["dng"] = {"Dungan"},
["dni"] = {"Lower Grand Valley Dani"},
["dnj"] = {"Dan"},
["dnk"] = {"Dengka"},
["dnn"] = {"Dzùùngoo"},
["dno"] = {"Ndrulo", "Northern Lendu"},
["dnr"] = {"Danaru"},
["dnt"] = {"Mid Grand Valley Dani"},
["dnu"] = {"Danau"},
["dnv"] = {"Danu"},
["dnw"] = {"Western Dani"},
["dny"] = {"Dení"},
["doa"] = {"Dom"},
["dob"] = {"Dobu"},
["doc"] = {"Northern Dong"},
["doe"] = {"Doe"},
["dof"] = {"Domu"},
["doh"] = {"Dong"},
["doi"] = {"Dogri (macrolanguage)"},
["dok"] = {"Dondo"},
["dol"] = {"Doso"},
["don"] = {"Toura (Papua New Guinea)"},
["doo"] = {"Dongo"},
["dop"] = {"Lukpa"},
["doq"] = {"Dominican Sign Language"},
["dor"] = {"Dori'o"},
["dos"] = {"Dogosé"},
["dot"] = {"Dass"},
["dov"] = {"Dombe"},
["dow"] = {"Doyayo"},
["dox"] = {"Bussa"},
["doy"] = {"Dompo"},
["doz"] = {"Dorze"},
["dpp"] = {"Papar"},
["dra"] = {"Dravidian languages"},
["drb"] = {"Dair"},
["drc"] = {"Minderico"},
["drd"] = {"Darmiya"},
["dre"] = {"Dolpo"},
["drg"] = {"Rungus"},
["dri"] = {"C'Lela"},
["drl"] = {"Paakantyi"},
["drn"] = {"West Damar"},
["dro"] = {"Daro-Matu Melanau"},
["drq"] = {"Dura"},
["drs"] = {"Gedeo"},
["drt"] = {"Drents"},
["dru"] = {"Rukai"},
["dry"] = {"Darai"},
["dsb"] = {"Lower Sorbian"},
["dse"] = {"Dutch Sign Language"},
["dsh"] = {"Daasanach"},
["dsi"] = {"Disa"},
["dsk"] = {"Dokshi"},
["dsl"] = {"Danish Sign Language"},
["dsn"] = {"Dusner"},
["dso"] = {"Desiya"},
["dsq"] = {"Tadaksahak"},
["dsz"] = {"Mardin Sign Language"},
["dta"] = {"Daur"},
["dtb"] = {"Labuk-Kinabatangan Kadazan"},
["dtd"] = {"Ditidaht"},
["dth"] = {"Adithinngithigh"},
["dti"] = {"Ana Tinga Dogon"},
["dtk"] = {"Tene Kan Dogon"},
["dtm"] = {"Tomo Kan Dogon"},
["dtn"] = {"Daatsʼíin"},
["dto"] = {"Tommo So Dogon"},
["dtp"] = {"Kadazan Dusun", "Central Dusun"},
["dtr"] = {"Lotud"},
["dts"] = {"Toro So Dogon"},
["dtt"] = {"Toro Tegu Dogon"},
["dtu"] = {"Tebul Ure Dogon"},
["dty"] = {"Dotyali"},
["dua"] = {"Duala"},
["dub"] = {"Dubli"},
["duc"] = {"Duna"},
["due"] = {"Umiray Dumaget Agta"},
["duf"] = {"Dumbea", "Drubea"},
["dug"] = {"Duruma", "Chiduruma"},
["duh"] = {"Dungra Bhil"},
["dui"] = {"Dumun"},
["duk"] = {"Uyajitaya"},
["dul"] = {"Alabat Island Agta"},
["dum"] = {"Middle Dutch (ca. 1050-1350)"},
["dun"] = {"Dusun Deyah"},
["duo"] = {"Dupaninan Agta"},
["dup"] = {"Duano"},
["duq"] = {"Dusun Malang"},
["dur"] = {"Dii"},
["dus"] = {"Dumi"},
["duu"] = {"Drung"},
["duv"] = {"Duvle"},
["duw"] = {"Dusun Witu"},
["dux"] = {"Duungooma"},
["duy"] = {"Dicamay Agta"},
["duz"] = {"Duli-Gey"},
["dva"] = {"Duau"},
["dwa"] = {"Diri"},
["dwk"] = {"Dawik Kui"},
["dwr"] = {"Dawro"},
["dws"] = {"Dutton World Speedwords"},
["dwu"] = {"Dhuwal"},
["dww"] = {"Dawawa"},
["dwy"] = {"Dhuwaya"},
["dwz"] = {"Dewas Rai"},
["dya"] = {"Dyan"},
["dyb"] = {"Dyaberdyaber"},
["dyd"] = {"Dyugun"},
["dyg"] = {"Villa Viciosa Agta"},
["dyi"] = {"Djimini Senoufo"},
["dym"] = {"Yanda Dom Dogon"},
["dyn"] = {"Dyangadi", "Dhanggatti"},
["dyo"] = {"Jola-Fonyi"},
["dyr"] = {"Dyarim"},
["dyu"] = {"Dyula"},
["dyy"] = {"Djabugay", "Dyaabugay"},
["dza"] = {"Tunzu"},
["dzd"] = {"Daza"},
["dze"] = {"Djiwarli"},
["dzg"] = {"Dazaga"},
["dzl"] = {"Dzalakha"},
["dzn"] = {"Dzando"},
["eaa"] = {"Karenggapa"},
["ebc"] = {"Beginci"},
["ebg"] = {"Ebughu"},
["ebk"] = {"Eastern Bontok"},
["ebo"] = {"Teke-Ebo"},
["ebr"] = {"Ebrié"},
["ebu"] = {"Embu", "Kiembu"},
["ecr"] = {"Eteocretan"},
["ecs"] = {"Ecuadorian Sign Language"},
["ecy"] = {"Eteocypriot"},
["eee"] = {"E"},
["efa"] = {"Efai"},
["efe"] = {"Efe"},
["efi"] = {"Efik"},
["ega"] = {"Ega"},
["egl"] = {"Emilian"},
["egm"] = {"Benamanga"},
["ego"] = {"Eggon"},
["egx"] = {"Egyptian languages"},
["egy"] = {"Egyptian (Ancient)"},
["ehs"] = {"Miyakubo Sign Language"},
["ehu"] = {"Ehueun"},
["eip"] = {"Eipomek"},
["eit"] = {"Eitiep"},
["eiv"] = {"Askopan"},
["eja"] = {"Ejamat"},
["eka"] = {"Ekajuk"},
["eke"] = {"Ekit"},
["ekg"] = {"Ekari"},
["eki"] = {"Eki"},
["ekk"] = {"Standard Estonian"},
["ekl"] = {"Kol (Bangladesh)", "Kol"},
["ekm"] = {"Elip"},
["eko"] = {"Koti"},
["ekp"] = {"Ekpeye"},
["ekr"] = {"Yace"},
["eky"] = {"Eastern Kayah"},
["ele"] = {"Elepi"},
["elh"] = {"El Hugeirat"},
["eli"] = {"Nding"},
["elk"] = {"Elkei"},
["elm"] = {"Eleme"},
["elo"] = {"El Molo"},
["elu"] = {"Elu"},
["elx"] = {"Elamite"},
["ema"] = {"Emai-Iuleha-Ora"},
["emb"] = {"Embaloh"},
["eme"] = {"Emerillon"},
["emg"] = {"Eastern Meohang"},
["emi"] = {"Mussau-Emira"},
["emk"] = {"Eastern Maninkakan"},
["emm"] = {"Mamulique"},
["emn"] = {"Eman"},
["emp"] = {"Northern Emberá"},
["emq"] = {"Eastern Minyag"},
["ems"] = {"Pacific Gulf Yupik"},
["emu"] = {"Eastern Muria"},
["emw"] = {"Emplawas"},
["emx"] = {"Erromintxela"},
["emy"] = {"Epigraphic Mayan"},
["emz"] = {"Mbessa"},
["ena"] = {"Apali"},
["enb"] = {"Markweeta"},
["enc"] = {"En"},
["end"] = {"Ende"},
["enf"] = {"Forest Enets"},
["enh"] = {"Tundra Enets"},
["enl"] = {"Enlhet"},
["enm"] = {"Middle English (1100-1500)"},
["enn"] = {"Engenni"},
["eno"] = {"Enggano"},
["enq"] = {"Enga"},
["enr"] = {"Emumu", "Emem"},
["enu"] = {"Enu"},
["env"] = {"Enwan (Edo State)"},
["enw"] = {"Enwan (Akwa Ibom State)"},
["enx"] = {"Enxet"},
["eot"] = {"Beti (Côte d'Ivoire)"},
["epi"] = {"Epie"},
["era"] = {"Eravallan"},
["erg"] = {"Sie"},
["erh"] = {"Eruwa"},
["eri"] = {"Ogea"},
["erk"] = {"South Efate"},
["ero"] = {"Horpa"},
["err"] = {"Erre"},
["ers"] = {"Ersu"},
["ert"] = {"Eritai"},
["erw"] = {"Erokwanas"},
["ese"] = {"Ese Ejja"},
["esg"] = {"Aheri Gondi"},
["esh"] = {"Eshtehardi"},
["esi"] = {"North Alaskan Inupiatun"},
["esk"] = {"Northwest Alaska Inupiatun"},
["esl"] = {"Egypt Sign Language"},
["esm"] = {"Esuma"},
["esn"] = {"Salvadoran Sign Language"},
["eso"] = {"Estonian Sign Language"},
["esq"] = {"Esselen"},
["ess"] = {"Central Siberian Yupik"},
["esu"] = {"Central Yupik"},
["esx"] = {"Eskimo-Aleut languages"},
["esy"] = {"Eskayan"},
["etb"] = {"Etebi"},
["etc"] = {"Etchemin"},
["eth"] = {"Ethiopian Sign Language"},
["etn"] = {"Eton (Vanuatu)"},
["eto"] = {"Eton (Cameroon)"},
["etr"] = {"Edolo"},
["ets"] = {"Yekhee"},
["ett"] = {"Etruscan"},
["etu"] = {"Ejagham"},
["etx"] = {"Eten"},
["etz"] = {"Semimi"},
["eud"] = {"Eudeve"},
["euq"] = {"Basque (family)"},
["eve"] = {"Even"},
["evh"] = {"Uvbie"},
["evn"] = {"Evenki"},
["ewo"] = {"Ewondo"},
["ext"] = {"Extremaduran"},
["eya"] = {"Eyak"},
["eyo"] = {"Keiyo"},
["eza"] = {"Ezaa"},
["eze"] = {"Uzekwe"},
["faa"] = {"Fasu"},
["fab"] = {"Fa d'Ambu"},
["fad"] = {"Wagi"},
["faf"] = {"Fagani"},
["fag"] = {"Finongan"},
["fah"] = {"Baissa Fali"},
["fai"] = {"Faiwol"},
["faj"] = {"Faita"},
["fak"] = {"Fang (Cameroon)"},
["fal"] = {"South Fali"},
["fam"] = {"Fam"},
["fan"] = {"Fang (Equatorial Guinea)"},
["fap"] = {"Paloor"},
["far"] = {"Fataleka"},
["fat"] = {"Fanti"},
["fau"] = {"Fayu"},
["fax"] = {"Fala"},
["fay"] = {"Southwestern Fars"},
["faz"] = {"Northwestern Fars"},
["fbl"] = {"West Albay Bikol"},
["fcs"] = {"Quebec Sign Language"},
["fer"] = {"Feroge"},
["ffi"] = {"Foia Foia"},
["ffm"] = {"Maasina Fulfulde"},
["fgr"] = {"Fongoro"},
["fia"] = {"Nobiin"},
["fie"] = {"Fyer"},
["fif"] = {"Faifi"},
["fil"] = {"Filipino", "Pilipino"},
["fip"] = {"Fipa"},
["fir"] = {"Firan"},
["fit"] = {"Tornedalen Finnish", "Meänkieli"},
["fiu"] = {"Finno-Ugrian languages"},
["fiw"] = {"Fiwaga"},
["fkk"] = {"Kirya-Konzəl"},
["fkv"] = {"Kven Finnish"},
["fla"] = {"Kalispel-Pend d'Oreille"},
["flh"] = {"Foau"},
["fli"] = {"Fali"},
["fll"] = {"North Fali"},
["fln"] = {"Flinders Island"},
["flr"] = {"Fuliiru"},
["fly"] = {"Flaaitaal", "Tsotsitaal"},
["fmp"] = {"Fe'fe'"},
["fmu"] = {"Far Western Muria"},
["fnb"] = {"Fanbak"},
["fng"] = {"Fanagalo"},
["fni"] = {"Fania"},
["fod"] = {"Foodo"},
["foi"] = {"Foi"},
["fom"] = {"Foma"},
["fon"] = {"Fon"},
["for"] = {"Fore"},
["fos"] = {"Siraya"},
["fox"] = {"Formosan languages"},
["fpe"] = {"Fernando Po Creole English"},
["fqs"] = {"Fas"},
["frc"] = {"Cajun French"},
["frd"] = {"Fordata"},
["frk"] = {"Frankish"},
["frm"] = {"Middle French (ca. 1400-1600)"},
["fro"] = {"Old French (842-ca. 1400)"},
["frp"] = {"Arpitan", "Francoprovençal"},
["frq"] = {"Forak"},
["frr"] = {"Northern Frisian"},
["frs"] = {"Eastern Frisian"},
["frt"] = {"Fortsenal"},
["fse"] = {"Finnish Sign Language"},
["fsl"] = {"French Sign Language"},
["fss"] = {"Finland-Swedish Sign Language", "finlandssvenskt teckenspråk", "suomenruotsalainen viittomakieli"},
["fub"] = {"Adamawa Fulfulde"},
["fuc"] = {"Pulaar"},
["fud"] = {"East Futuna"},
["fue"] = {"Borgu Fulfulde"},
["fuf"] = {"Pular"},
["fuh"] = {"Western Niger Fulfulde"},
["fui"] = {"Bagirmi Fulfulde"},
["fuj"] = {"Ko"},
["fum"] = {"Fum"},
["fun"] = {"Fulniô"},
["fuq"] = {"Central-Eastern Niger Fulfulde"},
["fur"] = {"Friulian"},
["fut"] = {"Futuna-Aniwa"},
["fuu"] = {"Furu"},
["fuv"] = {"Nigerian Fulfulde"},
["fuy"] = {"Fuyug"},
["fvr"] = {"Fur"},
["fwa"] = {"Fwâi"},
["fwe"] = {"Fwe"},
["gaa"] = {"Ga"},
["gab"] = {"Gabri"},
["gac"] = {"Mixed Great Andamanese"},
["gad"] = {"Gaddang"},
["gae"] = {"Guarequena"},
["gaf"] = {"Gende"},
["gag"] = {"Gagauz"},
["gah"] = {"Alekano"},
["gai"] = {"Borei"},
["gaj"] = {"Gadsup"},
["gak"] = {"Gamkonora"},
["gal"] = {"Galolen"},
["gam"] = {"Kandawo"},
["gan"] = {"Gan Chinese"},
["gao"] = {"Gants"},
["gap"] = {"Gal"},
["gaq"] = {"Gata'"},
["gar"] = {"Galeya"},
["gas"] = {"Adiwasi Garasia"},
["gat"] = {"Kenati"},
["gau"] = {"Mudhili Gadaba"},
["gaw"] = {"Nobonob"},
["gax"] = {"Borana-Arsi-Guji Oromo"},
["gay"] = {"Gayo"},
["gaz"] = {"West Central Oromo"},
["gba"] = {"Gbaya (Central African Republic)"},
["gbb"] = {"Kaytetye"},
["gbd"] = {"Karajarri"},
["gbe"] = {"Niksek"},
["gbf"] = {"Gaikundi"},
["gbg"] = {"Gbanziri"},
["gbh"] = {"Defi Gbe"},
["gbi"] = {"Galela"},
["gbj"] = {"Bodo Gadaba"},
["gbk"] = {"Gaddi"},
["gbl"] = {"Gamit"},
["gbm"] = {"Garhwali"},
["gbn"] = {"Mo'da"},
["gbo"] = {"Northern Grebo"},
["gbp"] = {"Gbaya-Bossangoa"},
["gbq"] = {"Gbaya-Bozoum"},
["gbr"] = {"Gbagyi"},
["gbs"] = {"Gbesi Gbe"},
["gbu"] = {"Gagadu"},
["gbv"] = {"Gbanu"},
["gbw"] = {"Gabi-Gabi"},
["gbx"] = {"Eastern Xwla Gbe"},
["gby"] = {"Gbari"},
["gbz"] = {"Zoroastrian Dari"},
["gcc"] = {"Mali"},
["gcd"] = {"Ganggalida"},
["gce"] = {"Galice"},
["gcf"] = {"Guadeloupean Creole French"},
["gcl"] = {"Grenadian Creole English"},
["gcn"] = {"Gaina"},
["gcr"] = {"Guianese Creole French"},
["gct"] = {"Colonia Tovar German"},
["gda"] = {"Gade Lohar"},
["gdb"] = {"Pottangi Ollar Gadaba"},
["gdc"] = {"Gugu Badhun"},
["gdd"] = {"Gedaged"},
["gde"] = {"Gude"},
["gdf"] = {"Guduf-Gava"},
["gdg"] = {"Ga'dang"},
["gdh"] = {"Gadjerawang", "Gajirrabeng"},
["gdi"] = {"Gundi"},
["gdj"] = {"Gurdjar"},
["gdk"] = {"Gadang"},
["gdl"] = {"Dirasha"},
["gdm"] = {"Laal"},
["gdn"] = {"Umanakaina"},
["gdo"] = {"Ghodoberi"},
["gdq"] = {"Mehri"},
["gdr"] = {"Wipi"},
["gds"] = {"Ghandruk Sign Language"},
["gdt"] = {"Kungardutyi"},
["gdu"] = {"Gudu"},
["gdx"] = {"Godwari"},
["gea"] = {"Geruma"},
["geb"] = {"Kire"},
["gec"] = {"Gboloo Grebo"},
["ged"] = {"Gade"},
["gef"] = {"Gerai"},
["geg"] = {"Gengle"},
["geh"] = {"Hutterite German", "Hutterisch"},
["gei"] = {"Gebe"},
["gej"] = {"Gen"},
["gek"] = {"Ywom"},
["gel"] = {"ut-Ma'in"},
["gem"] = {"Germanic languages"},
["geq"] = {"Geme"},
["ges"] = {"Geser-Gorom"},
["gev"] = {"Eviya"},
["gew"] = {"Gera"},
["gex"] = {"Garre"},
["gey"] = {"Enya"},
["gez"] = {"Geez"},
["gfk"] = {"Patpatar"},
["gft"] = {"Gafat"},
["gga"] = {"Gao"},
["ggb"] = {"Gbii"},
["ggd"] = {"Gugadj"},
["gge"] = {"Gurr-goni"},
["ggg"] = {"Gurgula"},
["ggk"] = {"Kungarakany"},
["ggl"] = {"Ganglau"},
["ggt"] = {"Gitua"},
["ggu"] = {"Gagu", "Gban"},
["ggw"] = {"Gogodala"},
["gha"] = {"Ghadamès"},
["ghc"] = {"Hiberno-Scottish Gaelic"},
["ghe"] = {"Southern Ghale"},
["ghh"] = {"Northern Ghale"},
["ghk"] = {"Geko Karen"},
["ghl"] = {"Ghulfan"},
["ghn"] = {"Ghanongga"},
["gho"] = {"Ghomara"},
["ghr"] = {"Ghera"},
["ghs"] = {"Guhu-Samane"},
["ght"] = {"Kuke", "Kutang Ghale"},
["gia"] = {"Kija"},
["gib"] = {"Gibanawa"},
["gic"] = {"Gail"},
["gid"] = {"Gidar"},
["gie"] = {"Gaɓogbo", "Guébie"},
["gig"] = {"Goaria"},
["gih"] = {"Githabul"},
["gii"] = {"Girirra"},
["gil"] = {"Gilbertese"},
["gim"] = {"Gimi (Eastern Highlands)"},
["gin"] = {"Hinukh"},
["gip"] = {"Gimi (West New Britain)"},
["giq"] = {"Green Gelao"},
["gir"] = {"Red Gelao"},
["gis"] = {"North Giziga"},
["git"] = {"Gitxsan"},
["giu"] = {"Mulao"},
["giw"] = {"White Gelao"},
["gix"] = {"Gilima"},
["giy"] = {"Giyug"},
["giz"] = {"South Giziga"},
["gjk"] = {"Kachi Koli"},
["gjm"] = {"Gunditjmara"},
["gjn"] = {"Gonja"},
["gjr"] = {"Gurindji Kriol"},
["gju"] = {"Gujari"},
["gka"] = {"Guya"},
["gkd"] = {"Magɨ (Madang Province)"},
["gke"] = {"Ndai"},
["gkn"] = {"Gokana"},
["gko"] = {"Kok-Nar"},
["gkp"] = {"Guinea Kpelle"},
["gku"] = {"ǂUngkue"},
["glb"] = {"Belning"},
["glc"] = {"Bon Gula"},
["gld"] = {"Nanai"},
["glh"] = {"Northwest Pashai", "Northwest Pashayi"},
["glj"] = {"Gula Iro"},
["glk"] = {"Gilaki"},
["gll"] = {"Garlali"},
["glo"] = {"Galambu"},
["glr"] = {"Glaro-Twabo"},
["glu"] = {"Gula (Chad)"},
["glw"] = {"Glavda"},
["gly"] = {"Gule"},
["gma"] = {"Gambera"},
["gmb"] = {"Gula'alaa"},
["gmd"] = {"Mághdì"},
["gme"] = {"East Germanic languages"},
["gmg"] = {"Magɨyi"},
["gmh"] = {"Middle High German (ca. 1050-1500)"},
["gml"] = {"Middle Low German"},
["gmm"] = {"Gbaya-Mbodomo"},
["gmn"] = {"Gimnime"},
["gmq"] = {"North Germanic languages"},
["gmr"] = {"Mirning", "Mirniny"},
["gmu"] = {"Gumalu"},
["gmv"] = {"Gamo"},
["gmw"] = {"West Germanic languages"},
["gmx"] = {"Magoma"},
["gmy"] = {"Mycenaean Greek"},
["gmz"] = {"Mgbolizhia"},
["gna"] = {"Kaansa"},
["gnb"] = {"Gangte"},
["gnc"] = {"Guanche"},
["gnd"] = {"Zulgo-Gemzek"},
["gne"] = {"Ganang"},
["gng"] = {"Ngangam"},
["gnh"] = {"Lere"},
["gni"] = {"Gooniyandi"},
["gnj"] = {"Ngen"},
["gnk"] = {"ǁGana"},
["gnl"] = {"Gangulu"},
["gnm"] = {"Ginuman"},
["gnn"] = {"Gumatj"},
["gno"] = {"Northern Gondi"},
["gnq"] = {"Gana"},
["gnr"] = {"Gureng Gureng"},
["gnt"] = {"Guntai"},
["gnu"] = {"Gnau"},
["gnw"] = {"Western Bolivian Guaraní"},
["gnz"] = {"Ganzi"},
["goa"] = {"Guro"},
["gob"] = {"Playero"},
["goc"] = {"Gorakor"},
["god"] = {"Godié"},
["goe"] = {"Gongduk"},
["gof"] = {"Gofa"},
["gog"] = {"Gogo"},
["goh"] = {"Old High German (ca. 750-1050)"},
["goi"] = {"Gobasi"},
["goj"] = {"Gowlan"},
["gok"] = {"Gowli"},
["gol"] = {"Gola"},
["gom"] = {"Goan Konkani"},
["gon"] = {"Gondi"},
["goo"] = {"Gone Dau"},
["gop"] = {"Yeretuar"},
["goq"] = {"Gorap"},
["gor"] = {"Gorontalo"},
["gos"] = {"Gronings"},
["got"] = {"Gothic"},
["gou"] = {"Gavar"},
["gov"] = {"Goo"},
["gow"] = {"Gorowa"},
["gox"] = {"Gobu"},
["goy"] = {"Goundo"},
["goz"] = {"Gozarkhani"},
["gpa"] = {"Gupa-Abawa"},
["gpe"] = {"Ghanaian Pidgin English"},
["gpn"] = {"Taiap"},
["gqa"] = {"Ga'anda"},
["gqi"] = {"Guiqiong"},
["gqn"] = {"Guana (Brazil)"},
["gqr"] = {"Gor"},
["gqu"] = {"Qau"},
["gra"] = {"Rajput Garasia"},
["grb"] = {"Grebo"},
["grc"] = {"Ancient Greek (to 1453)"},
["grd"] = {"Guruntum-Mbaaru"},
["grg"] = {"Madi"},
["grh"] = {"Gbiri-Niragu"},
["gri"] = {"Ghari"},
["grj"] = {"Southern Grebo"},
["grk"] = {"Greek languages"},
["grm"] = {"Kota Marudu Talantang"},
["gro"] = {"Groma"},
["grq"] = {"Gorovu"},
["grr"] = {"Taznatit"},
["grs"] = {"Gresi"},
["grt"] = {"Garo"},
["gru"] = {"Kistane"},
["grv"] = {"Central Grebo"},
["grw"] = {"Gweda"},
["grx"] = {"Guriaso"},
["gry"] = {"Barclayville Grebo"},
["grz"] = {"Guramalum"},
["gse"] = {"Ghanaian Sign Language"},
["gsg"] = {"German Sign Language"},
["gsl"] = {"Gusilay"},
["gsm"] = {"Guatemalan Sign Language"},
["gsn"] = {"Nema", "Gusan"},
["gso"] = {"Southwest Gbaya"},
["gsp"] = {"Wasembo"},
["gss"] = {"Greek Sign Language"},
["gsw"] = {"Swiss German", "Alemannic", "Alsatian"},
["gta"] = {"Guató"},
["gtu"] = {"Aghu-Tharnggala"},
["gua"] = {"Shiki"},
["gub"] = {"Guajajára"},
["guc"] = {"Wayuu"},
["gud"] = {"Yocoboué Dida"},
["gue"] = {"Gurindji"},
["guf"] = {"Gupapuyngu"},
["gug"] = {"Paraguayan Guaraní"},
["guh"] = {"Guahibo"},
["gui"] = {"Eastern Bolivian Guaraní"},
["guk"] = {"Gumuz"},
["gul"] = {"Sea Island Creole English"},
["gum"] = {"Guambiano"},
["gun"] = {"Mbyá Guaraní"},
["guo"] = {"Guayabero"},
["gup"] = {"Gunwinggu"},
["guq"] = {"Aché"},
["gur"] = {"Farefare"},
["gus"] = {"Guinean Sign Language"},
["gut"] = {"Maléku Jaíka"},
["guu"] = {"Yanomamö"},
["guw"] = {"Gun"},
["gux"] = {"Gourmanchéma"},
["guz"] = {"Gusii", "Ekegusii"},
["gva"] = {"Guana (Paraguay)"},
["gvc"] = {"Guanano"},
["gve"] = {"Duwet"},
["gvf"] = {"Golin"},
["gvj"] = {"Guajá"},
["gvl"] = {"Gulay"},
["gvm"] = {"Gurmana"},
["gvn"] = {"Kuku-Yalanji"},
["gvo"] = {"Gavião Do Jiparaná"},
["gvp"] = {"Pará Gavião"},
["gvr"] = {"Gurung"},
["gvs"] = {"Gumawana"},
["gvy"] = {"Guyani"},
["gwa"] = {"Mbato"},
["gwb"] = {"Gwa"},
["gwc"] = {"Gawri", "Kalami"},
["gwd"] = {"Gawwada"},
["gwe"] = {"Gweno"},
["gwf"] = {"Gowro"},
["gwg"] = {"Moo"},
["gwi"] = {"Gwichʼin"},
["gwj"] = {"ǀGwi"},
["gwm"] = {"Awngthim"},
["gwn"] = {"Gwandara"},
["gwr"] = {"Gwere"},
["gwt"] = {"Gawar-Bati"},
["gwu"] = {"Guwamu"},
["gww"] = {"Kwini"},
["gwx"] = {"Gua"},
["gxx"] = {"Wè Southern"},
["gya"] = {"Northwest Gbaya"},
["gyb"] = {"Garus"},
["gyd"] = {"Kayardild"},
["gye"] = {"Gyem"},
["gyf"] = {"Gungabula"},
["gyg"] = {"Gbayi"},
["gyi"] = {"Gyele"},
["gyl"] = {"Gayil"},
["gym"] = {"Ngäbere"},
["gyn"] = {"Guyanese Creole English"},
["gyo"] = {"Gyalsumdo"},
["gyr"] = {"Guarayu"},
["gyy"] = {"Gunya"},
["gyz"] = {"Geji", "Gyaazi"},
["gza"] = {"Ganza"},
["gzi"] = {"Gazi"},
["gzn"] = {"Gane"},
["haa"] = {"Han"},
["hab"] = {"Hanoi Sign Language"},
["hac"] = {"Gurani"},
["had"] = {"Hatam"},
["hae"] = {"Eastern Oromo"},
["haf"] = {"Haiphong Sign Language"},
["hag"] = {"Hanga"},
["hah"] = {"Hahon"},
["hai"] = {"Haida"},
["haj"] = {"Hajong"},
["hak"] = {"Hakka Chinese"},
["hal"] = {"Halang"},
["ham"] = {"Hewa"},
["han"] = {"Hangaza"},
["hao"] = {"Hakö"},
["hap"] = {"Hupla"},
["haq"] = {"Ha"},
["har"] = {"Harari"},
["has"] = {"Haisla"},
["hav"] = {"Havu"},
["haw"] = {"Hawaiian"},
["hax"] = {"Southern Haida"},
["hay"] = {"Haya"},
["haz"] = {"Hazaragi"},
["hba"] = {"Hamba"},
["hbb"] = {"Huba"},
["hbn"] = {"Heiban"},
["hbo"] = {"Ancient Hebrew"},
["hbu"] = {"Habu"},
["hca"] = {"Andaman Creole Hindi"},
["hch"] = {"Huichol"},
["hdn"] = {"Northern Haida"},
["hds"] = {"Honduras Sign Language"},
["hdy"] = {"Hadiyya"},
["hea"] = {"Northern Qiandong Miao"},
["hed"] = {"Herdé"},
["heg"] = {"Helong"},
["heh"] = {"Hehe"},
["hei"] = {"Heiltsuk"},
["hem"] = {"Hemba"},
["hgm"] = {"Haiǁom"},
["hgw"] = {"Haigwai"},
["hhi"] = {"Hoia Hoia"},
["hhr"] = {"Kerak"},
["hhy"] = {"Hoyahoya"},
["hia"] = {"Lamang"},
["hib"] = {"Hibito"},
["hid"] = {"Hidatsa"},
["hif"] = {"Fiji Hindi"},
["hig"] = {"Kamwe"},
["hih"] = {"Pamosu"},
["hii"] = {"Hinduri"},
["hij"] = {"Hijuk"},
["hik"] = {"Seit-Kaitetu"},
["hil"] = {"Hiligaynon"},
["him"] = {"Himachali languages", "Western Pahari languages"},
["hio"] = {"Tsoa"},
["hir"] = {"Himarimã"},
["hit"] = {"Hittite"},
["hiw"] = {"Hiw"},
["hix"] = {"Hixkaryána"},
["hji"] = {"Haji"},
["hka"] = {"Kahe"},
["hke"] = {"Hunde"},
["hkh"] = {"Khah", "Poguli"},
["hkk"] = {"Hunjara-Kaina Ke"},
["hkn"] = {"Mel-Khaonh"},
["hks"] = {"Hong Kong Sign Language", "Heung Kong Sau Yue"},
["hla"] = {"Halia"},
["hlb"] = {"Halbi"},
["hld"] = {"Halang Doan"},
["hle"] = {"Hlersu"},
["hlt"] = {"Matu Chin"},
["hlu"] = {"Hieroglyphic Luwian"},
["hma"] = {"Southern Mashan Hmong", "Southern Mashan Miao"},
["hmb"] = {"Humburi Senni Songhay"},
["hmc"] = {"Central Huishui Hmong", "Central Huishui Miao"},
["hmd"] = {"Large Flowery Miao", "A-hmaos", "Da-Hua Miao"},
["hme"] = {"Eastern Huishui Hmong", "Eastern Huishui Miao"},
["hmf"] = {"Hmong Don"},
["hmg"] = {"Southwestern Guiyang Hmong"},
["hmh"] = {"Southwestern Huishui Hmong", "Southwestern Huishui Miao"},
["hmi"] = {"Northern Huishui Hmong", "Northern Huishui Miao"},
["hmj"] = {"Ge", "Gejia"},
["hmk"] = {"Maek"},
["hml"] = {"Luopohe Hmong", "Luopohe Miao"},
["hmm"] = {"Central Mashan Hmong", "Central Mashan Miao"},
["hmn"] = {"Hmong", "Mong"},
["hmp"] = {"Northern Mashan Hmong", "Northern Mashan Miao"},
["hmq"] = {"Eastern Qiandong Miao"},
["hmr"] = {"Hmar"},
["hms"] = {"Southern Qiandong Miao"},
["hmt"] = {"Hamtai"},
["hmu"] = {"Hamap"},
["hmv"] = {"Hmong Dô"},
["hmw"] = {"Western Mashan Hmong", "Western Mashan Miao"},
["hmx"] = {"Hmong-Mien languages"},
["hmy"] = {"Southern Guiyang Hmong", "Southern Guiyang Miao"},
["hmz"] = {"Hmong Shua", "Sinicized Miao"},
["hna"] = {"Mina (Cameroon)"},
["hnd"] = {"Southern Hindko"},
["hne"] = {"Chhattisgarhi"},
["hng"] = {"Hungu"},
["hnh"] = {"ǁAni"},
["hni"] = {"Hani"},
["hnj"] = {"Hmong Njua", "Mong Leng", "Mong Njua"},
["hnn"] = {"Hanunoo"},
["hno"] = {"Northern Hindko"},
["hns"] = {"Caribbean Hindustani"},
["hnu"] = {"Hung"},
["hoa"] = {"Hoava"},
["hob"] = {"Mari (Madang Province)"},
["hoc"] = {"Ho"},
["hod"] = {"Holma"},
["hoe"] = {"Horom"},
["hoh"] = {"Hobyót"},
["hoi"] = {"Holikachuk"},
["hoj"] = {"Hadothi", "Haroti"},
["hok"] = {"Hokan languages"},
["hol"] = {"Holu"},
["hom"] = {"Homa"},
["hoo"] = {"Holoholo"},
["hop"] = {"Hopi"},
["hor"] = {"Horo"},
["hos"] = {"Ho Chi Minh City Sign Language"},
["hot"] = {"Hote", "Malê"},
["hov"] = {"Hovongan"},
["how"] = {"Honi"},
["hoy"] = {"Holiya"},
["hoz"] = {"Hozo"},
["hpo"] = {"Hpon"},
["hps"] = {"Hawai'i Sign Language (HSL)", "Hawai'i Pidgin Sign Language"},
["hra"] = {"Hrangkhol"},
["hrc"] = {"Niwer Mil"},
["hre"] = {"Hre"},
["hrk"] = {"Haruku"},
["hrm"] = {"Horned Miao"},
["hro"] = {"Haroi"},
["hrp"] = {"Nhirrpi"},
["hrt"] = {"Hértevin"},
["hru"] = {"Hruso"},
["hrw"] = {"Warwar Feni"},
["hrx"] = {"Hunsrik"},
["hrz"] = {"Harzani"},
["hsb"] = {"Upper Sorbian"},
["hsh"] = {"Hungarian Sign Language"},
["hsl"] = {"Hausa Sign Language"},
["hsn"] = {"Xiang Chinese"},
["hss"] = {"Harsusi"},
["hti"] = {"Hoti"},
["hto"] = {"Minica Huitoto"},
["hts"] = {"Hadza"},
["htu"] = {"Hitu"},
["htx"] = {"Middle Hittite"},
["hub"] = {"Huambisa"},
["huc"] = {"ǂHua", "ǂʼAmkhoe"},
["hud"] = {"Huaulu"},
["hue"] = {"San Francisco Del Mar Huave"},
["huf"] = {"Humene"},
["hug"] = {"Huachipaeri"},
["huh"] = {"Huilliche"},
["hui"] = {"Huli"},
["huj"] = {"Northern Guiyang Hmong", "Northern Guiyang Miao"},
["huk"] = {"Hulung"},
["hul"] = {"Hula"},
["hum"] = {"Hungana"},
["huo"] = {"Hu"},
["hup"] = {"Hupa"},
["huq"] = {"Tsat"},
["hur"] = {"Halkomelem"},
["hus"] = {"Huastec"},
["hut"] = {"Humla"},
["huu"] = {"Murui Huitoto"},
["huv"] = {"San Mateo Del Mar Huave"},
["huw"] = {"Hukumina"},
["hux"] = {"Nüpode Huitoto"},
["huy"] = {"Hulaulá"},
["huz"] = {"Hunzib"},
["hvc"] = {"Haitian Vodoun Culture Language"},
["hve"] = {"San Dionisio Del Mar Huave"},
["hvk"] = {"Haveke"},
["hvn"] = {"Sabu"},
["hvv"] = {"Santa María Del Mar Huave"},
["hwa"] = {"Wané"},
["hwc"] = {"Hawai'i Creole English", "Hawai'i Pidgin"},
["hwo"] = {"Hwana"},
["hya"] = {"Hya"},
["hyw"] = {"Western Armenian"},
["hyx"] = {"Armenian (family)"},
["iai"] = {"Iaai"},
["ian"] = {"Iatmul"},
["iar"] = {"Purari"},
["iba"] = {"Iban"},
["ibb"] = {"Ibibio"},
["ibd"] = {"Iwaidja"},
["ibe"] = {"Akpes"},
["ibg"] = {"Ibanag"},
["ibh"] = {"Bih"},
["ibl"] = {"Ibaloi"},
["ibm"] = {"Agoi"},
["ibn"] = {"Ibino"},
["ibr"] = {"Ibuoro"},
["ibu"] = {"Ibu"},
["iby"] = {"Ibani"},
["ica"] = {"Ede Ica"},
["ich"] = {"Etkywan"},
["icl"] = {"Icelandic Sign Language"},
["icr"] = {"Islander Creole English"},
["ida"] = {"Idakho-Isukha-Tiriki", "Luidakho-Luisukha-Lutirichi"},
["idb"] = {"Indo-Portuguese"},
["idc"] = {"Idon", "Ajiya"},
["idd"] = {"Ede Idaca"},
["ide"] = {"Idere"},
["idi"] = {"Idi"},
["idr"] = {"Indri"},
["ids"] = {"Idesa"},
["idt"] = {"Idaté"},
["idu"] = {"Idoma"},
["ifa"] = {"Amganad Ifugao"},
["ifb"] = {"Batad Ifugao", "Ayangan Ifugao"},
["ife"] = {"Ifè"},
["iff"] = {"Ifo"},
["ifk"] = {"Tuwali Ifugao"},
["ifm"] = {"Teke-Fuumu"},
["ifu"] = {"Mayoyao Ifugao"},
["ify"] = {"Keley-I Kallahan"},
["igb"] = {"Ebira"},
["ige"] = {"Igede"},
["igg"] = {"Igana"},
["igl"] = {"Igala"},
["igm"] = {"Kanggape"},
["ign"] = {"Ignaciano"},
["igo"] = {"Isebe"},
["igs"] = {"Interglossa"},
["igw"] = {"Igwe"},
["ihb"] = {"Iha Based Pidgin"},
["ihi"] = {"Ihievbe"},
["ihp"] = {"Iha"},
["ihw"] = {"Bidhawal"},
["iin"] = {"Thiin"},
["iir"] = {"Indo-Iranian languages"},
["ijc"] = {"Izon"},
["ije"] = {"Biseni"},
["ijj"] = {"Ede Ije"},
["ijn"] = {"Kalabari"},
["ijo"] = {"Ijo languages"},
["ijs"] = {"Southeast Ijo"},
["ike"] = {"Eastern Canadian Inuktitut"},
["ikh"] = {"Ikhin-Arokho"},
["iki"] = {"Iko"},
["ikk"] = {"Ika"},
["ikl"] = {"Ikulu"},
["iko"] = {"Olulumo-Ikom"},
["ikp"] = {"Ikpeshi"},
["ikr"] = {"Ikaranggal"},
["iks"] = {"Inuit Sign Language"},
["ikt"] = {"Inuinnaqtun", "Western Canadian Inuktitut"},
["ikv"] = {"Iku-Gora-Ankwa"},
["ikw"] = {"Ikwere"},
["ikx"] = {"Ik"},
["ikz"] = {"Ikizu"},
["ila"] = {"Ile Ape"},
["ilb"] = {"Ila"},
["ilg"] = {"Garig-Ilgar"},
["ili"] = {"Ili Turki"},
["ilk"] = {"Ilongot"},
["ilm"] = {"Iranun (Malaysia)"},
["ilo"] = {"Iloko"},
["ilp"] = {"Iranun (Philippines)"},
["ils"] = {"International Sign"},
["ilu"] = {"Ili'uun"},
["ilv"] = {"Ilue"},
["ima"] = {"Mala Malasar"},
["imi"] = {"Anamgura"},
["iml"] = {"Miluk"},
["imn"] = {"Imonda"},
["imo"] = {"Imbongu"},
["imr"] = {"Imroing"},
["ims"] = {"Marsian"},
["imt"] = {"Imotong"},
["imy"] = {"Milyan"},
["inb"] = {"Inga"},
["inc"] = {"Indic languages"},
["ine"] = {"Indo-European languages"},
["ing"] = {"Degexit'an"},
["inh"] = {"Ingush"},
["inj"] = {"Jungle Inga"},
["inl"] = {"Indonesian Sign Language"},
["inm"] = {"Minaean"},
["inn"] = {"Isinai"},
["ino"] = {"Inoke-Yate"},
["inp"] = {"Iñapari"},
["ins"] = {"Indian Sign Language"},
["int"] = {"Intha"},
["inz"] = {"Ineseño"},
["ior"] = {"Inor"},
["iou"] = {"Tuma-Irumu"},
["iow"] = {"Iowa-Oto"},
["ipi"] = {"Ipili"},
["ipo"] = {"Ipiko"},
["iqu"] = {"Iquito"},
["iqw"] = {"Ikwo"},
["ira"] = {"Iranian languages"},
["ire"] = {"Iresim"},
["irh"] = {"Irarutu"},
["iri"] = {"Rigwe", "Irigwe"},
["irk"] = {"Iraqw"},
["irn"] = {"Irántxe"},
["iro"] = {"Iroquoian languages"},
["irr"] = {"Ir"},
["iru"] = {"Irula"},
["irx"] = {"Kamberau"},
["iry"] = {"Iraya"},
["isa"] = {"Isabi"},
["isc"] = {"Isconahua"},
["isd"] = {"Isnag"},
["ise"] = {"Italian Sign Language"},
["isg"] = {"Irish Sign Language"},
["ish"] = {"Esan"},
["isi"] = {"Nkem-Nkum"},
["isk"] = {"Ishkashimi"},
["ism"] = {"Masimasi"},
["isn"] = {"Isanzu"},
["iso"] = {"Isoko"},
["isr"] = {"Israeli Sign Language"},
["ist"] = {"Istriot"},
["isu"] = {"Isu (Menchum Division)"},
["itb"] = {"Binongan Itneg"},
["itc"] = {"Italic languages"},
["itd"] = {"Southern Tidung"},
["ite"] = {"Itene"},
["iti"] = {"Inlaod Itneg"},
["itk"] = {"Judeo-Italian"},
["itl"] = {"Itelmen"},
["itm"] = {"Itu Mbon Uzo"},
["ito"] = {"Itonama"},
["itr"] = {"Iteri"},
["its"] = {"Isekiri"},
["itt"] = {"Maeng Itneg"},
["itv"] = {"Itawit"},
["itw"] = {"Ito"},
["itx"] = {"Itik"},
["ity"] = {"Moyadan Itneg"},
["itz"] = {"Itzá"},
["ium"] = {"Iu Mien"},
["ivb"] = {"Ibatan"},
["ivv"] = {"Ivatan"},
["iwk"] = {"I-Wak"},
["iwm"] = {"Iwam"},
["iwo"] = {"Iwur"},
["iws"] = {"Sepik Iwam"},
["ixc"] = {"Ixcatec"},
["ixl"] = {"Ixil"},
["iya"] = {"Iyayu"},
["iyo"] = {"Mesaka"},
["iyx"] = {"Yaka (Congo)"},
["izh"] = {"Ingrian"},
["izm"] = {"Kizamani"},
["izr"] = {"Izere"},
["izz"] = {"Izii"},
["jaa"] = {"Jamamadí"},
["jab"] = {"Hyam"},
["jac"] = {"Popti'", "Jakalteko"},
["jad"] = {"Jahanka"},
["jae"] = {"Yabem"},
["jaf"] = {"Jara"},
["jah"] = {"Jah Hut"},
["jaj"] = {"Zazao"},
["jak"] = {"Jakun"},
["jal"] = {"Yalahatan"},
["jam"] = {"Jamaican Creole English"},
["jan"] = {"Jandai"},
["jao"] = {"Yanyuwa"},
["jaq"] = {"Yaqay"},
["jas"] = {"New Caledonian Javanese"},
["jat"] = {"Jakati"},
["jau"] = {"Yaur"},
["jax"] = {"Jambi Malay"},
["jay"] = {"Yan-nhangu", "Nhangu"},
["jaz"] = {"Jawe"},
["jbe"] = {"Judeo-Berber"},
["jbi"] = {"Badjiri"},
["jbj"] = {"Arandai"},
["jbk"] = {"Barikewa"},
["jbm"] = {"Bijim"},
["jbn"] = {"Nafusi"},
["jbo"] = {"Lojban"},
["jbr"] = {"Jofotek-Bromnya"},
["jbt"] = {"Jabutí"},
["jbu"] = {"Jukun Takum"},
["jbw"] = {"Yawijibaya"},
["jcs"] = {"Jamaican Country Sign Language"},
["jct"] = {"Krymchak"},
["jda"] = {"Jad"},
["jdg"] = {"Jadgali"},
["jdt"] = {"Judeo-Tat"},
["jeb"] = {"Jebero"},
["jee"] = {"Jerung"},
["jeh"] = {"Jeh"},
["jei"] = {"Yei"},
["jek"] = {"Jeri Kuo"},
["jel"] = {"Yelmek"},
["jen"] = {"Dza"},
["jer"] = {"Jere"},
["jet"] = {"Manem"},
["jeu"] = {"Jonkor Bourmataguil"},
["jgb"] = {"Ngbee"},
["jge"] = {"Judeo-Georgian"},
["jgk"] = {"Gwak"},
["jgo"] = {"Ngomba"},
["jhi"] = {"Jehai"},
["jhs"] = {"Jhankot Sign Language"},
["jia"] = {"Jina"},
["jib"] = {"Jibu"},
["jic"] = {"Tol"},
["jid"] = {"Bu (Kaduna State)"},
["jie"] = {"Jilbe"},
["jig"] = {"Jingulu", "Djingili"},
["jih"] = {"sTodsde", "Shangzhai"},
["jii"] = {"Jiiddu"},
["jil"] = {"Jilim"},
["jim"] = {"Jimi (Cameroon)"},
["jio"] = {"Jiamao"},
["jiq"] = {"Guanyinqiao", "Lavrung"},
["jit"] = {"Jita"},
["jiu"] = {"Youle Jinuo"},
["jiv"] = {"Shuar"},
["jiy"] = {"Buyuan Jinuo"},
["jje"] = {"Jejueo"},
["jjr"] = {"Bankal"},
["jka"] = {"Kaera"},
["jkm"] = {"Mobwa Karen"},
["jko"] = {"Kubo"},
["jkp"] = {"Paku Karen"},
["jkr"] = {"Koro (India)"},
["jks"] = {"Amami Koniya Sign Language"},
["jku"] = {"Labir"},
["jle"] = {"Ngile"},
["jls"] = {"Jamaican Sign Language"},
["jma"] = {"Dima"},
["jmb"] = {"Zumbun"},
["jmc"] = {"Machame"},
["jmd"] = {"Yamdena"},
["jmi"] = {"Jimi (Nigeria)"},
["jml"] = {"Jumli"},
["jmn"] = {"Makuri Naga"},
["jmr"] = {"Kamara"},
["jms"] = {"Mashi (Nigeria)"},
["jmw"] = {"Mouwase"},
["jmx"] = {"Western Juxtlahuaca Mixtec"},
["jna"] = {"Jangshung"},
["jnd"] = {"Jandavra"},
["jng"] = {"Yangman"},
["jni"] = {"Janji"},
["jnj"] = {"Yemsa"},
["jnl"] = {"Rawat"},
["jns"] = {"Jaunsari"},
["job"] = {"Joba"},
["jod"] = {"Wojenaka"},
["jog"] = {"Jogi"},
["jor"] = {"Jorá"},
["jos"] = {"Jordanian Sign Language"},
["jow"] = {"Jowulu"},
["jpa"] = {"Jewish Palestinian Aramaic"},
["jpr"] = {"Judeo-Persian"},
["jpx"] = {"Japanese (family)"},
["jqr"] = {"Jaqaru"},
["jra"] = {"Jarai"},
["jrb"] = {"Judeo-Arabic"},
["jrr"] = {"Jiru"},
["jrt"] = {"Jakattoe"},
["jru"] = {"Japrería"},
["jsl"] = {"Japanese Sign Language"},
["jua"] = {"Júma"},
["jub"] = {"Wannu"},
["juc"] = {"Jurchen"},
["jud"] = {"Worodougou"},
["juh"] = {"Hõne"},
["jui"] = {"Ngadjuri"},
["juk"] = {"Wapan"},
["jul"] = {"Jirel"},
["jum"] = {"Jumjum"},
["jun"] = {"Juang"},
["juo"] = {"Jiba"},
["jup"] = {"Hupdë"},
["jur"] = {"Jurúna"},
["jus"] = {"Jumla Sign Language"},
["jut"] = {"Jutish"},
["juu"] = {"Ju"},
["juw"] = {"Wãpha"},
["juy"] = {"Juray"},
["jvd"] = {"Javindo"},
["jvn"] = {"Caribbean Javanese"},
["jwi"] = {"Jwira-Pepesa"},
["jya"] = {"Jiarong"},
["jye"] = {"Judeo-Yemeni Arabic"},
["jyy"] = {"Jaya"},
["kaa"] = {"Kara-Kalpak", "Karakalpak"},
["kab"] = {"Kabyle"},
["kac"] = {"Kachin", "Jingpho"},
["kad"] = {"Adara"},
["kae"] = {"Ketangalan"},
["kaf"] = {"Katso"},
["kag"] = {"Kajaman"},
["kah"] = {"Kara (Central African Republic)"},
["kai"] = {"Karekare"},
["kaj"] = {"Jju"},
["kak"] = {"Kalanguya", "Kayapa Kallahan"},
["kam"] = {"Kamba (Kenya)"},
["kao"] = {"Xaasongaxango"},
["kap"] = {"Bezhta"},
["kaq"] = {"Capanahua"},
["kar"] = {"Karen languages"},
["kav"] = {"Katukína"},
["kaw"] = {"Kawi"},
["kax"] = {"Kao"},
["kay"] = {"Kamayurá"},
["kba"] = {"Kalarko"},
["kbb"] = {"Kaxuiâna"},
["kbc"] = {"Kadiwéu"},
["kbd"] = {"Kabardian"},
["kbe"] = {"Kanju"},
["kbg"] = {"Khamba"},
["kbh"] = {"Camsá"},
["kbi"] = {"Kaptiau"},
["kbj"] = {"Kari"},
["kbk"] = {"Grass Koiari"},
["kbl"] = {"Kanembu"},
["kbm"] = {"Iwal"},
["kbn"] = {"Kare (Central African Republic)"},
["kbo"] = {"Keliko"},
["kbp"] = {"Kabiyè"},
["kbq"] = {"Kamano"},
["kbr"] = {"Kafa"},
["kbs"] = {"Kande"},
["kbt"] = {"Abadi"},
["kbu"] = {"Kabutra"},
["kbv"] = {"Dera (Indonesia)"},
["kbw"] = {"Kaiep"},
["kbx"] = {"Ap Ma"},
["kby"] = {"Manga Kanuri"},
["kbz"] = {"Duhwa"},
["kca"] = {"Khanty"},
["kcb"] = {"Kawacha"},
["kcc"] = {"Lubila"},
["kcd"] = {"Ngkâlmpw Kanum"},
["kce"] = {"Kaivi"},
["kcf"] = {"Ukaan"},
["kcg"] = {"Tyap"},
["kch"] = {"Vono"},
["kci"] = {"Kamantan"},
["kcj"] = {"Kobiana"},
["kck"] = {"Kalanga"},
["kcl"] = {"Kela (Papua New Guinea)", "Kala"},
["kcm"] = {"Gula (Central African Republic)"},
["kcn"] = {"Nubi"},
["kco"] = {"Kinalakna"},
["kcp"] = {"Kanga"},
["kcq"] = {"Kamo"},
["kcr"] = {"Katla"},
["kcs"] = {"Koenoem"},
["kct"] = {"Kaian"},
["kcu"] = {"Kami (Tanzania)"},
["kcv"] = {"Kete"},
["kcw"] = {"Kabwari"},
["kcx"] = {"Kachama-Ganjule"},
["kcy"] = {"Korandje"},
["kcz"] = {"Konongo"},
["kda"] = {"Worimi"},
["kdc"] = {"Kutu"},
["kdd"] = {"Yankunytjatjara"},
["kde"] = {"Makonde"},
["kdf"] = {"Mamusi"},
["kdg"] = {"Seba"},
["kdh"] = {"Tem"},
["kdi"] = {"Kumam"},
["kdj"] = {"Karamojong"},
["kdk"] = {"Numèè", "Kwényi"},
["kdl"] = {"Tsikimba"},
["kdm"] = {"Kagoma"},
["kdn"] = {"Kunda"},
["kdo"] = {"Kordofanian languages"},
["kdp"] = {"Kaningdon-Nindem"},
["kdq"] = {"Koch"},
["kdr"] = {"Karaim"},
["kdt"] = {"Kuy"},
["kdu"] = {"Kadaru"},
["kdw"] = {"Koneraw"},
["kdx"] = {"Kam"},
["kdy"] = {"Keder", "Keijar"},
["kdz"] = {"Kwaja"},
["kea"] = {"Kabuverdianu"},
["keb"] = {"Kélé"},
["kec"] = {"Keiga"},
["ked"] = {"Kerewe"},
["kee"] = {"Eastern Keres"},
["kef"] = {"Kpessi"},
["keg"] = {"Tese"},
["keh"] = {"Keak"},
["kei"] = {"Kei"},
["kej"] = {"Kadar"},
["kek"] = {"Kekchí"},
["kel"] = {"Kela (Democratic Republic of Congo)"},
["kem"] = {"Kemak"},
["ken"] = {"Kenyang"},
["keo"] = {"Kakwa"},
["kep"] = {"Kaikadi"},
["keq"] = {"Kamar"},
["ker"] = {"Kera"},
["kes"] = {"Kugbo"},
["ket"] = {"Ket"},
["keu"] = {"Akebu"},
["kev"] = {"Kanikkaran"},
["kew"] = {"West Kewa"},
["kex"] = {"Kukna"},
["key"] = {"Kupia"},
["kez"] = {"Kukele"},
["kfa"] = {"Kodava"},
["kfb"] = {"Northwestern Kolami"},
["kfc"] = {"Konda-Dora"},
["kfd"] = {"Korra Koraga"},
["kfe"] = {"Kota (India)"},
["kff"] = {"Koya"},
["kfg"] = {"Kudiya"},
["kfh"] = {"Kurichiya"},
["kfi"] = {"Kannada Kurumba"},
["kfj"] = {"Kemiehua"},
["kfk"] = {"Kinnauri"},
["kfl"] = {"Kung"},
["kfm"] = {"Khunsari"},
["kfn"] = {"Kuk"},
["kfo"] = {"Koro (Côte d'Ivoire)"},
["kfp"] = {"Korwa"},
["kfq"] = {"Korku"},
["kfr"] = {"Kachhi", "Kutchi"},
["kfs"] = {"Bilaspuri"},
["kft"] = {"Kanjari"},
["kfu"] = {"Katkari"},
["kfv"] = {"Kurmukar"},
["kfw"] = {"Kharam Naga"},
["kfx"] = {"Kullu Pahari"},
["kfy"] = {"Kumaoni"},
["kfz"] = {"Koromfé"},
["kga"] = {"Koyaga"},
["kgb"] = {"Kawe"},
["kge"] = {"Komering"},
["kgf"] = {"Kube"},
["kgg"] = {"Kusunda"},
["kgi"] = {"Selangor Sign Language"},
["kgj"] = {"Gamale Kham"},
["kgk"] = {"Kaiwá"},
["kgl"] = {"Kunggari"},
["kgn"] = {"Karingani"},
["kgo"] = {"Krongo"},
["kgp"] = {"Kaingang"},
["kgq"] = {"Kamoro"},
["kgr"] = {"Abun"},
["kgs"] = {"Kumbainggar"},
["kgt"] = {"Somyev"},
["kgu"] = {"Kobol"},
["kgv"] = {"Karas"},
["kgw"] = {"Karon Dori"},
["kgx"] = {"Kamaru"},
["kgy"] = {"Kyerung"},
["kha"] = {"Khasi"},
["khb"] = {"Lü"},
["khc"] = {"Tukang Besi North"},
["khd"] = {"Bädi Kanum"},
["khe"] = {"Korowai"},
["khf"] = {"Khuen"},
["khg"] = {"Khams Tibetan"},
["khh"] = {"Kehu"},
["khi"] = {"Khoisan languages"},
["khj"] = {"Kuturmi"},
["khk"] = {"Halh Mongolian"},
["khl"] = {"Lusi"},
["khn"] = {"Khandesi"},
["kho"] = {"Khotanese", "Sakan"},
["khp"] = {"Kapori", "Kapauri"},
["khq"] = {"Koyra Chiini Songhay"},
["khr"] = {"Kharia"},
["khs"] = {"Kasua"},
["kht"] = {"Khamti"},
["khu"] = {"Nkhumbi"},
["khv"] = {"Khvarshi"},
["khw"] = {"Khowar"},
["khx"] = {"Kanu"},
["khy"] = {"Kele (Democratic Republic of Congo)"},
["khz"] = {"Keapara"},
["kia"] = {"Kim"},
["kib"] = {"Koalib"},
["kic"] = {"Kickapoo"},
["kid"] = {"Koshin"},
["kie"] = {"Kibet"},
["kif"] = {"Eastern Parbate Kham"},
["kig"] = {"Kimaama", "Kimaghima"},
["kih"] = {"Kilmeri"},
["kii"] = {"Kitsai"},
["kij"] = {"Kilivila"},
["kil"] = {"Kariya"},
["kim"] = {"Karagas"},
["kio"] = {"Kiowa"},
["kip"] = {"Sheshi Kham"},
["kiq"] = {"Kosadle", "Kosare"},
["kis"] = {"Kis"},
["kit"] = {"Agob"},
["kiu"] = {"Kirmanjki (individual language)"},
["kiv"] = {"Kimbu"},
["kiw"] = {"Northeast Kiwai"},
["kix"] = {"Khiamniungan Naga"},
["kiy"] = {"Kirikiri"},
["kiz"] = {"Kisi"},
["kja"] = {"Mlap"},
["kjb"] = {"Q'anjob'al", "Kanjobal"},
["kjc"] = {"Coastal Konjo"},
["kjd"] = {"Southern Kiwai"},
["kje"] = {"Kisar"},
["kjg"] = {"Khmu"},
["kjh"] = {"Khakas"},
["kji"] = {"Zabana"},
["kjj"] = {"Khinalugh"},
["kjk"] = {"Highland Konjo"},
["kjl"] = {"Western Parbate Kham"},
["kjm"] = {"Kháng"},
["kjn"] = {"Kunjen"},
["kjo"] = {"Harijan Kinnauri"},
["kjp"] = {"Pwo Eastern Karen"},
["kjq"] = {"Western Keres"},
["kjr"] = {"Kurudu"},
["kjs"] = {"East Kewa"},
["kjt"] = {"Phrae Pwo Karen"},
["kju"] = {"Kashaya"},
["kjv"] = {"Kaikavian Literary Language"},
["kjx"] = {"Ramopa"},
["kjy"] = {"Erave"},
["kjz"] = {"Bumthangkha"},
["kka"] = {"Kakanda"},
["kkb"] = {"Kwerisa"},
["kkc"] = {"Odoodee"},
["kkd"] = {"Kinuku"},
["kke"] = {"Kakabe"},
["kkf"] = {"Kalaktang Monpa"},
["kkg"] = {"Mabaka Valley Kalinga"},
["kkh"] = {"Khün"},
["kki"] = {"Kagulu"},
["kkj"] = {"Kako"},
["kkk"] = {"Kokota"},
["kkl"] = {"Kosarek Yale"},
["kkm"] = {"Kiong"},
["kkn"] = {"Kon Keu"},
["kko"] = {"Karko"},
["kkp"] = {"Gugubera", "Koko-Bera"},
["kkq"] = {"Kaeku"},
["kkr"] = {"Kir-Balar"},
["kks"] = {"Giiwo"},
["kkt"] = {"Koi"},
["kku"] = {"Tumi"},
["kkv"] = {"Kangean"},
["kkw"] = {"Teke-Kukuya"},
["kkx"] = {"Kohin"},
["kky"] = {"Guugu Yimidhirr", "Guguyimidjir"},
["kkz"] = {"Kaska"},
["kla"] = {"Klamath-Modoc"},
["klb"] = {"Kiliwa"},
["klc"] = {"Kolbila"},
["kld"] = {"Gamilaraay"},
["kle"] = {"Kulung (Nepal)"},
["klf"] = {"Kendeje"},
["klg"] = {"Tagakaulo"},
["klh"] = {"Weliki"},
["kli"] = {"Kalumpang"},
["klj"] = {"Khalaj"},
["klk"] = {"Kono (Nigeria)"},
["kll"] = {"Kagan Kalagan"},
["klm"] = {"Migum"},
["kln"] = {"Kalenjin"},
["klo"] = {"Kapya"},
["klp"] = {"Kamasa"},
["klq"] = {"Rumu"},
["klr"] = {"Khaling"},
["kls"] = {"Kalasha"},
["klt"] = {"Nukna"},
["klu"] = {"Klao"},
["klv"] = {"Maskelynes"},
["klw"] = {"Tado", "Lindu"},
["klx"] = {"Koluwawa"},
["kly"] = {"Kalao"},
["klz"] = {"Kabola"},
["kma"] = {"Konni"},
["kmb"] = {"Kimbundu"},
["kmc"] = {"Southern Dong"},
["kmd"] = {"Majukayang Kalinga"},
["kme"] = {"Bakole"},
["kmf"] = {"Kare (Papua New Guinea)"},
["kmg"] = {"Kâte"},
["kmh"] = {"Kalam"},
["kmi"] = {"Kami (Nigeria)"},
["kmj"] = {"Kumarbhag Paharia"},
["kmk"] = {"Limos Kalinga"},
["kml"] = {"Tanudan Kalinga"},
["kmm"] = {"Kom (India)"},
["kmn"] = {"Awtuw"},
["kmo"] = {"Kwoma"},
["kmp"] = {"Gimme"},
["kmq"] = {"Kwama"},
["kmr"] = {"Northern Kurdish"},
["kms"] = {"Kamasau"},
["kmt"] = {"Kemtuik"},
["kmu"] = {"Kanite"},
["kmv"] = {"Karipúna Creole French"},
["kmw"] = {"Komo (Democratic Republic of Congo)"},
["kmx"] = {"Waboda"},
["kmy"] = {"Koma"},
["kmz"] = {"Khorasani Turkish"},
["kna"] = {"Dera (Nigeria)"},
["knb"] = {"Lubuagan Kalinga"},
["knc"] = {"Central Kanuri"},
["knd"] = {"Konda"},
["kne"] = {"Kankanaey"},
["knf"] = {"Mankanya"},
["kng"] = {"Koongo"},
["kni"] = {"Kanufi"},
["knj"] = {"Western Kanjobal"},
["knk"] = {"Kuranko"},
["knl"] = {"Keninjal"},
["knm"] = {"Kanamarí"},
["knn"] = {"Konkani (individual language)"},
["kno"] = {"Kono (Sierra Leone)"},
["knp"] = {"Kwanja"},
["knq"] = {"Kintaq"},
["knr"] = {"Kaningra"},
["kns"] = {"Kensiu"},
["knt"] = {"Panoan Katukína"},
["knu"] = {"Kono (Guinea)"},
["knv"] = {"Tabo"},
["knw"] = {"Kung-Ekoka"},
["knx"] = {"Kendayan", "Salako"},
["kny"] = {"Kanyok"},
["knz"] = {"Kalamsé"},
["koa"] = {"Konomala"},
["koc"] = {"Kpati"},
["kod"] = {"Kodi"},
["koe"] = {"Kacipo-Bale Suri"},
["kof"] = {"Kubi"},
["kog"] = {"Cogui", "Kogi"},
["koh"] = {"Koyo"},
["koi"] = {"Komi-Permyak"},
["kok"] = {"Konkani (macrolanguage)"},
["kol"] = {"Kol (Papua New Guinea)"},
["koo"] = {"Konzo"},
["kop"] = {"Waube"},
["koq"] = {"Kota (Gabon)"},
["kos"] = {"Kosraean"},
["kot"] = {"Lagwan"},
["kou"] = {"Koke"},
["kov"] = {"Kudu-Camo"},
["kow"] = {"Kugama"},
["koy"] = {"Koyukon"},
["koz"] = {"Korak"},
["kpa"] = {"Kutto"},
["kpb"] = {"Mullu Kurumba"},
["kpc"] = {"Curripaco"},
["kpd"] = {"Koba"},
["kpe"] = {"Kpelle"},
["kpf"] = {"Komba"},
["kpg"] = {"Kapingamarangi"},
["kph"] = {"Kplang"},
["kpi"] = {"Kofei"},
["kpj"] = {"Karajá"},
["kpk"] = {"Kpan"},
["kpl"] = {"Kpala"},
["kpm"] = {"Koho"},
["kpn"] = {"Kepkiriwát"},
["kpo"] = {"Ikposo"},
["kpq"] = {"Korupun-Sela"},
["kpr"] = {"Korafe-Yegha"},
["kps"] = {"Tehit"},
["kpt"] = {"Karata"},
["kpu"] = {"Kafoa"},
["kpv"] = {"Komi-Zyrian"},
["kpw"] = {"Kobon"},
["kpx"] = {"Mountain Koiali"},
["kpy"] = {"Koryak"},
["kpz"] = {"Kupsabiny"},
["kqa"] = {"Mum"},
["kqb"] = {"Kovai"},
["kqc"] = {"Doromu-Koki"},
["kqd"] = {"Koy Sanjaq Surat"},
["kqe"] = {"Kalagan"},
["kqf"] = {"Kakabai"},
["kqg"] = {"Khe"},
["kqh"] = {"Kisankasa"},
["kqi"] = {"Koitabu"},
["kqj"] = {"Koromira"},
["kqk"] = {"Kotafon Gbe"},
["kql"] = {"Kyenele"},
["kqm"] = {"Khisa"},
["kqn"] = {"Kaonde"},
["kqo"] = {"Eastern Krahn"},
["kqp"] = {"Kimré"},
["kqq"] = {"Krenak"},
["kqr"] = {"Kimaragang"},
["kqs"] = {"Northern Kissi"},
["kqt"] = {"Klias River Kadazan"},
["kqu"] = {"Seroa"},
["kqv"] = {"Okolod"},
["kqw"] = {"Kandas"},
["kqx"] = {"Mser"},
["kqy"] = {"Koorete"},
["kqz"] = {"Korana"},
["kra"] = {"Kumhali"},
["krb"] = {"Karkin"},
["krc"] = {"Karachay-Balkar"},
["krd"] = {"Kairui-Midiki"},
["kre"] = {"Panará"},
["krf"] = {"Koro (Vanuatu)"},
["krh"] = {"Kurama"},
["kri"] = {"Krio"},
["krj"] = {"Kinaray-A"},
["krk"] = {"Kerek"},
["krl"] = {"Karelian"},
["krn"] = {"Sapo"},
["kro"] = {"Kru languages"},
["krp"] = {"Durop"},
["krr"] = {"Krung"},
["krs"] = {"Gbaya (Sudan)"},
["krt"] = {"Tumari Kanuri"},
["kru"] = {"Kurukh"},
["krv"] = {"Kavet"},
["krw"] = {"Western Krahn"},
["krx"] = {"Karon"},
["kry"] = {"Kryts"},
["krz"] = {"Sota Kanum"},
["ksb"] = {"Shambala"},
["ksc"] = {"Southern Kalinga"},
["ksd"] = {"Kuanua"},
["kse"] = {"Kuni"},
["ksf"] = {"Bafia"},
["ksg"] = {"Kusaghe"},
["ksh"] = {"Kölsch"},
["ksi"] = {"Krisa", "I'saka"},
["ksj"] = {"Uare"},
["ksk"] = {"Kansa"},
["ksl"] = {"Kumalu"},
["ksm"] = {"Kumba"},
["ksn"] = {"Kasiguranin"},
["kso"] = {"Kofa"},
["ksp"] = {"Kaba"},
["ksq"] = {"Kwaami"},
["ksr"] = {"Borong"},
["kss"] = {"Southern Kisi"},
["kst"] = {"Winyé"},
["ksu"] = {"Khamyang"},
["ksv"] = {"Kusu"},
["ksw"] = {"S'gaw Karen"},
["ksx"] = {"Kedang"},
["ksy"] = {"Kharia Thar"},
["ksz"] = {"Kodaku"},
["kta"] = {"Katua"},
["ktb"] = {"Kambaata"},
["ktc"] = {"Kholok"},
["ktd"] = {"Kokata", "Kukatha"},
["kte"] = {"Nubri"},
["ktf"] = {"Kwami"},
["ktg"] = {"Kalkutung"},
["kth"] = {"Karanga"},
["kti"] = {"North Muyu"},
["ktj"] = {"Plapo Krumen"},
["ktk"] = {"Kaniet"},
["ktl"] = {"Koroshi"},
["ktm"] = {"Kurti"},
["ktn"] = {"Karitiâna"},
["kto"] = {"Kuot"},
["ktp"] = {"Kaduo"},
["ktq"] = {"Katabaga"},
["kts"] = {"South Muyu"},
["ktt"] = {"Ketum"},
["ktu"] = {"Kituba (Democratic Republic of Congo)"},
["ktv"] = {"Eastern Katu"},
["ktw"] = {"Kato"},
["ktx"] = {"Kaxararí"},
["kty"] = {"Kango (Bas-Uélé District)"},
["ktz"] = {"Juǀʼhoan", "Juǀʼhoansi"},
["kub"] = {"Kutep"},
["kuc"] = {"Kwinsu"},
["kud"] = {"'Auhelawa"},
["kue"] = {"Kuman (Papua New Guinea)"},
["kuf"] = {"Western Katu"},
["kug"] = {"Kupa"},
["kuh"] = {"Kushi"},
["kui"] = {"Kuikúro-Kalapálo", "Kalapalo"},
["kuj"] = {"Kuria"},
["kuk"] = {"Kepo'"},
["kul"] = {"Kulere"},
["kum"] = {"Kumyk"},
["kun"] = {"Kunama"},
["kuo"] = {"Kumukio"},
["kup"] = {"Kunimaipa"},
["kuq"] = {"Karipuna"},
["kus"] = {"Kusaal"},
["kut"] = {"Kutenai"},
["kuu"] = {"Upper Kuskokwim"},
["kuv"] = {"Kur"},
["kuw"] = {"Kpagua"},
["kux"] = {"Kukatja"},
["kuy"] = {"Kuuku-Ya'u"},
["kuz"] = {"Kunza"},
["kva"] = {"Bagvalal"},
["kvb"] = {"Kubu"},
["kvc"] = {"Kove"},
["kvd"] = {"Kui (Indonesia)"},
["kve"] = {"Kalabakan"},
["kvf"] = {"Kabalai"},
["kvg"] = {"Kuni-Boazi"},
["kvh"] = {"Komodo"},
["kvi"] = {"Kwang"},
["kvj"] = {"Psikye"},
["kvk"] = {"Korean Sign Language"},
["kvl"] = {"Kayaw"},
["kvm"] = {"Kendem"},
["kvn"] = {"Border Kuna"},
["kvo"] = {"Dobel"},
["kvp"] = {"Kompane"},
["kvq"] = {"Geba Karen"},
["kvr"] = {"Kerinci"},
["kvt"] = {"Lahta Karen", "Lahta"},
["kvu"] = {"Yinbaw Karen"},
["kvv"] = {"Kola"},
["kvw"] = {"Wersing"},
["kvx"] = {"Parkari Koli"},
["kvy"] = {"Yintale Karen", "Yintale"},
["kvz"] = {"Tsakwambo", "Tsaukambo"},
["kwa"] = {"Dâw"},
["kwb"] = {"Kwa"},
["kwc"] = {"Likwala"},
["kwd"] = {"Kwaio"},
["kwe"] = {"Kwerba"},
["kwf"] = {"Kwara'ae"},
["kwg"] = {"Sara Kaba Deme"},
["kwh"] = {"Kowiai"},
["kwi"] = {"Awa-Cuaiquer"},
["kwj"] = {"Kwanga"},
["kwk"] = {"Kwakiutl"},
["kwl"] = {"Kofyar"},
["kwm"] = {"Kwambi"},
["kwn"] = {"Kwangali"},
["kwo"] = {"Kwomtari"},
["kwp"] = {"Kodia"},
["kwr"] = {"Kwer"},
["kws"] = {"Kwese"},
["kwt"] = {"Kwesten"},
["kwu"] = {"Kwakum"},
["kwv"] = {"Sara Kaba Náà"},
["kww"] = {"Kwinti"},
["kwx"] = {"Khirwar"},
["kwy"] = {"San Salvador Kongo"},
["kwz"] = {"Kwadi"},
["kxa"] = {"Kairiru"},
["kxb"] = {"Krobu"},
["kxc"] = {"Konso", "Khonso"},
["kxd"] = {"Brunei"},
["kxf"] = {"Manumanaw Karen", "Manumanaw"},
["kxh"] = {"Karo (Ethiopia)"},
["kxi"] = {"Keningau Murut"},
["kxj"] = {"Kulfa"},
["kxk"] = {"Zayein Karen"},
["kxm"] = {"Northern Khmer"},
["kxn"] = {"Kanowit-Tanjong Melanau"},
["kxo"] = {"Kanoé"},
["kxp"] = {"Wadiyara Koli"},
["kxq"] = {"Smärky Kanum"},
["kxr"] = {"Koro (Papua New Guinea)"},
["kxs"] = {"Kangjia"},
["kxt"] = {"Koiwat"},
["kxv"] = {"Kuvi"},
["kxw"] = {"Konai"},
["kxx"] = {"Likuba"},
["kxy"] = {"Kayong"},
["kxz"] = {"Kerewo"},
["kya"] = {"Kwaya"},
["kyb"] = {"Butbut Kalinga"},
["kyc"] = {"Kyaka"},
["kyd"] = {"Karey"},
["kye"] = {"Krache"},
["kyf"] = {"Kouya"},
["kyg"] = {"Keyagana"},
["kyh"] = {"Karok"},
["kyi"] = {"Kiput"},
["kyj"] = {"Karao"},
["kyk"] = {"Kamayo"},
["kyl"] = {"Kalapuya"},
["kym"] = {"Kpatili"},
["kyn"] = {"Northern Binukidnon"},
["kyo"] = {"Kelon"},
["kyp"] = {"Kang"},
["kyq"] = {"Kenga"},
["kyr"] = {"Kuruáya"},
["kys"] = {"Baram Kayan"},
["kyt"] = {"Kayagar"},
["kyu"] = {"Western Kayah"},
["kyv"] = {"Kayort"},
["kyw"] = {"Kudmali"},
["kyx"] = {"Rapoisi"},
["kyy"] = {"Kambaira"},
["kyz"] = {"Kayabí"},
["kza"] = {"Western Karaboro"},
["kzb"] = {"Kaibobo"},
["kzc"] = {"Bondoukou Kulango"},
["kzd"] = {"Kadai"},
["kze"] = {"Kosena"},
["kzf"] = {"Da'a Kaili"},
["kzg"] = {"Kikai"},
["kzi"] = {"Kelabit"},
["kzk"] = {"Kazukuru"},
["kzl"] = {"Kayeli"},
["kzm"] = {"Kais"},
["kzn"] = {"Kokola"},
["kzo"] = {"Kaningi"},
["kzp"] = {"Kaidipang"},
["kzq"] = {"Kaike"},
["kzr"] = {"Karang"},
["kzs"] = {"Sugut Dusun"},
["kzu"] = {"Kayupulau"},
["kzv"] = {"Komyandaret"},
["kzw"] = {"Karirí-Xocó"},
["kzx"] = {"Kamarian"},
["kzy"] = {"Kango (Tshopo District)"},
["kzz"] = {"Kalabra"},
["laa"] = {"Southern Subanen"},
["lab"] = {"Linear A"},
["lac"] = {"Lacandon"},
["lad"] = {"Ladino"},
["lae"] = {"Pattani"},
["laf"] = {"Lafofa"},
["lag"] = {"Rangi"},
["lah"] = {"Lahnda"},
["lai"] = {"Lambya"},
["laj"] = {"Lango (Uganda)"},
["lal"] = {"Lalia"},
["lam"] = {"Lamba"},
["lan"] = {"Laru"},
["lap"] = {"Laka (Chad)"},
["laq"] = {"Qabiao"},
["lar"] = {"Larteh"},
["las"] = {"Lama (Togo)"},
["lau"] = {"Laba"},
["law"] = {"Lauje"},
["lax"] = {"Tiwa"},
["lay"] = {"Lama Bai"},
["laz"] = {"Aribwatsa"},
["lbb"] = {"Label"},
["lbc"] = {"Lakkia"},
["lbe"] = {"Lak"},
["lbf"] = {"Tinani"},
["lbg"] = {"Laopang"},
["lbi"] = {"La'bi"},
["lbj"] = {"Ladakhi"},
["lbk"] = {"Central Bontok"},
["lbl"] = {"Libon Bikol"},
["lbm"] = {"Lodhi"},
["lbn"] = {"Rmeet"},
["lbo"] = {"Laven"},
["lbq"] = {"Wampar"},
["lbr"] = {"Lohorung"},
["lbs"] = {"Libyan Sign Language"},
["lbt"] = {"Lachi"},
["lbu"] = {"Labu"},
["lbv"] = {"Lavatbura-Lamusong"},
["lbw"] = {"Tolaki"},
["lbx"] = {"Lawangan"},
["lby"] = {"Lamalama", "Lamu-Lamu"},
["lbz"] = {"Lardil"},
["lcc"] = {"Legenyem"},
["lcd"] = {"Lola"},
["lce"] = {"Loncong", "Sekak"},
["lcf"] = {"Lubu"},
["lch"] = {"Luchazi"},
["lcl"] = {"Lisela"},
["lcm"] = {"Tungag"},
["lcp"] = {"Western Lawa"},
["lcq"] = {"Luhu"},
["lcs"] = {"Lisabata-Nuniali"},
["lda"] = {"Kla-Dan"},
["ldb"] = {"Dũya"},
["ldd"] = {"Luri"},
["ldg"] = {"Lenyima"},
["ldh"] = {"Lamja-Dengsa-Tola"},
["ldi"] = {"Laari"},
["ldj"] = {"Lemoro"},
["ldk"] = {"Leelau"},
["ldl"] = {"Kaan"},
["ldm"] = {"Landoma"},
["ldn"] = {"Láadan"},
["ldo"] = {"Loo"},
["ldp"] = {"Tso"},
["ldq"] = {"Lufu"},
["lea"] = {"Lega-Shabunda"},
["leb"] = {"Lala-Bisa"},
["lec"] = {"Leco"},
["led"] = {"Lendu"},
["lee"] = {"Lyélé"},
["lef"] = {"Lelemi"},
["leh"] = {"Lenje"},
["lei"] = {"Lemio"},
["lej"] = {"Lengola"},
["lek"] = {"Leipon"},
["lel"] = {"Lele (Democratic Republic of Congo)"},
["lem"] = {"Nomaande"},
["len"] = {"Lenca"},
["leo"] = {"Leti (Cameroon)"},
["lep"] = {"Lepcha"},
["leq"] = {"Lembena"},
["ler"] = {"Lenkau"},
["les"] = {"Lese"},
["let"] = {"Lesing-Gelimi", "Amio-Gelimi"},
["leu"] = {"Kara (Papua New Guinea)"},
["lev"] = {"Lamma"},
["lew"] = {"Ledo Kaili"},
["lex"] = {"Luang"},
["ley"] = {"Lemolang"},
["lez"] = {"Lezghian"},
["lfa"] = {"Lefa"},
["lfn"] = {"Lingua Franca Nova"},
["lga"] = {"Lungga"},
["lgb"] = {"Laghu"},
["lgg"] = {"Lugbara"},
["lgh"] = {"Laghuu"},
["lgi"] = {"Lengilu"},
["lgk"] = {"Lingarak", "Neverver"},
["lgl"] = {"Wala"},
["lgm"] = {"Lega-Mwenga"},
["lgn"] = {"T'apo", "Opuuo"},
["lgo"] = {"Lango (South Sudan)"},
["lgq"] = {"Logba"},
["lgr"] = {"Lengo"},
["lgs"] = {"Guinea-Bissau Sign Language", "Língua Gestual Guineense"},
["lgt"] = {"Pahi"},
["lgu"] = {"Longgu"},
["lgz"] = {"Ligenza"},
["lha"] = {"Laha (Viet Nam)"},
["lhh"] = {"Laha (Indonesia)"},
["lhi"] = {"Lahu Shi"},
["lhl"] = {"Lahul Lohar"},
["lhm"] = {"Lhomi"},
["lhn"] = {"Lahanan"},
["lhp"] = {"Lhokpu"},
["lhs"] = {"Mlahsö"},
["lht"] = {"Lo-Toga"},
["lhu"] = {"Lahu"},
["lia"] = {"West-Central Limba"},
["lib"] = {"Likum"},
["lic"] = {"Hlai"},
["lid"] = {"Nyindrou"},
["lie"] = {"Likila"},
["lif"] = {"Limbu"},
["lig"] = {"Ligbi"},
["lih"] = {"Lihir"},
["lij"] = {"Ligurian"},
["lik"] = {"Lika"},
["lil"] = {"Lillooet"},
["lio"] = {"Liki"},
["lip"] = {"Sekpele"},
["liq"] = {"Libido"},
["lir"] = {"Liberian English"},
["lis"] = {"Lisu"},
["liu"] = {"Logorik"},
["liv"] = {"Liv"},
["liw"] = {"Col"},
["lix"] = {"Liabuku"},
["liy"] = {"Banda-Bambari"},
["liz"] = {"Libinza"},
["lja"] = {"Golpa"},
["lje"] = {"Rampi"},
["lji"] = {"Laiyolo"},
["ljl"] = {"Li'o"},
["ljp"] = {"Lampung Api"},
["ljw"] = {"Yirandali"},
["ljx"] = {"Yuru"},
["lka"] = {"Lakalei"},
["lkb"] = {"Kabras", "Lukabaras"},
["lkc"] = {"Kucong"},
["lkd"] = {"Lakondê"},
["lke"] = {"Kenyi"},
["lkh"] = {"Lakha"},
["lki"] = {"Laki"},
["lkj"] = {"Remun"},
["lkl"] = {"Laeko-Libuat"},
["lkm"] = {"Kalaamaya"},
["lkn"] = {"Lakon", "Vure"},
["lko"] = {"Khayo", "Olukhayo"},
["lkr"] = {"Päri"},
["lks"] = {"Kisa", "Olushisa"},
["lkt"] = {"Lakota"},
["lku"] = {"Kungkari"},
["lky"] = {"Lokoya"},
["lla"] = {"Lala-Roba"},
["llb"] = {"Lolo"},
["llc"] = {"Lele (Guinea)"},
["lld"] = {"Ladin"},
["lle"] = {"Lele (Papua New Guinea)"},
["llf"] = {"Hermit"},
["llg"] = {"Lole"},
["llh"] = {"Lamu"},
["lli"] = {"Teke-Laali"},
["llj"] = {"Ladji Ladji"},
["llk"] = {"Lelak"},
["lll"] = {"Lilau"},
["llm"] = {"Lasalimu"},
["lln"] = {"Lele (Chad)"},
["llp"] = {"North Efate"},
["llq"] = {"Lolak"},
["lls"] = {"Lithuanian Sign Language"},
["llu"] = {"Lau"},
["llx"] = {"Lauan"},
["lma"] = {"East Limba"},
["lmb"] = {"Merei"},
["lmc"] = {"Limilngan"},
["lmd"] = {"Lumun"},
["lme"] = {"Pévé"},
["lmf"] = {"South Lembata"},
["lmg"] = {"Lamogai"},
["lmh"] = {"Lambichhong"},
["lmi"] = {"Lombi"},
["lmj"] = {"West Lembata"},
["lmk"] = {"Lamkang"},
["lml"] = {"Hano"},
["lmn"] = {"Lambadi"},
["lmo"] = {"Lombard"},
["lmp"] = {"Limbum"},
["lmq"] = {"Lamatuka"},
["lmr"] = {"Lamalera"},
["lmu"] = {"Lamenu"},
["lmv"] = {"Lomaiviti"},
["lmw"] = {"Lake Miwok"},
["lmx"] = {"Laimbue"},
["lmy"] = {"Lamboya"},
["lna"] = {"Langbashe"},
["lnb"] = {"Mbalanhu"},
["lnd"] = {"Lundayeh", "Lun Bawang"},
["lng"] = {"Langobardic"},
["lnh"] = {"Lanoh"},
["lni"] = {"Daantanai'"},
["lnj"] = {"Leningitij"},
["lnl"] = {"South Central Banda"},
["lnm"] = {"Langam"},
["lnn"] = {"Lorediakarkar"},
["lns"] = {"Lamnso'"},
["lnu"] = {"Longuda"},
["lnw"] = {"Lanima"},
["lnz"] = {"Lonzo"},
["loa"] = {"Loloda"},
["lob"] = {"Lobi"},
["loc"] = {"Inonhan"},
["loe"] = {"Saluan"},
["lof"] = {"Logol"},
["log"] = {"Logo"},
["loh"] = {"Laarim", "Narim"},
["loi"] = {"Loma (Côte d'Ivoire)"},
["loj"] = {"Lou"},
["lok"] = {"Loko"},
["lol"] = {"Mongo"},
["lom"] = {"Loma (Liberia)"},
["lon"] = {"Malawi Lomwe"},
["loo"] = {"Lombo"},
["lop"] = {"Lopa"},
["loq"] = {"Lobala"},
["lor"] = {"Téén"},
["los"] = {"Loniu"},
["lot"] = {"Otuho"},
["lou"] = {"Louisiana Creole"},
["lov"] = {"Lopi"},
["low"] = {"Tampias Lobu"},
["lox"] = {"Loun"},
["loy"] = {"Loke"},
["loz"] = {"Lozi"},
["lpa"] = {"Lelepa"},
["lpe"] = {"Lepki"},
["lpn"] = {"Long Phuri Naga"},
["lpo"] = {"Lipo"},
["lpx"] = {"Lopit"},
["lqr"] = {"Logir"},
["lra"] = {"Rara Bakati'"},
["lrc"] = {"Northern Luri"},
["lre"] = {"Laurentian"},
["lrg"] = {"Laragia"},
["lri"] = {"Marachi", "Olumarachi"},
["lrk"] = {"Loarki"},
["lrl"] = {"Lari"},
["lrm"] = {"Marama", "Olumarama"},
["lrn"] = {"Lorang"},
["lro"] = {"Laro"},
["lrr"] = {"Southern Yamphu"},
["lrt"] = {"Larantuka Malay"},
["lrv"] = {"Larevat"},
["lrz"] = {"Lemerig"},
["lsa"] = {"Lasgerdi"},
["lsb"] = {"Burundian Sign Language", "Langue des Signes Burundaise"},
["lsc"] = {"Albarradas Sign Language", "Lengua de señas Albarradas"},
["lsd"] = {"Lishana Deni"},
["lse"] = {"Lusengo"},
["lsh"] = {"Lish"},
["lsi"] = {"Lashi"},
["lsl"] = {"Latvian Sign Language"},
["lsm"] = {"Saamia", "Olusamia"},
["lsn"] = {"Tibetan Sign Language"},
["lso"] = {"Laos Sign Language"},
["lsp"] = {"Panamanian Sign Language", "Lengua de Señas Panameñas"},
["lsr"] = {"Aruop"},
["lss"] = {"Lasi"},
["lst"] = {"Trinidad and Tobago Sign Language"},
["lsv"] = {"Sivia Sign Language"},
["lsw"] = {"Seychelles Sign Language", "Lalang Siny Seselwa", "Langue des Signes Seychelloise"},
["lsy"] = {"Mauritian Sign Language"},
["ltc"] = {"Late Middle Chinese"},
["ltg"] = {"Latgalian"},
["lth"] = {"Thur"},
["lti"] = {"Leti (Indonesia)"},
["ltn"] = {"Latundê"},
["lto"] = {"Tsotso", "Olutsotso"},
["lts"] = {"Tachoni", "Lutachoni"},
["ltu"] = {"Latu"},
["lua"] = {"Luba-Lulua"},
["luc"] = {"Aringa"},
["lud"] = {"Ludian"},
["lue"] = {"Luvale"},
["luf"] = {"Laua"},
["lui"] = {"Luiseno"},
["luj"] = {"Luna"},
["luk"] = {"Lunanakha"},
["lul"] = {"Olu'bo"},
["lum"] = {"Luimbi"},
["lun"] = {"Lunda"},
["luo"] = {"Luo (Kenya and Tanzania)", "Dholuo"},
["lup"] = {"Lumbu"},
["luq"] = {"Lucumi"},
["lur"] = {"Laura"},
["lus"] = {"Lushai"},
["lut"] = {"Lushootseed"},
["luu"] = {"Lumba-Yakkha"},
["luv"] = {"Luwati"},
["luw"] = {"Luo (Cameroon)"},
["luy"] = {"Luyia", "Oluluyia"},
["luz"] = {"Southern Luri"},
["lva"] = {"Maku'a"},
["lvi"] = {"Lavi"},
["lvk"] = {"Lavukaleve"},
["lvl"] = {"Lwel"},
["lvs"] = {"Standard Latvian"},
["lvu"] = {"Levuka"},
["lwa"] = {"Lwalu"},
["lwe"] = {"Lewo Eleng"},
["lwg"] = {"Wanga", "Oluwanga"},
["lwh"] = {"White Lachi"},
["lwl"] = {"Eastern Lawa"},
["lwm"] = {"Laomian"},
["lwo"] = {"Luwo"},
["lws"] = {"Malawian Sign Language"},
["lwt"] = {"Lewotobi"},
["lwu"] = {"Lawu"},
["lww"] = {"Lewo"},
["lxm"] = {"Lakurumau"},
["lya"] = {"Layakha"},
["lyg"] = {"Lyngngam"},
["lyn"] = {"Luyana"},
["lzh"] = {"Literary Chinese"},
["lzl"] = {"Litzlitz"},
["lzn"] = {"Leinong Naga"},
["lzz"] = {"Laz"},
["maa"] = {"San Jerónimo Tecóatl Mazatec"},
["mab"] = {"Yutanduchi Mixtec"},
["mad"] = {"Madurese"},
["mae"] = {"Bo-Rukul"},
["maf"] = {"Mafa"},
["mag"] = {"Magahi"},
["mai"] = {"Maithili"},
["maj"] = {"Jalapa De Díaz Mazatec"},
["mak"] = {"Makasar"},
["mam"] = {"Mam"},
["man"] = {"Mandingo", "Manding"},
["map"] = {"Austronesian languages"},
["maq"] = {"Chiquihuitlán Mazatec"},
["mas"] = {"Masai"},
["mat"] = {"San Francisco Matlatzinca"},
["mau"] = {"Huautla Mazatec"},
["mav"] = {"Sateré-Mawé"},
["maw"] = {"Mampruli"},
["max"] = {"North Moluccan Malay"},
["maz"] = {"Central Mazahua"},
["mba"] = {"Higaonon"},
["mbb"] = {"Western Bukidnon Manobo"},
["mbc"] = {"Macushi"},
["mbd"] = {"Dibabawon Manobo"},
["mbe"] = {"Molale"},
["mbf"] = {"Baba Malay"},
["mbh"] = {"Mangseng"},
["mbi"] = {"Ilianen Manobo"},
["mbj"] = {"Nadëb"},
["mbk"] = {"Malol"},
["mbl"] = {"Maxakalí"},
["mbm"] = {"Ombamba"},
["mbn"] = {"Macaguán"},
["mbo"] = {"Mbo (Cameroon)"},
["mbp"] = {"Malayo"},
["mbq"] = {"Maisin"},
["mbr"] = {"Nukak Makú"},
["mbs"] = {"Sarangani Manobo"},
["mbt"] = {"Matigsalug Manobo"},
["mbu"] = {"Mbula-Bwazza"},
["mbv"] = {"Mbulungish"},
["mbw"] = {"Maring"},
["mbx"] = {"Mari (East Sepik Province)"},
["mby"] = {"Memoni"},
["mbz"] = {"Amoltepec Mixtec"},
["mca"] = {"Maca"},
["mcb"] = {"Machiguenga"},
["mcc"] = {"Bitur"},
["mcd"] = {"Sharanahua"},
["mce"] = {"Itundujia Mixtec"},
["mcf"] = {"Matsés"},
["mcg"] = {"Mapoyo"},
["mch"] = {"Maquiritari"},
["mci"] = {"Mese"},
["mcj"] = {"Mvanip"},
["mck"] = {"Mbunda"},
["mcl"] = {"Macaguaje"},
["mcm"] = {"Malaccan Creole Portuguese"},
["mcn"] = {"Masana"},
["mco"] = {"Coatlán Mixe"},
["mcp"] = {"Makaa"},
["mcq"] = {"Ese"},
["mcr"] = {"Menya"},
["mcs"] = {"Mambai"},
["mct"] = {"Mengisa"},
["mcu"] = {"Cameroon Mambila"},
["mcv"] = {"Minanibai"},
["mcw"] = {"Mawa (Chad)"},
["mcx"] = {"Mpiemo"},
["mcy"] = {"South Watut"},
["mcz"] = {"Mawan"},
["mda"] = {"Mada (Nigeria)"},
["mdb"] = {"Morigi"},
["mdc"] = {"Male (Papua New Guinea)"},
["mdd"] = {"Mbum"},
["mde"] = {"Maba (Chad)"},
["mdf"] = {"Moksha"},
["mdg"] = {"Massalat"},
["mdh"] = {"Maguindanaon"},
["mdi"] = {"Mamvu"},
["mdj"] = {"Mangbetu"},
["mdk"] = {"Mangbutu"},
["mdl"] = {"Maltese Sign Language"},
["mdm"] = {"Mayogo"},
["mdn"] = {"Mbati"},
["mdp"] = {"Mbala"},
["mdq"] = {"Mbole"},
["mdr"] = {"Mandar"},
["mds"] = {"Maria (Papua New Guinea)"},
["mdt"] = {"Mbere"},
["mdu"] = {"Mboko"},
["mdv"] = {"Santa Lucía Monteverde Mixtec"},
["mdw"] = {"Mbosi"},
["mdx"] = {"Dizin"},
["mdy"] = {"Male (Ethiopia)"},
["mdz"] = {"Suruí Do Pará"},
["mea"] = {"Menka"},
["meb"] = {"Ikobi"},
["mec"] = {"Marra"},
["med"] = {"Melpa"},
["mee"] = {"Mengen"},
["mef"] = {"Megam"},
["meh"] = {"Southwestern Tlaxiaco Mixtec"},
["mei"] = {"Midob"},
["mej"] = {"Meyah"},
["mek"] = {"Mekeo"},
["mel"] = {"Central Melanau"},
["mem"] = {"Mangala"},
["men"] = {"Mende (Sierra Leone)"},
["meo"] = {"Kedah Malay"},
["mep"] = {"Miriwoong"},
["meq"] = {"Merey"},
["mer"] = {"Meru"},
["mes"] = {"Masmaje"},
["met"] = {"Mato"},
["meu"] = {"Motu"},
["mev"] = {"Mano"},
["mew"] = {"Maaka"},
["mey"] = {"Hassaniyya"},
["mez"] = {"Menominee"},
["mfa"] = {"Pattani Malay"},
["mfb"] = {"Bangka"},
["mfc"] = {"Mba"},
["mfd"] = {"Mendankwe-Nkwen"},
["mfe"] = {"Morisyen"},
["mff"] = {"Naki"},
["mfg"] = {"Mogofin"},
["mfh"] = {"Matal"},
["mfi"] = {"Wandala"},
["mfj"] = {"Mefele"},
["mfk"] = {"North Mofu"},
["mfl"] = {"Putai"},
["mfm"] = {"Marghi South"},
["mfn"] = {"Cross River Mbembe"},
["mfo"] = {"Mbe"},
["mfp"] = {"Makassar Malay"},
["mfq"] = {"Moba"},
["mfr"] = {"Marrithiyel"},
["mfs"] = {"Mexican Sign Language"},
["mft"] = {"Mokerang"},
["mfu"] = {"Mbwela"},
["mfv"] = {"Mandjak"},
["mfw"] = {"Mulaha"},
["mfx"] = {"Melo"},
["mfy"] = {"Mayo"},
["mfz"] = {"Mabaan"},
["mga"] = {"Middle Irish (900-1200)"},
["mgb"] = {"Mararit"},
["mgc"] = {"Morokodo"},
["mgd"] = {"Moru"},
["mge"] = {"Mango"},
["mgf"] = {"Maklew"},
["mgg"] = {"Mpumpong"},
["mgh"] = {"Makhuwa-Meetto"},
["mgi"] = {"Lijili"},
["mgj"] = {"Abureni"},
["mgk"] = {"Mawes"},
["mgl"] = {"Maleu-Kilenge"},
["mgm"] = {"Mambae"},
["mgn"] = {"Mbangi"},
["mgo"] = {"Meta'"},
["mgp"] = {"Eastern Magar"},
["mgq"] = {"Malila"},
["mgr"] = {"Mambwe-Lungu"},
["mgs"] = {"Manda (Tanzania)"},
["mgt"] = {"Mongol"},
["mgu"] = {"Mailu"},
["mgv"] = {"Matengo"},
["mgw"] = {"Matumbi"},
["mgy"] = {"Mbunga"},
["mgz"] = {"Mbugwe"},
["mha"] = {"Manda (India)"},
["mhb"] = {"Mahongwe"},
["mhc"] = {"Mocho"},
["mhd"] = {"Mbugu"},
["mhe"] = {"Besisi", "Mah Meri"},
["mhf"] = {"Mamaa"},
["mhg"] = {"Margu"},
["mhi"] = {"Ma'di"},
["mhj"] = {"Mogholi"},
["mhk"] = {"Mungaka"},
["mhl"] = {"Mauwake"},
["mhm"] = {"Makhuwa-Moniga"},
["mhn"] = {"Mócheno"},
["mho"] = {"Mashi (Zambia)"},
["mhp"] = {"Balinese Malay"},
["mhq"] = {"Mandan"},
["mhr"] = {"Eastern Mari"},
["mhs"] = {"Buru (Indonesia)"},
["mht"] = {"Mandahuaca"},
["mhu"] = {"Digaro-Mishmi", "Darang Deng"},
["mhw"] = {"Mbukushu"},
["mhx"] = {"Maru", "Lhaovo"},
["mhy"] = {"Ma'anyan"},
["mhz"] = {"Mor (Mor Islands)"},
["mia"] = {"Miami"},
["mib"] = {"Atatláhuca Mixtec"},
["mic"] = {"Mi'kmaq", "Micmac"},
["mid"] = {"Mandaic"},
["mie"] = {"Ocotepec Mixtec"},
["mif"] = {"Mofu-Gudur"},
["mig"] = {"San Miguel El Grande Mixtec"},
["mih"] = {"Chayuco Mixtec"},
["mii"] = {"Chigmecatitlán Mixtec"},
["mij"] = {"Abar", "Mungbam"},
["mik"] = {"Mikasuki"},
["mil"] = {"Peñoles Mixtec"},
["mim"] = {"Alacatlatzala Mixtec"},
["min"] = {"Minangkabau"},
["mio"] = {"Pinotepa Nacional Mixtec"},
["mip"] = {"Apasco-Apoala Mixtec"},
["miq"] = {"Mískito"},
["mir"] = {"Isthmus Mixe"},
["mis"] = {"Uncoded languages"},
["mit"] = {"Southern Puebla Mixtec"},
["miu"] = {"Cacaloxtepec Mixtec"},
["miw"] = {"Akoye"},
["mix"] = {"Mixtepec Mixtec"},
["miy"] = {"Ayutla Mixtec"},
["miz"] = {"Coatzospan Mixtec"},
["mjb"] = {"Makalero"},
["mjc"] = {"San Juan Colorado Mixtec"},
["mjd"] = {"Northwest Maidu"},
["mje"] = {"Muskum"},
["mjg"] = {"Tu"},
["mjh"] = {"Mwera (Nyasa)"},
["mji"] = {"Kim Mun"},
["mjj"] = {"Mawak"},
["mjk"] = {"Matukar"},
["mjl"] = {"Mandeali"},
["mjm"] = {"Medebur"},
["mjn"] = {"Ma (Papua New Guinea)"},
["mjo"] = {"Malankuravan"},
["mjp"] = {"Malapandaram"},
["mjq"] = {"Malaryan"},
["mjr"] = {"Malavedan"},
["mjs"] = {"Miship"},
["mjt"] = {"Sauria Paharia"},
["mju"] = {"Manna-Dora"},
["mjv"] = {"Mannan"},
["mjw"] = {"Karbi"},
["mjx"] = {"Mahali"},
["mjy"] = {"Mahican"},
["mjz"] = {"Majhi"},
["mka"] = {"Mbre"},
["mkb"] = {"Mal Paharia"},
["mkc"] = {"Siliput"},
["mke"] = {"Mawchi"},
["mkf"] = {"Miya"},
["mkg"] = {"Mak (China)"},
["mkh"] = {"Mon-Khmer languages"},
["mki"] = {"Dhatki"},
["mkj"] = {"Mokilese"},
["mkk"] = {"Byep"},
["mkl"] = {"Mokole"},
["mkm"] = {"Moklen"},
["mkn"] = {"Kupang Malay"},
["mko"] = {"Mingang Doso"},
["mkp"] = {"Moikodi"},
["mkq"] = {"Bay Miwok"},
["mkr"] = {"Malas"},
["mks"] = {"Silacayoapan Mixtec"},
["mkt"] = {"Vamale"},
["mku"] = {"Konyanka Maninka"},
["mkv"] = {"Mafea"},
["mkw"] = {"Kituba (Congo)"},
["mkx"] = {"Kinamiging Manobo"},
["mky"] = {"East Makian"},
["mkz"] = {"Makasae"},
["mla"] = {"Malo"},
["mlb"] = {"Mbule"},
["mlc"] = {"Cao Lan"},
["mle"] = {"Manambu"},
["mlf"] = {"Mal"},
["mlh"] = {"Mape"},
["mli"] = {"Malimpung"},
["mlj"] = {"Miltu"},
["mlk"] = {"Ilwana", "Kiwilwana"},
["mll"] = {"Malua Bay"},
["mlm"] = {"Mulam"},
["mln"] = {"Malango"},
["mlo"] = {"Mlomp"},
["mlp"] = {"Bargam"},
["mlq"] = {"Western Maninkakan"},
["mlr"] = {"Vame"},
["mls"] = {"Masalit"},
["mlu"] = {"To'abaita"},
["mlv"] = {"Motlav", "Mwotlap"},
["mlw"] = {"Moloko"},
["mlx"] = {"Malfaxal", "Naha'ai"},
["mlz"] = {"Malaynon"},
["mma"] = {"Mama"},
["mmb"] = {"Momina"},
["mmc"] = {"Michoacán Mazahua"},
["mmd"] = {"Maonan"},
["mme"] = {"Mae"},
["mmf"] = {"Mundat"},
["mmg"] = {"North Ambrym"},
["mmh"] = {"Mehináku"},
["mmi"] = {"Musar"},
["mmj"] = {"Majhwar"},
["mmk"] = {"Mukha-Dora"},
["mml"] = {"Man Met"},
["mmm"] = {"Maii"},
["mmn"] = {"Mamanwa"},
["mmo"] = {"Mangga Buang"},
["mmp"] = {"Siawi"},
["mmq"] = {"Musak"},
["mmr"] = {"Western Xiangxi Miao"},
["mmt"] = {"Malalamai"},
["mmu"] = {"Mmaala"},
["mmv"] = {"Miriti"},
["mmw"] = {"Emae"},
["mmx"] = {"Madak"},
["mmy"] = {"Migaama"},
["mmz"] = {"Mabaale"},
["mna"] = {"Mbula"},
["mnb"] = {"Muna"},
["mnc"] = {"Manchu"},
["mnd"] = {"Mondé"},
["mne"] = {"Naba"},
["mnf"] = {"Mundani"},
["mng"] = {"Eastern Mnong"},
["mnh"] = {"Mono (Democratic Republic of Congo)"},
["mni"] = {"Manipuri"},
["mnj"] = {"Munji"},
["mnk"] = {"Mandinka"},
["mnl"] = {"Tiale"},
["mnm"] = {"Mapena"},
["mnn"] = {"Southern Mnong"},
["mno"] = {"Manobo languages"},
["mnp"] = {"Min Bei Chinese"},
["mnq"] = {"Minriq"},
["mnr"] = {"Mono (USA)"},
["mns"] = {"Mansi"},
["mnu"] = {"Mer"},
["mnv"] = {"Rennell-Bellona"},
["mnw"] = {"Mon"},
["mnx"] = {"Manikion"},
["mny"] = {"Manyawa"},
["mnz"] = {"Moni"},
["moa"] = {"Mwan"},
["moc"] = {"Mocoví"},
["mod"] = {"Mobilian"},
["moe"] = {"Innu", "Montagnais"},
["mog"] = {"Mongondow"},
["moh"] = {"Mohawk"},
["moi"] = {"Mboi"},
["moj"] = {"Monzombo"},
["mok"] = {"Morori"},
["mom"] = {"Mangue"},
["moo"] = {"Monom"},
["mop"] = {"Mopán Maya"},
["moq"] = {"Mor (Bomberai Peninsula)"},
["mor"] = {"Moro"},
["mos"] = {"Mossi"},
["mot"] = {"Barí"},
["mou"] = {"Mogum"},
["mov"] = {"Mohave"},
["mow"] = {"Moi (Congo)"},
["mox"] = {"Molima"},
["moy"] = {"Shekkacho"},
["moz"] = {"Mukulu", "Gergiko"},
["mpa"] = {"Mpoto"},
["mpb"] = {"Malak Malak", "Mullukmulluk"},
["mpc"] = {"Mangarrayi"},
["mpd"] = {"Machinere"},
["mpe"] = {"Majang"},
["mpg"] = {"Marba"},
["mph"] = {"Maung"},
["mpi"] = {"Mpade"},
["mpj"] = {"Martu Wangka", "Wangkajunga"},
["mpk"] = {"Mbara (Chad)"},
["mpl"] = {"Middle Watut"},
["mpm"] = {"Yosondúa Mixtec"},
["mpn"] = {"Mindiri"},
["mpo"] = {"Miu"},
["mpp"] = {"Migabac"},
["mpq"] = {"Matís"},
["mpr"] = {"Vangunu"},
["mps"] = {"Dadibi"},
["mpt"] = {"Mian"},
["mpu"] = {"Makuráp"},
["mpv"] = {"Mungkip"},
["mpw"] = {"Mapidian"},
["mpx"] = {"Misima-Panaeati"},
["mpy"] = {"Mapia"},
["mpz"] = {"Mpi"},
["mqa"] = {"Maba (Indonesia)"},
["mqb"] = {"Mbuko"},
["mqc"] = {"Mangole"},
["mqe"] = {"Matepi"},
["mqf"] = {"Momuna"},
["mqg"] = {"Kota Bangun Kutai Malay"},
["mqh"] = {"Tlazoyaltepec Mixtec"},
["mqi"] = {"Mariri"},
["mqj"] = {"Mamasa"},
["mqk"] = {"Rajah Kabunsuwan Manobo"},
["mql"] = {"Mbelime"},
["mqm"] = {"South Marquesan"},
["mqn"] = {"Moronene"},
["mqo"] = {"Modole"},
["mqp"] = {"Manipa"},
["mqq"] = {"Minokok"},
["mqr"] = {"Mander"},
["mqs"] = {"West Makian"},
["mqt"] = {"Mok"},
["mqu"] = {"Mandari"},
["mqv"] = {"Mosimo"},
["mqw"] = {"Murupi"},
["mqx"] = {"Mamuju"},
["mqy"] = {"Manggarai"},
["mqz"] = {"Pano"},
["mra"] = {"Mlabri"},
["mrb"] = {"Marino"},
["mrc"] = {"Maricopa"},
["mrd"] = {"Western Magar"},
["mre"] = {"Martha's Vineyard Sign Language"},
["mrf"] = {"Elseng"},
["mrg"] = {"Mising"},
["mrh"] = {"Mara Chin"},
["mrj"] = {"Western Mari"},
["mrk"] = {"Hmwaveke"},
["mrl"] = {"Mortlockese"},
["mrm"] = {"Merlav", "Mwerlap"},
["mrn"] = {"Cheke Holo"},
["mro"] = {"Mru"},
["mrp"] = {"Morouas"},
["mrq"] = {"North Marquesan"},
["mrr"] = {"Maria (India)"},
["mrs"] = {"Maragus"},
["mrt"] = {"Marghi Central"},
["mru"] = {"Mono (Cameroon)"},
["mrv"] = {"Mangareva"},
["mrw"] = {"Maranao"},
["mrx"] = {"Maremgi", "Dineor"},
["mry"] = {"Mandaya"},
["mrz"] = {"Marind"},
["msb"] = {"Masbatenyo"},
["msc"] = {"Sankaran Maninka"},
["msd"] = {"Yucatec Maya Sign Language"},
["mse"] = {"Musey"},
["msf"] = {"Mekwei"},
["msg"] = {"Moraid"},
["msh"] = {"Masikoro Malagasy"},
["msi"] = {"Sabah Malay"},
["msj"] = {"Ma (Democratic Republic of Congo)"},
["msk"] = {"Mansaka"},
["msl"] = {"Molof", "Poule"},
["msm"] = {"Agusan Manobo"},
["msn"] = {"Vurës"},
["mso"] = {"Mombum"},
["msp"] = {"Maritsauá"},
["msq"] = {"Caac"},
["msr"] = {"Mongolian Sign Language"},
["mss"] = {"West Masela"},
["msu"] = {"Musom"},
["msv"] = {"Maslam"},
["msw"] = {"Mansoanka"},
["msx"] = {"Moresada"},
["msy"] = {"Aruamu"},
["msz"] = {"Momare"},
["mta"] = {"Cotabato Manobo"},
["mtb"] = {"Anyin Morofo"},
["mtc"] = {"Munit"},
["mtd"] = {"Mualang"},
["mte"] = {"Mono (Solomon Islands)"},
["mtf"] = {"Murik (Papua New Guinea)"},
["mtg"] = {"Una"},
["mth"] = {"Munggui"},
["mti"] = {"Maiwa (Papua New Guinea)"},
["mtj"] = {"Moskona"},
["mtk"] = {"Mbe'"},
["mtl"] = {"Montol"},
["mtm"] = {"Mator"},
["mtn"] = {"Matagalpa"},
["mto"] = {"Totontepec Mixe"},
["mtp"] = {"Wichí Lhamtés Nocten"},
["mtq"] = {"Muong"},
["mtr"] = {"Mewari"},
["mts"] = {"Yora"},
["mtt"] = {"Mota"},
["mtu"] = {"Tututepec Mixtec"},
["mtv"] = {"Asaro'o"},
["mtw"] = {"Southern Binukidnon"},
["mtx"] = {"Tidaá Mixtec"},
["mty"] = {"Nabi"},
["mua"] = {"Mundang"},
["mub"] = {"Mubi"},
["muc"] = {"Ajumbu"},
["mud"] = {"Mednyj Aleut"},
["mue"] = {"Media Lengua"},
["mug"] = {"Musgu"},
["muh"] = {"Mündü"},
["mui"] = {"Musi"},
["muj"] = {"Mabire"},
["muk"] = {"Mugom"},
["mul"] = {"Multiple languages"},
["mum"] = {"Maiwala"},
["mun"] = {"Munda languages"},
["muo"] = {"Nyong"},
["mup"] = {"Malvi"},
["muq"] = {"Eastern Xiangxi Miao"},
["mur"] = {"Murle"},
["mus"] = {"Creek"},
["mut"] = {"Western Muria"},
["muu"] = {"Yaaku"},
["muv"] = {"Muthuvan"},
["mux"] = {"Bo-Ung"},
["muy"] = {"Muyang"},
["muz"] = {"Mursi"},
["mva"] = {"Manam"},
["mvb"] = {"Mattole"},
["mvd"] = {"Mamboru"},
["mve"] = {"Marwari (Pakistan)"},
["mvf"] = {"Peripheral Mongolian"},
["mvg"] = {"Yucuañe Mixtec"},
["mvh"] = {"Mulgi"},
["mvi"] = {"Miyako"},
["mvk"] = {"Mekmek"},
["mvl"] = {"Mbara (Australia)"},
["mvn"] = {"Minaveha"},
["mvo"] = {"Marovo"},
["mvp"] = {"Duri"},
["mvq"] = {"Moere"},
["mvr"] = {"Marau"},
["mvs"] = {"Massep"},
["mvt"] = {"Mpotovoro"},
["mvu"] = {"Marfa"},
["mvv"] = {"Tagal Murut"},
["mvw"] = {"Machinga"},
["mvx"] = {"Meoswar"},
["mvy"] = {"Indus Kohistani"},
["mvz"] = {"Mesqan"},
["mwa"] = {"Mwatebu"},
["mwb"] = {"Juwal"},
["mwc"] = {"Are"},
["mwe"] = {"Mwera (Chimwera)"},
["mwf"] = {"Murrinh-Patha"},
["mwg"] = {"Aiklep"},
["mwh"] = {"Mouk-Aria"},
["mwi"] = {"Labo", "Ninde"},
["mwk"] = {"Kita Maninkakan"},
["mwl"] = {"Mirandese"},
["mwm"] = {"Sar"},
["mwn"] = {"Nyamwanga"},
["mwo"] = {"Central Maewo"},
["mwp"] = {"Kala Lagaw Ya"},
["mwq"] = {"Mün Chin"},
["mwr"] = {"Marwari"},
["mws"] = {"Mwimbi-Muthambi"},
["mwt"] = {"Moken"},
["mwu"] = {"Mittu"},
["mwv"] = {"Mentawai"},
["mww"] = {"Hmong Daw"},
["mwz"] = {"Moingi"},
["mxa"] = {"Northwest Oaxaca Mixtec"},
["mxb"] = {"Tezoatlán Mixtec"},
["mxc"] = {"Manyika"},
["mxd"] = {"Modang"},
["mxe"] = {"Mele-Fila"},
["mxf"] = {"Malgbe"},
["mxg"] = {"Mbangala"},
["mxh"] = {"Mvuba"},
["mxi"] = {"Mozarabic"},
["mxj"] = {"Miju-Mishmi", "Geman Deng"},
["mxk"] = {"Monumbo"},
["mxl"] = {"Maxi Gbe"},
["mxm"] = {"Meramera"},
["mxn"] = {"Moi (Indonesia)"},
["mxo"] = {"Mbowe"},
["mxp"] = {"Tlahuitoltepec Mixe"},
["mxq"] = {"Juquila Mixe"},
["mxr"] = {"Murik (Malaysia)"},
["mxs"] = {"Huitepec Mixtec"},
["mxt"] = {"Jamiltepec Mixtec"},
["mxu"] = {"Mada (Cameroon)"},
["mxv"] = {"Metlatónoc Mixtec"},
["mxw"] = {"Namo"},
["mxx"] = {"Mahou", "Mawukakan"},
["mxy"] = {"Southeastern Nochixtlán Mixtec"},
["mxz"] = {"Central Masela"},
["myb"] = {"Mbay"},
["myc"] = {"Mayeka"},
["mye"] = {"Myene"},
["myf"] = {"Bambassi"},
["myg"] = {"Manta"},
["myh"] = {"Makah"},
["myj"] = {"Mangayat"},
["myk"] = {"Mamara Senoufo"},
["myl"] = {"Moma"},
["mym"] = {"Me'en"},
["myn"] = {"Mayan languages"},
["myo"] = {"Anfillo"},
["myp"] = {"Pirahã"},
["myr"] = {"Muniche"},
["mys"] = {"Mesmes"},
["myu"] = {"Mundurukú"},
["myv"] = {"Erzya"},
["myw"] = {"Muyuw"},
["myx"] = {"Masaaba"},
["myy"] = {"Macuna"},
["myz"] = {"Classical Mandaic"},
["mza"] = {"Santa María Zacatepec Mixtec"},
["mzb"] = {"Tumzabt"},
["mzc"] = {"Madagascar Sign Language"},
["mzd"] = {"Malimba"},
["mze"] = {"Morawa"},
["mzg"] = {"Monastic Sign Language"},
["mzh"] = {"Wichí Lhamtés Güisnay"},
["mzi"] = {"Ixcatlán Mazatec"},
["mzj"] = {"Manya"},
["mzk"] = {"Nigeria Mambila"},
["mzl"] = {"Mazatlán Mixe"},
["mzm"] = {"Mumuye"},
["mzn"] = {"Mazanderani"},
["mzo"] = {"Matipuhy"},
["mzp"] = {"Movima"},
["mzq"] = {"Mori Atas"},
["mzr"] = {"Marúbo"},
["mzs"] = {"Macanese"},
["mzt"] = {"Mintil"},
["mzu"] = {"Inapang"},
["mzv"] = {"Manza"},
["mzw"] = {"Deg"},
["mzx"] = {"Mawayana"},
["mzy"] = {"Mozambican Sign Language"},
["mzz"] = {"Maiadomu"},
["naa"] = {"Namla"},
["nab"] = {"Southern Nambikuára"},
["nac"] = {"Narak"},
["nae"] = {"Naka'ela"},
["naf"] = {"Nabak"},
["nag"] = {"Naga Pidgin"},
["nah"] = {"Nahuatl languages"},
["nai"] = {"North American Indian languages"},
["naj"] = {"Nalu"},
["nak"] = {"Nakanai"},
["nal"] = {"Nalik"},
["nam"] = {"Ngan'gityemerri"},
["nan"] = {"Min Nan Chinese"},
["nao"] = {"Naaba"},
["nap"] = {"Neapolitan"},
["naq"] = {"Khoekhoe", "Nama (Namibia)"},
["nar"] = {"Iguta"},
["nas"] = {"Naasioi"},
["nat"] = {"Ca̱hungwa̱rya̱", "Hungworo"},
["naw"] = {"Nawuri"},
["nax"] = {"Nakwi"},
["nay"] = {"Ngarrindjeri"},
["naz"] = {"Coatepec Nahuatl"},
["nba"] = {"Nyemba"},
["nbb"] = {"Ndoe"},
["nbc"] = {"Chang Naga"},
["nbd"] = {"Ngbinda"},
["nbe"] = {"Konyak Naga"},
["nbg"] = {"Nagarchal"},
["nbh"] = {"Ngamo"},
["nbi"] = {"Mao Naga"},
["nbj"] = {"Ngarinyman"},
["nbk"] = {"Nake"},
["nbm"] = {"Ngbaka Ma'bo"},
["nbn"] = {"Kuri"},
["nbo"] = {"Nkukoli"},
["nbp"] = {"Nnam"},
["nbq"] = {"Nggem"},
["nbr"] = {"Numana"},
["nbs"] = {"Namibian Sign Language"},
["nbt"] = {"Na"},
["nbu"] = {"Rongmei Naga"},
["nbv"] = {"Ngamambo"},
["nbw"] = {"Southern Ngbandi"},
["nby"] = {"Ningera"},
["nca"] = {"Iyo"},
["ncb"] = {"Central Nicobarese"},
["ncc"] = {"Ponam"},
["ncd"] = {"Nachering"},
["nce"] = {"Yale"},
["ncf"] = {"Notsi"},
["ncg"] = {"Nisga'a"},
["nch"] = {"Central Huasteca Nahuatl"},
["nci"] = {"Classical Nahuatl"},
["ncj"] = {"Northern Puebla Nahuatl"},
["nck"] = {"Na-kara"},
["ncl"] = {"Michoacán Nahuatl"},
["ncm"] = {"Nambo"},
["ncn"] = {"Nauna"},
["nco"] = {"Sibe"},
["ncq"] = {"Northern Katang"},
["ncr"] = {"Ncane"},
["ncs"] = {"Nicaraguan Sign Language"},
["nct"] = {"Chothe Naga"},
["ncu"] = {"Chumburung"},
["ncx"] = {"Central Puebla Nahuatl"},
["ncz"] = {"Natchez"},
["nda"] = {"Ndasa"},
["ndb"] = {"Kenswei Nsei"},
["ndc"] = {"Ndau"},
["ndd"] = {"Nde-Nsele-Nta"},
["ndf"] = {"Nadruvian"},
["ndg"] = {"Ndengereko"},
["ndh"] = {"Ndali"},
["ndi"] = {"Samba Leko"},
["ndj"] = {"Ndamba"},
["ndk"] = {"Ndaka"},
["ndl"] = {"Ndolo"},
["ndm"] = {"Ndam"},
["ndn"] = {"Ngundi"},
["ndp"] = {"Ndo"},
["ndq"] = {"Ndombe"},
["ndr"] = {"Ndoola"},
["nds"] = {"Low German", "Low Saxon"},
["ndt"] = {"Ndunga"},
["ndu"] = {"Dugun"},
["ndv"] = {"Ndut"},
["ndw"] = {"Ndobo"},
["ndx"] = {"Nduga"},
["ndy"] = {"Lutos"},
["ndz"] = {"Ndogo"},
["nea"] = {"Eastern Ngad'a"},
["neb"] = {"Toura (Côte d'Ivoire)"},
["nec"] = {"Nedebang"},
["ned"] = {"Nde-Gbite"},
["nee"] = {"Nêlêmwa-Nixumwak"},
["nef"] = {"Nefamese"},
["neg"] = {"Negidal"},
["neh"] = {"Nyenkha"},
["nei"] = {"Neo-Hittite"},
["nej"] = {"Neko"},
["nek"] = {"Neku"},
["nem"] = {"Nemi"},
["nen"] = {"Nengone"},
["neo"] = {"Ná-Meo"},
["neq"] = {"North Central Mixe"},
["ner"] = {"Yahadian"},
["nes"] = {"Bhoti Kinnauri"},
["net"] = {"Nete"},
["neu"] = {"Neo"},
["nev"] = {"Nyaheun"},
["new"] = {"Newari", "Nepal Bhasa"},
["nex"] = {"Neme"},
["ney"] = {"Neyo"},
["nez"] = {"Nez Perce"},
["nfa"] = {"Dhao"},
["nfd"] = {"Ahwai"},
["nfl"] = {"Ayiwo", "Äiwoo"},
["nfr"] = {"Nafaanra"},
["nfu"] = {"Mfumte"},
["nga"] = {"Ngbaka"},
["ngb"] = {"Northern Ngbandi"},
["ngc"] = {"Ngombe (Democratic Republic of Congo)"},
["ngd"] = {"Ngando (Central African Republic)"},
["nge"] = {"Ngemba"},
["ngf"] = {"Trans-New Guinea languages"},
["ngg"] = {"Ngbaka Manza"},
["ngh"] = {"Nǁng"},
["ngi"] = {"Ngizim"},
["ngj"] = {"Ngie"},
["ngk"] = {"Dalabon"},
["ngl"] = {"Lomwe"},
["ngm"] = {"Ngatik Men's Creole"},
["ngn"] = {"Ngwo"},
["ngp"] = {"Ngulu"},
["ngq"] = {"Ngurimi", "Ngoreme"},
["ngr"] = {"Engdewu"},
["ngs"] = {"Gvoko"},
["ngt"] = {"Kriang", "Ngeq"},
["ngu"] = {"Guerrero Nahuatl"},
["ngv"] = {"Nagumi"},
["ngw"] = {"Ngwaba"},
["ngx"] = {"Nggwahyi"},
["ngy"] = {"Tibea"},
["ngz"] = {"Ngungwel"},
["nha"] = {"Nhanda"},
["nhb"] = {"Beng"},
["nhc"] = {"Tabasco Nahuatl"},
["nhd"] = {"Chiripá", "Ava Guaraní"},
["nhe"] = {"Eastern Huasteca Nahuatl"},
["nhf"] = {"Nhuwala"},
["nhg"] = {"Tetelcingo Nahuatl"},
["nhh"] = {"Nahari"},
["nhi"] = {"Zacatlán-Ahuacatlán-Tepetzintla Nahuatl"},
["nhk"] = {"Isthmus-Cosoleacaque Nahuatl"},
["nhm"] = {"Morelos Nahuatl"},
["nhn"] = {"Central Nahuatl"},
["nho"] = {"Takuu"},
["nhp"] = {"Isthmus-Pajapan Nahuatl"},
["nhq"] = {"Huaxcaleca Nahuatl"},
["nhr"] = {"Naro"},
["nht"] = {"Ometepec Nahuatl"},
["nhu"] = {"Noone"},
["nhv"] = {"Temascaltepec Nahuatl"},
["nhw"] = {"Western Huasteca Nahuatl"},
["nhx"] = {"Isthmus-Mecayapan Nahuatl"},
["nhy"] = {"Northern Oaxaca Nahuatl"},
["nhz"] = {"Santa María La Alta Nahuatl"},
["nia"] = {"Nias"},
["nib"] = {"Nakame"},
["nic"] = {"Niger-Kordofanian languages"},
["nid"] = {"Ngandi"},
["nie"] = {"Niellim"},
["nif"] = {"Nek"},
["nig"] = {"Ngalakgan"},
["nih"] = {"Nyiha (Tanzania)"},
["nii"] = {"Nii"},
["nij"] = {"Ngaju"},
["nik"] = {"Southern Nicobarese"},
["nil"] = {"Nila"},
["nim"] = {"Nilamba"},
["nin"] = {"Ninzo"},
["nio"] = {"Nganasan"},
["niq"] = {"Nandi"},
["nir"] = {"Nimboran"},
["nis"] = {"Nimi"},
["nit"] = {"Southeastern Kolami"},
["niu"] = {"Niuean"},
["niv"] = {"Gilyak"},
["niw"] = {"Nimo"},
["nix"] = {"Hema"},
["niy"] = {"Ngiti"},
["niz"] = {"Ningil"},
["nja"] = {"Nzanyi"},
["njb"] = {"Nocte Naga"},
["njd"] = {"Ndonde Hamba"},
["njh"] = {"Lotha Naga"},
["nji"] = {"Gudanji"},
["njj"] = {"Njen"},
["njl"] = {"Njalgulgule"},
["njm"] = {"Angami Naga"},
["njn"] = {"Liangmai Naga"},
["njo"] = {"Ao Naga"},
["njr"] = {"Njerep"},
["njs"] = {"Nisa"},
["njt"] = {"Ndyuka-Trio Pidgin"},
["nju"] = {"Ngadjunmaya"},
["njx"] = {"Kunyi"},
["njy"] = {"Njyem"},
["njz"] = {"Nyishi"},
["nka"] = {"Nkoya"},
["nkb"] = {"Khoibu Naga"},
["nkc"] = {"Nkongho"},
["nkd"] = {"Koireng"},
["nke"] = {"Duke"},
["nkf"] = {"Inpui Naga"},
["nkg"] = {"Nekgini"},
["nkh"] = {"Khezha Naga"},
["nki"] = {"Thangal Naga"},
["nkj"] = {"Nakai"},
["nkk"] = {"Nokuku"},
["nkm"] = {"Namat"},
["nkn"] = {"Nkangala"},
["nko"] = {"Nkonya"},
["nkp"] = {"Niuatoputapu"},
["nkq"] = {"Nkami"},
["nkr"] = {"Nukuoro"},
["nks"] = {"North Asmat"},
["nkt"] = {"Nyika (Tanzania)"},
["nku"] = {"Bouna Kulango"},
["nkv"] = {"Nyika (Malawi and Zambia)"},
["nkw"] = {"Nkutu"},
["nkx"] = {"Nkoroo"},
["nkz"] = {"Nkari"},
["nla"] = {"Ngombale"},
["nlc"] = {"Nalca"},
["nle"] = {"East Nyala"},
["nlg"] = {"Gela"},
["nli"] = {"Grangali"},
["nlj"] = {"Nyali"},
["nlk"] = {"Ninia Yali"},
["nll"] = {"Nihali"},
["nlm"] = {"Mankiyali"},
["nlo"] = {"Ngul"},
["nlq"] = {"Lao Naga"},
["nlu"] = {"Nchumbulu"},
["nlv"] = {"Orizaba Nahuatl"},
["nlw"] = {"Walangama"},
["nlx"] = {"Nahali"},
["nly"] = {"Nyamal"},
["nlz"] = {"Nalögo"},
["nma"] = {"Maram Naga"},
["nmb"] = {"Big Nambas", "V'ënen Taut"},
["nmc"] = {"Ngam"},
["nmd"] = {"Ndumu"},
["nme"] = {"Mzieme Naga"},
["nmf"] = {"Tangkhul Naga (India)"},
["nmg"] = {"Kwasio"},
["nmh"] = {"Monsang Naga"},
["nmi"] = {"Nyam"},
["nmj"] = {"Ngombe (Central African Republic)"},
["nmk"] = {"Namakura"},
["nml"] = {"Ndemli"},
["nmm"] = {"Manangba"},
["nmn"] = {"ǃXóõ"},
["nmo"] = {"Moyon Naga"},
["nmp"] = {"Nimanbur"},
["nmq"] = {"Nambya"},
["nmr"] = {"Nimbari"},
["nms"] = {"Letemboi"},
["nmt"] = {"Namonuito"},
["nmu"] = {"Northeast Maidu"},
["nmv"] = {"Ngamini"},
["nmw"] = {"Nimoa", "Rifao"},
["nmx"] = {"Nama (Papua New Guinea)"},
["nmy"] = {"Namuyi"},
["nmz"] = {"Nawdm"},
["nna"] = {"Nyangumarta"},
["nnb"] = {"Nande"},
["nnc"] = {"Nancere"},
["nnd"] = {"West Ambae"},
["nne"] = {"Ngandyera"},
["nnf"] = {"Ngaing"},
["nng"] = {"Maring Naga"},
["nnh"] = {"Ngiemboon"},
["nni"] = {"North Nuaulu"},
["nnj"] = {"Nyangatom"},
["nnk"] = {"Nankina"},
["nnl"] = {"Northern Rengma Naga"},
["nnm"] = {"Namia"},
["nnn"] = {"Ngete"},
["nnp"] = {"Wancho Naga"},
["nnq"] = {"Ngindo"},
["nnr"] = {"Narungga"},
["nnt"] = {"Nanticoke"},
["nnu"] = {"Dwang"},
["nnv"] = {"Nugunu (Australia)"},
["nnw"] = {"Southern Nuni"},
["nny"] = {"Nyangga"},
["nnz"] = {"Nda'nda'"},
["noa"] = {"Woun Meu"},
["noc"] = {"Nuk"},
["nod"] = {"Northern Thai"},
["noe"] = {"Nimadi"},
["nof"] = {"Nomane"},
["nog"] = {"Nogai"},
["noh"] = {"Nomu"},
["noi"] = {"Noiri"},
["noj"] = {"Nonuya"},
["nok"] = {"Nooksack"},
["nol"] = {"Nomlaki"},
["non"] = {"Old Norse"},
["nop"] = {"Numanggang"},
["noq"] = {"Ngongo"},
["nos"] = {"Eastern Nisu"},
["not"] = {"Nomatsiguenga"},
["nou"] = {"Ewage-Notu"},
["nov"] = {"Novial"},
["now"] = {"Nyambo"},
["noy"] = {"Noy"},
["noz"] = {"Nayi"},
["npa"] = {"Nar Phu"},
["npb"] = {"Nupbikha"},
["npg"] = {"Ponyo-Gongwang Naga"},
["nph"] = {"Phom Naga"},
["npi"] = {"Nepali (individual language)"},
["npl"] = {"Southeastern Puebla Nahuatl"},
["npn"] = {"Mondropolon"},
["npo"] = {"Pochuri Naga"},
["nps"] = {"Nipsan"},
["npu"] = {"Puimei Naga"},
["npx"] = {"Noipx"},
["npy"] = {"Napu"},
["nqg"] = {"Southern Nago"},
["nqk"] = {"Kura Ede Nago"},
["nql"] = {"Ngendelengo"},
["nqm"] = {"Ndom"},
["nqn"] = {"Nen"},
["nqo"] = {"N'Ko", "N’Ko"},
["nqq"] = {"Kyan-Karyaw Naga"},
["nqt"] = {"Nteng"},
["nqy"] = {"Akyaung Ari Naga"},
["nra"] = {"Ngom"},
["nrb"] = {"Nara"},
["nrc"] = {"Noric"},
["nre"] = {"Southern Rengma Naga"},
["nrf"] = {"Jèrriais", "Guernésiais", "Sercquiais"},
["nrg"] = {"Narango"},
["nri"] = {"Chokri Naga"},
["nrk"] = {"Ngarla"},
["nrl"] = {"Ngarluma"},
["nrm"] = {"Narom"},
["nrn"] = {"Norn"},
["nrp"] = {"North Picene"},
["nrr"] = {"Norra", "Nora"},
["nrt"] = {"Northern Kalapuya"},
["nru"] = {"Narua"},
["nrx"] = {"Ngurmbur"},
["nrz"] = {"Lala"},
["nsa"] = {"Sangtam Naga"},
["nsb"] = {"Lower Nossob"},
["nsc"] = {"Nshi"},
["nsd"] = {"Southern Nisu"},
["nse"] = {"Nsenga"},
["nsf"] = {"Northwestern Nisu"},
["nsg"] = {"Ngasa"},
["nsh"] = {"Ngoshie"},
["nsi"] = {"Nigerian Sign Language"},
["nsk"] = {"Naskapi"},
["nsl"] = {"Norwegian Sign Language"},
["nsm"] = {"Sumi Naga"},
["nsn"] = {"Nehan"},
["nso"] = {"Pedi", "Northern Sotho", "Sepedi"},
["nsp"] = {"Nepalese Sign Language"},
["nsq"] = {"Northern Sierra Miwok"},
["nsr"] = {"Maritime Sign Language"},
["nss"] = {"Nali"},
["nst"] = {"Tase Naga"},
["nsu"] = {"Sierra Negra Nahuatl"},
["nsv"] = {"Southwestern Nisu"},
["nsw"] = {"Navut"},
["nsx"] = {"Nsongo"},
["nsy"] = {"Nasal"},
["nsz"] = {"Nisenan"},
["ntd"] = {"Northern Tidung"},
["nte"] = {"Nathembo"},
["ntg"] = {"Ngantangarra"},
["nti"] = {"Natioro"},
["ntj"] = {"Ngaanyatjarra"},
["ntk"] = {"Ikoma-Nata-Isenye"},
["ntm"] = {"Nateni"},
["nto"] = {"Ntomba"},
["ntp"] = {"Northern Tepehuan"},
["ntr"] = {"Delo"},
["ntu"] = {"Natügu"},
["ntw"] = {"Nottoway"},
["ntx"] = {"Tangkhul Naga (Myanmar)"},
["nty"] = {"Mantsi"},
["ntz"] = {"Natanzi"},
["nua"] = {"Yuanga"},
["nub"] = {"Nubian languages"},
["nuc"] = {"Nukuini"},
["nud"] = {"Ngala"},
["nue"] = {"Ngundu"},
["nuf"] = {"Nusu"},
["nug"] = {"Nungali"},
["nuh"] = {"Ndunda"},
["nui"] = {"Ngumbi"},
["nuj"] = {"Nyole"},
["nuk"] = {"Nuu-chah-nulth", "Nuuchahnulth"},
["nul"] = {"Nusa Laut"},
["num"] = {"Niuafo'ou"},
["nun"] = {"Anong"},
["nuo"] = {"Nguôn"},
["nup"] = {"Nupe-Nupe-Tako"},
["nuq"] = {"Nukumanu"},
["nur"] = {"Nukuria"},
["nus"] = {"Nuer"},
["nut"] = {"Nung (Viet Nam)"},
["nuu"] = {"Ngbundu"},
["nuv"] = {"Northern Nuni"},
["nuw"] = {"Nguluwan"},
["nux"] = {"Mehek"},
["nuy"] = {"Nunggubuyu"},
["nuz"] = {"Tlamacazapa Nahuatl"},
["nvh"] = {"Nasarian"},
["nvm"] = {"Namiae"},
["nvo"] = {"Nyokon"},
["nwa"] = {"Nawathinehena"},
["nwb"] = {"Nyabwa"},
["nwc"] = {"Classical Newari", "Classical Nepal Bhasa", "Old Newari"},
["nwe"] = {"Ngwe"},
["nwg"] = {"Ngayawung"},
["nwi"] = {"Southwest Tanna"},
["nwm"] = {"Nyamusa-Molo"},
["nwo"] = {"Nauo"},
["nwr"] = {"Nawaru"},
["nww"] = {"Ndwewe"},
["nwx"] = {"Middle Newar"},
["nwy"] = {"Nottoway-Meherrin"},
["nxa"] = {"Nauete"},
["nxd"] = {"Ngando (Democratic Republic of Congo)"},
["nxe"] = {"Nage"},
["nxg"] = {"Ngad'a"},
["nxi"] = {"Nindi"},
["nxk"] = {"Koki Naga"},
["nxl"] = {"South Nuaulu"},
["nxm"] = {"Numidian"},
["nxn"] = {"Ngawun"},
["nxo"] = {"Ndambomo"},
["nxq"] = {"Naxi"},
["nxr"] = {"Ninggerum"},
["nxx"] = {"Nafri"},
["nyb"] = {"Nyangbo"},
["nyc"] = {"Nyanga-li"},
["nyd"] = {"Nyore", "Olunyole"},
["nye"] = {"Nyengo"},
["nyf"] = {"Giryama", "Kigiryama"},
["nyg"] = {"Nyindu"},
["nyh"] = {"Nyikina"},
["nyi"] = {"Ama (Sudan)"},
["nyj"] = {"Nyanga"},
["nyk"] = {"Nyaneka"},
["nyl"] = {"Nyeu"},
["nym"] = {"Nyamwezi"},
["nyn"] = {"Nyankole"},
["nyo"] = {"Nyoro"},
["nyp"] = {"Nyang'i"},
["nyq"] = {"Nayini"},
["nyr"] = {"Nyiha (Malawi)"},
["nys"] = {"Nyungar"},
["nyt"] = {"Nyawaygi"},
["nyu"] = {"Nyungwe"},
["nyv"] = {"Nyulnyul"},
["nyw"] = {"Nyaw"},
["nyx"] = {"Nganyaywana"},
["nyy"] = {"Nyakyusa-Ngonde"},
["nza"] = {"Tigon Mbembe"},
["nzb"] = {"Njebi"},
["nzd"] = {"Nzadi"},
["nzi"] = {"Nzima"},
["nzk"] = {"Nzakara"},
["nzm"] = {"Zeme Naga"},
["nzr"] = {"Dir-Nyamzak-Mbarimi"},
["nzs"] = {"New Zealand Sign Language"},
["nzu"] = {"Teke-Nzikou"},
["nzy"] = {"Nzakambay"},
["nzz"] = {"Nanga Dama Dogon"},
["oaa"] = {"Orok"},
["oac"] = {"Oroch"},
["oar"] = {"Old Aramaic (up to 700 BCE)", "Ancient Aramaic (up to 700 BCE)"},
["oav"] = {"Old Avar"},
["obi"] = {"Obispeño"},
["obk"] = {"Southern Bontok"},
["obl"] = {"Oblo"},
["obm"] = {"Moabite"},
["obo"] = {"Obo Manobo"},
["obr"] = {"Old Burmese"},
["obt"] = {"Old Breton"},
["obu"] = {"Obulom"},
["oca"] = {"Ocaina"},
["och"] = {"Old Chinese"},
["ocm"] = {"Old Cham"},
["oco"] = {"Old Cornish"},
["ocu"] = {"Atzingo Matlatzinca"},
["oda"] = {"Odut"},
["odk"] = {"Od"},
["odt"] = {"Old Dutch"},
["odu"] = {"Odual"},
["ofo"] = {"Ofo"},
["ofs"] = {"Old Frisian"},
["ofu"] = {"Efutop"},
["ogb"] = {"Ogbia"},
["ogc"] = {"Ogbah"},
["oge"] = {"Old Georgian"},
["ogg"] = {"Ogbogolo"},
["ogo"] = {"Khana"},
["ogu"] = {"Ogbronuagum"},
["oht"] = {"Old Hittite"},
["ohu"] = {"Old Hungarian"},
["oia"] = {"Oirata"},
["oie"] = {"Okolie"},
["oin"] = {"Inebu One"},
["ojb"] = {"Northwestern Ojibwa"},
["ojc"] = {"Central Ojibwa"},
["ojg"] = {"Eastern Ojibwa"},
["ojp"] = {"Old Japanese"},
["ojs"] = {"Severn Ojibwa"},
["ojv"] = {"Ontong Java"},
["ojw"] = {"Western Ojibwa"},
["oka"] = {"Okanagan"},
["okb"] = {"Okobo"},
["okc"] = {"Kobo"},
["okd"] = {"Okodia"},
["oke"] = {"Okpe (Southwestern Edo)"},
["okg"] = {"Koko Babangk"},
["okh"] = {"Koresh-e Rostam"},
["oki"] = {"Okiek"},
["okj"] = {"Oko-Juwoi"},
["okk"] = {"Kwamtim One"},
["okl"] = {"Old Kentish Sign Language"},
["okm"] = {"Middle Korean (10th-16th cent.)"},
["okn"] = {"Oki-No-Erabu"},
["oko"] = {"Old Korean (3rd-9th cent.)"},
["okr"] = {"Kirike"},
["oks"] = {"Oko-Eni-Osayen"},
["oku"] = {"Oku"},
["okv"] = {"Orokaiva"},
["okx"] = {"Okpe (Northwestern Edo)"},
["okz"] = {"Old Khmer"},
["ola"] = {"Walungge"},
["old"] = {"Mochi"},
["ole"] = {"Olekha"},
["olk"] = {"Olkol"},
["olm"] = {"Oloma"},
["olo"] = {"Livvi"},
["olr"] = {"Olrat"},
["olt"] = {"Old Lithuanian"},
["olu"] = {"Kuvale"},
["oma"] = {"Omaha-Ponca"},
["omb"] = {"East Ambae"},
["omc"] = {"Mochica"},
["omg"] = {"Omagua"},
["omi"] = {"Omi"},
["omk"] = {"Omok"},
["oml"] = {"Ombo"},
["omn"] = {"Minoan"},
["omo"] = {"Utarmbung"},
["omp"] = {"Old Manipuri"},
["omq"] = {"Oto-Manguean languages"},
["omr"] = {"Old Marathi"},
["omt"] = {"Omotik"},
["omu"] = {"Omurano"},
["omv"] = {"Omotic languages"},
["omw"] = {"South Tairora"},
["omx"] = {"Old Mon"},
["omy"] = {"Old Malay"},
["ona"] = {"Ona"},
["onb"] = {"Lingao"},
["one"] = {"Oneida"},
["ong"] = {"Olo"},
["oni"] = {"Onin"},
["onj"] = {"Onjob"},
["onk"] = {"Kabore One"},
["onn"] = {"Onobasulu"},
["ono"] = {"Onondaga"},
["onp"] = {"Sartang"},
["onr"] = {"Northern One"},
["ons"] = {"Ono"},
["ont"] = {"Ontenu"},
["onu"] = {"Unua"},
["onw"] = {"Old Nubian"},
["onx"] = {"Onin Based Pidgin"},
["ood"] = {"Tohono O'odham"},
["oog"] = {"Ong"},
["oon"] = {"Önge"},
["oor"] = {"Oorlams"},
["oos"] = {"Old Ossetic"},
["opa"] = {"Okpamheri"},
["opk"] = {"Kopkaka"},
["opm"] = {"Oksapmin"},
["opo"] = {"Opao"},
["opt"] = {"Opata"},
["opy"] = {"Ofayé"},
["ora"] = {"Oroha"},
["orc"] = {"Orma"},
["ore"] = {"Orejón"},
["org"] = {"Oring"},
["orh"] = {"Oroqen"},
["orn"] = {"Orang Kanaq"},
["oro"] = {"Orokolo"},
["orr"] = {"Oruma"},
["ors"] = {"Orang Seletar"},
["ort"] = {"Adivasi Oriya"},
["oru"] = {"Ormuri"},
["orv"] = {"Old Russian"},
["orw"] = {"Oro Win"},
["orx"] = {"Oro"},
["ory"] = {"Odia (individual language)", "Oriya (individual language)"},
["orz"] = {"Ormu"},
["osa"] = {"Osage"},
["osc"] = {"Oscan"},
["osi"] = {"Osing"},
["osn"] = {"Old Sundanese"},
["oso"] = {"Ososo"},
["osp"] = {"Old Spanish"},
["ost"] = {"Osatu"},
["osu"] = {"Southern One"},
["osx"] = {"Old Saxon"},
["ota"] = {"Ottoman Turkish (1500-1928)"},
["otb"] = {"Old Tibetan"},
["otd"] = {"Ot Danum"},
["ote"] = {"Mezquital Otomi"},
["oti"] = {"Oti"},
["otk"] = {"Old Turkish"},
["otl"] = {"Tilapa Otomi"},
["otm"] = {"Eastern Highland Otomi"},
["otn"] = {"Tenango Otomi"},
["oto"] = {"Otomian languages"},
["otq"] = {"Querétaro Otomi"},
["otr"] = {"Otoro"},
["ots"] = {"Estado de México Otomi"},
["ott"] = {"Temoaya Otomi"},
["otu"] = {"Otuke"},
["otw"] = {"Ottawa"},
["otx"] = {"Texcatepec Otomi"},
["oty"] = {"Old Tamil"},
["otz"] = {"Ixtenco Otomi"},
["oua"] = {"Tagargrent"},
["oub"] = {"Glio-Oubi"},
["oue"] = {"Oune"},
["oui"] = {"Old Uighur"},
["oum"] = {"Ouma"},
["ovd"] = {"Elfdalian", "Övdalian"},
["owi"] = {"Owiniga"},
["owl"] = {"Old Welsh"},
["oyb"] = {"Oy"},
["oyd"] = {"Oyda"},
["oym"] = {"Wayampi"},
["oyy"] = {"Oya'oya"},
["ozm"] = {"Koonzime"},
["paa"] = {"Papuan languages"},
["pab"] = {"Parecís"},
["pac"] = {"Pacoh"},
["pad"] = {"Paumarí"},
["pae"] = {"Pagibete"},
["paf"] = {"Paranawát"},
["pag"] = {"Pangasinan"},
["pah"] = {"Tenharim"},
["pai"] = {"Pe"},
["pak"] = {"Parakanã"},
["pal"] = {"Pahlavi"},
["pam"] = {"Pampanga", "Kapampangan"},
["pao"] = {"Northern Paiute"},
["pap"] = {"Papiamento"},
["paq"] = {"Parya"},
["par"] = {"Panamint", "Timbisha"},
["pas"] = {"Papasena"},
["pau"] = {"Palauan"},
["pav"] = {"Pakaásnovos"},
["paw"] = {"Pawnee"},
["pax"] = {"Pankararé"},
["pay"] = {"Pech"},
["paz"] = {"Pankararú"},
["pbb"] = {"Páez"},
["pbc"] = {"Patamona"},
["pbe"] = {"Mezontla Popoloca"},
["pbf"] = {"Coyotepec Popoloca"},
["pbg"] = {"Paraujano"},
["pbh"] = {"E'ñapa Woromaipu"},
["pbi"] = {"Parkwa"},
["pbl"] = {"Mak (Nigeria)"},
["pbm"] = {"Puebla Mazatec"},
["pbn"] = {"Kpasam"},
["pbo"] = {"Papel"},
["pbp"] = {"Badyara"},
["pbr"] = {"Pangwa"},
["pbs"] = {"Central Pame"},
["pbt"] = {"Southern Pashto"},
["pbu"] = {"Northern Pashto"},
["pbv"] = {"Pnar"},
["pby"] = {"Pyu (Papua New Guinea)"},
["pca"] = {"Santa Inés Ahuatempan Popoloca"},
["pcb"] = {"Pear"},
["pcc"] = {"Bouyei"},
["pcd"] = {"Picard"},
["pce"] = {"Ruching Palaung"},
["pcf"] = {"Paliyan"},
["pcg"] = {"Paniya"},
["pch"] = {"Pardhan"},
["pci"] = {"Duruwa"},
["pcj"] = {"Parenga"},
["pck"] = {"Paite Chin"},
["pcl"] = {"Pardhi"},
["pcm"] = {"Nigerian Pidgin"},
["pcn"] = {"Piti"},
["pcp"] = {"Pacahuara"},
["pcw"] = {"Pyapun"},
["pda"] = {"Anam"},
["pdc"] = {"Pennsylvania German"},
["pdi"] = {"Pa Di"},
["pdn"] = {"Podena", "Fedan"},
["pdo"] = {"Padoe"},
["pdt"] = {"Plautdietsch"},
["pdu"] = {"Kayan"},
["pea"] = {"Peranakan Indonesian"},
["peb"] = {"Eastern Pomo"},
["ped"] = {"Mala (Papua New Guinea)"},
["pee"] = {"Taje"},
["pef"] = {"Northeastern Pomo"},
["peg"] = {"Pengo"},
["peh"] = {"Bonan"},
["pei"] = {"Chichimeca-Jonaz"},
["pej"] = {"Northern Pomo"},
["pek"] = {"Penchal"},
["pel"] = {"Pekal"},
["pem"] = {"Phende"},
["peo"] = {"Old Persian (ca. 600-400 B.C.)"},
["pep"] = {"Kunja"},
["peq"] = {"Southern Pomo"},
["pes"] = {"Iranian Persian"},
["pev"] = {"Pémono"},
["pex"] = {"Petats"},
["pey"] = {"Petjo"},
["pez"] = {"Eastern Penan"},
["pfa"] = {"Pááfang"},
["pfe"] = {"Pere"},
["pfl"] = {"Pfaelzisch"},
["pga"] = {"Sudanese Creole Arabic"},
["pgd"] = {"Gāndhārī"},
["pgg"] = {"Pangwali"},
["pgi"] = {"Pagi"},
["pgk"] = {"Rerep"},
["pgl"] = {"Primitive Irish"},
["pgn"] = {"Paelignian"},
["pgs"] = {"Pangseng"},
["pgu"] = {"Pagu"},
["pgz"] = {"Papua New Guinean Sign Language"},
["pha"] = {"Pa-Hng"},
["phd"] = {"Phudagi"},
["phg"] = {"Phuong"},
["phh"] = {"Phukha"},
["phi"] = {"Philippine languages"},
["phj"] = {"Pahari"},
["phk"] = {"Phake"},
["phl"] = {"Phalura", "Palula"},
["phm"] = {"Phimbi"},
["phn"] = {"Phoenician"},
["pho"] = {"Phunoi"},
["phq"] = {"Phana'"},
["phr"] = {"Pahari-Potwari"},
["pht"] = {"Phu Thai"},
["phu"] = {"Phuan"},
["phv"] = {"Pahlavani"},
["phw"] = {"Phangduwali"},
["pia"] = {"Pima Bajo"},
["pib"] = {"Yine"},
["pic"] = {"Pinji"},
["pid"] = {"Piaroa"},
["pie"] = {"Piro"},
["pif"] = {"Pingelapese"},
["pig"] = {"Pisabo"},
["pih"] = {"Pitcairn-Norfolk"},
["pij"] = {"Pijao"},
["pil"] = {"Yom"},
["pim"] = {"Powhatan"},
["pin"] = {"Piame"},
["pio"] = {"Piapoco"},
["pip"] = {"Pero"},
["pir"] = {"Piratapuyo"},
["pis"] = {"Pijin"},
["pit"] = {"Pitta Pitta"},
["piu"] = {"Pintupi-Luritja"},
["piv"] = {"Pileni", "Vaeakau-Taumako"},
["piw"] = {"Pimbwe"},
["pix"] = {"Piu"},
["piy"] = {"Piya-Kwonci"},
["piz"] = {"Pije"},
["pjt"] = {"Pitjantjatjara"},
["pka"] = {"Ardhamāgadhī Prākrit"},
["pkb"] = {"Pokomo", "Kipfokomo"},
["pkc"] = {"Paekche"},
["pkg"] = {"Pak-Tong"},
["pkh"] = {"Pankhu"},
["pkn"] = {"Pakanha"},
["pko"] = {"Pökoot"},
["pkp"] = {"Pukapuka"},
["pkr"] = {"Attapady Kurumba"},
["pks"] = {"Pakistan Sign Language"},
["pkt"] = {"Maleng"},
["pku"] = {"Paku"},
["pla"] = {"Miani"},
["plb"] = {"Polonombauk"},
["plc"] = {"Central Palawano"},
["pld"] = {"Polari"},
["ple"] = {"Palu'e"},
["plf"] = {"Central Malayo-Polynesian languages"},
["plg"] = {"Pilagá"},
["plh"] = {"Paulohi"},
["plk"] = {"Kohistani Shina"},
["pll"] = {"Shwe Palaung"},
["pln"] = {"Palenquero"},
["plo"] = {"Oluta Popoluca"},
["plq"] = {"Palaic"},
["plr"] = {"Palaka Senoufo"},
["pls"] = {"San Marcos Tlacoyalco Popoloca", "San Marcos Tlalcoyalco Popoloca"},
["plt"] = {"Plateau Malagasy"},
["plu"] = {"Palikúr"},
["plv"] = {"Southwest Palawano"},
["plw"] = {"Brooke's Point Palawano"},
["ply"] = {"Bolyu"},
["plz"] = {"Paluan"},
["pma"] = {"Paama"},
["pmb"] = {"Pambia"},
["pmd"] = {"Pallanganmiddang"},
["pme"] = {"Pwaamei"},
["pmf"] = {"Pamona"},
["pmh"] = {"Māhārāṣṭri Prākrit"},
["pmi"] = {"Northern Pumi"},
["pmj"] = {"Southern Pumi"},
["pml"] = {"Lingua Franca"},
["pmm"] = {"Pomo"},
["pmn"] = {"Pam"},
["pmo"] = {"Pom"},
["pmq"] = {"Northern Pame"},
["pmr"] = {"Paynamar"},
["pms"] = {"Piemontese"},
["pmt"] = {"Tuamotuan"},
["pmw"] = {"Plains Miwok"},
["pmx"] = {"Poumei Naga"},
["pmy"] = {"Papuan Malay"},
["pmz"] = {"Southern Pame"},
["pna"] = {"Punan Bah-Biau"},
["pnb"] = {"Western Panjabi"},
["pnc"] = {"Pannei"},
["pnd"] = {"Mpinda"},
["pne"] = {"Western Penan"},
["png"] = {"Pangu", "Pongu"},
["pnh"] = {"Penrhyn"},
["pni"] = {"Aoheng"},
["pnj"] = {"Pinjarup"},
["pnk"] = {"Paunaka"},
["pnl"] = {"Paleni"},
["pnm"] = {"Punan Batu 1"},
["pnn"] = {"Pinai-Hagahai"},
["pno"] = {"Panobo"},
["pnp"] = {"Pancana"},
["pnq"] = {"Pana (Burkina Faso)"},
["pnr"] = {"Panim"},
["pns"] = {"Ponosakan"},
["pnt"] = {"Pontic"},
["pnu"] = {"Jiongnai Bunu"},
["pnv"] = {"Pinigura"},
["pnw"] = {"Banyjima", "Panytyima"},
["pnx"] = {"Phong-Kniang"},
["pny"] = {"Pinyin"},
["pnz"] = {"Pana (Central African Republic)"},
["poc"] = {"Poqomam"},
["poe"] = {"San Juan Atzingo Popoloca"},
["pof"] = {"Poke"},
["pog"] = {"Potiguára"},
["poh"] = {"Poqomchi'"},
["poi"] = {"Highland Popoluca"},
["pok"] = {"Pokangá"},
["pom"] = {"Southeastern Pomo"},
["pon"] = {"Pohnpeian"},
["poo"] = {"Central Pomo"},
["pop"] = {"Pwapwâ"},
["poq"] = {"Texistepec Popoluca"},
["pos"] = {"Sayula Popoluca"},
["pot"] = {"Potawatomi"},
["pov"] = {"Upper Guinea Crioulo"},
["pow"] = {"San Felipe Otlaltepec Popoloca"},
["pox"] = {"Polabian"},
["poy"] = {"Pogolo"},
["poz"] = {"Malayo-Polynesian languages"},
["ppe"] = {"Papi"},
["ppi"] = {"Paipai"},
["ppk"] = {"Uma"},
["ppl"] = {"Pipil", "Nicarao"},
["ppm"] = {"Papuma"},
["ppn"] = {"Papapana"},
["ppo"] = {"Folopa"},
["ppp"] = {"Pelende"},
["ppq"] = {"Pei"},
["pps"] = {"San Luís Temalacayuca Popoloca"},
["ppt"] = {"Pare"},
["ppu"] = {"Papora"},
["pqa"] = {"Pa'a"},
["pqe"] = {"Eastern Malayo-Polynesian languages"},
["pqm"] = {"Malecite-Passamaquoddy"},
["pqw"] = {"Western Malayo-Polynesian languages"},
["pra"] = {"Prakrit languages"},
["prc"] = {"Parachi"},
["prd"] = {"Parsi-Dari"},
["pre"] = {"Principense"},
["prf"] = {"Paranan"},
["prg"] = {"Prussian"},
["prh"] = {"Porohanon"},
["pri"] = {"Paicî"},
["prk"] = {"Parauk"},
["prl"] = {"Peruvian Sign Language"},
["prm"] = {"Kibiri"},
["prn"] = {"Prasuni"},
["pro"] = {"Old Provençal (to 1500)", "Old Occitan (to 1500)"},
["prq"] = {"Ashéninka Perené"},
["prr"] = {"Puri"},
["prs"] = {"Dari", "Afghan Persian"},
["prt"] = {"Phai"},
["pru"] = {"Puragi"},
["prw"] = {"Parawen"},
["prx"] = {"Purik"},
["prz"] = {"Providencia Sign Language"},
["psa"] = {"Asue Awyu"},
["psc"] = {"Iranian Sign Language", "Persian Sign Language"},
["psd"] = {"Plains Indian Sign Language"},
["pse"] = {"Central Malay"},
["psg"] = {"Penang Sign Language"},
["psh"] = {"Southwest Pashai", "Southwest Pashayi"},
["psi"] = {"Southeast Pashai", "Southeast Pashayi"},
["psl"] = {"Puerto Rican Sign Language"},
["psm"] = {"Pauserna"},
["psn"] = {"Panasuan"},
["pso"] = {"Polish Sign Language"},
["psp"] = {"Philippine Sign Language"},
["psq"] = {"Pasi"},
["psr"] = {"Portuguese Sign Language"},
["pss"] = {"Kaulong"},
["pst"] = {"Central Pashto"},
["psu"] = {"Sauraseni Prākrit"},
["psw"] = {"Port Sandwich"},
["psy"] = {"Piscataway"},
["pta"] = {"Pai Tavytera"},
["pth"] = {"Pataxó Hã-Ha-Hãe"},
["pti"] = {"Pindiini", "Wangkatha"},
["ptn"] = {"Patani"},
["pto"] = {"Zo'é"},
["ptp"] = {"Patep"},
["ptq"] = {"Pattapu"},
["ptr"] = {"Piamatsina"},
["ptt"] = {"Enrekang"},
["ptu"] = {"Bambam"},
["ptv"] = {"Port Vato"},
["ptw"] = {"Pentlatch"},
["pty"] = {"Pathiya"},
["pua"] = {"Western Highland Purepecha"},
["pub"] = {"Purum"},
["puc"] = {"Punan Merap"},
["pud"] = {"Punan Aput"},
["pue"] = {"Puelche"},
["puf"] = {"Punan Merah"},
["pug"] = {"Phuie"},
["pui"] = {"Puinave"},
["puj"] = {"Punan Tubu"},
["pum"] = {"Puma"},
["puo"] = {"Puoc"},
["pup"] = {"Pulabu"},
["puq"] = {"Puquina"},
["pur"] = {"Puruborá"},
["put"] = {"Putoh"},
["puu"] = {"Punu"},
["puw"] = {"Puluwatese"},
["pux"] = {"Puare"},
["puy"] = {"Purisimeño"},
["pwa"] = {"Pawaia"},
["pwb"] = {"Panawa"},
["pwg"] = {"Gapapaiwa"},
["pwi"] = {"Patwin"},
["pwm"] = {"Molbog"},
["pwn"] = {"Paiwan"},
["pwo"] = {"Pwo Western Karen"},
["pwr"] = {"Powari"},
["pww"] = {"Pwo Northern Karen"},
["pxm"] = {"Quetzaltepec Mixe"},
["pye"] = {"Pye Krumen"},
["pym"] = {"Fyam"},
["pyn"] = {"Poyanáwa"},
["pys"] = {"Paraguayan Sign Language", "Lengua de Señas del Paraguay"},
["pyu"] = {"Puyuma"},
["pyx"] = {"Pyu (Myanmar)"},
["pyy"] = {"Pyen"},
["pze"] = {"Pesse"},
["pzh"] = {"Pazeh"},
["pzn"] = {"Jejara Naga", "Para Naga"},
["qua"] = {"Quapaw"},
["qub"] = {"Huallaga Huánuco Quechua"},
["quc"] = {"K'iche'", "Quiché"},
["qud"] = {"Calderón Highland Quichua"},
["quf"] = {"Lambayeque Quechua"},
["qug"] = {"Chimborazo Highland Quichua"},
["quh"] = {"South Bolivian Quechua"},
["qui"] = {"Quileute"},
["quk"] = {"Chachapoyas Quechua"},
["qul"] = {"North Bolivian Quechua"},
["qum"] = {"Sipacapense"},
["qun"] = {"Quinault"},
["qup"] = {"Southern Pastaza Quechua"},
["quq"] = {"Quinqui"},
["qur"] = {"Yanahuanca Pasco Quechua"},
["qus"] = {"Santiago del Estero Quichua"},
["quv"] = {"Sacapulteco"},
["quw"] = {"Tena Lowland Quichua"},
["qux"] = {"Yauyos Quechua"},
["quy"] = {"Ayacucho Quechua"},
["quz"] = {"Cusco Quechua"},
["qva"] = {"Ambo-Pasco Quechua"},
["qvc"] = {"Cajamarca Quechua"},
["qve"] = {"Eastern Apurímac Quechua"},
["qvh"] = {"Huamalíes-Dos de Mayo Huánuco Quechua"},
["qvi"] = {"Imbabura Highland Quichua"},
["qvj"] = {"Loja Highland Quichua"},
["qvl"] = {"Cajatambo North Lima Quechua"},
["qvm"] = {"Margos-Yarowilca-Lauricocha Quechua"},
["qvn"] = {"North Junín Quechua"},
["qvo"] = {"Napo Lowland Quechua"},
["qvp"] = {"Pacaraos Quechua"},
["qvs"] = {"San Martín Quechua"},
["qvw"] = {"Huaylla Wanca Quechua"},
["qvy"] = {"Queyu"},
["qvz"] = {"Northern Pastaza Quichua"},
["qwa"] = {"Corongo Ancash Quechua"},
["qwc"] = {"Classical Quechua"},
["qwe"] = {"Quechuan (family)"},
["qwh"] = {"Huaylas Ancash Quechua"},
["qwm"] = {"Kuman (Russia)"},
["qws"] = {"Sihuas Ancash Quechua"},
["qwt"] = {"Kwalhioqua-Tlatskanai"},
["qxa"] = {"Chiquián Ancash Quechua"},
["qxc"] = {"Chincha Quechua"},
["qxh"] = {"Panao Huánuco Quechua"},
["qxl"] = {"Salasaca Highland Quichua"},
["qxn"] = {"Northern Conchucos Ancash Quechua"},
["qxo"] = {"Southern Conchucos Ancash Quechua"},
["qxp"] = {"Puno Quechua"},
["qxq"] = {"Qashqa'i"},
["qxr"] = {"Cañar Highland Quichua"},
["qxs"] = {"Southern Qiang"},
["qxt"] = {"Santa Ana de Tusi Pasco Quechua"},
["qxu"] = {"Arequipa-La Unión Quechua"},
["qxw"] = {"Jauja Wanca Quechua"},
["qya"] = {"Quenya"},
["qyp"] = {"Quiripi"},
["raa"] = {"Dungmali"},
["rab"] = {"Camling"},
["rac"] = {"Rasawa"},
["rad"] = {"Rade"},
["raf"] = {"Western Meohang"},
["rag"] = {"Logooli", "Lulogooli"},
["rah"] = {"Rabha"},
["rai"] = {"Ramoaaina"},
["raj"] = {"Rajasthani"},
["rak"] = {"Tulu-Bohuai"},
["ral"] = {"Ralte"},
["ram"] = {"Canela"},
["ran"] = {"Riantana"},
["rao"] = {"Rao"},
["rap"] = {"Rapanui"},
["raq"] = {"Saam"},
["rar"] = {"Rarotongan", "Cook Islands Maori"},
["ras"] = {"Tegali"},
["rat"] = {"Razajerdi"},
["rau"] = {"Raute"},
["rav"] = {"Sampang"},
["raw"] = {"Rawang"},
["rax"] = {"Rang"},
["ray"] = {"Rapa"},
["raz"] = {"Rahambuu"},
["rbb"] = {"Rumai Palaung"},
["rbk"] = {"Northern Bontok"},
["rbl"] = {"Miraya Bikol"},
["rbp"] = {"Barababaraba"},
["rcf"] = {"Réunion Creole French"},
["rdb"] = {"Rudbari"},
["rea"] = {"Rerau"},
["reb"] = {"Rembong"},
["ree"] = {"Rejang Kayan"},
["reg"] = {"Kara (Tanzania)"},
["rei"] = {"Reli"},
["rej"] = {"Rejang"},
["rel"] = {"Rendille"},
["rem"] = {"Remo"},
["ren"] = {"Rengao"},
["rer"] = {"Rer Bare"},
["res"] = {"Reshe"},
["ret"] = {"Retta"},
["rey"] = {"Reyesano"},
["rga"] = {"Roria"},
["rge"] = {"Romano-Greek"},
["rgk"] = {"Rangkas"},
["rgn"] = {"Romagnol"},
["rgr"] = {"Resígaro"},
["rgs"] = {"Southern Roglai"},
["rgu"] = {"Ringgou"},
["rhg"] = {"Rohingya"},
["rhp"] = {"Yahang"},
["ria"] = {"Riang (India)"},
["rib"] = {"Bribri Sign Language"},
["rif"] = {"Tarifit"},
["ril"] = {"Riang Lang", "Riang (Myanmar)"},
["rim"] = {"Nyaturu"},
["rin"] = {"Nungu"},
["rir"] = {"Ribun"},
["rit"] = {"Ritharrngu"},
["riu"] = {"Riung"},
["rjg"] = {"Rajong"},
["rji"] = {"Raji"},
["rjs"] = {"Rajbanshi"},
["rka"] = {"Kraol"},
["rkb"] = {"Rikbaktsa"},
["rkh"] = {"Rakahanga-Manihiki"},
["rki"] = {"Rakhine"},
["rkm"] = {"Marka"},
["rkt"] = {"Rangpuri", "Kamta"},
["rkw"] = {"Arakwal"},
["rma"] = {"Rama"},
["rmb"] = {"Rembarrnga"},
["rmc"] = {"Carpathian Romani"},
["rmd"] = {"Traveller Danish"},
["rme"] = {"Angloromani"},
["rmf"] = {"Kalo Finnish Romani"},
["rmg"] = {"Traveller Norwegian"},
["rmh"] = {"Murkim"},
["rmi"] = {"Lomavren"},
["rmk"] = {"Romkun"},
["rml"] = {"Baltic Romani"},
["rmm"] = {"Roma"},
["rmn"] = {"Balkan Romani"},
["rmo"] = {"Sinte Romani"},
["rmp"] = {"Rempi"},
["rmq"] = {"Caló"},
["rms"] = {"Romanian Sign Language"},
["rmt"] = {"Domari"},
["rmu"] = {"Tavringer Romani"},
["rmv"] = {"Romanova"},
["rmw"] = {"Welsh Romani"},
["rmx"] = {"Romam"},
["rmy"] = {"Vlax Romani"},
["rmz"] = {"Marma"},
["rnb"] = {"Brunca Sign Language"},
["rnd"] = {"Ruund"},
["rng"] = {"Ronga"},
["rnl"] = {"Ranglong"},
["rnn"] = {"Roon"},
["rnp"] = {"Rongpo"},
["rnr"] = {"Nari Nari"},
["rnw"] = {"Rungwa"},
["roa"] = {"Romance languages"},
["rob"] = {"Tae'"},
["roc"] = {"Cacgia Roglai"},
["rod"] = {"Rogo"},
["roe"] = {"Ronji"},
["rof"] = {"Rombo"},
["rog"] = {"Northern Roglai"},
["rol"] = {"Romblomanon"},
["rom"] = {"Romany"},
["roo"] = {"Rotokas"},
["rop"] = {"Kriol"},
["ror"] = {"Rongga"},
["rou"] = {"Runga"},
["row"] = {"Dela-Oenale"},
["rpn"] = {"Repanbitip"},
["rpt"] = {"Rapting"},
["rri"] = {"Ririo"},
["rro"] = {"Waima"},
["rrt"] = {"Arritinngithigh"},
["rsb"] = {"Romano-Serbian"},
["rsk"] = {"Ruthenian", "Rusnak"},
["rsl"] = {"Russian Sign Language"},
["rsm"] = {"Miriwoong Sign Language"},
["rsn"] = {"Rwandan Sign Language"},
["rsw"] = {"Rishiwa"},
["rtc"] = {"Rungtu Chin"},
["rth"] = {"Ratahan"},
["rtm"] = {"Rotuman"},
["rts"] = {"Yurats"},
["rtw"] = {"Rathawi"},
["rub"] = {"Gungu"},
["ruc"] = {"Ruuli"},
["rue"] = {"Rusyn"},
["ruf"] = {"Luguru"},
["rug"] = {"Roviana"},
["ruh"] = {"Ruga"},
["rui"] = {"Rufiji"},
["ruk"] = {"Che"},
["ruo"] = {"Istro Romanian"},
["rup"] = {"Macedo-Romanian", "Aromanian", "Arumanian"},
["ruq"] = {"Megleno Romanian"},
["rut"] = {"Rutul"},
["ruu"] = {"Lanas Lobu"},
["ruy"] = {"Mala (Nigeria)"},
["ruz"] = {"Ruma"},
["rwa"] = {"Rawo"},
["rwk"] = {"Rwa"},
["rwl"] = {"Ruwila"},
["rwm"] = {"Amba (Uganda)"},
["rwo"] = {"Rawa"},
["rwr"] = {"Marwari (India)"},
["rxd"] = {"Ngardi"},
["rxw"] = {"Karuwali", "Garuwali"},
["ryn"] = {"Northern Amami-Oshima"},
["rys"] = {"Yaeyama"},
["ryu"] = {"Central Okinawan"},
["rzh"] = {"Rāziḥī"},
["saa"] = {"Saba"},
["sab"] = {"Buglere"},
["sac"] = {"Meskwaki"},
["sad"] = {"Sandawe"},
["sae"] = {"Sabanê"},
["saf"] = {"Safaliba"},
["sah"] = {"Yakut"},
["sai"] = {"South American Indian languages"},
["saj"] = {"Sahu"},
["sak"] = {"Sake"},
["sal"] = {"Salishan languages"},
["sam"] = {"Samaritan Aramaic"},
["sao"] = {"Sause"},
["saq"] = {"Samburu"},
["sar"] = {"Saraveca"},
["sas"] = {"Sasak"},
["sat"] = {"Santali"},
["sau"] = {"Saleman"},
["sav"] = {"Saafi-Saafi"},
["saw"] = {"Sawi"},
["sax"] = {"Sa"},
["say"] = {"Saya"},
["saz"] = {"Saurashtra"},
["sba"] = {"Ngambay"},
["sbb"] = {"Simbo"},
["sbc"] = {"Kele (Papua New Guinea)"},
["sbd"] = {"Southern Samo"},
["sbe"] = {"Saliba"},
["sbf"] = {"Chabu", "Shabo"},
["sbg"] = {"Seget"},
["sbh"] = {"Sori-Harengan"},
["sbi"] = {"Seti"},
["sbj"] = {"Surbakhal"},
["sbk"] = {"Safwa"},
["sbl"] = {"Botolan Sambal"},
["sbm"] = {"Sagala"},
["sbn"] = {"Sindhi Bhil"},
["sbo"] = {"Sabüm"},
["sbp"] = {"Sangu (Tanzania)"},
["sbq"] = {"Sileibi"},
["sbr"] = {"Sembakung Murut"},
["sbs"] = {"Subiya"},
["sbt"] = {"Kimki"},
["sbu"] = {"Stod Bhoti"},
["sbv"] = {"Sabine"},
["sbw"] = {"Simba"},
["sbx"] = {"Seberuang"},
["sby"] = {"Soli"},
["sbz"] = {"Sara Kaba"},
["scb"] = {"Chut"},
["sce"] = {"Dongxiang"},
["scf"] = {"San Miguel Creole French"},
["scg"] = {"Sanggau"},
["sch"] = {"Sakachep"},
["sci"] = {"Sri Lankan Creole Malay"},
["sck"] = {"Sadri"},
["scl"] = {"Shina"},
["scn"] = {"Sicilian"},
["sco"] = {"Scots"},
["scp"] = {"Hyolmo", "Helambu Sherpa"},
["scq"] = {"Sa'och"},
["scs"] = {"North Slavey"},
["sct"] = {"Southern Katang"},
["scu"] = {"Shumcho"},
["scv"] = {"Sheni"},
["scw"] = {"Sha"},
["scx"] = {"Sicel"},
["sda"] = {"Toraja-Sa'dan"},
["sdb"] = {"Shabak"},
["sdc"] = {"Sassarese Sardinian"},
["sde"] = {"Surubu"},
["sdf"] = {"Sarli"},
["sdg"] = {"Savi"},
["sdh"] = {"Southern Kurdish"},
["sdj"] = {"Suundi"},
["sdk"] = {"Sos Kundi"},
["sdl"] = {"Saudi Arabian Sign Language"},
["sdn"] = {"Gallurese Sardinian"},
["sdo"] = {"Bukar-Sadung Bidayuh"},
["sdp"] = {"Sherdukpen"},
["sdq"] = {"Semandang"},
["sdr"] = {"Oraon Sadri"},
["sds"] = {"Sened"},
["sdt"] = {"Shuadit"},
["sdu"] = {"Sarudu"},
["sdv"] = {"Eastern Sudanic languages"},
["sdx"] = {"Sibu Melanau"},
["sdz"] = {"Sallands"},
["sea"] = {"Semai"},
["seb"] = {"Shempire Senoufo"},
["sec"] = {"Sechelt"},
["sed"] = {"Sedang"},
["see"] = {"Seneca"},
["sef"] = {"Cebaara Senoufo"},
["seg"] = {"Segeju"},
["seh"] = {"Sena"},
["sei"] = {"Seri"},
["sej"] = {"Sene"},
["sek"] = {"Sekani"},
["sel"] = {"Selkup"},
["sem"] = {"Semitic languages"},
["sen"] = {"Nanerigé Sénoufo"},
["seo"] = {"Suarmin"},
["sep"] = {"Sìcìté Sénoufo"},
["seq"] = {"Senara Sénoufo"},
["ser"] = {"Serrano"},
["ses"] = {"Koyraboro Senni Songhai"},
["set"] = {"Sentani"},
["seu"] = {"Serui-Laut"},
["sev"] = {"Nyarafolo Senoufo"},
["sew"] = {"Sewa Bay"},
["sey"] = {"Secoya"},
["sez"] = {"Senthang Chin"},
["sfb"] = {"Langue des signes de Belgique Francophone", "French Belgian Sign Language"},
["sfe"] = {"Eastern Subanen"},
["sfm"] = {"Small Flowery Miao"},
["sfs"] = {"South African Sign Language"},
["sfw"] = {"Sehwi"},
["sga"] = {"Old Irish (to 900)"},
["sgb"] = {"Mag-antsi Ayta"},
["sgc"] = {"Kipsigis"},
["sgd"] = {"Surigaonon"},
["sge"] = {"Segai"},
["sgg"] = {"Swiss-German Sign Language"},
["sgh"] = {"Shughni"},
["sgi"] = {"Suga"},
["sgj"] = {"Surgujia"},
["sgk"] = {"Sangkong"},
["sgm"] = {"Singa"},
["sgn"] = {"Sign languages"},
["sgp"] = {"Singpho"},
["sgr"] = {"Sangisari"},
["sgs"] = {"Samogitian"},
["sgt"] = {"Brokpake"},
["sgu"] = {"Salas"},
["sgw"] = {"Sebat Bet Gurage"},
["sgx"] = {"Sierra Leone Sign Language"},
["sgy"] = {"Sanglechi"},
["sgz"] = {"Sursurunga"},
["sha"] = {"Shall-Zwall"},
["shb"] = {"Ninam"},
["shc"] = {"Sonde"},
["shd"] = {"Kundal Shahi"},
["she"] = {"Sheko"},
["shg"] = {"Shua"},
["shh"] = {"Shoshoni"},
["shi"] = {"Tachelhit"},
["shj"] = {"Shatt"},
["shk"] = {"Shilluk"},
["shl"] = {"Shendu"},
["shm"] = {"Shahrudi"},
["shn"] = {"Shan"},
["sho"] = {"Shanga"},
["shp"] = {"Shipibo-Conibo"},
["shq"] = {"Sala"},
["shr"] = {"Shi"},
["shs"] = {"Shuswap"},
["sht"] = {"Shasta"},
["shu"] = {"Chadian Arabic"},
["shv"] = {"Shehri"},
["shw"] = {"Shwai"},
["shx"] = {"She"},
["shy"] = {"Tachawit"},
["shz"] = {"Syenara Senoufo"},
["sia"] = {"Akkala Sami"},
["sib"] = {"Sebop"},
["sid"] = {"Sidamo"},
["sie"] = {"Simaa"},
["sif"] = {"Siamou"},
["sig"] = {"Paasaal"},
["sih"] = {"Zire", "Sîshëë"},
["sii"] = {"Shom Peng"},
["sij"] = {"Numbami"},
["sik"] = {"Sikiana"},
["sil"] = {"Tumulung Sisaala"},
["sim"] = {"Mende (Papua New Guinea)"},
["sio"] = {"Siouan languages"},
["sip"] = {"Sikkimese"},
["siq"] = {"Sonia"},
["sir"] = {"Siri"},
["sis"] = {"Siuslaw"},
["sit"] = {"Sino-Tibetan languages"},
["siu"] = {"Sinagen"},
["siv"] = {"Sumariup"},
["siw"] = {"Siwai"},
["six"] = {"Sumau"},
["siy"] = {"Sivandi"},
["siz"] = {"Siwi"},
["sja"] = {"Epena"},
["sjb"] = {"Sajau Basap"},
["sjd"] = {"Kildin Sami"},
["sje"] = {"Pite Sami"},
["sjg"] = {"Assangori"},
["sjk"] = {"Kemi Sami"},
["sjl"] = {"Sajalong", "Miji"},
["sjm"] = {"Mapun"},
["sjn"] = {"Sindarin"},
["sjo"] = {"Xibe"},
["sjp"] = {"Surjapuri"},
["sjr"] = {"Siar-Lak"},
["sjs"] = {"Senhaja De Srair"},
["sjt"] = {"Ter Sami"},
["sju"] = {"Ume Sami"},
["sjw"] = {"Shawnee"},
["ska"] = {"Skagit"},
["skb"] = {"Saek"},
["skc"] = {"Ma Manda"},
["skd"] = {"Southern Sierra Miwok"},
["ske"] = {"Seke (Vanuatu)"},
["skf"] = {"Sakirabiá"},
["skg"] = {"Sakalava Malagasy"},
["skh"] = {"Sikule"},
["ski"] = {"Sika"},
["skj"] = {"Seke (Nepal)"},
["skm"] = {"Kutong"},
["skn"] = {"Kolibugan Subanon"},
["sko"] = {"Seko Tengah"},
["skp"] = {"Sekapan"},
["skq"] = {"Sininkere"},
["skr"] = {"Saraiki", "Seraiki"},
["sks"] = {"Maia"},
["skt"] = {"Sakata"},
["sku"] = {"Sakao"},
["skv"] = {"Skou"},
["skw"] = {"Skepi Creole Dutch"},
["skx"] = {"Seko Padang"},
["sky"] = {"Sikaiana"},
["skz"] = {"Sekar"},
["sla"] = {"Slavic languages"},
["slc"] = {"Sáliba"},
["sld"] = {"Sissala"},
["sle"] = {"Sholaga"},
["slf"] = {"Swiss-Italian Sign Language"},
["slg"] = {"Selungai Murut"},
["slh"] = {"Southern Puget Sound Salish"},
["sli"] = {"Lower Silesian"},
["slj"] = {"Salumá"},
["sll"] = {"Salt-Yui"},
["slm"] = {"Pangutaran Sama"},
["sln"] = {"Salinan"},
["slp"] = {"Lamaholot"},
["slr"] = {"Salar"},
["sls"] = {"Singapore Sign Language"},
["slt"] = {"Sila"},
["slu"] = {"Selaru"},
["slw"] = {"Sialum"},
["slx"] = {"Salampasu"},
["sly"] = {"Selayar"},
["slz"] = {"Ma'ya"},
["sma"] = {"Southern Sami"},
["smb"] = {"Simbari"},
["smc"] = {"Som"},
["smf"] = {"Auwe"},
["smg"] = {"Simbali"},
["smh"] = {"Samei"},
["smi"] = {"Sami languages"},
["smj"] = {"Lule Sami"},
["smk"] = {"Bolinao"},
["sml"] = {"Central Sama"},
["smm"] = {"Musasa"},
["smn"] = {"Inari Sami"},
["smp"] = {"Samaritan"},
["smq"] = {"Samo"},
["smr"] = {"Simeulue"},
["sms"] = {"Skolt Sami"},
["smt"] = {"Simte"},
["smu"] = {"Somray"},
["smv"] = {"Samvedi"},
["smw"] = {"Sumbawa"},
["smx"] = {"Samba"},
["smy"] = {"Semnani"},
["smz"] = {"Simeku"},
["snc"] = {"Sinaugoro"},
["sne"] = {"Bau Bidayuh"},
["snf"] = {"Noon"},
["sng"] = {"Sanga (Democratic Republic of Congo)"},
["sni"] = {"Sensi"},
["snj"] = {"Riverain Sango"},
["snk"] = {"Soninke"},
["snl"] = {"Sangil"},
["snm"] = {"Southern Ma'di"},
["snn"] = {"Siona"},
["sno"] = {"Snohomish"},
["snp"] = {"Siane"},
["snq"] = {"Sangu (Gabon)"},
["snr"] = {"Sihan"},
["sns"] = {"South West Bay", "Nahavaq"},
["snu"] = {"Senggi", "Viid"},
["snv"] = {"Sa'ban"},
["snw"] = {"Selee"},
["snx"] = {"Sam"},
["sny"] = {"Saniyo-Hiyewe"},
["snz"] = {"Kou"},
["soa"] = {"Thai Song"},
["sob"] = {"Sobei"},
["soc"] = {"So (Democratic Republic of Congo)"},
["sod"] = {"Songoora"},
["soe"] = {"Songomeno"},
["sog"] = {"Sogdian"},
["soh"] = {"Aka"},
["soi"] = {"Sonha"},
["soj"] = {"Soi"},
["sok"] = {"Sokoro"},
["sol"] = {"Solos"},
["son"] = {"Songhai languages"},
["soo"] = {"Songo"},
["sop"] = {"Songe"},
["soq"] = {"Kanasi"},
["sor"] = {"Somrai"},
["sos"] = {"Seeku"},
["sou"] = {"Southern Thai"},
["sov"] = {"Sonsorol"},
["sow"] = {"Sowanda"},
["sox"] = {"Swo"},
["soy"] = {"Miyobe"},
["soz"] = {"Temi"},
["spb"] = {"Sepa (Indonesia)"},
["spc"] = {"Sapé"},
["spd"] = {"Saep"},
["spe"] = {"Sepa (Papua New Guinea)"},
["spg"] = {"Sian"},
["spi"] = {"Saponi"},
["spk"] = {"Sengo"},
["spl"] = {"Selepet"},
["spm"] = {"Akukem"},
["spn"] = {"Sanapaná"},
["spo"] = {"Spokane"},
["spp"] = {"Supyire Senoufo"},
["spq"] = {"Loreto-Ucayali Spanish"},
["spr"] = {"Saparua"},
["sps"] = {"Saposa"},
["spt"] = {"Spiti Bhoti"},
["spu"] = {"Sapuan"},
["spv"] = {"Sambalpuri", "Kosli"},
["spx"] = {"South Picene"},
["spy"] = {"Sabaot"},
["sqa"] = {"Shama-Sambuga"},
["sqh"] = {"Shau"},
["sqj"] = {"Albanian languages"},
["sqk"] = {"Albanian Sign Language"},
["sqm"] = {"Suma"},
["sqn"] = {"Susquehannock"},
["sqo"] = {"Sorkhei"},
["sqq"] = {"Sou"},
["sqr"] = {"Siculo Arabic"},
["sqs"] = {"Sri Lankan Sign Language"},
["sqt"] = {"Soqotri"},
["squ"] = {"Squamish"},
["sqx"] = {"Kufr Qassem Sign Language (KQSL)"},
["sra"] = {"Saruga"},
["srb"] = {"Sora"},
["src"] = {"Logudorese Sardinian"},
["sre"] = {"Sara"},
["srf"] = {"Nafi"},
["srg"] = {"Sulod"},
["srh"] = {"Sarikoli"},
["sri"] = {"Siriano"},
["srk"] = {"Serudung Murut"},
["srl"] = {"Isirawa"},
["srm"] = {"Saramaccan"},
["srn"] = {"Sranan Tongo"},
["sro"] = {"Campidanese Sardinian"},
["srq"] = {"Sirionó"},
["srr"] = {"Serer"},
["srs"] = {"Sarsi"},
["srt"] = {"Sauri"},
["sru"] = {"Suruí"},
["srv"] = {"Southern Sorsoganon"},
["srw"] = {"Serua"},
["srx"] = {"Sirmauri"},
["sry"] = {"Sera"},
["srz"] = {"Shahmirzadi"},
["ssa"] = {"Nilo-Saharan languages"},
["ssb"] = {"Southern Sama"},
["ssc"] = {"Suba-Simbiti"},
["ssd"] = {"Siroi"},
["sse"] = {"Balangingi", "Bangingih Sama"},
["ssf"] = {"Thao"},
["ssg"] = {"Seimat"},
["ssh"] = {"Shihhi Arabic"},
["ssi"] = {"Sansi"},
["ssj"] = {"Sausi"},
["ssk"] = {"Sunam"},
["ssl"] = {"Western Sisaala"},
["ssm"] = {"Semnam"},
["ssn"] = {"Waata"},
["sso"] = {"Sissano"},
["ssp"] = {"Spanish Sign Language"},
["ssq"] = {"So'a"},
["ssr"] = {"Swiss-French Sign Language"},
["sss"] = {"Sô"},
["sst"] = {"Sinasina"},
["ssu"] = {"Susuami"},
["ssv"] = {"Shark Bay"},
["ssx"] = {"Samberigi"},
["ssy"] = {"Saho"},
["ssz"] = {"Sengseng"},
["sta"] = {"Settla"},
["stb"] = {"Northern Subanen"},
["std"] = {"Sentinel"},
["ste"] = {"Liana-Seti"},
["stf"] = {"Seta"},
["stg"] = {"Trieng"},
["sth"] = {"Shelta"},
["sti"] = {"Bulo Stieng"},
["stj"] = {"Matya Samo"},
["stk"] = {"Arammba"},
["stl"] = {"Stellingwerfs"},
["stm"] = {"Setaman"},
["stn"] = {"Owa"},
["sto"] = {"Stoney"},
["stp"] = {"Southeastern Tepehuan"},
["stq"] = {"Saterfriesisch"},
["str"] = {"Straits Salish"},
["sts"] = {"Shumashti"},
["stt"] = {"Budeh Stieng"},
["stu"] = {"Samtao"},
["stv"] = {"Silt'e"},
["stw"] = {"Satawalese"},
["sty"] = {"Siberian Tatar"},
["sua"] = {"Sulka"},
["sub"] = {"Suku"},
["suc"] = {"Western Subanon"},
["sue"] = {"Suena"},
["sug"] = {"Suganga"},
["sui"] = {"Suki"},
["suj"] = {"Shubi"},
["suk"] = {"Sukuma"},
["suo"] = {"Bouni"},
["suq"] = {"Tirmaga-Chai Suri", "Suri"},
["sur"] = {"Mwaghavul"},
["sus"] = {"Susu"},
["sut"] = {"Subtiaba"},
["suv"] = {"Puroik"},
["suw"] = {"Sumbwa"},
["sux"] = {"Sumerian"},
["suy"] = {"Suyá"},
["suz"] = {"Sunwar"},
["sva"] = {"Svan"},
["svb"] = {"Ulau-Suain"},
["svc"] = {"Vincentian Creole English"},
["sve"] = {"Serili"},
["svk"] = {"Slovakian Sign Language"},
["svm"] = {"Slavomolisano"},
["svs"] = {"Savosavo"},
["svx"] = {"Skalvian"},
["swb"] = {"Maore Comorian"},
["swc"] = {"Congo Swahili"},
["swf"] = {"Sere"},
["swg"] = {"Swabian"},
["swh"] = {"Swahili (individual language)", "Kiswahili"},
["swi"] = {"Sui"},
["swj"] = {"Sira"},
["swk"] = {"Malawi Sena"},
["swl"] = {"Swedish Sign Language"},
["swm"] = {"Samosa"},
["swn"] = {"Sawknah"},
["swo"] = {"Shanenawa"},
["swp"] = {"Suau"},
["swq"] = {"Sharwa"},
["swr"] = {"Saweru"},
["sws"] = {"Seluwasan"},
["swt"] = {"Sawila"},
["swu"] = {"Suwawa"},
["swv"] = {"Shekhawati"},
["sww"] = {"Sowa"},
["swx"] = {"Suruahá"},
["swy"] = {"Sarua"},
["sxb"] = {"Suba"},
["sxc"] = {"Sicanian"},
["sxe"] = {"Sighu"},
["sxg"] = {"Shuhi", "Shixing"},
["sxk"] = {"Southern Kalapuya"},
["sxl"] = {"Selian"},
["sxm"] = {"Samre"},
["sxn"] = {"Sangir"},
["sxo"] = {"Sorothaptic"},
["sxr"] = {"Saaroa"},
["sxs"] = {"Sasaru"},
["sxu"] = {"Upper Saxon"},
["sxw"] = {"Saxwe Gbe"},
["sya"] = {"Siang"},
["syb"] = {"Central Subanen"},
["syc"] = {"Classical Syriac"},
["syd"] = {"Samoyedic languages"},
["syi"] = {"Seki"},
["syk"] = {"Sukur"},
["syl"] = {"Sylheti"},
["sym"] = {"Maya Samo"},
["syn"] = {"Senaya"},
["syo"] = {"Suoy"},
["syr"] = {"Syriac"},
["sys"] = {"Sinyar"},
["syw"] = {"Kagate"},
["syx"] = {"Samay"},
["syy"] = {"Al-Sayyid Bedouin Sign Language"},
["sza"] = {"Semelai"},
["szb"] = {"Ngalum"},
["szc"] = {"Semaq Beri"},
["sze"] = {"Seze"},
["szg"] = {"Sengele"},
["szl"] = {"Silesian"},
["szn"] = {"Sula"},
["szp"] = {"Suabo"},
["szs"] = {"Solomon Islands Sign Language"},
["szv"] = {"Isu (Fako Division)"},
["szw"] = {"Sawai"},
["szy"] = {"Sakizaya"},
["taa"] = {"Lower Tanana"},
["tab"] = {"Tabassaran"},
["tac"] = {"Lowland Tarahumara"},
["tad"] = {"Tause"},
["tae"] = {"Tariana"},
["taf"] = {"Tapirapé"},
["tag"] = {"Tagoi"},
["tai"] = {"Tai languages"},
["taj"] = {"Eastern Tamang"},
["tak"] = {"Tala"},
["tal"] = {"Tal"},
["tan"] = {"Tangale"},
["tao"] = {"Yami"},
["tap"] = {"Taabwa"},
["taq"] = {"Tamasheq"},
["tar"] = {"Central Tarahumara"},
["tas"] = {"Tay Boi"},
["tau"] = {"Upper Tanana"},
["tav"] = {"Tatuyo"},
["taw"] = {"Tai"},
["tax"] = {"Tamki"},
["tay"] = {"Atayal"},
["taz"] = {"Tocho"},
["tba"] = {"Aikanã"},
["tbc"] = {"Takia"},
["tbd"] = {"Kaki Ae"},
["tbe"] = {"Tanimbili"},
["tbf"] = {"Mandara"},
["tbg"] = {"North Tairora"},
["tbh"] = {"Dharawal", "Thurawal"},
["tbi"] = {"Gaam"},
["tbj"] = {"Tiang"},
["tbk"] = {"Calamian Tagbanwa"},
["tbl"] = {"Tboli"},
["tbm"] = {"Tagbu"},
["tbn"] = {"Barro Negro Tunebo"},
["tbo"] = {"Tawala"},
["tbp"] = {"Taworta", "Diebroud"},
["tbq"] = {"Tibeto-Burman languages"},
["tbr"] = {"Tumtum"},
["tbs"] = {"Tanguat"},
["tbt"] = {"Tembo (Kitembo)"},
["tbu"] = {"Tubar"},
["tbv"] = {"Tobo"},
["tbw"] = {"Tagbanwa"},
["tbx"] = {"Kapin"},
["tby"] = {"Tabaru"},
["tbz"] = {"Ditammari"},
["tca"] = {"Ticuna"},
["tcb"] = {"Tanacross"},
["tcc"] = {"Datooga"},
["tcd"] = {"Tafi"},
["tce"] = {"Southern Tutchone"},
["tcf"] = {"Malinaltepec Me'phaa", "Malinaltepec Tlapanec"},
["tcg"] = {"Tamagario"},
["tch"] = {"Turks And Caicos Creole English"},
["tci"] = {"Wára"},
["tck"] = {"Tchitchege"},
["tcl"] = {"Taman (Myanmar)"},
["tcm"] = {"Tanahmerah"},
["tcn"] = {"Tichurong"},
["tco"] = {"Taungyo"},
["tcp"] = {"Tawr Chin"},
["tcq"] = {"Kaiy"},
["tcs"] = {"Torres Strait Creole", "Yumplatok"},
["tct"] = {"T'en"},
["tcu"] = {"Southeastern Tarahumara"},
["tcw"] = {"Tecpatlán Totonac"},
["tcx"] = {"Toda"},
["tcy"] = {"Tulu"},
["tcz"] = {"Thado Chin"},
["tda"] = {"Tagdal"},
["tdb"] = {"Panchpargania"},
["tdc"] = {"Emberá-Tadó"},
["tdd"] = {"Tai Nüa"},
["tde"] = {"Tiranige Diga Dogon"},
["tdf"] = {"Talieng"},
["tdg"] = {"Western Tamang"},
["tdh"] = {"Thulung"},
["tdi"] = {"Tomadino"},
["tdj"] = {"Tajio"},
["tdk"] = {"Tambas"},
["tdl"] = {"Sur"},
["tdm"] = {"Taruma"},
["tdn"] = {"Tondano"},
["tdo"] = {"Teme"},
["tdq"] = {"Tita"},
["tdr"] = {"Todrah"},
["tds"] = {"Doutai"},
["tdt"] = {"Tetun Dili"},
["tdv"] = {"Toro"},
["tdx"] = {"Tandroy-Mahafaly Malagasy"},
["tdy"] = {"Tadyawan"},
["tea"] = {"Temiar"},
["teb"] = {"Tetete"},
["tec"] = {"Terik"},
["ted"] = {"Tepo Krumen"},
["tee"] = {"Huehuetla Tepehua"},
["tef"] = {"Teressa"},
["teg"] = {"Teke-Tege"},
["teh"] = {"Tehuelche"},
["tei"] = {"Torricelli"},
["tek"] = {"Ibali Teke"},
["tem"] = {"Timne"},
["ten"] = {"Tama (Colombia)"},
["teo"] = {"Teso"},
["tep"] = {"Tepecano"},
["teq"] = {"Temein"},
["ter"] = {"Tereno"},
["tes"] = {"Tengger"},
["tet"] = {"Tetum"},
["teu"] = {"Soo"},
["tev"] = {"Teor"},
["tew"] = {"Tewa (USA)"},
["tex"] = {"Tennet"},
["tey"] = {"Tulishi"},
["tez"] = {"Tetserret"},
["tfi"] = {"Tofin Gbe"},
["tfn"] = {"Tanaina"},
["tfo"] = {"Tefaro"},
["tfr"] = {"Teribe"},
["tft"] = {"Ternate"},
["tga"] = {"Sagalla"},
["tgb"] = {"Tobilung"},
["tgc"] = {"Tigak"},
["tgd"] = {"Ciwogai"},
["tge"] = {"Eastern Gorkha Tamang"},
["tgf"] = {"Chalikha"},
["tgh"] = {"Tobagonian Creole English"},
["tgi"] = {"Lawunuia"},
["tgj"] = {"Tagin"},
["tgn"] = {"Tandaganon"},
["tgo"] = {"Sudest"},
["tgp"] = {"Tangoa"},
["tgq"] = {"Tring"},
["tgr"] = {"Tareng"},
["tgs"] = {"Nume"},
["tgt"] = {"Central Tagbanwa"},
["tgu"] = {"Tanggu"},
["tgv"] = {"Tingui-Boto"},
["tgw"] = {"Tagwana Senoufo"},
["tgx"] = {"Tagish"},
["tgy"] = {"Togoyo"},
["tgz"] = {"Tagalaka"},
["thd"] = {"Kuuk Thaayorre", "Thayore"},
["the"] = {"Chitwania Tharu"},
["thf"] = {"Thangmi"},
["thh"] = {"Northern Tarahumara"},
["thi"] = {"Tai Long"},
["thk"] = {"Tharaka", "Kitharaka"},
["thl"] = {"Dangaura Tharu"},
["thm"] = {"Aheu"},
["thn"] = {"Thachanadan"},
["thp"] = {"Thompson"},
["thq"] = {"Kochila Tharu"},
["thr"] = {"Rana Tharu"},
["ths"] = {"Thakali"},
["tht"] = {"Tahltan"},
["thu"] = {"Thuri"},
["thv"] = {"Tahaggart Tamahaq"},
["thy"] = {"Tha"},
["thz"] = {"Tayart Tamajeq"},
["tia"] = {"Tidikelt Tamazight"},
["tic"] = {"Tira"},
["tif"] = {"Tifal"},
["tig"] = {"Tigre"},
["tih"] = {"Timugon Murut"},
["tii"] = {"Tiene"},
["tij"] = {"Tilung"},
["tik"] = {"Tikar"},
["til"] = {"Tillamook"},
["tim"] = {"Timbe"},
["tin"] = {"Tindi"},
["tio"] = {"Teop"},
["tip"] = {"Trimuris"},
["tiq"] = {"Tiéfo"},
["tis"] = {"Masadiit Itneg"},
["tit"] = {"Tinigua"},
["tiu"] = {"Adasen"},
["tiv"] = {"Tiv"},
["tiw"] = {"Tiwi"},
["tix"] = {"Southern Tiwa"},
["tiy"] = {"Tiruray"},
["tiz"] = {"Tai Hongjin"},
["tja"] = {"Tajuasohn"},
["tjg"] = {"Tunjung"},
["tji"] = {"Northern Tujia"},
["tjj"] = {"Tjungundji"},
["tjl"] = {"Tai Laing"},
["tjm"] = {"Timucua"},
["tjn"] = {"Tonjon"},
["tjo"] = {"Temacine Tamazight"},
["tjp"] = {"Tjupany"},
["tjs"] = {"Southern Tujia"},
["tju"] = {"Tjurruru"},
["tjw"] = {"Djabwurrung"},
["tka"] = {"Truká"},
["tkb"] = {"Buksa"},
["tkd"] = {"Tukudede"},
["tke"] = {"Takwane"},
["tkf"] = {"Tukumanféd"},
["tkg"] = {"Tesaka Malagasy"},
["tkl"] = {"Tokelau"},
["tkm"] = {"Takelma"},
["tkn"] = {"Toku-No-Shima"},
["tkp"] = {"Tikopia"},
["tkq"] = {"Tee"},
["tkr"] = {"Tsakhur"},
["tks"] = {"Takestani"},
["tkt"] = {"Kathoriya Tharu"},
["tku"] = {"Upper Necaxa Totonac"},
["tkv"] = {"Mur Pano"},
["tkw"] = {"Teanu"},
["tkx"] = {"Tangko"},
["tkz"] = {"Takua"},
["tla"] = {"Southwestern Tepehuan"},
["tlb"] = {"Tobelo"},
["tlc"] = {"Yecuatla Totonac"},
["tld"] = {"Talaud"},
["tlf"] = {"Telefol"},
["tlg"] = {"Tofanma"},
["tlh"] = {"Klingon", "tlhIngan Hol"},
["tli"] = {"Tlingit"},
["tlj"] = {"Talinga-Bwisi"},
["tlk"] = {"Taloki"},
["tll"] = {"Tetela"},
["tlm"] = {"Tolomako"},
["tln"] = {"Talondo'"},
["tlo"] = {"Talodi"},
["tlp"] = {"Filomena Mata-Coahuitlán Totonac"},
["tlq"] = {"Tai Loi"},
["tlr"] = {"Talise"},
["tls"] = {"Tambotalo"},
["tlt"] = {"Sou Nama", "Teluti"},
["tlu"] = {"Tulehu"},
["tlv"] = {"Taliabu"},
["tlx"] = {"Khehek"},
["tly"] = {"Talysh"},
["tma"] = {"Tama (Chad)"},
["tmb"] = {"Katbol", "Avava"},
["tmc"] = {"Tumak"},
["tmd"] = {"Haruai"},
["tme"] = {"Tremembé"},
["tmf"] = {"Toba-Maskoy"},
["tmg"] = {"Ternateño"},
["tmh"] = {"Tamashek"},
["tmi"] = {"Tutuba"},
["tmj"] = {"Samarokena"},
["tml"] = {"Tamnim Citak"},
["tmm"] = {"Tai Thanh"},
["tmn"] = {"Taman (Indonesia)"},
["tmo"] = {"Temoq"},
["tmq"] = {"Tumleo"},
["tmr"] = {"Jewish Babylonian Aramaic (ca. 200-1200 CE)"},
["tms"] = {"Tima"},
["tmt"] = {"Tasmate"},
["tmu"] = {"Iau"},
["tmv"] = {"Tembo (Motembo)"},
["tmw"] = {"Temuan"},
["tmy"] = {"Tami"},
["tmz"] = {"Tamanaku"},
["tna"] = {"Tacana"},
["tnb"] = {"Western Tunebo"},
["tnc"] = {"Tanimuca-Retuarã"},
["tnd"] = {"Angosturas Tunebo"},
["tng"] = {"Tobanga"},
["tnh"] = {"Maiani"},
["tni"] = {"Tandia"},
["tnk"] = {"Kwamera"},
["tnl"] = {"Lenakel"},
["tnm"] = {"Tabla"},
["tnn"] = {"North Tanna"},
["tno"] = {"Toromono"},
["tnp"] = {"Whitesands"},
["tnq"] = {"Taino"},
["tnr"] = {"Ménik"},
["tns"] = {"Tenis"},
["tnt"] = {"Tontemboan"},
["tnu"] = {"Tay Khang"},
["tnv"] = {"Tangchangya"},
["tnw"] = {"Tonsawang"},
["tnx"] = {"Tanema"},
["tny"] = {"Tongwe"},
["tnz"] = {"Ten'edn"},
["tob"] = {"Toba"},
["toc"] = {"Coyutla Totonac"},
["tod"] = {"Toma"},
["tof"] = {"Gizrra"},
["tog"] = {"Tonga (Nyasa)"},
["toh"] = {"Gitonga"},
["toi"] = {"Tonga (Zambia)"},
["toj"] = {"Tojolabal"},
["tok"] = {"Toki Pona"},
["tol"] = {"Tolowa"},
["tom"] = {"Tombulu"},
["too"] = {"Xicotepec De Juárez Totonac"},
["top"] = {"Papantla Totonac"},
["toq"] = {"Toposa"},
["tor"] = {"Togbo-Vara Banda"},
["tos"] = {"Highland Totonac"},
["tou"] = {"Tho"},
["tov"] = {"Upper Taromi"},
["tow"] = {"Jemez"},
["tox"] = {"Tobian"},
["toy"] = {"Topoiyo"},
["toz"] = {"To"},
["tpa"] = {"Taupota"},
["tpc"] = {"Azoyú Me'phaa", "Azoyú Tlapanec"},
["tpe"] = {"Tippera"},
["tpf"] = {"Tarpia"},
["tpg"] = {"Kula"},
["tpi"] = {"Tok Pisin"},
["tpj"] = {"Tapieté"},
["tpk"] = {"Tupinikin"},
["tpl"] = {"Tlacoapa Me'phaa", "Tlacoapa Tlapanec"},
["tpm"] = {"Tampulma"},
["tpn"] = {"Tupinambá"},
["tpo"] = {"Tai Pao"},
["tpp"] = {"Pisaflores Tepehua"},
["tpq"] = {"Tukpa"},
["tpr"] = {"Tuparí"},
["tpt"] = {"Tlachichilco Tepehua"},
["tpu"] = {"Tampuan"},
["tpv"] = {"Tanapag"},
["tpx"] = {"Acatepec Me'phaa", "Acatepec Tlapanec"},
["tpy"] = {"Trumai"},
["tpz"] = {"Tinputz"},
["tqb"] = {"Tembé"},
["tql"] = {"Lehali"},
["tqm"] = {"Turumsa"},
["tqn"] = {"Tenino"},
["tqo"] = {"Toaripi"},
["tqp"] = {"Tomoip"},
["tqq"] = {"Tunni"},
["tqr"] = {"Torona"},
["tqt"] = {"Western Totonac"},
["tqu"] = {"Touo"},
["tqw"] = {"Tonkawa"},
["tra"] = {"Tirahi"},
["trb"] = {"Terebu"},
["trc"] = {"Copala Triqui"},
["trd"] = {"Turi"},
["tre"] = {"East Tarangan"},
["trf"] = {"Trinidadian Creole English"},
["trg"] = {"Lishán Didán"},
["trh"] = {"Turaka"},
["tri"] = {"Trió"},
["trj"] = {"Toram"},
["trk"] = {"Turkic languages"},
["trl"] = {"Traveller Scottish"},
["trm"] = {"Tregami"},
["trn"] = {"Trinitario"},
["tro"] = {"Tarao Naga"},
["trp"] = {"Kok Borok"},
["trq"] = {"San Martín Itunyoso Triqui"},
["trr"] = {"Taushiro"},
["trs"] = {"Chicahuaxtla Triqui"},
["trt"] = {"Tunggare"},
["tru"] = {"Turoyo", "Surayt"},
["trv"] = {"Sediq", "Seediq", "Taroko"},
["trw"] = {"Torwali"},
["trx"] = {"Tringgus-Sembaan Bidayuh"},
["try"] = {"Turung"},
["trz"] = {"Torá"},
["tsa"] = {"Tsaangi"},
["tsb"] = {"Tsamai"},
["tsc"] = {"Tswa"},
["tsd"] = {"Tsakonian"},
["tse"] = {"Tunisian Sign Language"},
["tsg"] = {"Tausug"},
["tsh"] = {"Tsuvan"},
["tsi"] = {"Tsimshian"},
["tsj"] = {"Tshangla"},
["tsk"] = {"Tseku"},
["tsl"] = {"Ts'ün-Lao"},
["tsm"] = {"Turkish Sign Language", "Türk İşaret Dili"},
["tsp"] = {"Northern Toussian"},
["tsq"] = {"Thai Sign Language"},
["tsr"] = {"Akei"},
["tss"] = {"Taiwan Sign Language"},
["tst"] = {"Tondi Songway Kiini"},
["tsu"] = {"Tsou"},
["tsv"] = {"Tsogo"},
["tsw"] = {"Tsishingini"},
["tsx"] = {"Mubami"},
["tsy"] = {"Tebul Sign Language"},
["tsz"] = {"Purepecha"},
["tta"] = {"Tutelo"},
["ttb"] = {"Gaa"},
["ttc"] = {"Tektiteko"},
["ttd"] = {"Tauade"},
["tte"] = {"Bwanabwana"},
["ttf"] = {"Tuotomb"},
["ttg"] = {"Tutong"},
["tth"] = {"Upper Ta'oih"},
["tti"] = {"Tobati"},
["ttj"] = {"Tooro"},
["ttk"] = {"Totoro"},
["ttl"] = {"Totela"},
["ttm"] = {"Northern Tutchone"},
["ttn"] = {"Towei"},
["tto"] = {"Lower Ta'oih"},
["ttp"] = {"Tombelala"},
["ttq"] = {"Tawallammat Tamajaq"},
["ttr"] = {"Tera"},
["tts"] = {"Northeastern Thai"},
["ttt"] = {"Muslim Tat"},
["ttu"] = {"Torau"},
["ttv"] = {"Titan"},
["ttw"] = {"Long Wat"},
["tty"] = {"Sikaritai"},
["ttz"] = {"Tsum"},
["tua"] = {"Wiarumus"},
["tub"] = {"Tübatulabal"},
["tuc"] = {"Mutu"},
["tud"] = {"Tuxá"},
["tue"] = {"Tuyuca"},
["tuf"] = {"Central Tunebo"},
["tug"] = {"Tunia"},
["tuh"] = {"Taulil"},
["tui"] = {"Tupuri"},
["tuj"] = {"Tugutil"},
["tul"] = {"Tula"},
["tum"] = {"Tumbuka"},
["tun"] = {"Tunica"},
["tuo"] = {"Tucano"},
["tup"] = {"Tupi languages"},
["tuq"] = {"Tedaga"},
["tus"] = {"Tuscarora"},
["tut"] = {"Altaic languages"},
["tuu"] = {"Tututni"},
["tuv"] = {"Turkana"},
["tuw"] = {"Tungus languages"},
["tux"] = {"Tuxináwa"},
["tuy"] = {"Tugen"},
["tuz"] = {"Turka"},
["tva"] = {"Vaghua"},
["tvd"] = {"Tsuvadi"},
["tve"] = {"Te'un"},
["tvi"] = {"Tulai"},
["tvk"] = {"Southeast Ambrym"},
["tvl"] = {"Tuvalu"},
["tvm"] = {"Tela-Masbuar"},
["tvn"] = {"Tavoyan"},
["tvo"] = {"Tidore"},
["tvs"] = {"Taveta"},
["tvt"] = {"Tutsa Naga"},
["tvu"] = {"Tunen"},
["tvw"] = {"Sedoa"},
["tvx"] = {"Taivoan"},
["tvy"] = {"Timor Pidgin"},
["twa"] = {"Twana"},
["twb"] = {"Western Tawbuid"},
["twc"] = {"Teshenawa"},
["twd"] = {"Twents"},
["twe"] = {"Tewa (Indonesia)"},
["twf"] = {"Northern Tiwa"},
["twg"] = {"Tereweng"},
["twh"] = {"Tai Dón"},
["twl"] = {"Tawara"},
["twm"] = {"Tawang Monpa"},
["twn"] = {"Twendi"},
["two"] = {"Tswapong"},
["twp"] = {"Ere"},
["twq"] = {"Tasawaq"},
["twr"] = {"Southwestern Tarahumara"},
["twt"] = {"Turiwára"},
["twu"] = {"Termanu"},
["tww"] = {"Tuwari"},
["twx"] = {"Tewe"},
["twy"] = {"Tawoyan"},
["txa"] = {"Tombonuo"},
["txb"] = {"Tokharian B"},
["txc"] = {"Tsetsaut"},
["txe"] = {"Totoli"},
["txg"] = {"Tangut"},
["txh"] = {"Thracian"},
["txi"] = {"Ikpeng"},
["txj"] = {"Tarjumo"},
["txm"] = {"Tomini"},
["txn"] = {"West Tarangan"},
["txo"] = {"Toto"},
["txq"] = {"Tii"},
["txr"] = {"Tartessian"},
["txs"] = {"Tonsea"},
["txt"] = {"Citak"},
["txu"] = {"Kayapó"},
["txx"] = {"Tatana"},
["txy"] = {"Tanosy Malagasy"},
["tya"] = {"Tauya"},
["tye"] = {"Kyanga"},
["tyh"] = {"O'du"},
["tyi"] = {"Teke-Tsaayi"},
["tyj"] = {"Tai Do", "Tai Yo"},
["tyl"] = {"Thu Lao"},
["tyn"] = {"Kombai"},
["typ"] = {"Thaypan"},
["tyr"] = {"Tai Daeng"},
["tys"] = {"Tày Sa Pa"},
["tyt"] = {"Tày Tac"},
["tyu"] = {"Kua"},
["tyv"] = {"Tuvinian"},
["tyx"] = {"Teke-Tyee"},
["tyy"] = {"Tiyaa"},
["tyz"] = {"Tày"},
["tza"] = {"Tanzanian Sign Language"},
["tzh"] = {"Tzeltal"},
["tzj"] = {"Tz'utujil"},
["tzl"] = {"Talossan"},
["tzm"] = {"Central Atlas Tamazight"},
["tzn"] = {"Tugun"},
["tzo"] = {"Tzotzil"},
["tzx"] = {"Tabriak"},
["uam"] = {"Uamué"},
["uan"] = {"Kuan"},
["uar"] = {"Tairuma"},
["uba"] = {"Ubang"},
["ubi"] = {"Ubi"},
["ubl"] = {"Buhi'non Bikol"},
["ubr"] = {"Ubir"},
["ubu"] = {"Umbu-Ungu"},
["uby"] = {"Ubykh"},
["uda"] = {"Uda"},
["ude"] = {"Udihe"},
["udg"] = {"Muduga"},
["udi"] = {"Udi"},
["udj"] = {"Ujir"},
["udl"] = {"Wuzlam"},
["udm"] = {"Udmurt"},
["udu"] = {"Uduk"},
["ues"] = {"Kioko"},
["ufi"] = {"Ufim"},
["uga"] = {"Ugaritic"},
["ugb"] = {"Kuku-Ugbanh"},
["uge"] = {"Ughele"},
["ugh"] = {"Kubachi"},
["ugn"] = {"Ugandan Sign Language"},
["ugo"] = {"Ugong"},
["ugy"] = {"Uruguayan Sign Language"},
["uha"] = {"Uhami"},
["uhn"] = {"Damal"},
["uis"] = {"Uisai"},
["uiv"] = {"Iyive"},
["uji"] = {"Tanjijili"},
["uka"] = {"Kaburi"},
["ukg"] = {"Ukuriguma"},
["ukh"] = {"Ukhwejo"},
["uki"] = {"Kui (India)"},
["ukk"] = {"Muak Sa-aak"},
["ukl"] = {"Ukrainian Sign Language"},
["ukp"] = {"Ukpe-Bayobiri"},
["ukq"] = {"Ukwa"},
["uks"] = {"Urubú-Kaapor Sign Language", "Kaapor Sign Language"},
["uku"] = {"Ukue"},
["ukv"] = {"Kuku"},
["ukw"] = {"Ukwuani-Aboh-Ndoni"},
["uky"] = {"Kuuk-Yak"},
["ula"] = {"Fungwa"},
["ulb"] = {"Ulukwumi"},
["ulc"] = {"Ulch"},
["ule"] = {"Lule"},
["ulf"] = {"Usku", "Afra"},
["uli"] = {"Ulithian"},
["ulk"] = {"Meriam Mir"},
["ull"] = {"Ullatan"},
["ulm"] = {"Ulumanda'"},
["uln"] = {"Unserdeutsch"},
["ulu"] = {"Uma' Lung"},
["ulw"] = {"Ulwa"},
["uly"] = {"Buli"},
["uma"] = {"Umatilla"},
["umb"] = {"Umbundu"},
["umc"] = {"Marrucinian"},
["umd"] = {"Umbindhamu"},
["umg"] = {"Morrobalama", "Umbuygamu"},
["umi"] = {"Ukit"},
["umm"] = {"Umon"},
["umn"] = {"Makyan Naga"},
["umo"] = {"Umotína"},
["ump"] = {"Umpila"},
["umr"] = {"Umbugarla"},
["ums"] = {"Pendau"},
["umu"] = {"Munsee"},
["una"] = {"North Watut"},
["und"] = {"Undetermined"},
["une"] = {"Uneme"},
["ung"] = {"Ngarinyin"},
["uni"] = {"Uni"},
["unk"] = {"Enawené-Nawé"},
["unm"] = {"Unami"},
["unn"] = {"Kurnai"},
["unr"] = {"Mundari"},
["unu"] = {"Unubahe"},
["unx"] = {"Munda"},
["unz"] = {"Unde Kaili"},
["uon"] = {"Kulon"},
["upi"] = {"Umeda"},
["upv"] = {"Uripiv-Wala-Rano-Atchin"},
["ura"] = {"Urarina"},
["urb"] = {"Urubú-Kaapor", "Kaapor"},
["urc"] = {"Urningangg"},
["ure"] = {"Uru"},
["urf"] = {"Uradhi"},
["urg"] = {"Urigina"},
["urh"] = {"Urhobo"},
["uri"] = {"Urim"},
["urj"] = {"Uralic languages"},
["urk"] = {"Urak Lawoi'"},
["url"] = {"Urali"},
["urm"] = {"Urapmin"},
["urn"] = {"Uruangnirin"},
["uro"] = {"Ura (Papua New Guinea)"},
["urp"] = {"Uru-Pa-In"},
["urr"] = {"Lehalurup", "Löyöp"},
["urt"] = {"Urat"},
["uru"] = {"Urumi"},
["urv"] = {"Uruava"},
["urw"] = {"Sop"},
["urx"] = {"Urimo"},
["ury"] = {"Orya"},
["urz"] = {"Uru-Eu-Wau-Wau"},
["usa"] = {"Usarufa"},
["ush"] = {"Ushojo"},
["usi"] = {"Usui"},
["usk"] = {"Usaghade"},
["usp"] = {"Uspanteco"},
["uss"] = {"us-Saare"},
["usu"] = {"Uya"},
["uta"] = {"Otank"},
["ute"] = {"Ute-Southern Paiute"},
["uth"] = {"ut-Hun"},
["utp"] = {"Amba (Solomon Islands)"},
["utr"] = {"Etulo"},
["utu"] = {"Utu"},
["uum"] = {"Urum"},
["uur"] = {"Ura (Vanuatu)"},
["uuu"] = {"U"},
["uve"] = {"West Uvean", "Fagauvea"},
["uvh"] = {"Uri"},
["uvl"] = {"Lote"},
["uwa"] = {"Kuku-Uwanh"},
["uya"] = {"Doko-Uyanga"},
["uzn"] = {"Northern Uzbek"},
["uzs"] = {"Southern Uzbek"},
["vaa"] = {"Vaagri Booli"},
["vae"] = {"Vale"},
["vaf"] = {"Vafsi"},
["vag"] = {"Vagla"},
["vah"] = {"Varhadi-Nagpuri"},
["vai"] = {"Vai"},
["vaj"] = {"Sekele", "Northwestern ǃKung", "Vasekele"},
["val"] = {"Vehes"},
["vam"] = {"Vanimo"},
["van"] = {"Valman"},
["vao"] = {"Vao"},
["vap"] = {"Vaiphei"},
["var"] = {"Huarijio"},
["vas"] = {"Vasavi"},
["vau"] = {"Vanuma"},
["vav"] = {"Varli"},
["vay"] = {"Wayu"},
["vbb"] = {"Southeast Babar"},
["vbk"] = {"Southwestern Bontok"},
["vec"] = {"Venetian"},
["ved"] = {"Veddah"},
["vel"] = {"Veluws"},
["vem"] = {"Vemgo-Mabas"},
["veo"] = {"Ventureño"},
["vep"] = {"Veps"},
["ver"] = {"Mom Jango"},
["vgr"] = {"Vaghri"},
["vgt"] = {"Vlaamse Gebarentaal", "Flemish Sign Language"},
["vic"] = {"Virgin Islands Creole English"},
["vid"] = {"Vidunda"},
["vif"] = {"Vili"},
["vig"] = {"Viemo"},
["vil"] = {"Vilela"},
["vin"] = {"Vinza"},
["vis"] = {"Vishavan"},
["vit"] = {"Viti"},
["viv"] = {"Iduna"},
["vjk"] = {"Bajjika"},
["vka"] = {"Kariyarra"},
["vkj"] = {"Kujarge"},
["vkk"] = {"Kaur"},
["vkl"] = {"Kulisusu"},
["vkm"] = {"Kamakan"},
["vkn"] = {"Koro Nulu"},
["vko"] = {"Kodeoha"},
["vkp"] = {"Korlai Creole Portuguese"},
["vkt"] = {"Tenggarong Kutai Malay"},
["vku"] = {"Kurrama"},
["vkz"] = {"Koro Zuba"},
["vlp"] = {"Valpei"},
["vls"] = {"Vlaams"},
["vma"] = {"Martuyhunira"},
["vmb"] = {"Barbaram"},
["vmc"] = {"Juxtlahuaca Mixtec"},
["vmd"] = {"Mudu Koraga"},
["vme"] = {"East Masela"},
["vmf"] = {"Mainfränkisch"},
["vmg"] = {"Lungalunga"},
["vmh"] = {"Maraghei"},
["vmi"] = {"Miwa"},
["vmj"] = {"Ixtayutla Mixtec"},
["vmk"] = {"Makhuwa-Shirima"},
["vml"] = {"Malgana"},
["vmm"] = {"Mitlatongo Mixtec"},
["vmp"] = {"Soyaltepec Mazatec"},
["vmq"] = {"Soyaltepec Mixtec"},
["vmr"] = {"Marenje"},
["vms"] = {"Moksela"},
["vmu"] = {"Muluridyi"},
["vmv"] = {"Valley Maidu"},
["vmw"] = {"Makhuwa"},
["vmx"] = {"Tamazola Mixtec"},
["vmy"] = {"Ayautla Mazatec"},
["vmz"] = {"Mazatlán Mazatec"},
["vnk"] = {"Vano", "Lovono"},
["vnm"] = {"Vinmavis", "Neve'ei"},
["vnp"] = {"Vunapu"},
["vor"] = {"Voro"},
["vot"] = {"Votic"},
["vra"] = {"Vera'a"},
["vro"] = {"Võro"},
["vrs"] = {"Varisi"},
["vrt"] = {"Burmbar", "Banam Bay"},
["vsi"] = {"Moldova Sign Language"},
["vsl"] = {"Venezuelan Sign Language"},
["vsv"] = {"Valencian Sign Language", "Llengua de signes valenciana"},
["vto"] = {"Vitou"},
["vum"] = {"Vumbu"},
["vun"] = {"Vunjo"},
["vut"] = {"Vute"},
["vwa"] = {"Awa (China)"},
["waa"] = {"Walla Walla"},
["wab"] = {"Wab"},
["wac"] = {"Wasco-Wishram"},
["wad"] = {"Wamesa", "Wondama"},
["wae"] = {"Walser"},
["waf"] = {"Wakoná"},
["wag"] = {"Wa'ema"},
["wah"] = {"Watubela"},
["wai"] = {"Wares"},
["waj"] = {"Waffa"},
["wak"] = {"Wakashan languages"},
["wal"] = {"Wolaytta", "Wolaitta"},
["wam"] = {"Wampanoag"},
["wan"] = {"Wan"},
["wao"] = {"Wappo"},
["wap"] = {"Wapishana"},
["waq"] = {"Wagiman"},
["war"] = {"Waray (Philippines)"},
["was"] = {"Washo"},
["wat"] = {"Kaninuwa"},
["wau"] = {"Waurá"},
["wav"] = {"Waka"},
["waw"] = {"Waiwai"},
["wax"] = {"Watam", "Marangis"},
["way"] = {"Wayana"},
["waz"] = {"Wampur"},
["wba"] = {"Warao"},
["wbb"] = {"Wabo"},
["wbe"] = {"Waritai"},
["wbf"] = {"Wara"},
["wbh"] = {"Wanda"},
["wbi"] = {"Vwanji"},
["wbj"] = {"Alagwa"},
["wbk"] = {"Waigali"},
["wbl"] = {"Wakhi"},
["wbm"] = {"Wa"},
["wbp"] = {"Warlpiri"},
["wbq"] = {"Waddar"},
["wbr"] = {"Wagdi"},
["wbs"] = {"West Bengal Sign Language"},
["wbt"] = {"Warnman"},
["wbv"] = {"Wajarri"},
["wbw"] = {"Woi"},
["wca"] = {"Yanomámi"},
["wci"] = {"Waci Gbe"},
["wdd"] = {"Wandji"},
["wdg"] = {"Wadaginam"},
["wdj"] = {"Wadjiginy"},
["wdk"] = {"Wadikali"},
["wdt"] = {"Wendat"},
["wdu"] = {"Wadjigu"},
["wdy"] = {"Wadjabangayi"},
["wea"] = {"Wewaw"},
["wec"] = {"Wè Western"},
["wed"] = {"Wedau"},
["weg"] = {"Wergaia"},
["weh"] = {"Weh"},
["wei"] = {"Kiunum"},
["wem"] = {"Weme Gbe"},
["wen"] = {"Sorbian languages"},
["weo"] = {"Wemale"},
["wep"] = {"Westphalien"},
["wer"] = {"Weri"},
["wes"] = {"Cameroon Pidgin"},
["wet"] = {"Perai"},
["weu"] = {"Rawngtu Chin"},
["wew"] = {"Wejewa"},
["wfg"] = {"Yafi", "Zorop"},
["wga"] = {"Wagaya"},
["wgb"] = {"Wagawaga"},
["wgg"] = {"Wangkangurru", "Wangganguru"},
["wgi"] = {"Wahgi"},
["wgo"] = {"Waigeo"},
["wgu"] = {"Wirangu"},
["wgy"] = {"Warrgamay"},
["wha"] = {"Sou Upaa", "Manusela"},
["whg"] = {"North Wahgi"},
["whk"] = {"Wahau Kenyah"},
["whu"] = {"Wahau Kayan"},
["wib"] = {"Southern Toussian"},
["wic"] = {"Wichita"},
["wie"] = {"Wik-Epa"},
["wif"] = {"Wik-Keyangan"},
["wig"] = {"Wik Ngathan"},
["wih"] = {"Wik-Me'anha"},
["wii"] = {"Minidien"},
["wij"] = {"Wik-Iiyanh"},
["wik"] = {"Wikalkan"},
["wil"] = {"Wilawila"},
["wim"] = {"Wik-Mungkan"},
["win"] = {"Ho-Chunk"},
["wir"] = {"Wiraféd"},
["wiu"] = {"Wiru"},
["wiv"] = {"Vitu"},
["wiy"] = {"Wiyot"},
["wja"] = {"Waja"},
["wji"] = {"Warji"},
["wka"] = {"Kw'adza"},
["wkb"] = {"Kumbaran"},
["wkd"] = {"Wakde", "Mo"},
["wkl"] = {"Kalanadi"},
["wkr"] = {"Keerray-Woorroong"},
["wku"] = {"Kunduvadi"},
["wkw"] = {"Wakawaka"},
["wky"] = {"Wangkayutyuru"},
["wla"] = {"Walio"},
["wlc"] = {"Mwali Comorian"},
["wle"] = {"Wolane"},
["wlg"] = {"Kunbarlang"},
["wlh"] = {"Welaun"},
["wli"] = {"Waioli"},
["wlk"] = {"Wailaki"},
["wll"] = {"Wali (Sudan)"},
["wlm"] = {"Middle Welsh"},
["wlo"] = {"Wolio"},
["wlr"] = {"Wailapa"},
["wls"] = {"Wallisian"},
["wlu"] = {"Wuliwuli"},
["wlv"] = {"Wichí Lhamtés Vejoz"},
["wlw"] = {"Walak"},
["wlx"] = {"Wali (Ghana)"},
["wly"] = {"Waling"},
["wma"] = {"Mawa (Nigeria)"},
["wmb"] = {"Wambaya"},
["wmc"] = {"Wamas"},
["wmd"] = {"Mamaindé"},
["wme"] = {"Wambule"},
["wmg"] = {"Western Minyag"},
["wmh"] = {"Waima'a"},
["wmi"] = {"Wamin"},
["wmm"] = {"Maiwa (Indonesia)"},
["wmn"] = {"Waamwang"},
["wmo"] = {"Wom (Papua New Guinea)"},
["wms"] = {"Wambon"},
["wmt"] = {"Walmajarri"},
["wmw"] = {"Mwani"},
["wmx"] = {"Womo"},
["wnb"] = {"Mokati"},
["wnc"] = {"Wantoat"},
["wnd"] = {"Wandarang"},
["wne"] = {"Waneci"},
["wng"] = {"Wanggom"},
["wni"] = {"Ndzwani Comorian"},
["wnk"] = {"Wanukaka"},
["wnm"] = {"Wanggamala"},
["wnn"] = {"Wunumara"},
["wno"] = {"Wano"},
["wnp"] = {"Wanap"},
["wnu"] = {"Usan"},
["wnw"] = {"Wintu"},
["wny"] = {"Wanyi", "Waanyi"},
["woa"] = {"Kuwema", "Tyaraity"},
["wob"] = {"Wè Northern"},
["woc"] = {"Wogeo"},
["wod"] = {"Wolani"},
["woe"] = {"Woleaian"},
["wof"] = {"Gambian Wolof"},
["wog"] = {"Wogamusin"},
["woi"] = {"Kamang"},
["wok"] = {"Longto"},
["wom"] = {"Wom (Nigeria)"},
["won"] = {"Wongo"},
["woo"] = {"Manombai"},
["wor"] = {"Woria"},
["wos"] = {"Hanga Hundi"},
["wow"] = {"Wawonii"},
["woy"] = {"Weyto"},
["wpc"] = {"Maco"},
["wrb"] = {"Waluwarra", "Warluwara"},
["wrg"] = {"Warungu", "Gudjal"},
["wrh"] = {"Wiradjuri"},
["wri"] = {"Wariyangga"},
["wrk"] = {"Garrwa"},
["wrl"] = {"Warlmanpa"},
["wrm"] = {"Warumungu"},
["wrn"] = {"Warnang"},
["wro"] = {"Worrorra"},
["wrp"] = {"Waropen"},
["wrr"] = {"Wardaman"},
["wrs"] = {"Waris"},
["wru"] = {"Waru"},
["wrv"] = {"Waruna"},
["wrw"] = {"Gugu Warra"},
["wrx"] = {"Wae Rana"},
["wry"] = {"Merwari"},
["wrz"] = {"Waray (Australia)"},
["wsa"] = {"Warembori"},
["wsg"] = {"Adilabad Gondi"},
["wsi"] = {"Wusi"},
["wsk"] = {"Waskia"},
["wsr"] = {"Owenia"},
["wss"] = {"Wasa"},
["wsu"] = {"Wasu"},
["wsv"] = {"Wotapuri-Katarqalai"},
["wtb"] = {"Matambwe"},
["wtf"] = {"Watiwa"},
["wth"] = {"Wathawurrung"},
["wti"] = {"Berta"},
["wtk"] = {"Watakataui"},
["wtm"] = {"Mewati"},
["wtw"] = {"Wotu"},
["wua"] = {"Wikngenchera"},
["wub"] = {"Wunambal"},
["wud"] = {"Wudu"},
["wuh"] = {"Wutunhua"},
["wul"] = {"Silimo"},
["wum"] = {"Wumbvu"},
["wun"] = {"Bungu"},
["wur"] = {"Wurrugu"},
["wut"] = {"Wutung"},
["wuu"] = {"Wu Chinese"},
["wuv"] = {"Wuvulu-Aua"},
["wux"] = {"Wulna"},
["wuy"] = {"Wauyai"},
["wwa"] = {"Waama"},
["wwb"] = {"Wakabunga"},
["wwo"] = {"Wetamut", "Dorig"},
["wwr"] = {"Warrwa"},
["www"] = {"Wawa"},
["wxa"] = {"Waxianghua"},
["wxw"] = {"Wardandi"},
["wyb"] = {"Wangaaybuwan-Ngiyambaa"},
["wyi"] = {"Woiwurrung"},
["wym"] = {"Wymysorys"},
["wyn"] = {"Wyandot"},
["wyr"] = {"Wayoró"},
["wyy"] = {"Western Fijian"},
["xaa"] = {"Andalusian Arabic"},
["xab"] = {"Sambe"},
["xac"] = {"Kachari"},
["xad"] = {"Adai"},
["xae"] = {"Aequian"},
["xag"] = {"Aghwan"},
["xai"] = {"Kaimbé"},
["xaj"] = {"Ararandewára"},
["xak"] = {"Máku"},
["xal"] = {"Kalmyk", "Oirat"},
["xam"] = {"ǀXam"},
["xan"] = {"Xamtanga"},
["xao"] = {"Khao"},
["xap"] = {"Apalachee"},
["xaq"] = {"Aquitanian"},
["xar"] = {"Karami"},
["xas"] = {"Kamas"},
["xat"] = {"Katawixi"},
["xau"] = {"Kauwera"},
["xav"] = {"Xavánte"},
["xaw"] = {"Kawaiisu"},
["xay"] = {"Kayan Mahakam"},
["xbb"] = {"Lower Burdekin"},
["xbc"] = {"Bactrian"},
["xbd"] = {"Bindal"},
["xbe"] = {"Bigambal"},
["xbg"] = {"Bunganditj"},
["xbi"] = {"Kombio"},
["xbj"] = {"Birrpayi"},
["xbm"] = {"Middle Breton"},
["xbn"] = {"Kenaboi"},
["xbo"] = {"Bolgarian"},
["xbp"] = {"Bibbulman"},
["xbr"] = {"Kambera"},
["xbw"] = {"Kambiwá"},
["xby"] = {"Batjala", "Batyala"},
["xcb"] = {"Cumbric"},
["xcc"] = {"Camunic"},
["xce"] = {"Celtiberian"},
["xcg"] = {"Cisalpine Gaulish"},
["xch"] = {"Chemakum", "Chimakum"},
["xcl"] = {"Classical Armenian"},
["xcm"] = {"Comecrudo"},
["xcn"] = {"Cotoname"},
["xco"] = {"Chorasmian"},
["xcr"] = {"Carian"},
["xct"] = {"Classical Tibetan"},
["xcu"] = {"Curonian"},
["xcv"] = {"Chuvantsy"},
["xcw"] = {"Coahuilteco"},
["xcy"] = {"Cayuse"},
["xda"] = {"Darkinyung"},
["xdc"] = {"Dacian"},
["xdk"] = {"Dharuk"},
["xdm"] = {"Edomite"},
["xdo"] = {"Kwandu"},
["xdq"] = {"Kaitag"},
["xdy"] = {"Malayic Dayak"},
["xeb"] = {"Eblan"},
["xed"] = {"Hdi"},
["xeg"] = {"ǁXegwi"},
["xel"] = {"Kelo"},
["xem"] = {"Kembayan"},
["xep"] = {"Epi-Olmec"},
["xer"] = {"Xerénte"},
["xes"] = {"Kesawai"},
["xet"] = {"Xetá"},
["xeu"] = {"Keoru-Ahia"},
["xfa"] = {"Faliscan"},
["xga"] = {"Galatian"},
["xgb"] = {"Gbin"},
["xgd"] = {"Gudang"},
["xgf"] = {"Gabrielino-Fernandeño"},
["xgg"] = {"Goreng"},
["xgi"] = {"Garingbal"},
["xgl"] = {"Galindan"},
["xgm"] = {"Dharumbal", "Guwinmal"},
["xgn"] = {"Mongolian languages"},
["xgr"] = {"Garza"},
["xgu"] = {"Unggumi"},
["xgw"] = {"Guwa"},
["xha"] = {"Harami"},
["xhc"] = {"Hunnic"},
["xhd"] = {"Hadrami"},
["xhe"] = {"Khetrani"},
["xhm"] = {"Middle Khmer (1400 to 1850 CE)"},
["xhr"] = {"Hernican"},
["xht"] = {"Hattic"},
["xhu"] = {"Hurrian"},
["xhv"] = {"Khua"},
["xib"] = {"Iberian"},
["xii"] = {"Xiri"},
["xil"] = {"Illyrian"},
["xin"] = {"Xinca"},
["xir"] = {"Xiriâna"},
["xis"] = {"Kisan"},
["xiv"] = {"Indus Valley Language"},
["xiy"] = {"Xipaya"},
["xjb"] = {"Minjungbal"},
["xjt"] = {"Jaitmatang"},
["xka"] = {"Kalkoti"},
["xkb"] = {"Northern Nago"},
["xkc"] = {"Kho'ini"},
["xkd"] = {"Mendalam Kayan"},
["xke"] = {"Kereho"},
["xkf"] = {"Khengkha"},
["xkg"] = {"Kagoro"},
["xki"] = {"Kenyan Sign Language"},
["xkj"] = {"Kajali"},
["xkk"] = {"Kachok", "Kaco'"},
["xkl"] = {"Mainstream Kenyah"},
["xkn"] = {"Kayan River Kayan"},
["xko"] = {"Kiorr"},
["xkp"] = {"Kabatei"},
["xkq"] = {"Koroni"},
["xkr"] = {"Xakriabá"},
["xks"] = {"Kumbewaha"},
["xkt"] = {"Kantosi"},
["xku"] = {"Kaamba"},
["xkv"] = {"Kgalagadi"},
["xkw"] = {"Kembra"},
["xkx"] = {"Karore"},
["xky"] = {"Uma' Lasan"},
["xkz"] = {"Kurtokha"},
["xla"] = {"Kamula"},
["xlb"] = {"Loup B"},
["xlc"] = {"Lycian"},
["xld"] = {"Lydian"},
["xle"] = {"Lemnian"},
["xlg"] = {"Ligurian (Ancient)"},
["xli"] = {"Liburnian"},
["xln"] = {"Alanic"},
["xlo"] = {"Loup A"},
["xlp"] = {"Lepontic"},
["xls"] = {"Lusitanian"},
["xlu"] = {"Cuneiform Luwian"},
["xly"] = {"Elymian"},
["xma"] = {"Mushungulu"},
["xmb"] = {"Mbonga"},
["xmc"] = {"Makhuwa-Marrevone"},
["xmd"] = {"Mbudum"},
["xme"] = {"Median"},
["xmf"] = {"Mingrelian"},
["xmg"] = {"Mengaka"},
["xmh"] = {"Kugu-Muminh"},
["xmj"] = {"Majera"},
["xmk"] = {"Ancient Macedonian"},
["xml"] = {"Malaysian Sign Language"},
["xmm"] = {"Manado Malay"},
["xmn"] = {"Manichaean Middle Persian"},
["xmo"] = {"Morerebi"},
["xmp"] = {"Kuku-Mu'inh"},
["xmq"] = {"Kuku-Mangk"},
["xmr"] = {"Meroitic"},
["xms"] = {"Moroccan Sign Language"},
["xmt"] = {"Matbat"},
["xmu"] = {"Kamu"},
["xmv"] = {"Antankarana Malagasy", "Tankarana Malagasy"},
["xmw"] = {"Tsimihety Malagasy"},
["xmx"] = {"Salawati", "Maden"},
["xmy"] = {"Mayaguduna"},
["xmz"] = {"Mori Bawah"},
["xna"] = {"Ancient North Arabian"},
["xnb"] = {"Kanakanabu"},
["xnd"] = {"Na-Dene languages"},
["xng"] = {"Middle Mongolian"},
["xnh"] = {"Kuanhua"},
["xni"] = {"Ngarigu"},
["xnj"] = {"Ngoni (Tanzania)"},
["xnk"] = {"Nganakarti"},
["xnm"] = {"Ngumbarl"},
["xnn"] = {"Northern Kankanay"},
["xno"] = {"Anglo-Norman"},
["xnq"] = {"Ngoni (Mozambique)"},
["xnr"] = {"Kangri"},
["xns"] = {"Kanashi"},
["xnt"] = {"Narragansett"},
["xnu"] = {"Nukunul"},
["xny"] = {"Nyiyaparli"},
["xnz"] = {"Kenzi", "Mattoki"},
["xoc"] = {"O'chi'chi'"},
["xod"] = {"Kokoda"},
["xog"] = {"Soga"},
["xoi"] = {"Kominimung"},
["xok"] = {"Xokleng"},
["xom"] = {"Komo (Sudan)"},
["xon"] = {"Konkomba"},
["xoo"] = {"Xukurú"},
["xop"] = {"Kopar"},
["xor"] = {"Korubo"},
["xow"] = {"Kowaki"},
["xpa"] = {"Pirriya"},
["xpb"] = {"Northeastern Tasmanian", "Pyemmairrener"},
["xpc"] = {"Pecheneg"},
["xpd"] = {"Oyster Bay Tasmanian"},
["xpe"] = {"Liberia Kpelle"},
["xpf"] = {"Southeast Tasmanian", "Nuenonne"},
["xpg"] = {"Phrygian"},
["xph"] = {"North Midlands Tasmanian", "Tyerrenoterpanner"},
["xpi"] = {"Pictish"},
["xpj"] = {"Mpalitjanh"},
["xpk"] = {"Kulina Pano"},
["xpl"] = {"Port Sorell Tasmanian"},
["xpm"] = {"Pumpokol"},
["xpn"] = {"Kapinawá"},
["xpo"] = {"Pochutec"},
["xpp"] = {"Puyo-Paekche"},
["xpq"] = {"Mohegan-Pequot"},
["xpr"] = {"Parthian"},
["xps"] = {"Pisidian"},
["xpt"] = {"Punthamara"},
["xpu"] = {"Punic"},
["xpv"] = {"Northern Tasmanian", "Tommeginne"},
["xpw"] = {"Northwestern Tasmanian", "Peerapper"},
["xpx"] = {"Southwestern Tasmanian", "Toogee"},
["xpy"] = {"Puyo"},
["xpz"] = {"Bruny Island Tasmanian"},
["xqa"] = {"Karakhanid"},
["xqt"] = {"Qatabanian"},
["xra"] = {"Krahô"},
["xrb"] = {"Eastern Karaboro"},
["xrd"] = {"Gundungurra"},
["xre"] = {"Kreye"},
["xrg"] = {"Minang"},
["xri"] = {"Krikati-Timbira"},
["xrm"] = {"Armazic"},
["xrn"] = {"Arin"},
["xrr"] = {"Raetic"},
["xrt"] = {"Aranama-Tamique"},
["xru"] = {"Marriammu"},
["xrw"] = {"Karawa"},
["xsa"] = {"Sabaean"},
["xsb"] = {"Sambal"},
["xsc"] = {"Scythian"},
["xsd"] = {"Sidetic"},
["xse"] = {"Sempan"},
["xsh"] = {"Shamang"},
["xsi"] = {"Sio"},
["xsj"] = {"Subi"},
["xsl"] = {"South Slavey"},
["xsm"] = {"Kasem"},
["xsn"] = {"Sanga (Nigeria)"},
["xso"] = {"Solano"},
["xsp"] = {"Silopi"},
["xsq"] = {"Makhuwa-Saka"},
["xsr"] = {"Sherpa"},
["xsu"] = {"Sanumá"},
["xsv"] = {"Sudovian"},
["xsy"] = {"Saisiyat"},
["xta"] = {"Alcozauca Mixtec"},
["xtb"] = {"Chazumba Mixtec"},
["xtc"] = {"Katcha-Kadugli-Miri"},
["xtd"] = {"Diuxi-Tilantongo Mixtec"},
["xte"] = {"Ketengban"},
["xtg"] = {"Transalpine Gaulish"},
["xth"] = {"Yitha Yitha"},
["xti"] = {"Sinicahua Mixtec"},
["xtj"] = {"San Juan Teita Mixtec"},
["xtl"] = {"Tijaltepec Mixtec"},
["xtm"] = {"Magdalena Peñasco Mixtec"},
["xtn"] = {"Northern Tlaxiaco Mixtec"},
["xto"] = {"Tokharian A"},
["xtp"] = {"San Miguel Piedras Mixtec"},
["xtq"] = {"Tumshuqese"},
["xtr"] = {"Early Tripuri"},
["xts"] = {"Sindihui Mixtec"},
["xtt"] = {"Tacahua Mixtec"},
["xtu"] = {"Cuyamecalco Mixtec"},
["xtv"] = {"Thawa"},
["xtw"] = {"Tawandê"},
["xty"] = {"Yoloxochitl Mixtec"},
["xua"] = {"Alu Kurumba"},
["xub"] = {"Betta Kurumba"},
["xud"] = {"Umiida"},
["xug"] = {"Kunigami"},
["xuj"] = {"Jennu Kurumba"},
["xul"] = {"Ngunawal", "Nunukul"},
["xum"] = {"Umbrian"},
["xun"] = {"Unggaranggu"},
["xuo"] = {"Kuo"},
["xup"] = {"Upper Umpqua"},
["xur"] = {"Urartian"},
["xut"] = {"Kuthant"},
["xuu"] = {"Kxoe", "Khwedam"},
["xve"] = {"Venetic"},
["xvi"] = {"Kamviri"},
["xvn"] = {"Vandalic"},
["xvo"] = {"Volscian"},
["xvs"] = {"Vestinian"},
["xwa"] = {"Kwaza"},
["xwc"] = {"Woccon"},
["xwd"] = {"Wadi Wadi"},
["xwe"] = {"Xwela Gbe"},
["xwg"] = {"Kwegu"},
["xwj"] = {"Wajuk"},
["xwk"] = {"Wangkumara"},
["xwl"] = {"Western Xwla Gbe"},
["xwo"] = {"Written Oirat"},
["xwr"] = {"Kwerba Mamberamo"},
["xwt"] = {"Wotjobaluk"},
["xww"] = {"Wemba Wemba"},
["xxb"] = {"Boro (Ghana)"},
["xxk"] = {"Ke'o"},
["xxm"] = {"Minkin"},
["xxr"] = {"Koropó"},
["xxt"] = {"Tambora"},
["xya"] = {"Yaygir"},
["xyb"] = {"Yandjibara"},
["xyj"] = {"Mayi-Yapi"},
["xyk"] = {"Mayi-Kulan"},
["xyl"] = {"Yalakalore"},
["xyt"] = {"Mayi-Thakurti"},
["xyy"] = {"Yorta Yorta"},
["xzh"] = {"Zhang-Zhung"},
["xzm"] = {"Zemgalian"},
["xzp"] = {"Ancient Zapotec"},
["yaa"] = {"Yaminahua"},
["yab"] = {"Yuhup"},
["yac"] = {"Pass Valley Yali"},
["yad"] = {"Yagua"},
["yae"] = {"Pumé"},
["yaf"] = {"Yaka (Democratic Republic of Congo)"},
["yag"] = {"Yámana"},
["yah"] = {"Yazgulyam"},
["yai"] = {"Yagnobi"},
["yaj"] = {"Banda-Yangere"},
["yak"] = {"Yakama"},
["yal"] = {"Yalunka"},
["yam"] = {"Yamba"},
["yan"] = {"Mayangna"},
["yao"] = {"Yao"},
["yap"] = {"Yapese"},
["yaq"] = {"Yaqui"},
["yar"] = {"Yabarana"},
["yas"] = {"Nugunu (Cameroon)"},
["yat"] = {"Yambeta"},
["yau"] = {"Yuwana"},
["yav"] = {"Yangben"},
["yaw"] = {"Yawalapití"},
["yax"] = {"Yauma"},
["yay"] = {"Agwagwune"},
["yaz"] = {"Lokaa"},
["yba"] = {"Yala"},
["ybb"] = {"Yemba"},
["ybe"] = {"West Yugur"},
["ybh"] = {"Yakha"},
["ybi"] = {"Yamphu"},
["ybj"] = {"Hasha"},
["ybk"] = {"Bokha"},
["ybl"] = {"Yukuben"},
["ybm"] = {"Yaben"},
["ybn"] = {"Yabaâna"},
["ybo"] = {"Yabong"},
["ybx"] = {"Yawiyo"},
["yby"] = {"Yaweyuha"},
["ych"] = {"Chesu"},
["ycl"] = {"Lolopo"},
["ycn"] = {"Yucuna"},
["ycp"] = {"Chepya"},
["ycr"] = {"Yilan Creole"},
["yda"] = {"Yanda"},
["ydd"] = {"Eastern Yiddish"},
["yde"] = {"Yangum Dey"},
["ydg"] = {"Yidgha"},
["ydk"] = {"Yoidik"},
["yea"] = {"Ravula"},
["yec"] = {"Yeniche"},
["yee"] = {"Yimas"},
["yei"] = {"Yeni"},
["yej"] = {"Yevanic"},
["yel"] = {"Yela"},
["yer"] = {"Tarok"},
["yes"] = {"Nyankpa"},
["yet"] = {"Yetfa"},
["yeu"] = {"Yerukula"},
["yev"] = {"Yapunda"},
["yey"] = {"Yeyi"},
["yga"] = {"Malyangapa"},
["ygi"] = {"Yiningayi"},
["ygl"] = {"Yangum Gel"},
["ygm"] = {"Yagomi"},
["ygp"] = {"Gepo"},
["ygr"] = {"Yagaria"},
["ygs"] = {"Yolŋu Sign Language"},
["ygu"] = {"Yugul"},
["ygw"] = {"Yagwoia"},
["yha"] = {"Baha Buyang"},
["yhd"] = {"Judeo-Iraqi Arabic"},
["yhl"] = {"Hlepho Phowa"},
["yhs"] = {"Yan-nhaŋu Sign Language"},
["yia"] = {"Yinggarda"},
["yif"] = {"Ache"},
["yig"] = {"Wusa Nasu"},
["yih"] = {"Western Yiddish"},
["yii"] = {"Yidiny"},
["yij"] = {"Yindjibarndi"},
["yik"] = {"Dongshanba Lalo"},
["yil"] = {"Yindjilandji"},
["yim"] = {"Yimchungru Naga"},
["yin"] = {"Riang Lai", "Yinchia"},
["yip"] = {"Pholo"},
["yiq"] = {"Miqie"},
["yir"] = {"North Awyu"},
["yis"] = {"Yis"},
["yit"] = {"Eastern Lalu"},
["yiu"] = {"Awu"},
["yiv"] = {"Northern Nisu"},
["yix"] = {"Axi Yi"},
["yiz"] = {"Azhe"},
["yka"] = {"Yakan"},
["ykg"] = {"Northern Yukaghir"},
["ykh"] = {"Khamnigan Mongol"},
["yki"] = {"Yoke"},
["ykk"] = {"Yakaikeke"},
["ykl"] = {"Khlula"},
["ykm"] = {"Kap"},
["ykn"] = {"Kua-nsi"},
["yko"] = {"Yasa"},
["ykr"] = {"Yekora"},
["ykt"] = {"Kathu"},
["yku"] = {"Kuamasi"},
["yky"] = {"Yakoma"},
["yla"] = {"Yaul"},
["ylb"] = {"Yaleba"},
["yle"] = {"Yele"},
["ylg"] = {"Yelogu"},
["yli"] = {"Angguruk Yali"},
["yll"] = {"Yil"},
["ylm"] = {"Limi"},
["yln"] = {"Langnian Buyang"},
["ylo"] = {"Naluo Yi"},
["ylr"] = {"Yalarnnga"},
["ylu"] = {"Aribwaung"},
["yly"] = {"Nyâlayu", "Nyelâyu"},
["ymb"] = {"Yambes"},
["ymc"] = {"Southern Muji"},
["ymd"] = {"Muda"},
["yme"] = {"Yameo"},
["ymg"] = {"Yamongeri"},
["ymh"] = {"Mili"},
["ymi"] = {"Moji"},
["ymk"] = {"Makwe"},
["yml"] = {"Iamalele"},
["ymm"] = {"Maay"},
["ymn"] = {"Yamna", "Sunum"},
["ymo"] = {"Yangum Mon"},
["ymp"] = {"Yamap"},
["ymq"] = {"Qila Muji"},
["ymr"] = {"Malasar"},
["yms"] = {"Mysian"},
["ymx"] = {"Northern Muji"},
["ymz"] = {"Muzi"},
["yna"] = {"Aluo"},
["ynd"] = {"Yandruwandha"},
["yne"] = {"Lang'e"},
["yng"] = {"Yango"},
["ynk"] = {"Naukan Yupik"},
["ynl"] = {"Yangulam"},
["ynn"] = {"Yana"},
["yno"] = {"Yong"},
["ynq"] = {"Yendang"},
["yns"] = {"Yansi"},
["ynu"] = {"Yahuna"},
["yob"] = {"Yoba"},
["yog"] = {"Yogad"},
["yoi"] = {"Yonaguni"},
["yok"] = {"Yokuts"},
["yol"] = {"Yola"},
["yom"] = {"Yombe"},
["yon"] = {"Yongkom"},
["yot"] = {"Yotti"},
["yox"] = {"Yoron"},
["yoy"] = {"Yoy"},
["ypa"] = {"Phala"},
["ypb"] = {"Labo Phowa"},
["ypg"] = {"Phola"},
["yph"] = {"Phupha"},
["ypk"] = {"Yupik languages"},
["ypm"] = {"Phuma"},
["ypn"] = {"Ani Phowa"},
["ypo"] = {"Alo Phola"},
["ypp"] = {"Phupa"},
["ypz"] = {"Phuza"},
["yra"] = {"Yerakai"},
["yrb"] = {"Yareba"},
["yre"] = {"Yaouré"},
["yrk"] = {"Nenets"},
["yrl"] = {"Nhengatu"},
["yrm"] = {"Yirrk-Mel"},
["yrn"] = {"Yerong"},
["yro"] = {"Yaroamë"},
["yrs"] = {"Yarsun"},
["yrw"] = {"Yarawata"},
["yry"] = {"Yarluyandi"},
["ysc"] = {"Yassic"},
["ysd"] = {"Samatao"},
["ysg"] = {"Sonaga"},
["ysl"] = {"Yugoslavian Sign Language"},
["ysm"] = {"Myanmar Sign Language"},
["ysn"] = {"Sani"},
["yso"] = {"Nisi (China)"},
["ysp"] = {"Southern Lolopo"},
["ysr"] = {"Sirenik Yupik"},
["yss"] = {"Yessan-Mayo"},
["ysy"] = {"Sanie"},
["yta"] = {"Talu"},
["ytl"] = {"Tanglang"},
["ytp"] = {"Thopho"},
["ytw"] = {"Yout Wam"},
["yty"] = {"Yatay"},
["yua"] = {"Yucateco", "Yucatec Maya"},
["yub"] = {"Yugambal"},
["yuc"] = {"Yuchi"},
["yud"] = {"Judeo-Tripolitanian Arabic"},
["yue"] = {"Yue Chinese", "Cantonese"},
["yuf"] = {"Havasupai-Walapai-Yavapai"},
["yug"] = {"Yug"},
["yui"] = {"Yurutí"},
["yuj"] = {"Karkar-Yuri"},
["yuk"] = {"Yuki"},
["yul"] = {"Yulu"},
["yum"] = {"Quechan"},
["yun"] = {"Bena (Nigeria)"},
["yup"] = {"Yukpa"},
["yuq"] = {"Yuqui"},
["yur"] = {"Yurok"},
["yut"] = {"Yopno"},
["yuw"] = {"Yau (Morobe Province)"},
["yux"] = {"Southern Yukaghir"},
["yuy"] = {"East Yugur"},
["yuz"] = {"Yuracare"},
["yva"] = {"Yawa"},
["yvt"] = {"Yavitero"},
["ywa"] = {"Kalou"},
["ywg"] = {"Yinhawangka"},
["ywl"] = {"Western Lalu"},
["ywn"] = {"Yawanawa"},
["ywq"] = {"Wuding-Luquan Yi"},
["ywr"] = {"Yawuru"},
["ywt"] = {"Xishanba Lalo", "Central Lalo"},
["ywu"] = {"Wumeng Nasu"},
["yww"] = {"Yawarawarga"},
["yxa"] = {"Mayawali"},
["yxg"] = {"Yagara"},
["yxl"] = {"Yardliyawarra"},
["yxm"] = {"Yinwum"},
["yxu"] = {"Yuyu"},
["yxy"] = {"Yabula Yabula"},
["yyr"] = {"Yir Yoront"},
["yyu"] = {"Yau (Sandaun Province)"},
["yyz"] = {"Ayizi"},
["yzg"] = {"E'ma Buyang"},
["yzk"] = {"Zokhuo"},
["zaa"] = {"Sierra de Juárez Zapotec"},
["zab"] = {"Western Tlacolula Valley Zapotec", "San Juan Guelavía Zapotec"},
["zac"] = {"Ocotlán Zapotec"},
["zad"] = {"Cajonos Zapotec"},
["zae"] = {"Yareni Zapotec"},
["zaf"] = {"Ayoquesco Zapotec"},
["zag"] = {"Zaghawa"},
["zah"] = {"Zangwal"},
["zai"] = {"Isthmus Zapotec"},
["zaj"] = {"Zaramo"},
["zak"] = {"Zanaki"},
["zal"] = {"Zauzou"},
["zam"] = {"Miahuatlán Zapotec"},
["zao"] = {"Ozolotepec Zapotec"},
["zap"] = {"Zapotec"},
["zaq"] = {"Aloápam Zapotec"},
["zar"] = {"Rincón Zapotec"},
["zas"] = {"Santo Domingo Albarradas Zapotec"},
["zat"] = {"Tabaa Zapotec"},
["zau"] = {"Zangskari"},
["zav"] = {"Yatzachi Zapotec"},
["zaw"] = {"Mitla Zapotec"},
["zax"] = {"Xadani Zapotec"},
["zay"] = {"Zayse-Zergulla", "Zaysete"},
["zaz"] = {"Zari"},
["zba"] = {"Balaibalan"},
["zbc"] = {"Central Berawan"},
["zbe"] = {"East Berawan"},
["zbl"] = {"Blissymbols", "Bliss", "Blissymbolics"},
["zbt"] = {"Batui"},
["zbu"] = {"Bu (Bauchi State)"},
["zbw"] = {"West Berawan"},
["zca"] = {"Coatecas Altas Zapotec"},
["zcd"] = {"Las Delicias Zapotec"},
["zch"] = {"Central Hongshuihe Zhuang"},
["zdj"] = {"Ngazidja Comorian"},
["zea"] = {"Zeeuws"},
["zeg"] = {"Zenag"},
["zeh"] = {"Eastern Hongshuihe Zhuang"},
["zem"] = {"Zeem"},
["zen"] = {"Zenaga"},
["zga"] = {"Kinga"},
["zgb"] = {"Guibei Zhuang"},
["zgh"] = {"Standard Moroccan Tamazight"},
["zgm"] = {"Minz Zhuang"},
["zgn"] = {"Guibian Zhuang"},
["zgr"] = {"Magori"},
["zhb"] = {"Zhaba"},
["zhd"] = {"Dai Zhuang"},
["zhi"] = {"Zhire"},
["zhn"] = {"Nong Zhuang"},
["zhw"] = {"Zhoa"},
["zhx"] = {"Chinese (family)"},
["zia"] = {"Zia"},
["zib"] = {"Zimbabwe Sign Language"},
["zik"] = {"Zimakani"},
["zil"] = {"Zialo"},
["zim"] = {"Mesme"},
["zin"] = {"Zinza"},
["ziw"] = {"Zigula"},
["ziz"] = {"Zizilivakan"},
["zka"] = {"Kaimbulawa"},
["zkd"] = {"Kadu"},
["zkg"] = {"Koguryo"},
["zkh"] = {"Khorezmian"},
["zkk"] = {"Karankawa"},
["zkn"] = {"Kanan"},
["zko"] = {"Kott"},
["zkp"] = {"São Paulo Kaingáng"},
["zkr"] = {"Zakhring"},
["zkt"] = {"Kitan"},
["zku"] = {"Kaurna"},
["zkv"] = {"Krevinian"},
["zkz"] = {"Khazar"},
["zla"] = {"Zula"},
["zle"] = {"East Slavic languages"},
["zlj"] = {"Liujiang Zhuang"},
["zlm"] = {"Malay (individual language)"},
["zln"] = {"Lianshan Zhuang"},
["zlq"] = {"Liuqian Zhuang"},
["zls"] = {"South Slavic languages"},
["zlu"] = {"Zul"},
["zlw"] = {"West Slavic languages"},
["zma"] = {"Manda (Australia)"},
["zmb"] = {"Zimba"},
["zmc"] = {"Margany"},
["zmd"] = {"Maridan"},
["zme"] = {"Mangerr"},
["zmf"] = {"Mfinu"},
["zmg"] = {"Marti Ke"},
["zmh"] = {"Makolkol"},
["zmi"] = {"Negeri Sembilan Malay"},
["zmj"] = {"Maridjabin"},
["zmk"] = {"Mandandanyi"},
["zml"] = {"Matngala"},
["zmm"] = {"Marimanindji", "Marramaninyshi"},
["zmn"] = {"Mbangwe"},
["zmo"] = {"Molo"},
["zmp"] = {"Mpuono"},
["zmq"] = {"Mituku"},
["zmr"] = {"Maranunggu"},
["zms"] = {"Mbesa"},
["zmt"] = {"Maringarr"},
["zmu"] = {"Muruwari"},
["zmv"] = {"Mbariman-Gudhinma"},
["zmw"] = {"Mbo (Democratic Republic of Congo)"},
["zmx"] = {"Bomitaba"},
["zmy"] = {"Mariyedi"},
["zmz"] = {"Mbandja"},
["zna"] = {"Zan Gula"},
["znd"] = {"Zande languages"},
["zne"] = {"Zande (individual language)"},
["zng"] = {"Mang"},
["znk"] = {"Manangkari"},
["zns"] = {"Mangas"},
["zoc"] = {"Copainalá Zoque"},
["zoh"] = {"Chimalapa Zoque"},
["zom"] = {"Zou"},
["zoo"] = {"Asunción Mixtepec Zapotec"},
["zoq"] = {"Tabasco Zoque"},
["zor"] = {"Rayón Zoque"},
["zos"] = {"Francisco León Zoque"},
["zpa"] = {"Lachiguiri Zapotec"},
["zpb"] = {"Yautepec Zapotec"},
["zpc"] = {"Choapan Zapotec"},
["zpd"] = {"Southeastern Ixtlán Zapotec"},
["zpe"] = {"Petapa Zapotec"},
["zpf"] = {"San Pedro Quiatoni Zapotec"},
["zpg"] = {"Guevea De Humboldt Zapotec"},
["zph"] = {"Totomachapan Zapotec"},
["zpi"] = {"Santa María Quiegolani Zapotec"},
["zpj"] = {"Quiavicuzas Zapotec"},
["zpk"] = {"Tlacolulita Zapotec"},
["zpl"] = {"Lachixío Zapotec"},
["zpm"] = {"Mixtepec Zapotec"},
["zpn"] = {"Santa Inés Yatzechi Zapotec"},
["zpo"] = {"Amatlán Zapotec"},
["zpp"] = {"El Alto Zapotec"},
["zpq"] = {"Zoogocho Zapotec"},
["zpr"] = {"Santiago Xanica Zapotec"},
["zps"] = {"Coatlán Zapotec"},
["zpt"] = {"San Vicente Coatlán Zapotec"},
["zpu"] = {"Yalálag Zapotec"},
["zpv"] = {"Chichicapan Zapotec"},
["zpw"] = {"Zaniza Zapotec"},
["zpx"] = {"San Baltazar Loxicha Zapotec"},
["zpy"] = {"Mazaltepec Zapotec"},
["zpz"] = {"Texmelucan Zapotec"},
["zqe"] = {"Qiubei Zhuang"},
["zra"] = {"Kara (Korea)"},
["zrg"] = {"Mirgan"},
["zrn"] = {"Zerenkel"},
["zro"] = {"Záparo"},
["zrp"] = {"Zarphatic"},
["zrs"] = {"Mairasi"},
["zsa"] = {"Sarasira"},
["zsk"] = {"Kaskean"},
["zsl"] = {"Zambian Sign Language"},
["zsm"] = {"Standard Malay"},
["zsr"] = {"Southern Rincon Zapotec"},
["zsu"] = {"Sukurum"},
["zte"] = {"Elotepec Zapotec"},
["ztg"] = {"Xanaguía Zapotec"},
["ztl"] = {"Lapaguía-Guivini Zapotec"},
["ztm"] = {"San Agustín Mixtepec Zapotec"},
["ztn"] = {"Santa Catarina Albarradas Zapotec"},
["ztp"] = {"Loxicha Zapotec"},
["ztq"] = {"Quioquitani-Quierí Zapotec"},
["zts"] = {"Tilquiapan Zapotec"},
["ztt"] = {"Tejalapan Zapotec"},
["ztu"] = {"Güilá Zapotec"},
["ztx"] = {"Zaachila Zapotec"},
["zty"] = {"Yatee Zapotec"},
["zuh"] = {"Tokano"},
["zum"] = {"Kumzari"},
["zun"] = {"Zuni"},
["zuy"] = {"Zumaya"},
["zwa"] = {"Zay"},
["zxx"] = {"No linguistic content", "Not applicable"},
["zyb"] = {"Yongbei Zhuang"},
["zyg"] = {"Yang Zhuang"},
["zyj"] = {"Youjiang Zhuang"},
["zyn"] = {"Yongnan Zhuang"},
["zyp"] = {"Zyphe Chin"},
["zza"] = {"Zaza", "Dimili", "Dimli (macrolanguage)", "Kirdki", "Kirmanjki (macrolanguage)", "Zazaki"},
["zzj"] = {"Zuojiang Zhuang"}
}
local deprecated = {
["in"] = {"Indonesian"},
["iw"] = {"Hebrew"},
["ji"] = {"Yiddish"},
["jw"] = {"Javanese"},
["mo"] = {"Moldavian", "Moldovan"},
["aam"] = {"Aramanik"},
["adp"] = {"Adap"},
["agp"] = {"Paranan"},
["ais"] = {"Nataoran Amis"},
["ajp"] = {"South Levantine Arabic"},
["ajt"] = {"Judeo-Tunisian Arabic"},
["aoh"] = {"Arma"},
["asd"] = {"Asas"},
["aue"] = {"ǂKxʼauǁʼein"},
["ayx"] = {"Ayi (China)"},
["ayy"] = {"Tayabas Ayta"},
["baz"] = {"Tunen"},
["bbz"] = {"Babalia Creole Arabic"},
["bgm"] = {"Baga Mboteni"},
["bhk"] = {"Albay Bicolano"},
["bic"] = {"Bikaru"},
["bij"] = {"Vaghat-Ya-Bijim-Legeri"},
["bjd"] = {"Bandjigali"},
["bjq"] = {"Southern Betsimisaraka Malagasy"},
["bkb"] = {"Finallig"},
["blg"] = {"Balau"},
["bmy"] = {"Bemba (Democratic Republic of Congo)"},
["bpb"] = {"Barbacoas"},
["btb"] = {"Beti (Cameroon)"},
["btl"] = {"Bhatola"},
["bxx"] = {"Borna (Democratic Republic of Congo)"},
["byy"] = {"Buya"},
["cbe"] = {"Chipiajes"},
["cbh"] = {"Cagua"},
["cca"] = {"Cauca"},
["ccq"] = {"Chaungtha"},
["cdg"] = {"Chamari"},
["cjr"] = {"Chorotega"},
["cka"] = {"Khumi Awa Chin"},
["cmk"] = {"Chimakum"},
["coy"] = {"Coyaima"},
["cqu"] = {"Chilean Quechua"},
["cug"] = {"Chungmboko", "Cung"},
["cum"] = {"Cumeral"},
["daf"] = {"Dan"},
["dap"] = {"Nisi (India)"},
["dgu"] = {"Degaru"},
["dha"] = {"Dhanwar (India)"},
["dit"] = {"Dirari"},
["djl"] = {"Djiwarli"},
["dkl"] = {"Kolum So Dogon"},
["drh"] = {"Darkhat"},
["drr"] = {"Dororo"},
["drw"] = {"Darwazi"},
["dud"] = {"Hun-Saare"},
["duj"] = {"Dhuwal"},
["dwl"] = {"Walo Kumbe Dogon"},
["ekc"] = {"Eastern Karnic"},
["elp"] = {"Elpaputih"},
["emo"] = {"Emok"},
["gav"] = {"Gabutamon"},
["gbc"] = {"Garawa"},
["gfx"] = {"Mangetti Dune ǃXung"},
["ggn"] = {"Eastern Gurung"},
["ggo"] = {"Southern Gondi"},
["ggr"] = {"Aghu Tharnggalu"},
["gio"] = {"Gelao"},
["gji"] = {"Geji"},
["gli"] = {"Guliguli"},
["gti"] = {"Gbati-ri"},
["guv"] = {"Gey"},
["hrr"] = {"Horuru"},
["iap"] = {"Iapama"},
["ibi"] = {"Ibilo"},
["ill"] = {"Iranun"},
["ilw"] = {"Talur"},
["ime"] = {"Imeraguen"},
["izi"] = {"Izi-Ezaa-Ikwo-Mgbo"},
["jar"] = {"Jarawa (Nigeria)"},
["jeg"] = {"Jeng"},
["kbf"] = {"Kakauhua"},
["kdv"] = {"Kado"},
["kgc"] = {"Kasseng"},
["kgd"] = {"Kataang"},
["kgh"] = {"Upper Tanudan Kalinga"},
["kgm"] = {"Karipúna"},
["kjf"] = {"Khalaj [Indo-Iranian]"},
["koj"] = {"Sara Dunjo"},
["kox"] = {"Coxima"},
["kpp"] = {"Paku Karen"},
["krm"] = {"Krim"},
["ksa"] = {"Shuwa-Zamani"},
["ktr"] = {"Kota Marudu Tinagas"},
["kvs"] = {"Kunggara"},
["kwq"] = {"Kwak"},
["kxe"] = {"Kakihum"},
["kxl"] = {"Nepali Kurux"},
["kxu"] = {"Kui (India)"},
["kzh"] = {"Kenuzi-Dongola"},
["kzj"] = {"Coastal Kadazan"},
["kzt"] = {"Tambunan Dusun"},
["lak"] = {"Laka (Nigeria)"},
["lba"] = {"Lui"},
["leg"] = {"Lengua"},
["lii"] = {"Lingkhim"},
["llo"] = {"Khlor"},
["lmm"] = {"Lamam"},
["lmz"] = {"Lumbee"},
["lno"] = {"Lango (South Sudan)"},
["lsg"] = {"Lyons Sign Language"},
["meg"] = {"Mea"},
["mgx"] = {"Omati"},
["mhh"] = {"Maskoy Pidgin"},
["mja"] = {"Mahei"},
["mld"] = {"Malakhel"},
["mnt"] = {"Maykulan"},
["mof"] = {"Mohegan-Montauk-Narragansett"},
["mst"] = {"Cataelano Mandaya"},
["mvm"] = {"Muya"},
["mwd"] = {"Mudbura"},
["mwj"] = {"Maligo"},
["mwx"] = {"Mediak"},
["mwy"] = {"Mosiro"},
["myd"] = {"Maramba"},
["myi"] = {"Mina (India)"},
["myq"] = {"Forest Maninka"},
["myt"] = {"Sangab Mandaya"},
["nad"] = {"Nijadali"},
["nbf"] = {"Naxi"},
["nbx"] = {"Ngura"},
["ncp"] = {"Ndaktup"},
["ngo"] = {"Ngoni"},
["nln"] = {"Durango Nahuatl"},
["nlr"] = {"Ngarla"},
["nns"] = {"Ningye"},
["nnx"] = {"Ngong"},
["nom"] = {"Nocamán"},
["noo"] = {"Nootka"},
["nts"] = {"Natagaimas"},
["nxu"] = {"Narau"},
["ome"] = {"Omejes"},
["oun"] = {"ǃOǃung"},
["pat"] = {"Papitalai"},
["pbz"] = {"Palu"},
["pcr"] = {"Panang"},
["pgy"] = {"Pongyong"},
["pii"] = {"Pini"},
["plj"] = {"Polci"},
["plp"] = {"Palpa"},
["pmc"] = {"Palumata"},
["pmk"] = {"Pamlico"},
["pmu"] = {"Mirpur Panjabi"},
["pod"] = {"Ponares"},
["ppa"] = {"Pao"},
["ppr"] = {"Piru"},
["prb"] = {"Lua'"},
["prp"] = {"Parsi"},
["pry"] = {"Pray 3"},
["puk"] = {"Pu Ko"},
["puz"] = {"Purum Naga"},
["rie"] = {"Rien"},
["rmr"] = {"Caló"},
["rna"] = {"Runa"},
["rsi"] = {"Rennellese Sign Language"},
["sap"] = {"Sanapaná"},
["sca"] = {"Sansu"},
["sdm"] = {"Semandang"},
["sgl"] = {"Sanglechi-Ishkashimi"},
["sgo"] = {"Songa"},
["skk"] = {"Sok"},
["slq"] = {"Salchuq"},
["smd"] = {"Sama"},
["snb"] = {"Sebuyau"},
["snh"] = {"Shinabo"},
["sul"] = {"Surigaonon"},
["sum"] = {"Sumo-Mayangna"},
["svr"] = {"Savara"},
["szd"] = {"Seru"},
["tbb"] = {"Tapeba"},
["tdu"] = {"Tempasuk Dusun"},
["tgg"] = {"Tangga"},
["thc"] = {"Tai Hang Tong"},
["thw"] = {"Thudam"},
["thx"] = {"The"},
["tid"] = {"Tidong"},
["tie"] = {"Tingal"},
["tkk"] = {"Takpa"},
["tlw"] = {"South Wemale"},
["tmk"] = {"Northwestern Tamang"},
["tmp"] = {"Tai Mène"},
["tne"] = {"Tinoc Kallahan"},
["tnf"] = {"Tangshewi"},
["toe"] = {"Tomedes"},
["tpw"] = {"Tupí"},
["tsf"] = {"Southwestern Tamang"},
["unp"] = {"Worora"},
["uok"] = {"Uokha"},
["uun"] = {"Kulon-Pazeh"},
["vki"] = {"Ija-Zuba"},
["wgw"] = {"Wagawaga"},
["wit"] = {"Wintu"},
["wiw"] = {"Wirangu"},
["wra"] = {"Warapu"},
["wrd"] = {"Warduji"},
["wya"] = {"Wyandot"},
["xba"] = {"Kamba (Brazil)"},
["xbx"] = {"Kabixí"},
["xia"] = {"Xiandao"},
["xip"] = {"Xipináwa"},
["xkh"] = {"Karahawyana"},
["xrq"] = {"Karranga"},
["xss"] = {"Assan"},
["xtz"] = {"Tasmanian"},
["ybd"] = {"Yangbye"},
["yds"] = {"Yiddish Sign Language"},
["yen"] = {"Yendang"},
["yiy"] = {"Yir Yoront"},
["yma"] = {"Yamphe"},
["ymt"] = {"Mator-Taygi-Karagas"},
["ynh"] = {"Yangho"},
["yos"] = {"Yos"},
["yri"] = {"Yarí"},
["yuu"] = {"Yugh"},
["zir"] = {"Ziriya"},
["zkb"] = {"Koibal"},
["zua"] = {"Zeem"}
}
return {
active = active,
deprecated = deprecated,
}
d2b8387b798a45d93230d1c1b7b22a80714751a1
Module:Language/data/iana scripts
828
153
407
406
2023-10-17T20:36:09Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Language/data/iana_scripts]]
Scribunto
text/plain
-- File-Date: 2023-08-02
return {
["Adlm"] = {"Adlam"},
["Afak"] = {"Afaka"},
["Aghb"] = {"Caucasian Albanian"},
["Ahom"] = {"Ahom", "Tai Ahom"},
["Arab"] = {"Arabic"},
["Aran"] = {"Arabic (Nastaliq variant)"},
["Armi"] = {"Imperial Aramaic"},
["Armn"] = {"Armenian"},
["Avst"] = {"Avestan"},
["Bali"] = {"Balinese"},
["Bamu"] = {"Bamum"},
["Bass"] = {"Bassa Vah"},
["Batk"] = {"Batak"},
["Beng"] = {"Bengali", "Bangla"},
["Bhks"] = {"Bhaiksuki"},
["Blis"] = {"Blissymbols"},
["Bopo"] = {"Bopomofo"},
["Brah"] = {"Brahmi"},
["Brai"] = {"Braille"},
["Bugi"] = {"Buginese"},
["Buhd"] = {"Buhid"},
["Cakm"] = {"Chakma"},
["Cans"] = {"Unified Canadian Aboriginal Syllabics"},
["Cari"] = {"Carian"},
["Cham"] = {"Cham"},
["Cher"] = {"Cherokee"},
["Chrs"] = {"Chorasmian"},
["Cirt"] = {"Cirth"},
["Copt"] = {"Coptic"},
["Cpmn"] = {"Cypro-Minoan"},
["Cprt"] = {"Cypriot syllabary"},
["Cyrl"] = {"Cyrillic"},
["Cyrs"] = {"Cyrillic (Old Church Slavonic variant)"},
["Deva"] = {"Devanagari", "Nagari"},
["Diak"] = {"Dives Akuru"},
["Dogr"] = {"Dogra"},
["Dsrt"] = {"Deseret", "Mormon"},
["Dupl"] = {"Duployan shorthand", "Duployan stenography"},
["Egyd"] = {"Egyptian demotic"},
["Egyh"] = {"Egyptian hieratic"},
["Egyp"] = {"Egyptian hieroglyphs"},
["Elba"] = {"Elbasan"},
["Elym"] = {"Elymaic"},
["Ethi"] = {"Ethiopic", "Geʻez", "Ge'ez"},
["Geok"] = {"Khutsuri (Asomtavruli and Nuskhuri)"},
["Geor"] = {"Georgian (Mkhedruli and Mtavruli)"},
["Glag"] = {"Glagolitic"},
["Gong"] = {"Gunjala Gondi"},
["Gonm"] = {"Masaram Gondi"},
["Goth"] = {"Gothic"},
["Gran"] = {"Grantha"},
["Grek"] = {"Greek"},
["Gujr"] = {"Gujarati"},
["Guru"] = {"Gurmukhi"},
["Hanb"] = {"Han with Bopomofo (alias for Han + Bopomofo)"},
["Hang"] = {"Hangul", "Hangŭl", "Hangeul"},
["Hani"] = {"Han", "Hanzi", "Kanji", "Hanja"},
["Hano"] = {"Hanunoo", "Hanunóo"},
["Hans"] = {"Han (Simplified variant)"},
["Hant"] = {"Han (Traditional variant)"},
["Hatr"] = {"Hatran"},
["Hebr"] = {"Hebrew"},
["Hira"] = {"Hiragana"},
["Hluw"] = {"Anatolian Hieroglyphs", "Luwian Hieroglyphs", "Hittite Hieroglyphs"},
["Hmng"] = {"Pahawh Hmong"},
["Hmnp"] = {"Nyiakeng Puachue Hmong"},
["Hrkt"] = {"Japanese syllabaries (alias for Hiragana + Katakana)"},
["Hung"] = {"Old Hungarian", "Hungarian Runic"},
["Inds"] = {"Indus", "Harappan"},
["Ital"] = {"Old Italic (Etruscan, Oscan, etc.)"},
["Jamo"] = {"Jamo (alias for Jamo subset of Hangul)"},
["Java"] = {"Javanese"},
["Jpan"] = {"Japanese (alias for Han + Hiragana + Katakana)"},
["Jurc"] = {"Jurchen"},
["Kali"] = {"Kayah Li"},
["Kana"] = {"Katakana"},
["Kawi"] = {"Kawi"},
["Khar"] = {"Kharoshthi"},
["Khmr"] = {"Khmer"},
["Khoj"] = {"Khojki"},
["Kitl"] = {"Khitan large script"},
["Kits"] = {"Khitan small script"},
["Knda"] = {"Kannada"},
["Kore"] = {"Korean (alias for Hangul + Han)"},
["Kpel"] = {"Kpelle"},
["Kthi"] = {"Kaithi"},
["Lana"] = {"Tai Tham", "Lanna"},
["Laoo"] = {"Lao"},
["Latf"] = {"Latin (Fraktur variant)"},
["Latg"] = {"Latin (Gaelic variant)"},
["Latn"] = {"Latin"},
["Leke"] = {"Leke"},
["Lepc"] = {"Lepcha", "Róng"},
["Limb"] = {"Limbu"},
["Lina"] = {"Linear A"},
["Linb"] = {"Linear B"},
["Lisu"] = {"Lisu", "Fraser"},
["Loma"] = {"Loma"},
["Lyci"] = {"Lycian"},
["Lydi"] = {"Lydian"},
["Mahj"] = {"Mahajani"},
["Maka"] = {"Makasar"},
["Mand"] = {"Mandaic", "Mandaean"},
["Mani"] = {"Manichaean"},
["Marc"] = {"Marchen"},
["Maya"] = {"Mayan hieroglyphs"},
["Medf"] = {"Medefaidrin", "Oberi Okaime", "Oberi Ɔkaimɛ"},
["Mend"] = {"Mende Kikakui"},
["Merc"] = {"Meroitic Cursive"},
["Mero"] = {"Meroitic Hieroglyphs"},
["Mlym"] = {"Malayalam"},
["Modi"] = {"Modi", "Moḍī"},
["Mong"] = {"Mongolian"},
["Moon"] = {"Moon", "Moon code", "Moon script", "Moon type"},
["Mroo"] = {"Mro", "Mru"},
["Mtei"] = {"Meitei Mayek", "Meithei", "Meetei"},
["Mult"] = {"Multani"},
["Mymr"] = {"Myanmar", "Burmese"},
["Nagm"] = {"Nag Mundari"},
["Nand"] = {"Nandinagari"},
["Narb"] = {"Old North Arabian", "Ancient North Arabian"},
["Nbat"] = {"Nabataean"},
["Newa"] = {"Newa", "Newar", "Newari", "Nepāla lipi"},
["Nkdb"] = {"Naxi Dongba", "na²¹ɕi³³ to³³ba²¹", "Nakhi Tomba"},
["Nkgb"] = {"Naxi Geba", "na²¹ɕi³³ gʌ²¹ba²¹", "'Na-'Khi ²Ggŏ-¹baw", "Nakhi Geba"},
["Nkoo"] = {"N’Ko", "N'Ko"},
["Nshu"] = {"Nüshu"},
["Ogam"] = {"Ogham"},
["Olck"] = {"Ol Chiki", "Ol Cemet'", "Ol", "Santali"},
["Orkh"] = {"Old Turkic", "Orkhon Runic"},
["Orya"] = {"Oriya", "Odia"},
["Osge"] = {"Osage"},
["Osma"] = {"Osmanya"},
["Ougr"] = {"Old Uyghur"},
["Palm"] = {"Palmyrene"},
["Pauc"] = {"Pau Cin Hau"},
["Pcun"] = {"Proto-Cuneiform"},
["Pelm"] = {"Proto-Elamite"},
["Perm"] = {"Old Permic"},
["Phag"] = {"Phags-pa"},
["Phli"] = {"Inscriptional Pahlavi"},
["Phlp"] = {"Psalter Pahlavi"},
["Phlv"] = {"Book Pahlavi"},
["Phnx"] = {"Phoenician"},
["Piqd"] = {"Klingon (KLI pIqaD)"},
["Plrd"] = {"Miao", "Pollard"},
["Prti"] = {"Inscriptional Parthian"},
["Psin"] = {"Proto-Sinaitic"},
["Ranj"] = {"Ranjana"},
["Rjng"] = {"Rejang", "Redjang", "Kaganga"},
["Rohg"] = {"Hanifi Rohingya"},
["Roro"] = {"Rongorongo"},
["Runr"] = {"Runic"},
["Samr"] = {"Samaritan"},
["Sara"] = {"Sarati"},
["Sarb"] = {"Old South Arabian"},
["Saur"] = {"Saurashtra"},
["Sgnw"] = {"SignWriting"},
["Shaw"] = {"Shavian", "Shaw"},
["Shrd"] = {"Sharada", "Śāradā"},
["Shui"] = {"Shuishu"},
["Sidd"] = {"Siddham", "Siddhaṃ", "Siddhamātṛkā"},
["Sind"] = {"Khudawadi", "Sindhi"},
["Sinh"] = {"Sinhala"},
["Sogd"] = {"Sogdian"},
["Sogo"] = {"Old Sogdian"},
["Sora"] = {"Sora Sompeng"},
["Soyo"] = {"Soyombo"},
["Sund"] = {"Sundanese"},
["Sunu"] = {"Sunuwar"},
["Sylo"] = {"Syloti Nagri"},
["Syrc"] = {"Syriac"},
["Syre"] = {"Syriac (Estrangelo variant)"},
["Syrj"] = {"Syriac (Western variant)"},
["Syrn"] = {"Syriac (Eastern variant)"},
["Tagb"] = {"Tagbanwa"},
["Takr"] = {"Takri", "Ṭākrī", "Ṭāṅkrī"},
["Tale"] = {"Tai Le"},
["Talu"] = {"New Tai Lue"},
["Taml"] = {"Tamil"},
["Tang"] = {"Tangut"},
["Tavt"] = {"Tai Viet"},
["Telu"] = {"Telugu"},
["Teng"] = {"Tengwar"},
["Tfng"] = {"Tifinagh", "Berber"},
["Tglg"] = {"Tagalog", "Baybayin", "Alibata"},
["Thaa"] = {"Thaana"},
["Thai"] = {"Thai"},
["Tibt"] = {"Tibetan"},
["Tirh"] = {"Tirhuta"},
["Tnsa"] = {"Tangsa"},
["Toto"] = {"Toto"},
["Ugar"] = {"Ugaritic"},
["Vaii"] = {"Vai"},
["Visp"] = {"Visible Speech"},
["Vith"] = {"Vithkuqi"},
["Wara"] = {"Warang Citi", "Varang Kshiti"},
["Wcho"] = {"Wancho"},
["Wole"] = {"Woleai"},
["Xpeo"] = {"Old Persian"},
["Xsux"] = {"Sumero-Akkadian cuneiform"},
["Yezi"] = {"Yezidi"},
["Yiii"] = {"Yi"},
["Zanb"] = {"Zanabazar Square", "Zanabazarin Dörböljin Useg", "Xewtee Dörböljin Bicig", "Horizontal Square Script"},
["Zinh"] = {"Code for inherited script"},
["Zmth"] = {"Mathematical notation"},
["Zsye"] = {"Symbols (Emoji variant)"},
["Zsym"] = {"Symbols"},
["Zxxx"] = {"Code for unwritten documents"},
["Zyyy"] = {"Code for undetermined script"},
["Zzzz"] = {"Code for uncoded script"}
}
441e9d6e54b88bea137b8945819732a90106bd4d
Module:Language/data/iana regions
828
154
409
408
2023-10-17T20:36:09Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Language/data/iana_regions]]
Scribunto
text/plain
-- File-Date: 2023-08-02
return {
["AC"] = {"Ascension Island"},
["AD"] = {"Andorra"},
["AE"] = {"United Arab Emirates"},
["AF"] = {"Afghanistan"},
["AG"] = {"Antigua and Barbuda"},
["AI"] = {"Anguilla"},
["AL"] = {"Albania"},
["AM"] = {"Armenia"},
["AO"] = {"Angola"},
["AQ"] = {"Antarctica"},
["AR"] = {"Argentina"},
["AS"] = {"American Samoa"},
["AT"] = {"Austria"},
["AU"] = {"Australia"},
["AW"] = {"Aruba"},
["AX"] = {"Åland Islands"},
["AZ"] = {"Azerbaijan"},
["BA"] = {"Bosnia and Herzegovina"},
["BB"] = {"Barbados"},
["BD"] = {"Bangladesh"},
["BE"] = {"Belgium"},
["BF"] = {"Burkina Faso"},
["BG"] = {"Bulgaria"},
["BH"] = {"Bahrain"},
["BI"] = {"Burundi"},
["BJ"] = {"Benin"},
["BL"] = {"Saint Barthélemy"},
["BM"] = {"Bermuda"},
["BN"] = {"Brunei Darussalam"},
["BO"] = {"Bolivia"},
["BQ"] = {"Bonaire, Sint Eustatius and Saba"},
["BR"] = {"Brazil"},
["BS"] = {"Bahamas"},
["BT"] = {"Bhutan"},
["BV"] = {"Bouvet Island"},
["BW"] = {"Botswana"},
["BY"] = {"Belarus"},
["BZ"] = {"Belize"},
["CA"] = {"Canada"},
["CC"] = {"Cocos (Keeling) Islands"},
["CD"] = {"The Democratic Republic of the Congo"},
["CF"] = {"Central African Republic"},
["CG"] = {"Congo"},
["CH"] = {"Switzerland"},
["CI"] = {"Côte d'Ivoire"},
["CK"] = {"Cook Islands"},
["CL"] = {"Chile"},
["CM"] = {"Cameroon"},
["CN"] = {"China"},
["CO"] = {"Colombia"},
["CP"] = {"Clipperton Island"},
["CQ"] = {"Sark"},
["CR"] = {"Costa Rica"},
["CU"] = {"Cuba"},
["CV"] = {"Cabo Verde", "Cape Verde"},
["CW"] = {"Curaçao"},
["CX"] = {"Christmas Island"},
["CY"] = {"Cyprus"},
["CZ"] = {"Czechia", "Czech Republic"},
["DE"] = {"Germany"},
["DG"] = {"Diego Garcia"},
["DJ"] = {"Djibouti"},
["DK"] = {"Denmark"},
["DM"] = {"Dominica"},
["DO"] = {"Dominican Republic"},
["DZ"] = {"Algeria"},
["EA"] = {"Ceuta, Melilla"},
["EC"] = {"Ecuador"},
["EE"] = {"Estonia"},
["EG"] = {"Egypt"},
["EH"] = {"Western Sahara"},
["ER"] = {"Eritrea"},
["ES"] = {"Spain"},
["ET"] = {"Ethiopia"},
["EU"] = {"European Union"},
["EZ"] = {"Eurozone"},
["FI"] = {"Finland"},
["FJ"] = {"Fiji"},
["FK"] = {"Falkland Islands (Malvinas)"},
["FM"] = {"Federated States of Micronesia"},
["FO"] = {"Faroe Islands"},
["FR"] = {"France"},
["GA"] = {"Gabon"},
["GB"] = {"United Kingdom"},
["GD"] = {"Grenada"},
["GE"] = {"Georgia"},
["GF"] = {"French Guiana"},
["GG"] = {"Guernsey"},
["GH"] = {"Ghana"},
["GI"] = {"Gibraltar"},
["GL"] = {"Greenland"},
["GM"] = {"Gambia"},
["GN"] = {"Guinea"},
["GP"] = {"Guadeloupe"},
["GQ"] = {"Equatorial Guinea"},
["GR"] = {"Greece"},
["GS"] = {"South Georgia and the South Sandwich Islands"},
["GT"] = {"Guatemala"},
["GU"] = {"Guam"},
["GW"] = {"Guinea-Bissau"},
["GY"] = {"Guyana"},
["HK"] = {"Hong Kong"},
["HM"] = {"Heard Island and McDonald Islands"},
["HN"] = {"Honduras"},
["HR"] = {"Croatia"},
["HT"] = {"Haiti"},
["HU"] = {"Hungary"},
["IC"] = {"Canary Islands"},
["ID"] = {"Indonesia"},
["IE"] = {"Ireland"},
["IL"] = {"Israel"},
["IM"] = {"Isle of Man"},
["IN"] = {"India"},
["IO"] = {"British Indian Ocean Territory"},
["IQ"] = {"Iraq"},
["IR"] = {"Islamic Republic of Iran"},
["IS"] = {"Iceland"},
["IT"] = {"Italy"},
["JE"] = {"Jersey"},
["JM"] = {"Jamaica"},
["JO"] = {"Jordan"},
["JP"] = {"Japan"},
["KE"] = {"Kenya"},
["KG"] = {"Kyrgyzstan"},
["KH"] = {"Cambodia"},
["KI"] = {"Kiribati"},
["KM"] = {"Comoros"},
["KN"] = {"Saint Kitts and Nevis"},
["KP"] = {"Democratic People's Republic of Korea"},
["KR"] = {"Republic of Korea"},
["KW"] = {"Kuwait"},
["KY"] = {"Cayman Islands"},
["KZ"] = {"Kazakhstan"},
["LA"] = {"Lao People's Democratic Republic"},
["LB"] = {"Lebanon"},
["LC"] = {"Saint Lucia"},
["LI"] = {"Liechtenstein"},
["LK"] = {"Sri Lanka"},
["LR"] = {"Liberia"},
["LS"] = {"Lesotho"},
["LT"] = {"Lithuania"},
["LU"] = {"Luxembourg"},
["LV"] = {"Latvia"},
["LY"] = {"Libya"},
["MA"] = {"Morocco"},
["MC"] = {"Monaco"},
["MD"] = {"Moldova"},
["ME"] = {"Montenegro"},
["MF"] = {"Saint Martin (French part)"},
["MG"] = {"Madagascar"},
["MH"] = {"Marshall Islands"},
["MK"] = {"North Macedonia"},
["ML"] = {"Mali"},
["MM"] = {"Myanmar"},
["MN"] = {"Mongolia"},
["MO"] = {"Macao"},
["MP"] = {"Northern Mariana Islands"},
["MQ"] = {"Martinique"},
["MR"] = {"Mauritania"},
["MS"] = {"Montserrat"},
["MT"] = {"Malta"},
["MU"] = {"Mauritius"},
["MV"] = {"Maldives"},
["MW"] = {"Malawi"},
["MX"] = {"Mexico"},
["MY"] = {"Malaysia"},
["MZ"] = {"Mozambique"},
["NA"] = {"Namibia"},
["NC"] = {"New Caledonia"},
["NE"] = {"Niger"},
["NF"] = {"Norfolk Island"},
["NG"] = {"Nigeria"},
["NI"] = {"Nicaragua"},
["NL"] = {"Netherlands"},
["NO"] = {"Norway"},
["NP"] = {"Nepal"},
["NR"] = {"Nauru"},
["NU"] = {"Niue"},
["NZ"] = {"New Zealand"},
["OM"] = {"Oman"},
["PA"] = {"Panama"},
["PE"] = {"Peru"},
["PF"] = {"French Polynesia"},
["PG"] = {"Papua New Guinea"},
["PH"] = {"Philippines"},
["PK"] = {"Pakistan"},
["PL"] = {"Poland"},
["PM"] = {"Saint Pierre and Miquelon"},
["PN"] = {"Pitcairn"},
["PR"] = {"Puerto Rico"},
["PS"] = {"State of Palestine"},
["PT"] = {"Portugal"},
["PW"] = {"Palau"},
["PY"] = {"Paraguay"},
["QA"] = {"Qatar"},
["RE"] = {"Réunion"},
["RO"] = {"Romania"},
["RS"] = {"Serbia"},
["RU"] = {"Russian Federation"},
["RW"] = {"Rwanda"},
["SA"] = {"Saudi Arabia"},
["SB"] = {"Solomon Islands"},
["SC"] = {"Seychelles"},
["SD"] = {"Sudan"},
["SE"] = {"Sweden"},
["SG"] = {"Singapore"},
["SH"] = {"Saint Helena, Ascension and Tristan da Cunha"},
["SI"] = {"Slovenia"},
["SJ"] = {"Svalbard and Jan Mayen"},
["SK"] = {"Slovakia"},
["SL"] = {"Sierra Leone"},
["SM"] = {"San Marino"},
["SN"] = {"Senegal"},
["SO"] = {"Somalia"},
["SR"] = {"Suriname"},
["SS"] = {"South Sudan"},
["ST"] = {"Sao Tome and Principe"},
["SV"] = {"El Salvador"},
["SX"] = {"Sint Maarten (Dutch part)"},
["SY"] = {"Syrian Arab Republic"},
["SZ"] = {"Eswatini", "eSwatini", "Swaziland"},
["TA"] = {"Tristan da Cunha"},
["TC"] = {"Turks and Caicos Islands"},
["TD"] = {"Chad"},
["TF"] = {"French Southern Territories"},
["TG"] = {"Togo"},
["TH"] = {"Thailand"},
["TJ"] = {"Tajikistan"},
["TK"] = {"Tokelau"},
["TL"] = {"Timor-Leste"},
["TM"] = {"Turkmenistan"},
["TN"] = {"Tunisia"},
["TO"] = {"Tonga"},
["TR"] = {"Türkiye", "Turkey"},
["TT"] = {"Trinidad and Tobago"},
["TV"] = {"Tuvalu"},
["TW"] = {"Taiwan, Province of China"},
["TZ"] = {"United Republic of Tanzania"},
["UA"] = {"Ukraine"},
["UG"] = {"Uganda"},
["UM"] = {"United States Minor Outlying Islands"},
["UN"] = {"United Nations"},
["US"] = {"United States"},
["UY"] = {"Uruguay"},
["UZ"] = {"Uzbekistan"},
["VA"] = {"Holy See (Vatican City State)"},
["VC"] = {"Saint Vincent and the Grenadines"},
["VE"] = {"Venezuela"},
["VG"] = {"British Virgin Islands"},
["VI"] = {"U.S. Virgin Islands"},
["VN"] = {"Viet Nam"},
["VU"] = {"Vanuatu"},
["WF"] = {"Wallis and Futuna"},
["WS"] = {"Samoa"},
["YE"] = {"Yemen"},
["YT"] = {"Mayotte"},
["ZA"] = {"South Africa"},
["ZM"] = {"Zambia"},
["ZW"] = {"Zimbabwe"},
["001"] = {"World"},
["002"] = {"Africa"},
["003"] = {"North America"},
["005"] = {"South America"},
["009"] = {"Oceania"},
["011"] = {"Western Africa"},
["013"] = {"Central America"},
["014"] = {"Eastern Africa"},
["015"] = {"Northern Africa"},
["017"] = {"Middle Africa"},
["018"] = {"Southern Africa"},
["019"] = {"Americas"},
["021"] = {"Northern America"},
["029"] = {"Caribbean"},
["030"] = {"Eastern Asia"},
["034"] = {"Southern Asia"},
["035"] = {"South-Eastern Asia"},
["039"] = {"Southern Europe"},
["053"] = {"Australia and New Zealand"},
["054"] = {"Melanesia"},
["057"] = {"Micronesia"},
["061"] = {"Polynesia"},
["142"] = {"Asia"},
["143"] = {"Central Asia"},
["145"] = {"Western Asia"},
["150"] = {"Europe"},
["151"] = {"Eastern Europe"},
["154"] = {"Northern Europe"},
["155"] = {"Western Europe"},
["202"] = {"Sub-Saharan Africa"},
["419"] = {"Latin America and the Caribbean"}
}
08de6963e81994fd00a9f7b5a76b5ed63c543989
Module:Language/data/iana variants
828
155
411
410
2023-10-17T20:36:09Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Language/data/iana_variants]]
Scribunto
text/plain
-- File-Date: 2023-08-02
return {
["1606nict"] = {
["descriptions"] = {"Late Middle French (to 1606)"},
["prefixes"] = {"frm"},
},
["1694acad"] = {
["descriptions"] = {"Early Modern French"},
["prefixes"] = {"fr"},
},
["1901"] = {
["descriptions"] = {"Traditional German orthography"},
["prefixes"] = {"de"},
},
["1959acad"] = {
["descriptions"] = {"\"Academic\" (\"governmental\") variant of Belarusian as codified in 1959"},
["prefixes"] = {"be"},
},
["1994"] = {
["descriptions"] = {"Standardized Resian orthography"},
["prefixes"] = {"sl-rozaj", "sl-rozaj-biske", "sl-rozaj-njiva", "sl-rozaj-osojs", "sl-rozaj-solba"},
},
["1996"] = {
["descriptions"] = {"German orthography of 1996"},
["prefixes"] = {"de"},
},
["abl1943"] = {
["descriptions"] = {"Orthographic formulation of 1943 - Official in Brazil (Formulário Ortográfico de 1943 - Oficial no Brasil)"},
["prefixes"] = {"pt-br"},
},
["akuapem"] = {
["descriptions"] = {"Akuapem Twi"},
["prefixes"] = {"tw"},
},
["alalc97"] = {
["descriptions"] = {"ALA-LC Romanization, 1997 edition"},
["prefixes"] = {},
},
["aluku"] = {
["descriptions"] = {"Aluku dialect", "Boni dialect"},
["prefixes"] = {"djk"},
},
["ao1990"] = {
["descriptions"] = {"Portuguese Language Orthographic Agreement of 1990 (Acordo Ortográfico da Língua Portuguesa de 1990)"},
["prefixes"] = {"pt", "gl"},
},
["aranes"] = {
["descriptions"] = {"Aranese"},
["prefixes"] = {"oc"},
},
["arkaika"] = {
["descriptions"] = {"Arcaicam Esperantom", "Arkaika Esperanto"},
["prefixes"] = {"eo"},
},
["asante"] = {
["descriptions"] = {"Asante Twi", "Ashanti Twi"},
["prefixes"] = {"tw"},
},
["auvern"] = {
["descriptions"] = {"Auvergnat"},
["prefixes"] = {"oc"},
},
["baku1926"] = {
["descriptions"] = {"Unified Turkic Latin Alphabet (Historical)"},
["prefixes"] = {"az", "ba", "crh", "kk", "krc", "ky", "sah", "tk", "tt", "uz"},
},
["balanka"] = {
["descriptions"] = {"The Balanka dialect of Anii"},
["prefixes"] = {"blo"},
},
["barla"] = {
["descriptions"] = {"The Barlavento dialect group of Kabuverdianu"},
["prefixes"] = {"kea"},
},
["basiceng"] = {
["descriptions"] = {"Basic English"},
["prefixes"] = {"en"},
},
["bauddha"] = {
["descriptions"] = {"Buddhist Hybrid Sanskrit"},
["prefixes"] = {"sa"},
},
["bciav"] = {
["descriptions"] = {"BCI Blissymbolics AV"},
["prefixes"] = {"zbl"},
},
["bcizbl"] = {
["descriptions"] = {"BCI Blissymbolics"},
["prefixes"] = {"zbl"},
},
["biscayan"] = {
["descriptions"] = {"Biscayan dialect of Basque"},
["prefixes"] = {"eu"},
},
["biske"] = {
["descriptions"] = {"The San Giorgio dialect of Resian", "The Bila dialect of Resian"},
["prefixes"] = {"sl-rozaj"},
},
["blasl"] = {
["descriptions"] = {"Black American Sign Language dialect"},
["prefixes"] = {"ase", "sgn-ase"},
},
["bohoric"] = {
["descriptions"] = {"Slovene in Bohorič alphabet"},
["prefixes"] = {"sl"},
},
["boont"] = {
["descriptions"] = {"Boontling"},
["prefixes"] = {"en"},
},
["bornholm"] = {
["descriptions"] = {"Bornholmsk"},
["prefixes"] = {"da"},
},
["cisaup"] = {
["descriptions"] = {"Cisalpine"},
["prefixes"] = {"oc"},
},
["colb1945"] = {
["descriptions"] = {"Portuguese-Brazilian Orthographic Convention of 1945 (Convenção Ortográfica Luso-Brasileira de 1945)"},
["prefixes"] = {"pt"},
},
["cornu"] = {
["descriptions"] = {"Cornu-English", "Cornish English", "Anglo-Cornish"},
["prefixes"] = {"en"},
},
["creiss"] = {
["descriptions"] = {"Occitan variants of the Croissant area"},
["prefixes"] = {"oc"},
},
["dajnko"] = {
["descriptions"] = {"Slovene in Dajnko alphabet"},
["prefixes"] = {"sl"},
},
["ekavsk"] = {
["descriptions"] = {"Serbian with Ekavian pronunciation"},
["prefixes"] = {"sr", "sr-latn", "sr-cyrl"},
},
["emodeng"] = {
["descriptions"] = {"Early Modern English (1500-1700)"},
["prefixes"] = {"en"},
},
["fonipa"] = {
["descriptions"] = {"International Phonetic Alphabet"},
["prefixes"] = {},
},
["fonkirsh"] = {
["descriptions"] = {"Kirshenbaum Phonetic Alphabet"},
["prefixes"] = {},
},
["fonnapa"] = {
["descriptions"] = {"North American Phonetic Alphabet", "Americanist Phonetic Notation"},
["prefixes"] = {},
},
["fonupa"] = {
["descriptions"] = {"Uralic Phonetic Alphabet"},
["prefixes"] = {},
},
["fonxsamp"] = {
["descriptions"] = {"X-SAMPA transcription"},
["prefixes"] = {},
},
["gallo"] = {
["descriptions"] = {"Gallo"},
["prefixes"] = {"fr"},
},
["gascon"] = {
["descriptions"] = {"Gascon"},
["prefixes"] = {"oc"},
},
["grclass"] = {
["descriptions"] = {"Classical Occitan orthography"},
["prefixes"] = {"oc", "oc-aranes", "oc-auvern", "oc-cisaup", "oc-creiss", "oc-gascon", "oc-lemosin", "oc-lengadoc", "oc-nicard", "oc-provenc", "oc-vivaraup"},
},
["grital"] = {
["descriptions"] = {"Italian-inspired Occitan orthography"},
["prefixes"] = {"oc", "oc-cisaup", "oc-nicard", "oc-provenc"},
},
["grmistr"] = {
["descriptions"] = {"Mistralian or Mistralian-inspired Occitan orthography"},
["prefixes"] = {"oc", "oc-aranes", "oc-auvern", "oc-cisaup", "oc-creiss", "oc-gascon", "oc-lemosin", "oc-lengadoc", "oc-nicard", "oc-provenc", "oc-vivaraup"},
},
["hepburn"] = {
["descriptions"] = {"Hepburn romanization"},
["prefixes"] = {"ja-latn"},
},
["hognorsk"] = {
["descriptions"] = {"Norwegian in Høgnorsk (High Norwegian) orthography"},
["prefixes"] = {"nn"},
},
["hsistemo"] = {
["descriptions"] = {"Standard H-system orthographic fallback for spelling Esperanto"},
["prefixes"] = {"eo"},
},
["ijekavsk"] = {
["descriptions"] = {"Serbian with Ijekavian pronunciation"},
["prefixes"] = {"sr", "sr-latn", "sr-cyrl"},
},
["itihasa"] = {
["descriptions"] = {"Epic Sanskrit"},
["prefixes"] = {"sa"},
},
["ivanchov"] = {
["descriptions"] = {"Bulgarian in 1899 orthography"},
["prefixes"] = {"bg"},
},
["jauer"] = {
["descriptions"] = {"Jauer dialect of Romansh"},
["prefixes"] = {"rm"},
},
["jyutping"] = {
["descriptions"] = {"Jyutping Cantonese Romanization"},
["prefixes"] = {"yue"},
},
["kkcor"] = {
["descriptions"] = {"Common Cornish orthography of Revived Cornish"},
["prefixes"] = {"kw"},
},
["kociewie"] = {
["descriptions"] = {"The Kociewie dialect of Polish"},
["prefixes"] = {"pl"},
},
["kscor"] = {
["descriptions"] = {"Standard Cornish orthography of Revived Cornish", "Kernowek Standard"},
["prefixes"] = {"kw"},
},
["laukika"] = {
["descriptions"] = {"Classical Sanskrit"},
["prefixes"] = {"sa"},
},
["lemosin"] = {
["descriptions"] = {"Limousin"},
["prefixes"] = {"oc"},
},
["lengadoc"] = {
["descriptions"] = {"Languedocien"},
["prefixes"] = {"oc"},
},
["lipaw"] = {
["descriptions"] = {"The Lipovaz dialect of Resian", "The Lipovec dialect of Resian"},
["prefixes"] = {"sl-rozaj"},
},
["ltg1929"] = {
["descriptions"] = {"The Latgalian language orthography codified in 1929"},
["prefixes"] = {"ltg"},
},
["ltg2007"] = {
["descriptions"] = {"The Latgalian language orthography codified in the language law in 2007"},
["prefixes"] = {"ltg"},
},
["luna1918"] = {
["descriptions"] = {"Post-1917 Russian orthography"},
["prefixes"] = {"ru"},
},
["metelko"] = {
["descriptions"] = {"Slovene in Metelko alphabet"},
["prefixes"] = {"sl"},
},
["monoton"] = {
["descriptions"] = {"Monotonic Greek"},
["prefixes"] = {"el"},
},
["ndyuka"] = {
["descriptions"] = {"Ndyuka dialect", "Aukan dialect"},
["prefixes"] = {"djk"},
},
["nedis"] = {
["descriptions"] = {"Natisone dialect", "Nadiza dialect"},
["prefixes"] = {"sl"},
},
["newfound"] = {
["descriptions"] = {"Newfoundland English"},
["prefixes"] = {"en-ca"},
},
["nicard"] = {
["descriptions"] = {"Niçard"},
["prefixes"] = {"oc"},
},
["njiva"] = {
["descriptions"] = {"The Gniva dialect of Resian", "The Njiva dialect of Resian"},
["prefixes"] = {"sl-rozaj"},
},
["nulik"] = {
["descriptions"] = {"Volapük nulik", "Volapük perevidöl", "Volapük nulädik", "de Jong's Volapük", "New Volapük", "Revised Volapük", "Modern Volapük"},
["prefixes"] = {"vo"},
},
["osojs"] = {
["descriptions"] = {"The Oseacco dialect of Resian", "The Osojane dialect of Resian"},
["prefixes"] = {"sl-rozaj"},
},
["oxendict"] = {
["descriptions"] = {"Oxford English Dictionary spelling"},
["prefixes"] = {"en"},
},
["pahawh2"] = {
["descriptions"] = {"Pahawh Hmong Second Stage Reduced orthography"},
["prefixes"] = {"mww", "hnj"},
},
["pahawh3"] = {
["descriptions"] = {"Pahawh Hmong Third Stage Reduced orthography"},
["prefixes"] = {"mww", "hnj"},
},
["pahawh4"] = {
["descriptions"] = {"Pahawh Hmong Final Version orthography"},
["prefixes"] = {"mww", "hnj"},
},
["pamaka"] = {
["descriptions"] = {"Pamaka dialect"},
["prefixes"] = {"djk"},
},
["peano"] = {
["descriptions"] = {"Latino Sine Flexione", "Interlingua de API", "Interlingua de Peano"},
["prefixes"] = {"la"},
},
["petr1708"] = {
["descriptions"] = {"Petrine orthography"},
["prefixes"] = {"ru"},
},
["pinyin"] = {
["descriptions"] = {"Pinyin romanization"},
["prefixes"] = {"zh-latn", "bo-latn"},
},
["polyton"] = {
["descriptions"] = {"Polytonic Greek"},
["prefixes"] = {"el"},
},
["provenc"] = {
["descriptions"] = {"Provençal"},
["prefixes"] = {"oc"},
},
["puter"] = {
["descriptions"] = {"Puter idiom of Romansh"},
["prefixes"] = {"rm"},
},
["rigik"] = {
["descriptions"] = {"Volapük rigik", "Schleyer's Volapük", "Original Volapük", "Classic Volapük"},
["prefixes"] = {"vo"},
},
["rozaj"] = {
["descriptions"] = {"Resian", "Resianic", "Rezijan"},
["prefixes"] = {"sl"},
},
["rumgr"] = {
["descriptions"] = {"Rumantsch Grischun"},
["prefixes"] = {"rm"},
},
["scotland"] = {
["descriptions"] = {"Scottish Standard English"},
["prefixes"] = {"en"},
},
["scouse"] = {
["descriptions"] = {"Scouse"},
["prefixes"] = {"en"},
},
["simple"] = {
["descriptions"] = {"Simplified form"},
["prefixes"] = {},
},
["solba"] = {
["descriptions"] = {"The Stolvizza dialect of Resian", "The Solbica dialect of Resian"},
["prefixes"] = {"sl-rozaj"},
},
["sotav"] = {
["descriptions"] = {"The Sotavento dialect group of Kabuverdianu"},
["prefixes"] = {"kea"},
},
["spanglis"] = {
["descriptions"] = {"Spanglish"},
["prefixes"] = {"en", "es"},
},
["surmiran"] = {
["descriptions"] = {"Surmiran idiom of Romansh"},
["prefixes"] = {"rm"},
},
["sursilv"] = {
["descriptions"] = {"Sursilvan idiom of Romansh"},
["prefixes"] = {"rm"},
},
["sutsilv"] = {
["descriptions"] = {"Sutsilvan idiom of Romansh"},
["prefixes"] = {"rm"},
},
["synnejyl"] = {
["descriptions"] = {"Synnejysk", "South Jutish"},
["prefixes"] = {"da"},
},
["tarask"] = {
["descriptions"] = {"Belarusian in Taraskievica orthography"},
["prefixes"] = {"be"},
},
["tongyong"] = {
["descriptions"] = {"Tongyong Pinyin romanization"},
["prefixes"] = {"zh-latn"},
},
["tunumiit"] = {
["descriptions"] = {"Tunumiisiut", "East Greenlandic", "Østgrønlandsk"},
["prefixes"] = {"kl"},
},
["uccor"] = {
["descriptions"] = {"Unified Cornish orthography of Revived Cornish"},
["prefixes"] = {"kw"},
},
["ucrcor"] = {
["descriptions"] = {"Unified Cornish Revised orthography of Revived Cornish"},
["prefixes"] = {"kw"},
},
["ulster"] = {
["descriptions"] = {"Ulster dialect of Scots"},
["prefixes"] = {"sco"},
},
["unifon"] = {
["descriptions"] = {"Unifon phonetic alphabet"},
["prefixes"] = {"en", "hup", "kyh", "tol", "yur"},
},
["vaidika"] = {
["descriptions"] = {"Vedic Sanskrit"},
["prefixes"] = {"sa"},
},
["valencia"] = {
["descriptions"] = {"Valencian"},
["prefixes"] = {"ca"},
},
["vallader"] = {
["descriptions"] = {"Vallader idiom of Romansh"},
["prefixes"] = {"rm"},
},
["vecdruka"] = {
["descriptions"] = {"Latvian orthography used before 1920s (\"vecā druka\")"},
["prefixes"] = {"lv"},
},
["vivaraup"] = {
["descriptions"] = {"Vivaro-Alpine"},
["prefixes"] = {"oc"},
},
["wadegile"] = {
["descriptions"] = {"Wade-Giles romanization"},
["prefixes"] = {"zh-latn"},
},
["xsistemo"] = {
["descriptions"] = {"Standard X-system orthographic fallback for spelling Esperanto"},
["prefixes"] = {"eo"},
}
}
36f89cd82969f3b0f948034eba0fa2c149ee65c2
Module:Language/data/iana suppressed scripts
828
156
413
412
2023-10-17T20:36:10Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Language/data/iana_suppressed_scripts]]
Scribunto
text/plain
-- File-Date: 2023-08-02
return {
["Arab"] = {"ar", "fa", "ps", "ur"},
["Armn"] = {"hy"},
["Beng"] = {"as", "bn"},
["Blis"] = {"zbl"},
["Cyrl"] = {"ab", "be", "bg", "kk", "mk", "ru", "uk"},
["Deva"] = {"hi", "mr", "ne", "kok", "mai"},
["Ethi"] = {"am", "ti"},
["Geor"] = {"ka"},
["Grek"] = {"el"},
["Gujr"] = {"gu"},
["Guru"] = {"pa"},
["Hebr"] = {"he", "iw", "yi"},
["Jpan"] = {"ja"},
["Khmr"] = {"km"},
["Knda"] = {"kn"},
["Kore"] = {"ko"},
["Laoo"] = {"lo"},
["Latn"] = {"af", "ay", "bs", "ca", "ch", "cs", "cy", "da", "de", "en", "eo",
"es", "et", "eu", "fi", "fj", "fo", "fr", "fy", "ga", "gl", "gn",
"gv", "hr", "ht", "hu", "id", "in", "is", "it", "kl", "la", "lb",
"ln", "lt", "lv", "mg", "mh", "mo", "ms", "mt", "na", "nb", "nd",
"nl", "nn", "no", "nr", "ny", "om", "pl", "pt", "qu", "rm", "rn",
"ro", "rw", "sg", "sk", "sl", "sm", "so", "sq", "ss", "st", "sv",
"sw", "tl", "tn", "to", "tr", "ts", "ve", "vi", "xh", "zu", "dsb",
"frr", "frs", "gsw", "hsb", "men", "nds", "niu", "nso", "tem", "tkl", "tmh",
"tpi", "tvl"},
["Mlym"] = {"ml"},
["Mymr"] = {"my"},
["Nkoo"] = {"nqo"},
["Orya"] = {"or"},
["Sinh"] = {"si"},
["Taml"] = {"ta"},
["Telu"] = {"te"},
["Thaa"] = {"dv"},
["Thai"] = {"th"},
["Tibt"] = {"dz"}
}
e2c364560ccc050dacdd276ebab1758584b937ad
Module:Lang/ISO 639 synonyms
828
157
415
414
2023-10-17T20:36:10Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Lang/ISO_639_synonyms]]
Scribunto
text/plain
-- File-Date: 2013-01-11
return {
["aar"] = "aa",
["abk"] = "ab",
["afr"] = "af",
["aka"] = "ak",
["amh"] = "am",
["ara"] = "ar",
["arg"] = "an",
["asm"] = "as",
["ava"] = "av",
["ave"] = "ae",
["aym"] = "ay",
["aze"] = "az",
["bak"] = "ba",
["bam"] = "bm",
["bel"] = "be",
["ben"] = "bn",
["bih"] = "bh",
["bis"] = "bi",
["bod"] = "bo",
["bos"] = "bs",
["bre"] = "br",
["bul"] = "bg",
["cat"] = "ca",
["ces"] = "cs",
["cha"] = "ch",
["che"] = "ce",
["chu"] = "cu",
["chv"] = "cv",
["cor"] = "kw",
["cos"] = "co",
["cre"] = "cr",
["cym"] = "cy",
["dan"] = "da",
["deu"] = "de",
["div"] = "dv",
["dzo"] = "dz",
["ell"] = "el",
["eng"] = "en",
["epo"] = "eo",
["est"] = "et",
["eus"] = "eu",
["ewe"] = "ee",
["fao"] = "fo",
["fas"] = "fa",
["fij"] = "fj",
["fin"] = "fi",
["fra"] = "fr",
["fry"] = "fy",
["ful"] = "ff",
["gla"] = "gd",
["gle"] = "ga",
["glg"] = "gl",
["glv"] = "gv",
["grn"] = "gn",
["guj"] = "gu",
["hat"] = "ht",
["hau"] = "ha",
["heb"] = "he",
["her"] = "hz",
["hin"] = "hi",
["hmo"] = "ho",
["hrv"] = "hr",
["hun"] = "hu",
["hye"] = "hy",
["ibo"] = "ig",
["ido"] = "io",
["iii"] = "ii",
["iku"] = "iu",
["ile"] = "ie",
["ina"] = "ia",
["ind"] = "id",
["ipk"] = "ik",
["isl"] = "is",
["ita"] = "it",
["jav"] = "jv",
["jpn"] = "ja",
["kal"] = "kl",
["kan"] = "kn",
["kas"] = "ks",
["kat"] = "ka",
["kau"] = "kr",
["kaz"] = "kk",
["khm"] = "km",
["kik"] = "ki",
["kin"] = "rw",
["kir"] = "ky",
["kom"] = "kv",
["kon"] = "kg",
["kor"] = "ko",
["kua"] = "kj",
["kur"] = "ku",
["lao"] = "lo",
["lat"] = "la",
["lav"] = "lv",
["lim"] = "li",
["lin"] = "ln",
["lit"] = "lt",
["ltz"] = "lb",
["lub"] = "lu",
["lug"] = "lg",
["mah"] = "mh",
["mal"] = "ml",
["mar"] = "mr",
["mkd"] = "mk",
["mlg"] = "mg",
["mlt"] = "mt",
["mon"] = "mn",
["mri"] = "mi",
["msa"] = "ms",
["mya"] = "my",
["nau"] = "na",
["nav"] = "nv",
["nbl"] = "nr",
["nde"] = "nd",
["ndo"] = "ng",
["nep"] = "ne",
["nld"] = "nl",
["nno"] = "nn",
["nob"] = "nb",
["nor"] = "no",
["nya"] = "ny",
["oci"] = "oc",
["oji"] = "oj",
["ori"] = "or",
["orm"] = "om",
["oss"] = "os",
["pan"] = "pa",
["pli"] = "pi",
["pol"] = "pl",
["por"] = "pt",
["pus"] = "ps",
["que"] = "qu",
["roh"] = "rm",
["ron"] = "ro",
["run"] = "rn",
["rus"] = "ru",
["sag"] = "sg",
["san"] = "sa",
["sin"] = "si",
["slk"] = "sk",
["slv"] = "sl",
["sme"] = "se",
["smo"] = "sm",
["sna"] = "sn",
["snd"] = "sd",
["som"] = "so",
["sot"] = "st",
["spa"] = "es",
["sqi"] = "sq",
["srd"] = "sc",
["srp"] = "sr",
["ssw"] = "ss",
["sun"] = "su",
["swa"] = "sw",
["swe"] = "sv",
["tah"] = "ty",
["tam"] = "ta",
["tat"] = "tt",
["tel"] = "te",
["tgk"] = "tg",
["tgl"] = "tl",
["tha"] = "th",
["tir"] = "ti",
["ton"] = "to",
["tsn"] = "tn",
["tso"] = "ts",
["tuk"] = "tk",
["tur"] = "tr",
["twi"] = "tw",
["uig"] = "ug",
["ukr"] = "uk",
["urd"] = "ur",
["uzb"] = "uz",
["ven"] = "ve",
["vie"] = "vi",
["vol"] = "vo",
["wln"] = "wa",
["wol"] = "wo",
["xho"] = "xh",
["yid"] = "yi",
["yor"] = "yo",
["zha"] = "za",
["zho"] = "zh",
["zul"] = "zu"
}
f3fb5374c9e0fdef6ce6ea22736b79468358ca19
Module:Citation/CS1
828
158
417
416
2023-10-17T20:36:13Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Citation/CS1]]
Scribunto
text/plain
require ('strict');
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
each of these counts against the Lua upvalue limit
]]
local validation; -- functions in Module:Citation/CS1/Date_validation
local utilities; -- functions in Module:Citation/CS1/Utilities
local z = {}; -- table of tables in Module:Citation/CS1/Utilities
local identifiers; -- functions and tables in Module:Citation/CS1/Identifiers
local metadata; -- functions in Module:Citation/CS1/COinS
local cfg = {}; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
local whitelist = {}; -- table of tables listing valid template parameter names; defined in Module:Citation/CS1/Whitelist
--[[------------------< P A G E S C O P E V A R I A B L E S >---------------
declare variables here that have page-wide scope that are not brought in from
other modules; that are created here and used here
]]
local added_deprecated_cat; -- Boolean flag so that the category is added only once
local added_vanc_errs; -- Boolean flag so we only emit one Vancouver error / category
local added_generic_name_errs; -- Boolean flag so we only emit one generic name error / category and stop testing names once an error is encountered
local Frame; -- holds the module's frame table
local is_preview_mode; -- true when article is in preview mode; false when using 'Preview page with this template' (previewing the module)
local is_sandbox; -- true when using sandbox modules to render citation
--[[--------------------------< F I R S T _ S E T >------------------------------------------------------------
Locates and returns the first set value in a table of values where the order established in the table,
left-to-right (or top-to-bottom), is the order in which the values are evaluated. Returns nil if none are set.
This version replaces the original 'for _, val in pairs do' and a similar version that used ipairs. With the pairs
version the order of evaluation could not be guaranteed. With the ipairs version, a nil value would terminate
the for-loop before it reached the actual end of the list.
]]
local function first_set (list, count)
local i = 1;
while i <= count do -- loop through all items in list
if utilities.is_set( list[i] ) then
return list[i]; -- return the first set list member
end
i = i + 1; -- point to next
end
end
--[[--------------------------< A D D _ V A N C _ E R R O R >----------------------------------------------------
Adds a single Vancouver system error message to the template's output regardless of how many error actually exist.
To prevent duplication, added_vanc_errs is nil until an error message is emitted.
added_vanc_errs is a Boolean declared in page scope variables above
]]
local function add_vanc_error (source, position)
if added_vanc_errs then return end
added_vanc_errs = true; -- note that we've added this category
utilities.set_message ('err_vancouver', {source, position});
end
--[[--------------------------< I S _ S C H E M E >------------------------------------------------------------
does this thing that purports to be a URI scheme seem to be a valid scheme? The scheme is checked to see if it
is in agreement with http://tools.ietf.org/html/std66#section-3.1 which says:
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-").
returns true if it does, else false
]]
local function is_scheme (scheme)
return scheme and scheme:match ('^%a[%a%d%+%.%-]*:'); -- true if scheme is set and matches the pattern
end
--[=[-------------------------< I S _ D O M A I N _ N A M E >--------------------------------------------------
Does this thing that purports to be a domain name seem to be a valid domain name?
Syntax defined here: http://tools.ietf.org/html/rfc1034#section-3.5
BNF defined here: https://tools.ietf.org/html/rfc4234
Single character names are generally reserved; see https://tools.ietf.org/html/draft-ietf-dnsind-iana-dns-01#page-15;
see also [[Single-letter second-level domain]]
list of TLDs: https://www.iana.org/domains/root/db
RFC 952 (modified by RFC 1123) requires the first and last character of a hostname to be a letter or a digit. Between
the first and last characters the name may use letters, digits, and the hyphen.
Also allowed are IPv4 addresses. IPv6 not supported
domain is expected to be stripped of any path so that the last character in the last character of the TLD. tld
is two or more alpha characters. Any preceding '//' (from splitting a URL with a scheme) will be stripped
here. Perhaps not necessary but retained in case it is necessary for IPv4 dot decimal.
There are several tests:
the first character of the whole domain name including subdomains must be a letter or a digit
internationalized domain name (ASCII characters with .xn-- ASCII Compatible Encoding (ACE) prefix xn-- in the TLD) see https://tools.ietf.org/html/rfc3490
single-letter/digit second-level domains in the .org, .cash, and .today TLDs
q, x, and z SL domains in the .com TLD
i and q SL domains in the .net TLD
single-letter SL domains in the ccTLDs (where the ccTLD is two letters)
two-character SL domains in gTLDs (where the gTLD is two or more letters)
three-plus-character SL domains in gTLDs (where the gTLD is two or more letters)
IPv4 dot-decimal address format; TLD not allowed
returns true if domain appears to be a proper name and TLD or IPv4 address, else false
]=]
local function is_domain_name (domain)
if not domain then
return false; -- if not set, abandon
end
domain = domain:gsub ('^//', ''); -- strip '//' from domain name if present; done here so we only have to do it once
if not domain:match ('^[%w]') then -- first character must be letter or digit
return false;
end
if domain:match ('^%a+:') then -- hack to detect things that look like s:Page:Title where Page: is namespace at Wikisource
return false;
end
local patterns = { -- patterns that look like URLs
'%f[%w][%w][%w%-]+[%w]%.%a%a+$', -- three or more character hostname.hostname or hostname.tld
'%f[%w][%w][%w%-]+[%w]%.xn%-%-[%w]+$', -- internationalized domain name with ACE prefix
'%f[%a][qxz]%.com$', -- assigned one character .com hostname (x.com times out 2015-12-10)
'%f[%a][iq]%.net$', -- assigned one character .net hostname (q.net registered but not active 2015-12-10)
'%f[%w][%w]%.%a%a$', -- one character hostname and ccTLD (2 chars)
'%f[%w][%w][%w]%.%a%a+$', -- two character hostname and TLD
'^%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?', -- IPv4 address
}
for _, pattern in ipairs (patterns) do -- loop through the patterns list
if domain:match (pattern) then
return true; -- if a match then we think that this thing that purports to be a URL is a URL
end
end
for _, d in ipairs (cfg.single_letter_2nd_lvl_domains_t) do -- look for single letter second level domain names for these top level domains
if domain:match ('%f[%w][%w]%.' .. d) then
return true
end
end
return false; -- no matches, we don't know what this thing is
end
--[[--------------------------< I S _ U R L >------------------------------------------------------------------
returns true if the scheme and domain parts of a URL appear to be a valid URL; else false.
This function is the last step in the validation process. This function is separate because there are cases that
are not covered by split_url(), for example is_parameter_ext_wikilink() which is looking for bracketted external
wikilinks.
]]
local function is_url (scheme, domain)
if utilities.is_set (scheme) then -- if scheme is set check it and domain
return is_scheme (scheme) and is_domain_name (domain);
else
return is_domain_name (domain); -- scheme not set when URL is protocol-relative
end
end
--[[--------------------------< S P L I T _ U R L >------------------------------------------------------------
Split a URL into a scheme, authority indicator, and domain.
First remove Fully Qualified Domain Name terminator (a dot following TLD) (if any) and any path(/), query(?) or fragment(#).
If protocol-relative URL, return nil scheme and domain else return nil for both scheme and domain.
When not protocol-relative, get scheme, authority indicator, and domain. If there is an authority indicator (one
or more '/' characters immediately following the scheme's colon), make sure that there are only 2.
Any URL that does not have news: scheme must have authority indicator (//). TODO: are there other common schemes
like news: that don't use authority indicator?
Strip off any port and path;
]]
local function split_url (url_str)
local scheme, authority, domain;
url_str = url_str:gsub ('([%a%d])%.?[/%?#].*$', '%1'); -- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of '//')
if url_str:match ('^//%S*') then -- if there is what appears to be a protocol-relative URL
domain = url_str:match ('^//(%S*)')
elseif url_str:match ('%S-:/*%S+') then -- if there is what appears to be a scheme, optional authority indicator, and domain name
scheme, authority, domain = url_str:match ('(%S-:)(/*)(%S+)'); -- extract the scheme, authority indicator, and domain portions
if utilities.is_set (authority) then
authority = authority:gsub ('//', '', 1); -- replace place 1 pair of '/' with nothing;
if utilities.is_set(authority) then -- if anything left (1 or 3+ '/' where authority should be) then
return scheme; -- return scheme only making domain nil which will cause an error message
end
else
if not scheme:match ('^news:') then -- except for news:..., MediaWiki won't link URLs that do not have authority indicator; TODO: a better way to do this test?
return scheme; -- return scheme only making domain nil which will cause an error message
end
end
domain = domain:gsub ('(%a):%d+', '%1'); -- strip port number if present
end
return scheme, domain;
end
--[[--------------------------< L I N K _ P A R A M _ O K >---------------------------------------------------
checks the content of |title-link=, |series-link=, |author-link=, etc. for properly formatted content: no wikilinks, no URLs
Link parameters are to hold the title of a Wikipedia article, so none of the WP:TITLESPECIALCHARACTERS are allowed:
# < > [ ] | { } _
except the underscore which is used as a space in wiki URLs and # which is used for section links
returns false when the value contains any of these characters.
When there are no illegal characters, this function returns TRUE if value DOES NOT appear to be a valid URL (the
|<param>-link= parameter is ok); else false when value appears to be a valid URL (the |<param>-link= parameter is NOT ok).
]]
local function link_param_ok (value)
local scheme, domain;
if value:find ('[<>%[%]|{}]') then -- if any prohibited characters
return false;
end
scheme, domain = split_url (value); -- get scheme or nil and domain or nil from URL;
return not is_url (scheme, domain); -- return true if value DOES NOT appear to be a valid URL
end
--[[--------------------------< L I N K _ T I T L E _ O K >---------------------------------------------------
Use link_param_ok() to validate |<param>-link= value and its matching |<title>= value.
|<title>= may be wiki-linked but not when |<param>-link= has a value. This function emits an error message when
that condition exists
check <link> for inter-language interwiki-link prefix. prefix must be a MediaWiki-recognized language
code and must begin with a colon.
]]
local function link_title_ok (link, lorig, title, torig)
local orig;
if utilities.is_set (link) then -- don't bother if <param>-link doesn't have a value
if not link_param_ok (link) then -- check |<param>-link= markup
orig = lorig; -- identify the failing link parameter
elseif title:find ('%[%[') then -- check |title= for wikilink markup
orig = torig; -- identify the failing |title= parameter
elseif link:match ('^%a+:') then -- if the link is what looks like an interwiki
local prefix = link:match ('^(%a+):'):lower(); -- get the interwiki prefix
if cfg.inter_wiki_map[prefix] then -- if prefix is in the map, must have preceding colon
orig = lorig; -- flag as error
end
end
end
if utilities.is_set (orig) then
link = ''; -- unset
utilities.set_message ('err_bad_paramlink', orig); -- URL or wikilink in |title= with |title-link=;
end
return link; -- link if ok, empty string else
end
--[[--------------------------< C H E C K _ U R L >------------------------------------------------------------
Determines whether a URL string appears to be valid.
First we test for space characters. If any are found, return false. Then split the URL into scheme and domain
portions, or for protocol-relative (//example.com) URLs, just the domain. Use is_url() to validate the two
portions of the URL. If both are valid, or for protocol-relative if domain is valid, return true, else false.
Because it is different from a standard URL, and because this module used external_link() to make external links
that work for standard and news: links, we validate newsgroup names here. The specification for a newsgroup name
is at https://tools.ietf.org/html/rfc5536#section-3.1.4
]]
local function check_url( url_str )
if nil == url_str:match ("^%S+$") then -- if there are any spaces in |url=value it can't be a proper URL
return false;
end
local scheme, domain;
scheme, domain = split_url (url_str); -- get scheme or nil and domain or nil from URL;
if 'news:' == scheme then -- special case for newsgroups
return domain:match('^[%a%d%+%-_]+%.[%a%d%+%-_%.]*[%a%d%+%-_]$');
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[=[-------------------------< I S _ P A R A M E T E R _ E X T _ W I K I L I N K >----------------------------
Return true if a parameter value has a string that begins and ends with square brackets [ and ] and the first
non-space characters following the opening bracket appear to be a URL. The test will also find external wikilinks
that use protocol-relative URLs. Also finds bare URLs.
The frontier pattern prevents a match on interwiki-links which are similar to scheme:path URLs. The tests that
find bracketed URLs are required because the parameters that call this test (currently |title=, |chapter=, |work=,
and |publisher=) may have wikilinks and there are articles or redirects like '//Hus' so, while uncommon, |title=[[//Hus]]
is possible as might be [[en://Hus]].
]=]
local function is_parameter_ext_wikilink (value)
local scheme, domain;
if value:match ('%f[%[]%[%a%S*:%S+.*%]') then -- if ext. wikilink with scheme and domain: [xxxx://yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(%a%S*:%S+).*%]'));
elseif value:match ('%f[%[]%[//%S+.*%]') then -- if protocol-relative ext. wikilink: [//yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(//%S+).*%]'));
elseif value:match ('%a%S*:%S+') then -- if bare URL with scheme; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(%a%S*:%S+)'));
elseif value:match ('//%S+') then -- if protocol-relative bare URL: //yyyyy.zzz; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(//%S+)')); -- what is left should be the domain
else
return false; -- didn't find anything that is obviously a URL
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[[-------------------------< C H E C K _ F O R _ U R L >-----------------------------------------------------
loop through a list of parameters and their values. Look at the value and if it has an external link, emit an error message.
]]
local function check_for_url (parameter_list, error_list)
for k, v in pairs (parameter_list) do -- for each parameter in the list
if is_parameter_ext_wikilink (v) then -- look at the value; if there is a URL add an error message
table.insert (error_list, utilities.wrap_style ('parameter', k));
end
end
end
--[[--------------------------< S A F E _ F O R _ U R L >------------------------------------------------------
Escape sequences for content that will be used for URL descriptions
]]
local function safe_for_url( str )
if str:match( "%[%[.-%]%]" ) ~= nil then
utilities.set_message ('err_wikilink_in_url', {});
end
return str:gsub( '[%[%]\n]', {
['['] = '[',
[']'] = ']',
['\n'] = ' ' } );
end
--[[--------------------------< E X T E R N A L _ L I N K >----------------------------------------------------
Format an external link with error checking
]]
local function external_link (URL, label, source, access)
local err_msg = '';
local domain;
local path;
local base_url;
if not utilities.is_set (label) then
label = URL;
if utilities.is_set (source) then
utilities.set_message ('err_bare_url_missing_title', {utilities.wrap_style ('parameter', source)});
else
error (cfg.messages["bare_url_no_origin"]); -- programmer error; valid parameter name does not have matching meta-parameter
end
end
if not check_url (URL) then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)});
end
domain, path = URL:match ('^([/%.%-%+:%a%d]+)([/%?#].*)$'); -- split the URL into scheme plus domain and path
if path then -- if there is a path portion
path = path:gsub ('[%[%]]', {['['] = '%5b', [']'] = '%5d'}); -- replace '[' and ']' with their percent-encoded values
URL = table.concat ({domain, path}); -- and reassemble
end
base_url = table.concat ({ "[", URL, " ", safe_for_url (label), "]" }); -- assemble a wiki-markup URL
if utilities.is_set (access) then -- access level (subscription, registration, limited)
base_url = utilities.substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[access].class, cfg.presentation[access].title, base_url}); -- add the appropriate icon
end
return base_url;
end
--[[--------------------------< D E P R E C A T E D _ P A R A M E T E R >--------------------------------------
Categorize and emit an error message when the citation contains one or more deprecated parameters. The function includes the
offending parameter name to the error message. Only one error message is emitted regardless of the number of deprecated
parameters in the citation.
added_deprecated_cat is a Boolean declared in page scope variables above
]]
local function deprecated_parameter(name)
if not added_deprecated_cat then
added_deprecated_cat = true; -- note that we've added this category
utilities.set_message ('err_deprecated_params', {name}); -- add error message
end
end
--[=[-------------------------< K E R N _ Q U O T E S >--------------------------------------------------------
Apply kerning to open the space between the quote mark provided by the module and a leading or trailing quote
mark contained in a |title= or |chapter= parameter's value.
This function will positive kern either single or double quotes:
"'Unkerned title with leading and trailing single quote marks'"
" 'Kerned title with leading and trailing single quote marks' " (in real life the kerning isn't as wide as this example)
Double single quotes (italic or bold wiki-markup) are not kerned.
Replaces Unicode quote marks in plain text or in the label portion of a [[L|D]] style wikilink with typewriter
quote marks regardless of the need for kerning. Unicode quote marks are not replaced in simple [[D]] wikilinks.
Call this function for chapter titles, for website titles, etc.; not for book titles.
]=]
local function kern_quotes (str)
local cap = '';
local wl_type, label, link;
wl_type, label, link = utilities.is_wikilink (str); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
if 1 == wl_type then -- [[D]] simple wikilink with or without quote marks
if mw.ustring.match (str, '%[%[[\"“”\'‘’].+[\"“”\'‘’]%]%]') then -- leading and trailing quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
str = utilities.substitute (cfg.presentation['kern-right'], str);
elseif mw.ustring.match (str, '%[%[[\"“”\'‘’].+%]%]') then -- leading quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
elseif mw.ustring.match (str, '%[%[.+[\"“”\'‘’]%]%]') then -- trailing quote marks
str = utilities.substitute (cfg.presentation['kern-right'], str);
end
else -- plain text or [[L|D]]; text in label variable
label = mw.ustring.gsub (label, '[“”]', '\"'); -- replace “” (U+201C & U+201D) with " (typewriter double quote mark)
label = mw.ustring.gsub (label, '[‘’]', '\''); -- replace ‘’ (U+2018 & U+2019) with ' (typewriter single quote mark)
cap = mw.ustring.match (label, "^([\"\'][^\'].+)"); -- match leading double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-left'], cap);
end
cap = mw.ustring.match (label, "^(.+[^\'][\"\'])$") -- match trailing double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-right'], cap);
end
if 2 == wl_type then
str = utilities.make_wikilink (link, label); -- reassemble the wikilink
else
str = label;
end
end
return str;
end
--[[--------------------------< F O R M A T _ S C R I P T _ V A L U E >----------------------------------------
|script-title= holds title parameters that are not written in Latin-based scripts: Chinese, Japanese, Arabic, Hebrew, etc. These scripts should
not be italicized and may be written right-to-left. The value supplied by |script-title= is concatenated onto Title after Title has been wrapped
in italic markup.
Regardless of language, all values provided by |script-title= are wrapped in <bdi>...</bdi> tags to isolate RTL languages from the English left to right.
|script-title= provides a unique feature. The value in |script-title= may be prefixed with a two-character ISO 639-1 language code and a colon:
|script-title=ja:*** *** (where * represents a Japanese character)
Spaces between the two-character code and the colon and the colon and the first script character are allowed:
|script-title=ja : *** ***
|script-title=ja: *** ***
|script-title=ja :*** ***
Spaces preceding the prefix are allowed: |script-title = ja:*** ***
The prefix is checked for validity. If it is a valid ISO 639-1 language code, the lang attribute (lang="ja") is added to the <bdi> tag so that browsers can
know the language the tag contains. This may help the browser render the script more correctly. If the prefix is invalid, the lang attribute
is not added. At this time there is no error message for this condition.
Supports |script-title=, |script-chapter=, |script-<periodical>=
]]
local function format_script_value (script_value, script_param)
local lang=''; -- initialize to empty string
local name;
if script_value:match('^%l%l%l?%s*:') then -- if first 3 or 4 non-space characters are script language prefix
lang = script_value:match('^(%l%l%l?)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
if not utilities.is_set (lang) then
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing title part']}); -- prefix without 'title'; add error message
return ''; -- script_value was just the prefix so return empty string
end
-- if we get this far we have prefix and script
name = cfg.lang_tag_remap[lang] or mw.language.fetchLanguageName( lang, cfg.this_wiki_code ); -- get language name so that we can use it to categorize
if utilities.is_set (name) then -- is prefix a proper ISO 639-1 language code?
script_value = script_value:gsub ('^%l+%s*:%s*', ''); -- strip prefix from script
-- is prefix one of these language codes?
if utilities.in_array (lang, cfg.script_lang_codes) then
utilities.add_prop_cat ('script', {name, lang})
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['unknown language code']}); -- unknown script-language; add error message
end
lang = ' lang="' .. lang .. '" '; -- convert prefix into a lang attribute
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['invalid language code']}); -- invalid language code; add error message
lang = ''; -- invalid so set lang to empty string
end
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing prefix']}); -- no language code prefix; add error message
end
script_value = utilities.substitute (cfg.presentation['bdi'], {lang, script_value}); -- isolate in case script is RTL
return script_value;
end
--[[--------------------------< S C R I P T _ C O N C A T E N A T E >------------------------------------------
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script
value has been wrapped in <bdi> tags.
]]
local function script_concatenate (title, script, script_param)
if utilities.is_set (script) then
script = format_script_value (script, script_param); -- <bdi> tags, lang attribute, categorization, etc.; returns empty string on error
if utilities.is_set (script) then
title = title .. ' ' .. script; -- concatenate title and script title
end
end
return title;
end
--[[--------------------------< W R A P _ M S G >--------------------------------------------------------------
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list
configuration taking one argument. Supports lower case text for {{citation}} templates. Additional text taken
from citation_config.messages - the reason this function is similar to but separate from wrap_style().
]]
local function wrap_msg (key, str, lower)
if not utilities.is_set ( str ) then
return "";
end
if true == lower then
local msg;
msg = cfg.messages[key]:lower(); -- set the message to lower case before
return utilities.substitute ( msg, str ); -- including template text
else
return utilities.substitute ( cfg.messages[key], str );
end
end
--[[----------------< W I K I S O U R C E _ U R L _ M A K E >-------------------
Makes a Wikisource URL from Wikisource interwiki-link. Returns the URL and appropriate
label; nil else.
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=
]]
local function wikisource_url_make (str)
local wl_type, D, L;
local ws_url, ws_label;
local wikisource_prefix = table.concat ({'https://', cfg.this_wiki_code, '.wikisource.org/wiki/'});
wl_type, D, L = utilities.is_wikilink (str); -- wl_type is 0 (not a wikilink), 1 (simple wikilink), 2 (complex wikilink)
if 0 == wl_type then -- not a wikilink; might be from |title-link=
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 1 == wl_type then -- simple wikilink: [[Wikisource:ws article]]
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 2 == wl_type then -- non-so-simple wikilink: [[Wikisource:ws article|displayed text]] ([[L|D]])
str = L:match ('^[Ww]ikisource:(.+)') or L:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_label = D; -- get ws article name from display portion of interwiki link
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title without namespace from link portion of wikilink
});
end
end
if ws_url then
ws_url = mw.uri.encode (ws_url, 'WIKI'); -- make a usable URL
ws_url = ws_url:gsub ('%%23', '#'); -- undo percent-encoding of fragment marker
end
return ws_url, ws_label, L or D; -- return proper URL or nil and a label or nil
end
--[[----------------< F O R M A T _ P E R I O D I C A L >-----------------------
Format the three periodical parameters: |script-<periodical>=, |<periodical>=,
and |trans-<periodical>= into a single Periodical meta-parameter.
]]
local function format_periodical (script_periodical, script_periodical_source, periodical, trans_periodical)
if not utilities.is_set (periodical) then
periodical = ''; -- to be safe for concatenation
else
periodical = utilities.wrap_style ('italic-title', periodical); -- style
end
periodical = script_concatenate (periodical, script_periodical, script_periodical_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (trans_periodical) then
trans_periodical = utilities.wrap_style ('trans-italic-title', trans_periodical);
if utilities.is_set (periodical) then
periodical = periodical .. ' ' .. trans_periodical;
else -- here when trans-periodical without periodical or script-periodical
periodical = trans_periodical;
utilities.set_message ('err_trans_missing_title', {'periodical'});
end
end
return periodical;
end
--[[------------------< F O R M A T _ C H A P T E R _ T I T L E >---------------
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=,
and |chapter-url= into a single chapter meta- parameter (chapter_url_source used
for error messages).
]]
local function format_chapter_title (script_chapter, script_chapter_source, chapter, chapter_source, trans_chapter, trans_chapter_source, chapter_url, chapter_url_source, no_quotes, access)
local ws_url, ws_label, L = wikisource_url_make (chapter); -- make a wikisource URL and label from a wikisource interwiki link
if ws_url then
ws_label = ws_label:gsub ('_', ' '); -- replace underscore separators with space characters
chapter = ws_label;
end
if not utilities.is_set (chapter) then
chapter = ''; -- to be safe for concatenation
else
if false == no_quotes then
chapter = kern_quotes (chapter); -- if necessary, separate chapter title's leading and trailing quote marks from module provided quote marks
chapter = utilities.wrap_style ('quoted-title', chapter);
end
end
chapter = script_concatenate (chapter, script_chapter, script_chapter_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (chapter_url) then
chapter = external_link (chapter_url, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
elseif ws_url then
chapter = external_link (ws_url, chapter .. ' ', 'ws link in chapter'); -- adds bare_url_missing_title error if appropriate; space char to move icon away from chap text; TODO: better way to do this?
chapter = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, chapter});
end
if utilities.is_set (trans_chapter) then
trans_chapter = utilities.wrap_style ('trans-quoted-title', trans_chapter);
if utilities.is_set (chapter) then
chapter = chapter .. ' ' .. trans_chapter;
else -- here when trans_chapter without chapter or script-chapter
chapter = trans_chapter;
chapter_source = trans_chapter_source:match ('trans%-?(.+)'); -- when no chapter, get matching name from trans-<param>
utilities.set_message ('err_trans_missing_title', {chapter_source});
end
end
return chapter;
end
--[[----------------< H A S _ I N V I S I B L E _ C H A R S >-------------------
This function searches a parameter's value for non-printable or invisible characters.
The search stops at the first match.
This function will detect the visible replacement character when it is part of the Wikisource.
Detects but ignores nowiki and math stripmarkers. Also detects other named stripmarkers
(gallery, math, pre, ref) and identifies them with a slightly different error message.
See also coins_cleanup().
Output of this function is an error message that identifies the character or the
Unicode group, or the stripmarker that was detected along with its position (or,
for multi-byte characters, the position of its first byte) in the parameter value.
]]
local function has_invisible_chars (param, v)
local position = ''; -- position of invisible char or starting position of stripmarker
local capture; -- used by stripmarker detection to hold name of the stripmarker
local stripmarker; -- boolean set true when a stripmarker is found
capture = string.match (v, '[%w%p ]*'); -- test for values that are simple ASCII text and bypass other tests if true
if capture == v then -- if same there are no Unicode characters
return;
end
for _, invisible_char in ipairs (cfg.invisible_chars) do
local char_name = invisible_char[1]; -- the character or group name
local pattern = invisible_char[2]; -- the pattern used to find it
position, _, capture = mw.ustring.find (v, pattern); -- see if the parameter value contains characters that match the pattern
if position and (cfg.invisible_defs.zwj == capture) then -- if we found a zero-width joiner character
if mw.ustring.find (v, cfg.indic_script) then -- it's ok if one of the Indic scripts
position = nil; -- unset position
elseif cfg.emoji_t[mw.ustring.codepoint (v, position+1)] then -- is zwj followed by a character listed in emoji{}?
position = nil; -- unset position
end
end
if position then
if 'nowiki' == capture or 'math' == capture or -- nowiki and math stripmarkers (not an error condition)
('templatestyles' == capture and utilities.in_array (param, {'id', 'quote'})) then -- templatestyles stripmarker allowed in these parameters
stripmarker = true; -- set a flag
elseif true == stripmarker and cfg.invisible_defs.del == capture then -- because stripmakers begin and end with the delete char, assume that we've found one end of a stripmarker
position = nil; -- unset
else
local err_msg;
if capture and not (cfg.invisible_defs.del == capture or cfg.invisible_defs.zwj == capture) then
err_msg = capture .. ' ' .. char_name;
else
err_msg = char_name .. ' ' .. 'character';
end
utilities.set_message ('err_invisible_char', {err_msg, utilities.wrap_style ('parameter', param), position}); -- add error message
return; -- and done with this parameter
end
end
end
end
--[[-------------------< A R G U M E N T _ W R A P P E R >----------------------
Argument wrapper. This function provides support for argument mapping defined
in the configuration file so that multiple names can be transparently aliased to
single internal variable.
]]
local function argument_wrapper ( args )
local origin = {};
return setmetatable({
ORIGIN = function ( self, k )
local dummy = self[k]; -- force the variable to be loaded.
return origin[k];
end
},
{
__index = function ( tbl, k )
if origin[k] ~= nil then
return nil;
end
local args, list, v = args, cfg.aliases[k];
if type( list ) == 'table' then
v, origin[k] = utilities.select_one ( args, list, 'err_redundant_parameters' );
if origin[k] == nil then
origin[k] = ''; -- Empty string, not nil
end
elseif list ~= nil then
v, origin[k] = args[list], list;
else
-- maybe let through instead of raising an error?
-- v, origin[k] = args[k], k;
error( cfg.messages['unknown_argument_map'] .. ': ' .. k);
end
-- Empty strings, not nil;
if v == nil then
v = '';
origin[k] = '';
end
tbl = rawset( tbl, k, v );
return v;
end,
});
end
--[[--------------------------< N O W R A P _ D A T E >-------------------------
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>.
When date is DD MMMM YYYY or is MMMM DD, YYYY then wrap in nowrap span:
<span ...>DD MMMM</span> YYYY or <span ...>MMMM DD,</span> YYYY
DOES NOT yet support MMMM YYYY or any of the date ranges.
]]
local function nowrap_date (date)
local cap = '';
local cap2 = '';
if date:match("^%d%d%d%d%-%d%d%-%d%d$") then
date = utilities.substitute (cfg.presentation['nowrap1'], date);
elseif date:match("^%a+%s*%d%d?,%s+%d%d%d%d$") or date:match ("^%d%d?%s*%a+%s+%d%d%d%d$") then
cap, cap2 = string.match (date, "^(.*)%s+(%d%d%d%d)$");
date = utilities.substitute (cfg.presentation['nowrap2'], {cap, cap2});
end
return date;
end
--[[--------------------------< S E T _ T I T L E T Y P E >---------------------
This function sets default title types (equivalent to the citation including
|type=<default value>) for those templates that have defaults. Also handles the
special case where it is desirable to omit the title type from the rendered citation
(|type=none).
]]
local function set_titletype (cite_class, title_type)
if utilities.is_set (title_type) then
if 'none' == cfg.keywords_xlate[title_type] then
title_type = ''; -- if |type=none then type parameter not displayed
end
return title_type; -- if |type= has been set to any other value use that value
end
return cfg.title_types [cite_class] or ''; -- set template's default title type; else empty string for concatenation
end
--[[--------------------------< S A F E _ J O I N >-----------------------------
Joins a sequence of strings together while checking for duplicate separation characters.
]]
local function safe_join( tbl, duplicate_char )
local f = {}; -- create a function table appropriate to type of 'duplicate character'
if 1 == #duplicate_char then -- for single byte ASCII characters use the string library functions
f.gsub = string.gsub
f.match = string.match
f.sub = string.sub
else -- for multi-byte characters use the ustring library functions
f.gsub = mw.ustring.gsub
f.match = mw.ustring.match
f.sub = mw.ustring.sub
end
local str = ''; -- the output string
local comp = ''; -- what does 'comp' mean?
local end_chr = '';
local trim;
for _, value in ipairs( tbl ) do
if value == nil then value = ''; end
if str == '' then -- if output string is empty
str = value; -- assign value to it (first time through the loop)
elseif value ~= '' then
if value:sub(1, 1) == '<' then -- special case of values enclosed in spans and other markup.
comp = value:gsub( "%b<>", "" ); -- remove HTML markup (<span>string</span> -> string)
else
comp = value;
end
-- typically duplicate_char is sepc
if f.sub(comp, 1, 1) == duplicate_char then -- is first character same as duplicate_char? why test first character?
-- Because individual string segments often (always?) begin with terminal punct for the
-- preceding segment: 'First element' .. 'sepc next element' .. etc.?
trim = false;
end_chr = f.sub(str, -1, -1); -- get the last character of the output string
-- str = str .. "<HERE(enchr=" .. end_chr .. ")" -- debug stuff?
if end_chr == duplicate_char then -- if same as separator
str = f.sub(str, 1, -2); -- remove it
elseif end_chr == "'" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "''" then -- if last three chars of str are sepc''
str = f.sub(str, 1, -4) .. "''"; -- remove them and add back ''
elseif f.sub(str, -5, -1) == duplicate_char .. "]]''" then -- if last five chars of str are sepc]]''
trim = true; -- why? why do this and next differently from previous?
elseif f.sub(str, -4, -1) == duplicate_char .. "]''" then -- if last four chars of str are sepc]''
trim = true; -- same question
end
elseif end_chr == "]" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "]]" then -- if last three chars of str are sepc]] wikilink
trim = true;
elseif f.sub(str, -3, -1) == duplicate_char .. '"]' then -- if last three chars of str are sepc"] quoted external link
trim = true;
elseif f.sub(str, -2, -1) == duplicate_char .. "]" then -- if last two chars of str are sepc] external link
trim = true;
elseif f.sub(str, -4, -1) == duplicate_char .. "'']" then -- normal case when |url=something & |title=Title.
trim = true;
end
elseif end_chr == " " then -- if last char of output string is a space
if f.sub(str, -2, -1) == duplicate_char .. " " then -- if last two chars of str are <sepc><space>
str = f.sub(str, 1, -3); -- remove them both
end
end
if trim then
if value ~= comp then -- value does not equal comp when value contains HTML markup
local dup2 = duplicate_char;
if f.match(dup2, "%A" ) then dup2 = "%" .. dup2; end -- if duplicate_char not a letter then escape it
value = f.gsub(value, "(%b<>)" .. dup2, "%1", 1 ) -- remove duplicate_char if it follows HTML markup
else
value = f.sub(value, 2, -1 ); -- remove duplicate_char when it is first character
end
end
end
str = str .. value; -- add it to the output string
end
end
return str;
end
--[[--------------------------< I S _ S U F F I X >-----------------------------
returns true if suffix is properly formed Jr, Sr, or ordinal in the range 1–9.
Puncutation not allowed.
]]
local function is_suffix (suffix)
if utilities.in_array (suffix, {'Jr', 'Sr', 'Jnr', 'Snr', '1st', '2nd', '3rd'}) or suffix:match ('^%dth$') then
return true;
end
return false;
end
--[[--------------------< I S _ G O O D _ V A N C _ N A M E >-------------------
For Vancouver style, author/editor names are supposed to be rendered in Latin
(read ASCII) characters. When a name uses characters that contain diacritical
marks, those characters are to be converted to the corresponding Latin
character. When a name is written using a non-Latin alphabet or logogram, that
name is to be transliterated into Latin characters. The module doesn't do this
so editors may/must.
This test allows |first= and |last= names to contain any of the letters defined
in the four Unicode Latin character sets
[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A
[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF
[http://www.unicode.org/charts/PDF/U0100.pdf Latin Extended-A] 0100–017F
[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F
|lastn= also allowed to contain hyphens, spaces, and apostrophes.
(http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods
This original test:
if nil == mw.ustring.find (last, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%']*$")
or nil == mw.ustring.find (first, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%'%.]+[2-6%a]*$") then
was written outside of the code editor and pasted here because the code editor
gets confused between character insertion point and cursor position. The test has
been rewritten to use decimal character escape sequence for the individual bytes
of the Unicode characters so that it is not necessary to use an external editor
to maintain this code.
\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)
\195\152-\195\182 – Ø-ö (U+00D8-U+00F6 – C0 controls)
\195\184-\198\191 – ø-ƿ (U+00F8-U+01BF – C0 controls, Latin extended A & B)
\199\132-\201\143 – DŽ-ɏ (U+01C4-U+024F – Latin extended B)
]]
local function is_good_vanc_name (last, first, suffix, position)
if not suffix then
if first:find ('[,%s]') then -- when there is a space or comma, might be first name/initials + generational suffix
first = first:match ('(.-)[,%s]+'); -- get name/initials
suffix = first:match ('[,%s]+(.+)$'); -- get generational suffix
end
end
if utilities.is_set (suffix) then
if not is_suffix (suffix) then
add_vanc_error (cfg.err_msg_supl.suffix, position);
return false; -- not a name with an appropriate suffix
end
end
if nil == mw.ustring.find (last, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%']*$") or
nil == mw.ustring.find (first, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%'%.]*$") then
add_vanc_error (cfg.err_msg_supl['non-Latin char'], position);
return false; -- not a string of Latin characters; Vancouver requires Romanization
end;
return true;
end
--[[--------------------------< R E D U C E _ T O _ I N I T I A L S >------------------------------------------
Attempts to convert names to initials in support of |name-list-style=vanc.
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period.
See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.
Vancouver style requires family rank designations (Jr, II, III, etc.) to be rendered
as Jr, 2nd, 3rd, etc. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.
This code only accepts and understands generational suffix in the Vancouver format
because Roman numerals look like, and can be mistaken for, initials.
This function uses ustring functions because firstname initials may be any of the
Unicode Latin characters accepted by is_good_vanc_name ().
]]
local function reduce_to_initials(first, position)
local name, suffix = mw.ustring.match(first, "^(%u+) ([%dJS][%drndth]+)$");
if not name then -- if not initials and a suffix
name = mw.ustring.match(first, "^(%u+)$"); -- is it just initials?
end
if name then -- if first is initials with or without suffix
if 3 > mw.ustring.len (name) then -- if one or two initials
if suffix then -- if there is a suffix
if is_suffix (suffix) then -- is it legitimate?
return first; -- one or two initials and a valid suffix so nothing to do
else
add_vanc_error (cfg.err_msg_supl.suffix, position); -- one or two initials with invalid suffix so error message
return first; -- and return first unmolested
end
else
return first; -- one or two initials without suffix; nothing to do
end
end
end -- if here then name has 3 or more uppercase letters so treat them as a word
local initials, names = {}, {}; -- tables to hold name parts and initials
local i = 1; -- counter for number of initials
names = mw.text.split (first, '[%s,]+'); -- split into a table of names and possible suffix
while names[i] do -- loop through the table
if 1 < i and names[i]:match ('[%dJS][%drndth]+%.?$') then -- if not the first name, and looks like a suffix (may have trailing dot)
names[i] = names[i]:gsub ('%.', ''); -- remove terminal dot if present
if is_suffix (names[i]) then -- if a legitimate suffix
table.insert (initials, ' ' .. names[i]); -- add a separator space, insert at end of initials table
break; -- and done because suffix must fall at the end of a name
end -- no error message if not a suffix; possibly because of Romanization
end
if 3 > i then
table.insert (initials, mw.ustring.sub(names[i], 1, 1)); -- insert the initial at end of initials table
end
i = i + 1; -- bump the counter
end
return table.concat(initials) -- Vancouver format does not include spaces.
end
--[[--------------------------< I N T E R W I K I _ P R E F I X E N _ G E T >----------------------------------
extract interwiki prefixen from <value>. Returns two one or two values:
false – no prefixen
nil – prefix exists but not recognized
project prefix, language prefix – when value has either of:
:<project>:<language>:<article>
:<language>:<project>:<article>
project prefix, nil – when <value> has only a known single-letter prefix
nil, language prefix – when <value> has only a known language prefix
accepts single-letter project prefixen: 'd' (wikidata), 's' (wikisource), and 'w' (wikipedia) prefixes; at this
writing, the other single-letter prefixen (b (wikibook), c (commons), m (meta), n (wikinews), q (wikiquote), and
v (wikiversity)) are not supported.
]]
local function interwiki_prefixen_get (value, is_link)
if not value:find (':%l+:') then -- if no prefix
return false; -- abandon; boolean here to distinguish from nil fail returns later
end
local prefix_patterns_linked_t = { -- sequence of valid interwiki and inter project prefixen
'^%[%[:([dsw]):(%l%l+):', -- wikilinked; project and language prefixes
'^%[%[:(%l%l+):([dsw]):', -- wikilinked; language and project prefixes
'^%[%[:([dsw]):', -- wikilinked; project prefix
'^%[%[:(%l%l+):', -- wikilinked; language prefix
}
local prefix_patterns_unlinked_t = { -- sequence of valid interwiki and inter project prefixen
'^:([dsw]):(%l%l+):', -- project and language prefixes
'^:(%l%l+):([dsw]):', -- language and project prefixes
'^:([dsw]):', -- project prefix
'^:(%l%l+):', -- language prefix
}
local cap1, cap2;
for _, pattern in ipairs ((is_link and prefix_patterns_linked_t) or prefix_patterns_unlinked_t) do
cap1, cap2 = value:match (pattern);
if cap1 then
break; -- found a match so stop looking
end
end
if cap1 and cap2 then -- when both then :project:language: or :language:project: (both forms allowed)
if 1 == #cap1 then -- length == 1 then :project:language:
if cfg.inter_wiki_map[cap2] then -- is language prefix in the interwiki map?
return cap1, cap2; -- return interwiki project and interwiki language
end
else -- here when :language:project:
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return cap2, cap1; -- return interwiki project and interwiki language
end
end
return nil; -- unknown interwiki language
elseif not (cap1 or cap2) then -- both are nil?
return nil; -- we got something that looks like a project prefix but isn't; return fail
elseif 1 == #cap1 then -- here when one capture
return cap1, nil; -- length is 1 so return project, nil language
else -- here when one capture and its length it more than 1
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return nil, cap1; -- return nil project, language
end
end
end
--[[--------------------------< L I S T _ P E O P L E >--------------------------
Formats a list of people (authors, contributors, editors, interviewers, translators)
names in the list will be linked when
|<name>-link= has a value
|<name>-mask- does NOT have a value; masked names are presumed to have been
rendered previously so should have been linked there
when |<name>-mask=0, the associated name is not rendered
]]
local function list_people (control, people, etal)
local sep;
local namesep;
local format = control.format;
local maximum = control.maximum;
local name_list = {};
if 'vanc' == format then -- Vancouver-like name styling?
sep = cfg.presentation['sep_nl_vanc']; -- name-list separator between names is a comma
namesep = cfg.presentation['sep_name_vanc']; -- last/first separator is a space
else
sep = cfg.presentation['sep_nl']; -- name-list separator between names is a semicolon
namesep = cfg.presentation['sep_name']; -- last/first separator is <comma><space>
end
if sep:sub (-1, -1) ~= " " then sep = sep .. " " end
if utilities.is_set (maximum) and maximum < 1 then return "", 0; end -- returned 0 is for EditorCount; not used for other names
for i, person in ipairs (people) do
if utilities.is_set (person.last) then
local mask = person.mask;
local one;
local sep_one = sep;
if utilities.is_set (maximum) and i > maximum then
etal = true;
break;
end
if mask then
local n = tonumber (mask); -- convert to a number if it can be converted; nil else
if n then
one = 0 ~= n and string.rep("—", n) or nil; -- make a string of (n > 0) mdashes, nil else, to replace name
person.link = nil; -- don't create link to name if name is replaces with mdash string or has been set nil
else
one = mask; -- replace name with mask text (must include name-list separator)
sep_one = " "; -- modify name-list separator
end
else
one = person.last; -- get surname
local first = person.first -- get given name
if utilities.is_set (first) then
if ("vanc" == format) then -- if Vancouver format
one = one:gsub ('%.', ''); -- remove periods from surnames (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
if not person.corporate and is_good_vanc_name (one, first, nil, i) then -- and name is all Latin characters; corporate authors not tested
first = reduce_to_initials (first, i); -- attempt to convert first name(s) to initials
end
end
one = one .. namesep .. first;
end
end
if utilities.is_set (person.link) then
one = utilities.make_wikilink (person.link, one); -- link author/editor
end
if one then -- if <one> has a value (name, mdash replacement, or mask text replacement)
local proj, tag = interwiki_prefixen_get (one, true); -- get the interwiki prefixen if present
if 'w' == proj and ('Wikipedia' == mw.site.namespaces.Project['name']) then
proj = nil; -- for stuff like :w:de:<article>, :w is unnecessary TODO: maint cat?
end
if proj then
proj = ({['d'] = 'Wikidata', ['s'] = 'Wikisource', ['w'] = 'Wikipedia'})[proj]; -- :w (wikipedia) for linking from a non-wikipedia project
if proj then
one = one .. utilities.wrap_style ('interproj', proj); -- add resized leading space, brackets, static text, language name
tag = nil; -- unset; don't do both project and language
end
end
if tag == cfg.this_wiki_code then
tag = nil; -- stuff like :en:<article> at en.wiki is pointless TODO: maint cat?
end
if tag then
local lang = cfg.lang_tag_remap[tag] or cfg.mw_languages_by_tag_t[tag];
if lang then -- error messaging done in extract_names() where we know parameter names
one = one .. utilities.wrap_style ('interwiki', lang); -- add resized leading space, brackets, static text, language name
end
end
table.insert (name_list, one); -- add it to the list of names
table.insert (name_list, sep_one); -- add the proper name-list separator
end
end
end
local count = #name_list / 2; -- (number of names + number of separators) divided by 2
if 0 < count then
if 1 < count and not etal then
if 'amp' == format then
name_list[#name_list-2] = " & "; -- replace last separator with ampersand text
elseif 'and' == format then
if 2 == count then
name_list[#name_list-2] = cfg.presentation.sep_nl_and; -- replace last separator with 'and' text
else
name_list[#name_list-2] = cfg.presentation.sep_nl_end; -- replace last separator with '(sep) and' text
end
end
end
name_list[#name_list] = nil; -- erase the last separator
end
local result = table.concat (name_list); -- construct list
if etal and utilities.is_set (result) then -- etal may be set by |display-authors=etal but we might not have a last-first list
result = result .. sep .. cfg.messages['et al']; -- we've got a last-first list and etal so add et al.
end
return result, count; -- return name-list string and count of number of names (count used for editor names only)
end
--[[--------------------< M A K E _ C I T E R E F _ I D >-----------------------
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise
returns an empty string.
namelist is one of the contributor-, author-, or editor-name lists chosen in that
order. year is Year or anchor_year.
]]
local function make_citeref_id (namelist, year)
local names={}; -- a table for the one to four names and year
for i,v in ipairs (namelist) do -- loop through the list and take up to the first four last names
names[i] = v.last
if i == 4 then break end -- if four then done
end
table.insert (names, year); -- add the year at the end
local id = table.concat(names); -- concatenate names and year for CITEREF id
if utilities.is_set (id) then -- if concatenation is not an empty string
return "CITEREF" .. id; -- add the CITEREF portion
else
return ''; -- return an empty string; no reason to include CITEREF id in this citation
end
end
--[[--------------------------< C I T E _ C L A S S _A T T R I B U T E _M A K E >------------------------------
construct <cite> tag class attribute for this citation.
<cite_class> – config.CitationClass from calling template
<mode> – value from |mode= parameter
]]
local function cite_class_attribute_make (cite_class, mode)
local class_t = {};
table.insert (class_t, 'citation'); -- required for blue highlight
if 'citation' ~= cite_class then
table.insert (class_t, cite_class); -- identify this template for user css
table.insert (class_t, utilities.is_set (mode) and mode or 'cs1'); -- identify the citation style for user css or javascript
else
table.insert (class_t, utilities.is_set (mode) and mode or 'cs2'); -- identify the citation style for user css or javascript
end
for _, prop_key in ipairs (z.prop_keys_t) do
table.insert (class_t, prop_key); -- identify various properties for user css or javascript
end
return table.concat (class_t, ' '); -- make a big string and done
end
--[[---------------------< N A M E _ H A S _ E T A L >--------------------------
Evaluates the content of name parameters (author, editor, etc.) for variations on
the theme of et al. If found, the et al. is removed, a flag is set to true and
the function returns the modified name and the flag.
This function never sets the flag to false but returns its previous state because
it may have been set by previous passes through this function or by the associated
|display-<names>=etal parameter
]]
local function name_has_etal (name, etal, nocat, param)
if utilities.is_set (name) then -- name can be nil in which case just return
local patterns = cfg.et_al_patterns; -- get patterns from configuration
for _, pattern in ipairs (patterns) do -- loop through all of the patterns
if name:match (pattern) then -- if this 'et al' pattern is found in name
name = name:gsub (pattern, ''); -- remove the offending text
etal = true; -- set flag (may have been set previously here or by |display-<names>=etal)
if not nocat then -- no categorization for |vauthors=
utilities.set_message ('err_etal', {param}); -- and set an error if not added
end
end
end
end
return name, etal;
end
--[[---------------------< N A M E _ I S _ N U M E R I C >----------------------
Add maint cat when name parameter value does not contain letters. Does not catch
mixed alphanumeric names so |last=A. Green (1922-1987) does not get caught in the
current version of this test but |first=(1888) is caught.
returns nothing
]]
local function name_is_numeric (name, list_name)
if utilities.is_set (name) then
if mw.ustring.match (name, '^[%A]+$') then -- when name does not contain any letters
utilities.set_message ('maint_numeric_names', cfg.special_case_translation [list_name]); -- add a maint cat for this template
end
end
end
--[[-----------------< N A M E _ H A S _ M U L T _ N A M E S >------------------
Evaluates the content of last/surname (authors etc.) parameters for multiple names.
Multiple names are indicated if there is more than one comma or any "unescaped"
semicolons. Escaped semicolons are ones used as part of selected HTML entities.
If the condition is met, the function adds the multiple name maintenance category.
Same test for first except that commas should not appear in given names (MOS:JR says
that the generational suffix does not take a separator character). Titles, degrees,
postnominals, affiliations, all normally comma separated don't belong in a citation.
<name> – name parameter value
<list_name> – AuthorList, EditorList, etc
<limit> – number of allowed commas; 1 (default) for surnames; 0 for given names
returns nothing
]]
local function name_has_mult_names (name, list_name, limit)
local _, commas, semicolons, nbsps;
limit = limit and limit or 1;
if utilities.is_set (name) then
_, commas = name:gsub (',', ''); -- count the number of commas
_, semicolons = name:gsub (';', ''); -- count the number of semicolons
-- nbsps probably should be its own separate count rather than merged in
-- some way with semicolons because Lua patterns do not support the
-- grouping operator that regex does, which means there is no way to add
-- more entities to escape except by adding more counts with the new
-- entities
_, nbsps = name:gsub (' ',''); -- count nbsps
-- There is exactly 1 semicolon per entity, so subtract nbsps
-- from semicolons to 'escape' them. If additional entities are added,
-- they also can be subtracted.
if limit < commas or 0 < (semicolons - nbsps) then
utilities.set_message ('maint_mult_names', cfg.special_case_translation [list_name]); -- add a maint message
end
end
end
--[=[-------------------------< I S _ G E N E R I C >----------------------------------------------------------
Compares values assigned to various parameters according to the string provided as <item> in the function call.
<item> can have on of two values:
'generic_names' – for name-holding parameters: |last=, |first=, |editor-last=, etc
'generic_titles' – for |title=
There are two types of generic tests. The 'accept' tests look for a pattern that should not be rejected by the
'reject' test. For example,
|author=[[John Smith (author)|Smith, John]]
would be rejected by the 'author' reject test. But piped wikilinks with 'author' disambiguation should not be
rejected so the 'accept' test prevents that from happening. Accept tests are always performed before reject
tests.
Each of the 'accept' and 'reject' sequence tables hold tables for en.wiki (['en']) and local.wiki (['local'])
that each can hold a test sequence table The sequence table holds, at index [1], a test pattern, and, at index
[2], a boolean control value. The control value tells string.find() or mw.ustring.find() to do plain-text search (true)
or a pattern search (false). The intent of all this complexity is to make these searches as fast as possible so
that we don't run out of processing time on very large articles.
Returns
true when a reject test finds the pattern or string
false when an accept test finds the pattern or string
nil else
]=]
local function is_generic (item, value, wiki)
local test_val;
local str_lower = { -- use string.lower() for en.wiki (['en']) and use mw.ustring.lower() or local.wiki (['local'])
['en'] = string.lower,
['local'] = mw.ustring.lower,
}
local str_find = { -- use string.find() for en.wiki (['en']) and use mw.ustring.find() or local.wiki (['local'])
['en'] = string.find,
['local'] = mw.ustring.find,
}
local function test (val, test_t, wiki) -- local function to do the testing; <wiki> selects lower() and find() functions
val = test_t[2] and str_lower[wiki](value) or val; -- when <test_t[2]> set to 'true', plaintext search using lowercase value
return str_find[wiki] (val, test_t[1], 1, test_t[2]); -- return nil when not found or matched
end
local test_types_t = {'accept', 'reject'}; -- test accept patterns first, then reject patterns
local wikis_t = {'en', 'local'}; -- do tests for each of these keys; en.wiki first, local.wiki second
for _, test_type in ipairs (test_types_t) do -- for each test type
for _, generic_value in pairs (cfg.special_case_translation[item][test_type]) do -- spin through the list of generic value fragments to accept or reject
for _, wiki in ipairs (wikis_t) do
if generic_value[wiki] then
if test (value, generic_value[wiki], wiki) then -- go do the test
return ('reject' == test_type); -- param value rejected, return true; false else
end
end
end
end
end
end
--[[--------------------------< N A M E _ I S _ G E N E R I C >------------------------------------------------
calls is_generic() to determine if <name> is a 'generic name' listed in cfg.generic_names; <name_alias> is the
parameter name used in error messaging
]]
local function name_is_generic (name, name_alias)
if not added_generic_name_errs and is_generic ('generic_names', name) then
utilities.set_message ('err_generic_name', name_alias); -- set an error message
added_generic_name_errs = true;
end
end
--[[--------------------------< N A M E _ C H E C K S >--------------------------------------------------------
This function calls various name checking functions used to validate the content of the various name-holding parameters.
]]
local function name_checks (last, first, list_name, last_alias, first_alias)
local accept_name;
if utilities.is_set (last) then
last, accept_name = utilities.has_accept_as_written (last); -- remove accept-this-as-written markup when it wraps all of <last>
if not accept_name then -- <last> not wrapped in accept-as-written markup
name_has_mult_names (last, list_name); -- check for multiple names in the parameter
name_is_numeric (last, list_name); -- check for names that are composed of digits and punctuation
name_is_generic (last, last_alias); -- check for names found in the generic names list
end
end
if utilities.is_set (first) then
first, accept_name = utilities.has_accept_as_written (first); -- remove accept-this-as-written markup when it wraps all of <first>
if not accept_name then -- <first> not wrapped in accept-as-written markup
name_has_mult_names (first, list_name, 0); -- check for multiple names in the parameter; 0 is number of allowed commas in a given name
name_is_numeric (first, list_name); -- check for names that are composed of digits and punctuation
name_is_generic (first, first_alias); -- check for names found in the generic names list
end
local wl_type, D = utilities.is_wikilink (first);
if 0 ~= wl_type then
first = D;
utilities.set_message ('err_bad_paramlink', first_alias);
end
end
return last, first; -- done
end
--[[----------------------< E X T R A C T _ N A M E S >-------------------------
Gets name list from the input arguments
Searches through args in sequential order to find |lastn= and |firstn= parameters
(or their aliases), and their matching link and mask parameters. Stops searching
when both |lastn= and |firstn= are not found in args after two sequential attempts:
found |last1=, |last2=, and |last3= but doesn't find |last4= and |last5= then the
search is done.
This function emits an error message when there is a |firstn= without a matching
|lastn=. When there are 'holes' in the list of last names, |last1= and |last3=
are present but |last2= is missing, an error message is emitted. |lastn= is not
required to have a matching |firstn=.
When an author or editor parameter contains some form of 'et al.', the 'et al.'
is stripped from the parameter and a flag (etal) returned that will cause list_people()
to add the static 'et al.' text from Module:Citation/CS1/Configuration. This keeps
'et al.' out of the template's metadata. When this occurs, an error is emitted.
]]
local function extract_names(args, list_name)
local names = {}; -- table of names
local last; -- individual name components
local first;
local link;
local mask;
local i = 1; -- loop counter/indexer
local n = 1; -- output table indexer
local count = 0; -- used to count the number of times we haven't found a |last= (or alias for authors, |editor-last or alias for editors)
local etal = false; -- return value set to true when we find some form of et al. in an author parameter
local last_alias, first_alias, link_alias; -- selected parameter aliases used in error messaging
while true do
last, last_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'err_redundant_parameters', i ); -- search through args for name components beginning at 1
first, first_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'err_redundant_parameters', i );
link, link_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i );
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
if last then -- error check |lastn= alias for unknown interwiki link prefix; done here because this is where we have the parameter name
local project, language = interwiki_prefixen_get (last, true); -- true because we expect interwiki links in |lastn= to be wikilinked
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', last_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
last = utilities.remove_wiki_link (last); -- remove wikilink markup; show display value only
end
end
if link then -- error check |linkn= alias for unknown interwiki link prefix
local project, language = interwiki_prefixen_get (link, false); -- false because wiki links in |author-linkn= is an error
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', link_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
link = nil; -- unset so we don't link
link_alias = nil;
end
end
last, etal = name_has_etal (last, etal, false, last_alias); -- find and remove variations on et al.
first, etal = name_has_etal (first, etal, false, first_alias); -- find and remove variations on et al.
last, first = name_checks (last, first, list_name, last_alias, first_alias); -- multiple names, extraneous annotation, etc. checks
if first and not last then -- if there is a firstn without a matching lastn
local alias = first_alias:find ('given', 1, true) and 'given' or 'first'; -- get first or given form of the alias
utilities.set_message ('err_first_missing_last', {
first_alias, -- param name of alias missing its mate
first_alias:gsub (alias, {['first'] = 'last', ['given'] = 'surname'}), -- make param name appropriate to the alias form
}); -- add this error message
elseif not first and not last then -- if both firstn and lastn aren't found, are we done?
count = count + 1; -- number of times we haven't found last and first
if 2 <= count then -- two missing names and we give up
break; -- normal exit or there is a two-name hole in the list; can't tell which
end
else -- we have last with or without a first
local result;
link = link_title_ok (link, link_alias, last, last_alias); -- check for improper wiki-markup
if first then
link = link_title_ok (link, link_alias, first, first_alias); -- check for improper wiki-markup
end
names[n] = {last = last, first = first, link = link, mask = mask, corporate = false}; -- add this name to our names list (corporate for |vauthors= only)
n = n + 1; -- point to next location in the names table
if 1 == count then -- if the previous name was missing
utilities.set_message ('err_missing_name', {list_name:match ("(%w+)List"):lower(), i - 1}); -- add this error message
end
count = 0; -- reset the counter, we're looking for two consecutive missing names
end
i = i + 1; -- point to next args location
end
return names, etal; -- all done, return our list of names and the etal flag
end
--[[--------------------------< N A M E _ T A G _ G E T >------------------------------------------------------
attempt to decode |language=<lang_param> and return language name and matching tag; nil else.
This function looks for:
<lang_param> as a tag in cfg.lang_tag_remap{}
<lang_param> as a name in cfg.lang_name_remap{}
<lang_param> as a name in cfg.mw_languages_by_name_t
<lang_param> as a tag in cfg.mw_languages_by_tag_t
when those fail, presume that <lang_param> is an IETF-like tag that MediaWiki does not recognize. Strip all
script, region, variant, whatever subtags from <lang_param> to leave just a two or three character language tag
and look for the new <lang_param> in cfg.mw_languages_by_tag_t{}
on success, returns name (in properly capitalized form) and matching tag (in lowercase); on failure returns nil
]]
local function name_tag_get (lang_param)
local lang_param_lc = mw.ustring.lower (lang_param); -- use lowercase as an index into the various tables
local name;
local tag;
name = cfg.lang_tag_remap[lang_param_lc]; -- assume <lang_param_lc> is a tag; attempt to get remapped language name
if name then -- when <name>, <lang_param> is a tag for a remapped language name
return name, lang_param_lc; -- so return <name> from remap and <lang_param_lc>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- still assuming that <lang_param_lc> is a tag; strip script, region, variant subtags
name = cfg.lang_tag_remap[tag]; -- attempt to get remapped language name with language subtag only
if name then -- when <name>, <tag> is a tag for a remapped language name
return name, tag; -- so return <name> from remap and <tag>
end
if cfg.lang_name_remap[lang_param_lc] then -- not a tag, assume <lang_param_lc> is a name; attempt to get remapped language tag
return cfg.lang_name_remap[lang_param_lc][1], cfg.lang_name_remap[lang_param_lc][2]; -- for this <lang_param_lc>, return a (possibly) new name and appropriate tag
end
tag = cfg.mw_languages_by_name_t[lang_param_lc]; -- assume that <lang_param_lc> is a language name; attempt to get its matching tag
if tag then
return cfg.mw_languages_by_tag_t[tag], tag; -- <lang_param_lc> is a name so return the name from the table and <tag>
end
name = cfg.mw_languages_by_tag_t[lang_param_lc]; -- assume that <lang_param_lc> is a tag; attempt to get its matching language name
if name then
return name, lang_param_lc; -- <lang_param_lc> is a tag so return it and <name>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- is <lang_param_lc> an IETF-like tag that MediaWiki doesn't recognize? <tag> gets the language subtag; nil else
if tag then
name = cfg.mw_languages_by_tag_t[tag]; -- attempt to get a language name using the shortened <tag>
if name then
return name, tag; -- <lang_param_lc> is an unrecognized IETF-like tag so return <name> and language subtag
end
end
end
--[[-------------------< L A N G U A G E _ P A R A M E T E R >------------------
Gets language name from a provided two- or three-character ISO 639 code. If a code
is recognized by MediaWiki, use the returned name; if not, then use the value that
was provided with the language parameter.
When |language= contains a recognized language (either code or name), the page is
assigned to the category for that code: Category:Norwegian-language sources (no).
For valid three-character code languages, the page is assigned to the single category
for '639-2' codes: Category:CS1 ISO 639-2 language sources.
Languages that are the same as the local wiki are not categorized. MediaWiki does
not recognize three-character equivalents of two-character codes: code 'ar' is
recognized but code 'ara' is not.
This function supports multiple languages in the form |language=nb, French, th
where the language names or codes are separated from each other by commas with
optional space characters.
]]
local function language_parameter (lang)
local tag; -- some form of IETF-like language tag; language subtag with optional region, sript, vatiant, etc subtags
local lang_subtag; -- ve populates |language= with mostly unecessary region subtags the MediaWiki does not recognize; this is the base language subtag
local name; -- the language name
local language_list = {}; -- table of language names to be rendered
local names_t = {}; -- table made from the value assigned to |language=
local this_wiki_name = mw.language.fetchLanguageName (cfg.this_wiki_code, cfg.this_wiki_code); -- get this wiki's language name
names_t = mw.text.split (lang, '%s*,%s*'); -- names should be a comma separated list
for _, lang in ipairs (names_t) do -- reuse lang here because we don't yet know if lang is a language name or a language tag
name, tag = name_tag_get (lang); -- attempt to get name/tag pair for <lang>; <name> has proper capitalization; <tag> is lowercase
if utilities.is_set (tag) then
lang_subtag = tag:gsub ('^(%a%a%a?)%-.*', '%1'); -- for categorization, strip any IETF-like tags from language tag
if cfg.this_wiki_code ~= lang_subtag then -- when the language is not the same as this wiki's language
if 2 == lang_subtag:len() then -- and is a two-character tag
utilities.add_prop_cat ('foreign-lang-source', {name, tag}, lang_subtag); -- categorize it; tag appended to allow for multiple language categorization
else -- or is a recognized language (but has a three-character tag)
utilities.add_prop_cat ('foreign-lang-source-2', {lang_subtag}, lang_subtag); -- categorize it differently TODO: support multiple three-character tag categories per cs1|2 template?
end
elseif cfg.local_lang_cat_enable then -- when the language and this wiki's language are the same and categorization is enabled
utilities.add_prop_cat ('local-lang-source', {name, lang_subtag}); -- categorize it
end
else
name = lang; -- return whatever <lang> has so that we show something
utilities.set_message ('maint_unknown_lang'); -- add maint category if not already added
end
table.insert (language_list, name);
name = ''; -- so we can reuse it
end
name = utilities.make_sep_list (#language_list, language_list);
if (1 == #language_list) and (lang_subtag == cfg.this_wiki_code) then -- when only one language, find lang name in this wiki lang name; for |language=en-us, 'English' in 'American English'
return ''; -- if one language and that language is this wiki's return an empty string (no annotation)
end
return (" " .. wrap_msg ('language', name)); -- otherwise wrap with '(in ...)'
--[[ TODO: should only return blank or name rather than full list
so we can clean up the bunched parenthetical elements Language, Type, Format
]]
end
--[[-----------------------< S E T _ C S _ S T Y L E >--------------------------
Gets the default CS style configuration for the given mode.
Returns default separator and either postscript as passed in or the default.
In CS1, the default postscript and separator are '.'.
In CS2, the default postscript is the empty string and the default separator is ','.
]]
local function set_cs_style (postscript, mode)
if utilities.is_set(postscript) then
-- emit a maintenance message if user postscript is the default cs1 postscript
-- we catch the opposite case for cs2 in set_style
if mode == 'cs1' and postscript == cfg.presentation['ps_' .. mode] then
utilities.set_message ('maint_postscript');
end
else
postscript = cfg.presentation['ps_' .. mode];
end
return cfg.presentation['sep_' .. mode], postscript;
end
--[[--------------------------< S E T _ S T Y L E >-----------------------------
Sets the separator and postscript styles. Checks the |mode= first and the
#invoke CitationClass second. Removes the postscript if postscript == none.
]]
local function set_style (mode, postscript, cite_class)
local sep;
if 'cs2' == mode then
sep, postscript = set_cs_style (postscript, 'cs2');
elseif 'cs1' == mode then
sep, postscript = set_cs_style (postscript, 'cs1');
elseif 'citation' == cite_class then
sep, postscript = set_cs_style (postscript, 'cs2');
else
sep, postscript = set_cs_style (postscript, 'cs1');
end
if cfg.keywords_xlate[postscript:lower()] == 'none' then
-- emit a maintenance message if user postscript is the default cs2 postscript
-- we catch the opposite case for cs1 in set_cs_style
if 'cs2' == mode or 'citation' == cite_class then
utilities.set_message ('maint_postscript');
end
postscript = '';
end
return sep, postscript
end
--[=[-------------------------< I S _ P D F >-----------------------------------
Determines if a URL has the file extension that is one of the PDF file extensions
used by [[MediaWiki:Common.css]] when applying the PDF icon to external links.
returns true if file extension is one of the recognized extensions, else false
]=]
local function is_pdf (url)
return url:match ('%.pdf$') or url:match ('%.PDF$') or
url:match ('%.pdf[%?#]') or url:match ('%.PDF[%?#]') or
url:match ('%.PDF#') or url:match ('%.pdf#');
end
--[[--------------------------< S T Y L E _ F O R M A T >-----------------------
Applies CSS style to |format=, |chapter-format=, etc. Also emits an error message
if the format parameter does not have a matching URL parameter. If the format parameter
is not set and the URL contains a file extension that is recognized as a PDF document
by MediaWiki's commons.css, this code will set the format parameter to (PDF) with
the appropriate styling.
]]
local function style_format (format, url, fmt_param, url_param)
if utilities.is_set (format) then
format = utilities.wrap_style ('format', format); -- add leading space, parentheses, resize
if not utilities.is_set (url) then
utilities.set_message ('err_format_missing_url', {fmt_param, url_param}); -- add an error message
end
elseif is_pdf (url) then -- format is not set so if URL is a PDF file then
format = utilities.wrap_style ('format', 'PDF'); -- set format to PDF
else
format = ''; -- empty string for concatenation
end
return format;
end
--[[---------------------< G E T _ D I S P L A Y _ N A M E S >------------------
Returns a number that defines the number of names displayed for author and editor
name lists and a Boolean flag to indicate when et al. should be appended to the name list.
When the value assigned to |display-xxxxors= is a number greater than or equal to zero,
return the number and the previous state of the 'etal' flag (false by default
but may have been set to true if the name list contains some variant of the text 'et al.').
When the value assigned to |display-xxxxors= is the keyword 'etal', return a number
that is one greater than the number of authors in the list and set the 'etal' flag true.
This will cause the list_people() to display all of the names in the name list followed by 'et al.'
In all other cases, returns nil and the previous state of the 'etal' flag.
inputs:
max: A['DisplayAuthors'] or A['DisplayEditors'], etc; a number or some flavor of etal
count: #a or #e
list_name: 'authors' or 'editors'
etal: author_etal or editor_etal
This function sets an error message when |display-xxxxors= value greater than or equal to number of names but
not when <max> comes from {{cs1 config}} global settings. When using global settings, <param> is set to the
keyword 'cs1 config' which is used to supress the normal error. Error is suppressed because it is to be expected
that some citations in an article will have the same or fewer names that the limit specified in {{cs1 config}}.
]]
local function get_display_names (max, count, list_name, etal, param)
if utilities.is_set (max) then
if 'etal' == max:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
max = count + 1; -- number of authors + 1 so display all author name plus et al.
etal = true; -- overrides value set by extract_names()
elseif max:match ('^%d+$') then -- if is a string of numbers
max = tonumber (max); -- make it a number
if (max >= count) and ('cs1 config' ~= param) then -- error when local |display-xxxxors= value greater than or equal to number of names; not an error when using global setting
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil;
end
else -- not a valid keyword or number
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil; -- unset; as if |display-xxxxors= had not been set
end
end
return max, etal;
end
--[[----------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >---------------
Adds error if |page=, |pages=, |quote-page=, |quote-pages= has what appears to be
some form of p. or pp. abbreviation in the first characters of the parameter content.
check page for extraneous p, p., pp, pp., pg, pg. at start of parameter value:
good pattern: '^P[^%.P%l]' matches when page begins PX or P# but not Px
where x and X are letters and # is a digit
bad pattern: '^[Pp][PpGg]' matches when page begins pp, pP, Pp, PP, pg, pG, Pg, PG
]]
local function extra_text_in_page_check (val, name)
if not val:match (cfg.vol_iss_pg_patterns.good_ppattern) then
for _, pattern in ipairs (cfg.vol_iss_pg_patterns.bad_ppatterns) do -- spin through the selected sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message ('err_extra_text_pages', name); -- add error message
return; -- and done
end
end
end
end
--[[--------------------------< E X T R A _ T E X T _ I N _ V O L _ I S S _ C H E C K >------------------------
Adds error if |volume= or |issue= has what appears to be some form of redundant 'type' indicator.
For |volume=:
'V.', or 'Vol.' (with or without the dot) abbreviations or 'Volume' in the first characters of the parameter
content (all case insensitive). 'V' and 'v' (without the dot) are presumed to be roman numerals so
are allowed.
For |issue=:
'No.', 'I.', 'Iss.' (with or without the dot) abbreviations, or 'Issue' in the first characters of the
parameter content (all case insensitive).
Single character values ('v', 'i', 'n') allowed when not followed by separator character ('.', ':', '=', or
whitespace character) – param values are trimmed of whitespace by MediaWiki before delivered to the module.
<val> is |volume= or |issue= parameter value
<name> is |volume= or |issue= parameter name for error message
<selector> is 'v' for |volume=, 'i' for |issue=
sets error message on failure; returns nothing
]]
local function extra_text_in_vol_iss_check (val, name, selector)
if not utilities.is_set (val) then
return;
end
local patterns = 'v' == selector and cfg.vol_iss_pg_patterns.vpatterns or cfg.vol_iss_pg_patterns.ipatterns;
local handler = 'v' == selector and 'err_extra_text_volume' or 'err_extra_text_issue';
val = val:lower(); -- force parameter value to lower case
for _, pattern in ipairs (patterns) do -- spin through the selected sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message (handler, name); -- add error message
return; -- and done
end
end
end
--[=[-------------------------< G E T _ V _ N A M E _ T A B L E >----------------------------------------------
split apart a |vauthors= or |veditors= parameter. This function allows for corporate names, wrapped in doubled
parentheses to also have commas; in the old version of the code, the doubled parentheses were included in the
rendered citation and in the metadata. Individual author names may be wikilinked
|vauthors=Jones AB, [[E. B. White|White EB]], ((Black, Brown, and Co.))
]=]
local function get_v_name_table (vparam, output_table, output_link_table)
local name_table = mw.text.split(vparam, "%s*,%s*"); -- names are separated by commas
local wl_type, label, link; -- wl_type not used here; just a placeholder
local i = 1;
while name_table[i] do
if name_table[i]:match ('^%(%(.*[^%)][^%)]$') then -- first segment of corporate with one or more commas; this segment has the opening doubled parentheses
local name = name_table[i];
i = i + 1; -- bump indexer to next segment
while name_table[i] do
name = name .. ', ' .. name_table[i]; -- concatenate with previous segments
if name_table[i]:match ('^.*%)%)$') then -- if this table member has the closing doubled parentheses
break; -- and done reassembling so
end
i = i + 1; -- bump indexer
end
table.insert (output_table, name); -- and add corporate name to the output table
table.insert (output_link_table, ''); -- no wikilink
else
wl_type, label, link = utilities.is_wikilink (name_table[i]); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
table.insert (output_table, label); -- add this name
if 1 == wl_type then
table.insert (output_link_table, label); -- simple wikilink [[D]]
else
table.insert (output_link_table, link); -- no wikilink or [[L|D]]; add this link if there is one, else empty string
end
end
i = i + 1;
end
return output_table;
end
--[[--------------------------< P A R S E _ V A U T H O R S _ V E D I T O R S >--------------------------------
This function extracts author / editor names from |vauthors= or |veditors= and finds matching |xxxxor-maskn= and
|xxxxor-linkn= in args. It then returns a table of assembled names just as extract_names() does.
Author / editor names in |vauthors= or |veditors= must be in Vancouver system style. Corporate or institutional names
may sometimes be required and because such names will often fail the is_good_vanc_name() and other format compliance
tests, are wrapped in doubled parentheses ((corporate name)) to suppress the format tests.
Supports generational suffixes Jr, 2nd, 3rd, 4th–6th.
This function sets the Vancouver error when a required comma is missing and when there is a space between an author's initials.
]]
local function parse_vauthors_veditors (args, vparam, list_name)
local names = {}; -- table of names assembled from |vauthors=, |author-maskn=, |author-linkn=
local v_name_table = {};
local v_link_table = {}; -- when name is wikilinked, targets go in this table
local etal = false; -- return value set to true when we find some form of et al. vauthors parameter
local last, first, link, mask, suffix;
local corporate = false;
vparam, etal = name_has_etal (vparam, etal, true); -- find and remove variations on et al. do not categorize (do it here because et al. might have a period)
v_name_table = get_v_name_table (vparam, v_name_table, v_link_table); -- names are separated by commas
for i, v_name in ipairs(v_name_table) do
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
local accept_name;
v_name, accept_name = utilities.has_accept_as_written (v_name); -- remove accept-this-as-written markup when it wraps all of <v_name>
if accept_name then
last = v_name;
corporate = true; -- flag used in list_people()
elseif string.find(v_name, "%s") then
if v_name:find('[;%.]') then -- look for commonly occurring punctuation characters;
add_vanc_error (cfg.err_msg_supl.punctuation, i);
end
local lastfirstTable = {}
lastfirstTable = mw.text.split(v_name, "%s+")
first = table.remove(lastfirstTable); -- removes and returns value of last element in table which should be initials or generational suffix
if not mw.ustring.match (first, '^%u+$') then -- mw.ustring here so that later we will catch non-Latin characters
suffix = first; -- not initials so assume that whatever we got is a generational suffix
first = table.remove(lastfirstTable); -- get what should be the initials from the table
end
last = table.concat(lastfirstTable, ' ') -- returns a string that is the concatenation of all other names that are not initials and generational suffix
if not utilities.is_set (last) then
first = ''; -- unset
last = v_name; -- last empty because something wrong with first
add_vanc_error (cfg.err_msg_supl.name, i);
end
if mw.ustring.match (last, '%a+%s+%u+%s+%a+') then
add_vanc_error (cfg.err_msg_supl['missing comma'], i); -- matches last II last; the case when a comma is missing
end
if mw.ustring.match (v_name, ' %u %u$') then -- this test is in the wrong place TODO: move or replace with a more appropriate test
add_vanc_error (cfg.err_msg_supl.initials, i); -- matches a space between two initials
end
else
last = v_name; -- last name or single corporate name? Doesn't support multiword corporate names? do we need this?
end
if utilities.is_set (first) then
if not mw.ustring.match (first, "^%u?%u$") then -- first shall contain one or two upper-case letters, nothing else
add_vanc_error (cfg.err_msg_supl.initials, i); -- too many initials; mixed case initials (which may be ok Romanization); hyphenated initials
end
is_good_vanc_name (last, first, suffix, i); -- check first and last before restoring the suffix which may have a non-Latin digit
if utilities.is_set (suffix) then
first = first .. ' ' .. suffix; -- if there was a suffix concatenate with the initials
suffix = ''; -- unset so we don't add this suffix to all subsequent names
end
else
if not corporate then
is_good_vanc_name (last, '', nil, i);
end
end
link = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i ) or v_link_table[i];
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
names[i] = {last = last, first = first, link = link, mask = mask, corporate = corporate}; -- add this assembled name to our names list
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< S E L E C T _ A U T H O R _ E D I T O R _ S O U R C E >------------------------
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or
select one of |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.
Only one of these appropriate three will be used. The hierarchy is: |authorn= (and aliases) highest and |authors= lowest;
|editorn= (and aliases) highest and |veditors= lowest (support for |editors= withdrawn)
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second
test which mimicks the test used in extract_names() when looking for a hole in the author name list. There may be a better
way to do this, I just haven't discovered what that way is.
Emits an error message when more than one xxxxor name source is provided.
In this function, vxxxxors = vauthors or veditors; xxxxors = authors as appropriate.
]]
local function select_author_editor_source (vxxxxors, xxxxors, args, list_name)
local lastfirst = false;
if utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 1 ) or -- do this twice in case we have a |first1= without a |last1=; this ...
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 1 ) or -- ... also catches the case where |first= is used with |vauthors=
utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 2 ) or
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 2 ) then
lastfirst = true;
end
if (utilities.is_set (vxxxxors) and true == lastfirst) or -- these are the three error conditions
(utilities.is_set (vxxxxors) and utilities.is_set (xxxxors)) or
(true == lastfirst and utilities.is_set (xxxxors)) then
local err_name;
if 'AuthorList' == list_name then -- figure out which name should be used in error message
err_name = 'author';
else
err_name = 'editor';
end
utilities.set_message ('err_redundant_parameters', err_name .. '-name-list parameters'); -- add error message
end
if true == lastfirst then return 1 end; -- return a number indicating which author name source to use
if utilities.is_set (vxxxxors) then return 2 end;
if utilities.is_set (xxxxors) then return 3 end;
return 1; -- no authors so return 1; this allows missing author name test to run in case there is a first without last
end
--[[--------------------------< I S _ V A L I D _ P A R A M E T E R _ V A L U E >------------------------------
This function is used to validate a parameter's assigned value for those parameters that have only a limited number
of allowable values (yes, y, true, live, dead, etc.). When the parameter value has not been assigned a value (missing
or empty in the source template) the function returns the value specified by ret_val. If the parameter value is one
of the list of allowed values returns the translated value; else, emits an error message and returns the value
specified by ret_val.
TODO: explain <invert>
]]
local function is_valid_parameter_value (value, name, possible, ret_val, invert)
if not utilities.is_set (value) then
return ret_val; -- an empty parameter is ok
end
if (not invert and utilities.in_array (value, possible)) then -- normal; <value> is in <possible> table
return cfg.keywords_xlate[value]; -- return translation of parameter keyword
elseif invert and not utilities.in_array (value, possible) then -- invert; <value> is not in <possible> table
return value; -- return <value> as it is
else
utilities.set_message ('err_invalid_param_val', {name, value}); -- not an allowed value so add error message
return ret_val;
end
end
--[[--------------------------< T E R M I N A T E _ N A M E _ L I S T >----------------------------------------
This function terminates a name list (author, contributor, editor) with a separator character (sepc) and a space
when the last character is not a sepc character or when the last three characters are not sepc followed by two
closing square brackets (close of a wikilink). When either of these is true, the name_list is terminated with a
single space character.
]]
local function terminate_name_list (name_list, sepc)
if (string.sub (name_list, -3, -1) == sepc .. '. ') then -- if already properly terminated
return name_list; -- just return the name list
elseif (string.sub (name_list, -1, -1) == sepc) or (string.sub (name_list, -3, -1) == sepc .. ']]') then -- if last name in list ends with sepc char
return name_list .. " "; -- don't add another
else
return name_list .. sepc .. ' '; -- otherwise terminate the name list
end
end
--[[-------------------------< F O R M A T _ V O L U M E _ I S S U E >-----------------------------------------
returns the concatenation of the formatted volume and issue (or journal article number) parameters as a single
string; or formatted volume or formatted issue, or an empty string if neither are set.
]]
local function format_volume_issue (volume, issue, article, cite_class, origin, sepc, lower)
if not utilities.is_set (volume) and not utilities.is_set (issue) and not utilities.is_set (article) then
return '';
end
-- same condition as in format_pages_sheets()
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
local is_numeric_vol = volume and (volume:match ('^[MDCLXVI]+$') or volume:match ('^%d+$')); -- is only uppercase roman numerals or only digits?
local is_long_vol = volume and (4 < mw.ustring.len(volume)); -- is |volume= value longer than 4 characters?
if volume and (not is_numeric_vol and is_long_vol) then -- when not all digits or Roman numerals, is |volume= longer than 4 characters?
utilities.add_prop_cat ('long-vol'); -- yes, add properties cat
end
if is_journal then -- journal-style formatting
local vol = '';
if utilities.is_set (volume) then
if is_numeric_vol then -- |volume= value all digits or all uppercase Roman numerals?
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, volume}); -- render in bold face
elseif is_long_vol then -- not all digits or Roman numerals; longer than 4 characters?
vol = utilities.substitute (cfg.messages['j-vol'], {sepc, utilities.hyphen_to_dash (volume)}); -- not bold
else -- four or fewer characters
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, utilities.hyphen_to_dash (volume)}); -- bold
end
end
vol = vol .. (utilities.is_set (issue) and utilities.substitute (cfg.messages['j-issue'], issue) or '')
vol = vol .. (utilities.is_set (article) and utilities.substitute (cfg.messages['j-article-num'], article) or '')
return vol;
end
if 'podcast' == cite_class and utilities.is_set (issue) then
return wrap_msg ('issue', {sepc, issue}, lower);
end
if 'conference' == cite_class and utilities.is_set (article) then -- |article-number= supported only in journal and conference cites
if utilities.is_set (volume) and utilities.is_set (article) then -- both volume and article number
return wrap_msg ('vol-art', {sepc, utilities.hyphen_to_dash (volume), article}, lower);
elseif utilities.is_set (article) then -- article number alone; when volume alone, handled below
return wrap_msg ('art', {sepc, article}, lower);
end
end
-- all other types of citation
if utilities.is_set (volume) and utilities.is_set (issue) then
return wrap_msg ('vol-no', {sepc, utilities.hyphen_to_dash (volume), issue}, lower);
elseif utilities.is_set (volume) then
return wrap_msg ('vol', {sepc, utilities.hyphen_to_dash (volume)}, lower);
else
return wrap_msg ('issue', {sepc, issue}, lower);
end
end
--[[-------------------------< F O R M A T _ P A G E S _ S H E E T S >-----------------------------------------
adds static text to one of |page(s)= or |sheet(s)= values and returns it with all of the others set to empty strings.
The return order is:
page, pages, sheet, sheets
Singular has priority over plural when both are provided.
]]
local function format_pages_sheets (page, pages, sheet, sheets, cite_class, origin, sepc, nopp, lower)
if 'map' == cite_class then -- only cite map supports sheet(s) as in-source locators
if utilities.is_set (sheet) then
if 'journal' == origin then
return '', '', wrap_msg ('j-sheet', sheet, lower), '';
else
return '', '', wrap_msg ('sheet', {sepc, sheet}, lower), '';
end
elseif utilities.is_set (sheets) then
if 'journal' == origin then
return '', '', '', wrap_msg ('j-sheets', sheets, lower);
else
return '', '', '', wrap_msg ('sheets', {sepc, sheets}, lower);
end
end
end
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
if utilities.is_set (page) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], page), '', '', '';
elseif not nopp then
return utilities.substitute (cfg.messages['p-prefix'], {sepc, page}), '', '', '';
else
return utilities.substitute (cfg.messages['nopp'], {sepc, page}), '', '', '';
end
elseif utilities.is_set (pages) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], pages), '', '', '';
elseif tonumber(pages) ~= nil and not nopp then -- if pages is only digits, assume a single page number
return '', utilities.substitute (cfg.messages['p-prefix'], {sepc, pages}), '', '';
elseif not nopp then
return '', utilities.substitute (cfg.messages['pp-prefix'], {sepc, pages}), '', '';
else
return '', utilities.substitute (cfg.messages['nopp'], {sepc, pages}), '', '';
end
end
return '', '', '', ''; -- return empty strings
end
--[[--------------------------< I N S O U R C E _ L O C _ G E T >----------------------------------------------
returns one of the in-source locators: page, pages, or at.
If any of these are interwiki links to Wikisource, returns the label portion of the interwiki-link as plain text
for use in COinS. This COinS thing is done because here we convert an interwiki-link to an external link and
add an icon span around that; get_coins_pages() doesn't know about the span. TODO: should it?
TODO: add support for sheet and sheets?; streamline;
TODO: make it so that this function returns only one of the three as the single in-source (the return value assigned
to a new name)?
]]
local function insource_loc_get (page, page_orig, pages, pages_orig, at)
local ws_url, ws_label, coins_pages, L; -- for Wikisource interwiki-links; TODO: this corrupts page metadata (span remains in place after cleanup; fix there?)
if utilities.is_set (page) then
if utilities.is_set (pages) or utilities.is_set (at) then
pages = ''; -- unset the others
at = '';
end
extra_text_in_page_check (page, page_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (page); -- make ws URL from |page= interwiki link; link portion L becomes tooltip label
if ws_url then
page = external_link (ws_url, ws_label .. ' ', 'ws link in page'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
page = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, page});
coins_pages = ws_label;
end
elseif utilities.is_set (pages) then
if utilities.is_set (at) then
at = ''; -- unset
end
extra_text_in_page_check (pages, pages_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (pages); -- make ws URL from |pages= interwiki link; link portion L becomes tooltip label
if ws_url then
pages = external_link (ws_url, ws_label .. ' ', 'ws link in pages'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
pages = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, pages});
coins_pages = ws_label;
end
elseif utilities.is_set (at) then
ws_url, ws_label, L = wikisource_url_make (at); -- make ws URL from |at= interwiki link; link portion L becomes tooltip label
if ws_url then
at = external_link (ws_url, ws_label .. ' ', 'ws link in at'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
at = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, at});
coins_pages = ws_label;
end
end
return page, pages, at, coins_pages;
end
--[[--------------------------< I S _ U N I Q U E _ A R C H I V E _ U R L >------------------------------------
add error message when |archive-url= value is same as |url= or chapter-url= (or alias...) value
]]
local function is_unique_archive_url (archive, url, c_url, source, date)
if utilities.is_set (archive) then
if archive == url or archive == c_url then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)}); -- add error message
return '', ''; -- unset |archive-url= and |archive-date= because same as |url= or |chapter-url=
end
end
return archive, date;
end
--[=[-------------------------< A R C H I V E _ U R L _ C H E C K >--------------------------------------------
Check archive.org URLs to make sure they at least look like they are pointing at valid archives and not to the
save snapshot URL or to calendar pages. When the archive URL is 'https://web.archive.org/save/' (or http://...)
archive.org saves a snapshot of the target page in the URL. That is something that Wikipedia should not allow
unwitting readers to do.
When the archive.org URL does not have a complete timestamp, archive.org chooses a snapshot according to its own
algorithm or provides a calendar 'search' result. [[WP:ELNO]] discourages links to search results.
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
|archive-date= and an error message when:
|archive-url= holds an archive.org save command URL
|archive-url= is an archive.org URL that does not have a complete timestamp (YYYYMMDDhhmmss 14 digits) in the
correct place
otherwise returns |archive-url= and |archive-date=
There are two mostly compatible archive.org URLs:
//web.archive.org/<timestamp>... -- the old form
//web.archive.org/web/<timestamp>... -- the new form
The old form does not support or map to the new form when it contains a display flag. There are four identified flags
('id_', 'js_', 'cs_', 'im_') but since archive.org ignores others following the same form (two letters and an underscore)
we don't check for these specific flags but we do check the form.
This function supports a preview mode. When the article is rendered in preview mode, this function may return a modified
archive URL:
for save command errors, return undated wildcard (/*/)
for timestamp errors when the timestamp has a wildcard, return the URL unmodified
for timestamp errors when the timestamp does not have a wildcard, return with timestamp limited to six digits plus wildcard (/yyyymm*/)
A secondary function is to return an archive-url timestamp from those urls that have them (archive.org and
archive.today). The timestamp is used by validation.archive_date_check() to see if the value in |archive-date=
matches the timestamp in the archive url.
]=]
local function archive_url_check (url, date)
local err_msg = ''; -- start with the error message empty
local path, timestamp, flag; -- portions of the archive.org URL
timestamp = url:match ('//archive.today/(%d%d%d%d%d%d%d%d%d%d%d%d%d%d)/'); -- get timestamp from archive.today urls
if timestamp then -- if this was an archive.today url ...
return url, date, timestamp; -- return ArchiveURL, ArchiveDate, and timestamp from |archive-url=, and done
end
-- here for archive.org urls
if (not url:match('//web%.archive%.org/')) and (not url:match('//liveweb%.archive%.org/')) then -- also deprecated liveweb Wayback machine URL
return url, date; -- not an archive.org archive, return ArchiveURL and ArchiveDate
end
if url:match('//web%.archive%.org/save/') then -- if a save command URL, we don't want to allow saving of the target page
err_msg = cfg.err_msg_supl.save;
url = url:gsub ('(//web%.archive%.org)/save/', '%1/*/', 1); -- for preview mode: modify ArchiveURL
elseif url:match('//liveweb%.archive%.org/') then
err_msg = cfg.err_msg_supl.liveweb;
else
path, timestamp, flag = url:match('//web%.archive%.org/([^%d]*)(%d+)([^/]*)/'); -- split out some of the URL parts for evaluation
if not path then -- malformed in some way; pattern did not match
err_msg = cfg.err_msg_supl.timestamp;
elseif 14 ~= timestamp:len() then -- path and flag optional, must have 14-digit timestamp here
err_msg = cfg.err_msg_supl.timestamp;
if '*' ~= flag then
local replacement = timestamp:match ('^%d%d%d%d%d%d') or timestamp:match ('^%d%d%d%d'); -- get the first 6 (YYYYMM) or first 4 digits (YYYY)
if replacement then -- nil if there aren't at least 4 digits (year)
replacement = replacement .. string.rep ('0', 14 - replacement:len()); -- year or yearmo (4 or 6 digits) zero-fill to make 14-digit timestamp
url=url:gsub ('(//web%.archive%.org/[^%d]*)%d[^/]*', '%1' .. replacement .. '*', 1) -- for preview, modify ts to 14 digits plus splat for calendar display
end
end
elseif utilities.is_set (path) and 'web/' ~= path then -- older archive URLs do not have the extra 'web/' path element
err_msg = cfg.err_msg_supl.path;
elseif utilities.is_set (flag) and not utilities.is_set (path) then -- flag not allowed with the old form URL (without the 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
elseif utilities.is_set (flag) and not flag:match ('%a%a_') then -- flag if present must be two alpha characters and underscore (requires 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
else
return url, date, timestamp; -- return ArchiveURL, ArchiveDate, and timestamp from |archive-url=
end
end
-- if here, something not right so
utilities.set_message ('err_archive_url', {err_msg}); -- add error message and
if is_preview_mode then
return url, date, timestamp; -- preview mode so return ArchiveURL, ArchiveDate, and timestamp from |archive-url=
else
return '', ''; -- return empty strings for ArchiveURL and ArchiveDate
end
end
--[[--------------------------< P L A C E _ C H E C K >--------------------------------------------------------
check |place=, |publication-place=, |location= to see if these params include digits. This function added because
many editors misuse location to specify the in-source location (|page(s)= and |at= are supposed to do that)
returns the original parameter value without modification; added maint cat when parameter value contains digits
]]
local function place_check (param_val)
if not utilities.is_set (param_val) then -- parameter empty or omitted
return param_val; -- return that empty state
end
if mw.ustring.find (param_val, '%d') then -- not empty, are there digits in the parameter value
utilities.set_message ('maint_location'); -- yep, add maint cat
end
return param_val; -- and done
end
--[[--------------------------< I S _ A R C H I V E D _ C O P Y >----------------------------------------------
compares |title= to 'Archived copy' (placeholder added by bots that can't find proper title); if matches, return true; nil else
]]
local function is_archived_copy (title)
title = mw.ustring.lower(title); -- switch title to lower case
if title:find (cfg.special_case_translation.archived_copy.en) then -- if title is 'Archived copy'
return true;
elseif cfg.special_case_translation.archived_copy['local'] then
if mw.ustring.find (title, cfg.special_case_translation.archived_copy['local']) then -- mw.ustring() because might not be Latin script
return true;
end
end
end
--[[--------------------------< C I T A T I O N 0 >------------------------------------------------------------
This is the main function doing the majority of the citation formatting.
]]
local function citation0( config, args )
--[[
Load Input Parameters
The argument_wrapper facilitates the mapping of multiple aliases to single internal variable.
]]
local A = argument_wrapper ( args );
local i
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
local author_etal;
local a = {}; -- authors list from |lastn= / |firstn= pairs or |vauthors=
local Authors;
local NameListStyle;
if cfg.global_cs1_config_t['NameListStyle'] then -- global setting in {{cs1 config}} overrides local |name-list-style= parameter value; nil when empty or assigned value invalid
NameListStyle = is_valid_parameter_value (cfg.global_cs1_config_t['NameListStyle'], 'cs1 config: name-list-style', cfg.keywords_lists['name-list-style'], ''); -- error messaging 'param' here is a hoax
else
NameListStyle = is_valid_parameter_value (A['NameListStyle'], A:ORIGIN('NameListStyle'), cfg.keywords_lists['name-list-style'], '');
end
if cfg.global_cs1_config_t['NameListStyle'] and utilities.is_set (A['NameListStyle']) then -- when template has |name-list-style=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
local Collaboration = A['Collaboration'];
do -- to limit scope of selected
local selected = select_author_editor_source (A['Vauthors'], A['Authors'], args, 'AuthorList');
if 1 == selected then
a, author_etal = extract_names (args, 'AuthorList'); -- fetch author list from |authorn= / |lastn= / |firstn=, |author-linkn=, and |author-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
a, author_etal = parse_vauthors_veditors (args, A['Vauthors'], 'AuthorList'); -- fetch author list from |vauthors=, |author-linkn=, and |author-maskn=
elseif 3 == selected then
Authors = A['Authors']; -- use content of |authors=
if 'authors' == A:ORIGIN('Authors') then -- but add a maint cat if the parameter is |authors=
utilities.set_message ('maint_authors'); -- because use of this parameter is discouraged; what to do about the aliases is a TODO:
end
end
if utilities.is_set (Collaboration) then
author_etal = true; -- so that |display-authors=etal not required
end
end
local editor_etal;
local e = {}; -- editors list from |editor-lastn= / |editor-firstn= pairs or |veditors=
do -- to limit scope of selected
local selected = select_author_editor_source (A['Veditors'], nil, args, 'EditorList'); -- support for |editors= withdrawn
if 1 == selected then
e, editor_etal = extract_names (args, 'EditorList'); -- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
e, editor_etal = parse_vauthors_veditors (args, args.veditors, 'EditorList'); -- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=
end
end
local Chapter = A['Chapter']; -- done here so that we have access to |contribution= from |chapter= aliases
local Chapter_origin = A:ORIGIN ('Chapter');
local Contribution; -- because contribution is required for contributor(s)
if 'contribution' == Chapter_origin then
Contribution = Chapter; -- get the name of the contribution
end
local c = {}; -- contributors list from |contributor-lastn= / contributor-firstn= pairs
if utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (A['Periodical']) then -- |contributor= and |contribution= only supported in book cites
c = extract_names (args, 'ContributorList'); -- fetch contributor list from |contributorn= / |contributor-lastn=, -firstn=, -linkn=, -maskn=
if 0 < #c then
if not utilities.is_set (Contribution) then -- |contributor= requires |contribution=
utilities.set_message ('err_contributor_missing_required_param', 'contribution'); -- add missing contribution error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
if 0 == #a then -- |contributor= requires |author=
utilities.set_message ('err_contributor_missing_required_param', 'author'); -- add missing author error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
end
else -- if not a book cite
if utilities.select_one (args, cfg.aliases['ContributorList-Last'], 'err_redundant_parameters', 1 ) then -- are there contributor name list parameters?
utilities.set_message ('err_contributor_ignored'); -- add contributor ignored error message
end
Contribution = nil; -- unset
end
local Title = A['Title'];
local TitleLink = A['TitleLink'];
local auto_select = ''; -- default is auto
local accept_link;
TitleLink, accept_link = utilities.has_accept_as_written (TitleLink, true); -- test for accept-this-as-written markup
if (not accept_link) and utilities.in_array (TitleLink, {'none', 'pmc', 'doi'}) then -- check for special keywords
auto_select = TitleLink; -- remember selection for later
TitleLink = ''; -- treat as if |title-link= would have been empty
end
TitleLink = link_title_ok (TitleLink, A:ORIGIN ('TitleLink'), Title, 'title'); -- check for wiki-markup in |title-link= or wiki-markup in |title= when |title-link= is set
local Section = ''; -- {{cite map}} only; preset to empty string for concatenation if not used
if 'map' == config.CitationClass and 'section' == Chapter_origin then
Section = A['Chapter']; -- get |section= from |chapter= alias list; |chapter= and the other aliases not supported in {{cite map}}
Chapter = ''; -- unset for now; will be reset later from |map= if present
end
local Periodical = A['Periodical'];
local Periodical_origin = A:ORIGIN('Periodical');
local ScriptPeriodical = A['ScriptPeriodical'];
local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
local TransPeriodical = A['TransPeriodical'];
local TransPeriodical_origin = A:ORIGIN ('TransPeriodical');
if (utilities.in_array (config.CitationClass, {'book', 'encyclopaedia'}) and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (ScriptPeriodical))) then
local param;
if utilities.is_set (Periodical) then -- get a parameter name from one of these periodical related meta-parameters
Periodical = nil; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = Periodical_origin -- get parameter name for error messaging
elseif utilities.is_set (TransPeriodical) then
TransPeriodical = nil; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = TransPeriodical_origin; -- get parameter name for error messaging
elseif utilities.is_set (ScriptPeriodical) then
ScriptPeriodical = nil; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = ScriptPeriodical_origin; -- get parameter name for error messaging
end
if utilities.is_set (param) then -- if we found one
utilities.set_message ('err_periodical_ignored', {param}); -- emit an error message
end
end
if utilities.is_set (Periodical) then
local i;
Periodical, i = utilities.strip_apostrophe_markup (Periodical); -- strip apostrophe markup so that metadata isn't contaminated
if i then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {Periodical_origin});
end
end
if 'mailinglist' == config.CitationClass then -- special case for {{cite mailing list}}
if utilities.is_set (Periodical) and utilities.is_set (A ['MailingList']) then -- both set emit an error TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', Periodical_origin) .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'mailinglist')});
end
Periodical = A ['MailingList']; -- error or no, set Periodical to |mailinglist= value because this template is {{cite mailing list}}
Periodical_origin = A:ORIGIN('MailingList');
end
-- web and news not tested for now because of
-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
if not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message
local p = {['journal'] = 'journal', ['magazine'] = 'magazine'}; -- for error message
if p[config.CitationClass] then
utilities.set_message ('err_missing_periodical', {config.CitationClass, p[config.CitationClass]});
end
end
local Volume;
-- local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) then
if not utilities.in_array (Periodical_origin, cfg.citation_no_volume_t) then -- {{citation}} does not render |volume= when these parameters are used
Volume = A['Volume']; -- but does for all other 'periodicals'
end
elseif utilities.is_set (ScriptPeriodical) then
if 'script-website' ~= ScriptPeriodical_origin then -- {{citation}} does not render volume for |script-website=
Volume = A['Volume']; -- but does for all other 'periodicals'
end
else
Volume = A['Volume']; -- and does for non-'periodical' cites
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_volume) then -- render |volume= for cs1 according to the configuration settings
Volume = A['Volume'];
end
extra_text_in_vol_iss_check (Volume, A:ORIGIN ('Volume'), 'v');
local Issue;
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) and utilities.in_array (Periodical_origin, cfg.citation_issue_t) then -- {{citation}} may render |issue= when these parameters are used
Issue = utilities.hyphen_to_dash (A['Issue']);
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_issue) then -- conference & map books do not support issue; {{citation}} listed here because included in settings table
if not (utilities.in_array (config.CitationClass, {'conference', 'map', 'citation'}) and not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical))) then
Issue = utilities.hyphen_to_dash (A['Issue']);
end
end
local ArticleNumber;
if utilities.in_array (config.CitationClass, {'journal', 'conference'}) or ('citation' == config.CitationClass and utilities.is_set (Periodical) and 'journal' == Periodical_origin) then
ArticleNumber = A['ArticleNumber'];
end
extra_text_in_vol_iss_check (Issue, A:ORIGIN ('Issue'), 'i');
local Page;
local Pages;
local At;
local QuotePage;
local QuotePages;
if not utilities.in_array (config.CitationClass, cfg.templates_not_using_page) then -- TODO: rewrite to emit ignored parameter error message?
Page = A['Page'];
Pages = utilities.hyphen_to_dash (A['Pages']);
At = A['At'];
QuotePage = A['QuotePage'];
QuotePages = utilities.hyphen_to_dash (A['QuotePages']);
end
local Edition = A['Edition'];
local PublicationPlace = place_check (A['PublicationPlace'], A:ORIGIN('PublicationPlace'));
local Place = place_check (A['Place'], A:ORIGIN('Place'));
local PublisherName = A['PublisherName'];
local PublisherName_origin = A:ORIGIN('PublisherName');
if utilities.is_set (PublisherName) and (cfg.keywords_xlate['none'] ~= PublisherName) then
local i = 0;
PublisherName, i = utilities.strip_apostrophe_markup (PublisherName); -- strip apostrophe markup so that metadata isn't contaminated; publisher is never italicized
if i and (0 < i) then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {PublisherName_origin});
end
end
if ('document' == config.CitationClass) and not utilities.is_set (PublisherName) then
utilities.set_message ('err_missing_publisher', {config.CitationClass, 'publisher'});
end
local Newsgroup = A['Newsgroup']; -- TODO: strip apostrophe markup?
local Newsgroup_origin = A:ORIGIN('Newsgroup');
if 'newsgroup' == config.CitationClass then
if utilities.is_set (PublisherName) and (cfg.keywords_xlate['none'] ~= PublisherName) then -- general use parameter |publisher= not allowed in cite newsgroup
utilities.set_message ('err_parameter_ignored', {PublisherName_origin});
end
PublisherName = nil; -- ensure that this parameter is unset for the time being; will be used again after COinS
end
local URL = A['URL']; -- TODO: better way to do this for URL, ChapterURL, and MapURL?
local UrlAccess = is_valid_parameter_value (A['UrlAccess'], A:ORIGIN('UrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (URL) and utilities.is_set (UrlAccess) then
UrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', 'url');
end
local ChapterURL = A['ChapterURL'];
local ChapterUrlAccess = is_valid_parameter_value (A['ChapterUrlAccess'], A:ORIGIN('ChapterUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (ChapterURL) and utilities.is_set (ChapterUrlAccess) then
ChapterUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {A:ORIGIN('ChapterUrlAccess'):gsub ('%-access', '')});
end
local MapUrlAccess = is_valid_parameter_value (A['MapUrlAccess'], A:ORIGIN('MapUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (A['MapURL']) and utilities.is_set (MapUrlAccess) then
MapUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {'map-url'});
end
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
local no_tracking_cats = is_valid_parameter_value (A['NoTracking'], A:ORIGIN('NoTracking'), cfg.keywords_lists['yes_true_y'], nil);
-- check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories
if not utilities.is_set (no_tracking_cats) then -- ignore if we are already not going to categorize this page
if cfg.uncategorized_namespaces[this_page.namespace] then -- is this page's namespace id one of the uncategorized namespace ids?
no_tracking_cats = "true"; -- set no_tracking_cats
end
for _, v in ipairs (cfg.uncategorized_subpages) do -- cycle through page name patterns
if this_page.text:match (v) then -- test page name against each pattern
no_tracking_cats = "true"; -- set no_tracking_cats
break; -- bail out if one is found
end
end
end
-- check for extra |page=, |pages= or |at= parameters. (also sheet and sheets while we're at it)
utilities.select_one (args, {'page', 'p', 'pp', 'pages', 'at', 'sheet', 'sheets'}, 'err_redundant_parameters'); -- this is a dummy call simply to get the error message and category
local coins_pages;
Page, Pages, At, coins_pages = insource_loc_get (Page, A:ORIGIN('Page'), Pages, A:ORIGIN('Pages'), At);
local NoPP = is_valid_parameter_value (A['NoPP'], A:ORIGIN('NoPP'), cfg.keywords_lists['yes_true_y'], nil);
if utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- both |publication-place= and |place= (|location=) allowed if different
utilities.add_prop_cat ('location-test'); -- add property cat to evaluate how often PublicationPlace and Place are used together
if PublicationPlace == Place then
Place = ''; -- unset; don't need both if they are the same
end
elseif not utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- when only |place= (|location=) is set ...
PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
end
if PublicationPlace == Place then Place = ''; end -- don't need both if they are the same
local URL_origin = A:ORIGIN('URL'); -- get name of parameter that holds URL
local ChapterURL_origin = A:ORIGIN('ChapterURL'); -- get name of parameter that holds ChapterURL
local ScriptChapter = A['ScriptChapter'];
local ScriptChapter_origin = A:ORIGIN ('ScriptChapter');
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local TransChapter = A['TransChapter'];
local TransChapter_origin = A:ORIGIN ('TransChapter');
local TransTitle = A['TransTitle'];
local ScriptTitle = A['ScriptTitle'];
--[[
Parameter remapping for cite encyclopedia:
When the citation has these parameters:
|encyclopedia= and |title= then map |title= to |article= and |encyclopedia= to |title= for rendering
|encyclopedia= and |article= then map |encyclopedia= to |title= for rendering
|trans-title= maps to |trans-chapter= when |title= is re-mapped
|url= maps to |chapter-url= when |title= is remapped
All other combinations of |encyclopedia=, |title=, and |article= are not modified
]]
local Encyclopedia = A['Encyclopedia']; -- used as a flag by this module and by ~/COinS
if utilities.is_set (Encyclopedia) then -- emit error message when Encyclopedia set but template is other than {{cite encyclopedia}} or {{citation}}
if 'encyclopaedia' ~= config.CitationClass and 'citation' ~= config.CitationClass then
utilities.set_message ('err_parameter_ignored', {A:ORIGIN ('Encyclopedia')});
Encyclopedia = nil; -- unset because not supported by this template
end
end
if ('encyclopaedia' == config.CitationClass) or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Periodical) and utilities.is_set (Encyclopedia) then -- when both parameters set emit an error message; {{citation}} only; Periodical not allowed in {{cite encyclopedia}}
utilities.set_message ('err_periodical_ignored', {Periodical_origin});
end
if utilities.is_set (Encyclopedia) then
Periodical = Encyclopedia; -- error or no, set Periodical to Encyclopedia for rendering; {{citation}} could (not legitimately) have both; use Encyclopedia
Periodical_origin = A:ORIGIN ('Encyclopedia');
if utilities.is_set (Title) or utilities.is_set (ScriptTitle) then
if not utilities.is_set (Chapter) then
Chapter = Title; -- |encyclopedia= and |title= are set so map |title= to |article= and |encyclopedia= to |title= for rendering
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle')
TransChapter = TransTitle;
ChapterURL = URL;
ChapterURL_origin = URL_origin;
ChapterUrlAccess = UrlAccess;
if not utilities.is_set (ChapterURL) and utilities.is_set (TitleLink) then
Chapter = utilities.make_wikilink (TitleLink, Chapter);
end
Title = Periodical;
ChapterFormat = Format;
Periodical = ''; -- redundant so unset
TransTitle = '';
URL = '';
Format = '';
TitleLink = '';
ScriptTitle = '';
end
elseif utilities.is_set (Chapter) or utilities.is_set (ScriptChapter) then -- |title= not set
Title = Periodical; -- |encyclopedia= set and |article= set so map |encyclopedia= to |title= for rendering
Periodical = ''; -- redundant so unset
end
end
end
-- special case for cite techreport.
local ID = A['ID'];
if (config.CitationClass == "techreport") then -- special case for cite techreport
if utilities.is_set (A['Number']) then -- cite techreport uses 'number', which other citations alias to 'issue'
if not utilities.is_set (ID) then -- can we use ID for the "number"?
ID = A['Number']; -- yes, use it
else -- ID has a value so emit error message
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'id') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'number')});
end
end
end
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.
local ChapterLink -- = A['ChapterLink']; -- deprecated as a parameter but still used internally by cite episode
local Conference = A['Conference'];
local BookTitle = A['BookTitle'];
local TransTitle_origin = A:ORIGIN ('TransTitle');
if 'conference' == config.CitationClass then
if utilities.is_set (BookTitle) then
Chapter = Title;
Chapter_origin = 'title';
-- ChapterLink = TitleLink; -- |chapter-link= is deprecated
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
URL_origin = '';
ChapterFormat = Format;
TransChapter = TransTitle;
TransChapter_origin = TransTitle_origin;
Title = BookTitle;
Format = '';
-- TitleLink = '';
TransTitle = '';
URL = '';
end
elseif 'speech' ~= config.CitationClass then
Conference = ''; -- not cite conference or cite speech so make sure this is empty string
end
-- CS1/2 mode
local Mode;
if cfg.global_cs1_config_t['Mode'] then -- global setting in {{cs1 config}} overrides local |mode= parameter value; nil when empty or assigned value invalid
Mode = is_valid_parameter_value (cfg.global_cs1_config_t['Mode'], 'cs1 config: mode', cfg.keywords_lists['mode'], ''); -- error messaging 'param' here is a hoax
else
Mode = is_valid_parameter_value (A['Mode'], A:ORIGIN('Mode'), cfg.keywords_lists['mode'], '');
end
if cfg.global_cs1_config_t['Mode'] and utilities.is_set (A['Mode']) then -- when template has |mode=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
-- separator character and postscript
local sepc, PostScript = set_style (Mode:lower(), A['PostScript'], config.CitationClass);
-- controls capitalization of certain static text
local use_lowercase = ( sepc == ',' );
-- cite map oddities
local Cartography = "";
local Scale = "";
local Sheet = A['Sheet'] or '';
local Sheets = A['Sheets'] or '';
if config.CitationClass == "map" then
if utilities.is_set (Chapter) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'map') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', Chapter_origin)}); -- add error message
end
Chapter = A['Map'];
Chapter_origin = A:ORIGIN('Map');
ChapterURL = A['MapURL'];
ChapterURL_origin = A:ORIGIN('MapURL');
TransChapter = A['TransMap'];
ScriptChapter = A['ScriptMap']
ScriptChapter_origin = A:ORIGIN('ScriptMap')
ChapterUrlAccess = MapUrlAccess;
ChapterFormat = A['MapFormat'];
Cartography = A['Cartography'];
if utilities.is_set ( Cartography ) then
Cartography = sepc .. " " .. wrap_msg ('cartography', Cartography, use_lowercase);
end
Scale = A['Scale'];
if utilities.is_set ( Scale ) then
Scale = sepc .. " " .. Scale;
end
end
-- Account for the oddities that are {{cite episode}} and {{cite serial}}, before generation of COinS data.
local Series = A['Series'];
if 'episode' == config.CitationClass or 'serial' == config.CitationClass then
local SeriesLink = A['SeriesLink'];
SeriesLink = link_title_ok (SeriesLink, A:ORIGIN ('SeriesLink'), Series, 'series'); -- check for wiki-markup in |series-link= or wiki-markup in |series= when |series-link= is set
local Network = A['Network'];
local Station = A['Station'];
local s, n = {}, {};
-- do common parameters first
if utilities.is_set (Network) then table.insert(n, Network); end
if utilities.is_set (Station) then table.insert(n, Station); end
ID = table.concat(n, sepc .. ' ');
if 'episode' == config.CitationClass then -- handle the oddities that are strictly {{cite episode}}
local Season = A['Season'];
local SeriesNumber = A['SeriesNumber'];
if utilities.is_set (Season) and utilities.is_set (SeriesNumber) then -- these are mutually exclusive so if both are set TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'season') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'seriesno')}); -- add error message
SeriesNumber = ''; -- unset; prefer |season= over |seriesno=
end
-- assemble a table of parts concatenated later into Series
if utilities.is_set (Season) then table.insert(s, wrap_msg ('season', Season, use_lowercase)); end
if utilities.is_set (SeriesNumber) then table.insert(s, wrap_msg ('seriesnum', SeriesNumber, use_lowercase)); end
if utilities.is_set (Issue) then table.insert(s, wrap_msg ('episode', Issue, use_lowercase)); end
Issue = ''; -- unset because this is not a unique parameter
Chapter = Title; -- promote title parameters to chapter
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle');
ChapterLink = TitleLink; -- alias |episode-link=
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
ChapterFormat = Format;
Title = Series; -- promote series to title
TitleLink = SeriesLink;
Series = table.concat(s, sepc .. ' '); -- this is concatenation of season, seriesno, episode number
if utilities.is_set (ChapterLink) and not utilities.is_set (ChapterURL) then -- link but not URL
Chapter = utilities.make_wikilink (ChapterLink, Chapter);
elseif utilities.is_set (ChapterLink) and utilities.is_set (ChapterURL) then -- if both are set, URL links episode;
Series = utilities.make_wikilink (ChapterLink, Series);
end
URL = ''; -- unset
TransTitle = '';
ScriptTitle = '';
Format = '';
else -- now oddities that are cite serial
Issue = ''; -- unset because this parameter no longer supported by the citation/core version of cite serial
Chapter = A['Episode']; -- TODO: make |episode= available to cite episode someday?
if utilities.is_set (Series) and utilities.is_set (SeriesLink) then
Series = utilities.make_wikilink (SeriesLink, Series);
end
Series = utilities.wrap_style ('italic-title', Series); -- series is italicized
end
end
-- end of {{cite episode}} stuff
-- handle type parameter for those CS1 citations that have default values
local TitleType = A['TitleType'];
local Degree = A['Degree'];
if utilities.in_array (config.CitationClass, {'AV-media-notes', 'document', 'interview', 'mailinglist', 'map', 'podcast', 'pressrelease', 'report', 'speech', 'techreport', 'thesis'}) then
TitleType = set_titletype (config.CitationClass, TitleType);
if utilities.is_set (Degree) and "Thesis" == TitleType then -- special case for cite thesis
TitleType = Degree .. ' ' .. cfg.title_types ['thesis']:lower();
end
end
if utilities.is_set (TitleType) then -- if type parameter is specified
TitleType = utilities.substitute ( cfg.messages['type'], TitleType); -- display it in parentheses
-- TODO: Hack on TitleType to fix bunched parentheses problem
end
-- legacy: promote PublicationDate to Date if neither Date nor Year are set.
local Date = A['Date'];
local Date_origin; -- to hold the name of parameter promoted to Date; required for date error messaging
local PublicationDate = A['PublicationDate'];
local Year = A['Year'];
if not utilities.is_set (Date) then
Date = Year; -- promote Year to Date
Year = nil; -- make nil so Year as empty string isn't used for CITEREF
if not utilities.is_set (Date) and utilities.is_set (PublicationDate) then -- use PublicationDate when |date= and |year= are not set
Date = PublicationDate; -- promote PublicationDate to Date
PublicationDate = ''; -- unset, no longer needed
Date_origin = A:ORIGIN('PublicationDate'); -- save the name of the promoted parameter
else
Date_origin = A:ORIGIN('Year'); -- save the name of the promoted parameter
end
else
Date_origin = A:ORIGIN('Date'); -- not a promotion; name required for error messaging
end
if PublicationDate == Date then PublicationDate = ''; end -- if PublicationDate is same as Date, don't display in rendered citation
--[[
Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where
we get the date used in the metadata.
Date validation supporting code is in Module:Citation/CS1/Date_validation
]]
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], '');
if not utilities.is_set (DF) then
DF = cfg.global_df; -- local |df= if present overrides global df set by {{use xxx date}} template
end
local ArchiveURL;
local ArchiveDate;
local ArchiveFormat = A['ArchiveFormat'];
local archive_url_timestamp; -- timestamp from wayback machine url
ArchiveURL, ArchiveDate, archive_url_timestamp = archive_url_check (A['ArchiveURL'], A['ArchiveDate'])
ArchiveFormat = style_format (ArchiveFormat, ArchiveURL, 'archive-format', 'archive-url');
ArchiveURL, ArchiveDate = is_unique_archive_url (ArchiveURL, URL, ChapterURL, A:ORIGIN('ArchiveURL'), ArchiveDate); -- add error message when URL or ChapterURL == ArchiveURL
local AccessDate = A['AccessDate'];
-- local LayDate = A['LayDate'];
local COinS_date = {}; -- holds date info extracted from |date= for the COinS metadata by Module:Date verification
local DoiBroken = A['DoiBroken'];
local Embargo = A['Embargo'];
local anchor_year; -- used in the CITEREF identifier
do -- create defined block to contain local variables error_message, date_parameters_list, mismatch
local error_message = '';
-- AirDate has been promoted to Date so not necessary to check it
local date_parameters_list = {
['access-date'] = {val = AccessDate, name = A:ORIGIN ('AccessDate')},
['archive-date'] = {val = ArchiveDate, name = A:ORIGIN ('ArchiveDate')},
['date'] = {val = Date, name = Date_origin},
['doi-broken-date'] = {val = DoiBroken, name = A:ORIGIN ('DoiBroken')},
['pmc-embargo-date'] = {val = Embargo, name = A:ORIGIN ('Embargo')},
-- ['lay-date'] = {val = LayDate, name = A:ORIGIN ('LayDate')},
['publication-date'] = {val = PublicationDate, name = A:ORIGIN ('PublicationDate')},
['year'] = {val = Year, name = A:ORIGIN ('Year')},
};
local error_list = {};
anchor_year, Embargo = validation.dates(date_parameters_list, COinS_date, error_list);
-- start temporary Julian / Gregorian calendar uncertainty categorization
if COinS_date.inter_cal_cat then
utilities.add_prop_cat ('jul-greg-uncertainty');
end
-- end temporary Julian / Gregorian calendar uncertainty categorization
if utilities.is_set (Year) and utilities.is_set (Date) then -- both |date= and |year= not normally needed;
validation.year_date_check (Year, A:ORIGIN ('Year'), Date, A:ORIGIN ('Date'), error_list);
end
if 0 == #error_list then -- error free dates only; 0 when error_list is empty
local modified = false; -- flag
if utilities.is_set (DF) then -- if we need to reformat dates
modified = validation.reformat_dates (date_parameters_list, DF); -- reformat to DF format, use long month names if appropriate
end
if true == validation.date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate
modified = true;
utilities.set_message ('maint_date_format'); -- hyphens were converted so add maint category
end
-- for those wikis that can and want to have English date names translated to the local language; not supported at en.wiki
if cfg.date_name_auto_xlate_enable and validation.date_name_xlate (date_parameters_list, cfg.date_digit_auto_xlate_enable ) then
utilities.set_message ('maint_date_auto_xlated'); -- add maint cat
modified = true;
end
if modified then -- if the date_parameters_list values were modified
AccessDate = date_parameters_list['access-date'].val; -- overwrite date holding parameters with modified values
ArchiveDate = date_parameters_list['archive-date'].val;
Date = date_parameters_list['date'].val;
DoiBroken = date_parameters_list['doi-broken-date'].val;
-- LayDate = date_parameters_list['lay-date'].val;
PublicationDate = date_parameters_list['publication-date'].val;
end
if archive_url_timestamp and utilities.is_set (ArchiveDate) then
validation.archive_date_check (ArchiveDate, archive_url_timestamp); -- does YYYYMMDD in archive_url_timestamp match date in ArchiveDate
end
else
utilities.set_message ('err_bad_date', {utilities.make_sep_list (#error_list, error_list)}); -- add this error message
end
end -- end of do
if utilities.in_array (config.CitationClass, {'book', 'encyclopaedia'}) or -- {{cite book}}, {{cite encyclopedia}}; TODO: {{cite conference}} and others?
('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) or -- {{citation}} as an encylopedia citation
('citation' == config.CitationClass and not utilities.is_set (Periodical)) then -- {{citation}} as a book citation
if utilities.is_set (PublicationPlace) then
if not utilities.is_set (PublisherName) then
local date = COinS_date.rftdate and tonumber (COinS_date.rftdate:match ('%d%d%d%d')); -- get year portion of COinS date (because in Arabic numerals); convert string to number
if date and (1850 <= date) then -- location has no publisher; if date is 1850 or later
utilities.set_message ('maint_location_no_publisher'); -- add maint cat
end
else -- PublisherName has a value
if cfg.keywords_xlate['none'] == PublisherName then -- if that value is 'none' (only for book and encyclopedia citations)
PublisherName = ''; -- unset
end
end
end
end
local ID_list = {}; -- sequence table of rendered identifiers
local ID_list_coins = {}; -- table of identifiers and their values from args; key is same as cfg.id_handlers's key
local Class = A['Class']; -- arxiv class identifier
local ID_support = {
{A['ASINTLD'], 'ASIN', 'err_asintld_missing_asin', A:ORIGIN ('ASINTLD')},
{DoiBroken, 'DOI', 'err_doibroken_missing_doi', A:ORIGIN ('DoiBroken')},
{Embargo, 'PMC', 'err_embargo_missing_pmc', A:ORIGIN ('Embargo')},
}
ID_list, ID_list_coins = identifiers.identifier_lists_get (args, {DoiBroken = DoiBroken, ASINTLD = A['ASINTLD'], Embargo = Embargo, Class = Class}, ID_support);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, {{cite ssrn}}, before generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then -- |arxiv= or |eprint= required for cite arxiv; |biorxiv=, |citeseerx=, |medrxiv=, |ssrn= required for their templates
if not (args[cfg.id_handlers[config.CitationClass:upper()].parameters[1]] or -- can't use ID_list_coins k/v table here because invalid parameters omitted
args[cfg.id_handlers[config.CitationClass:upper()].parameters[2]]) then -- which causes unexpected parameter missing error message
utilities.set_message ('err_' .. config.CitationClass .. '_missing'); -- add error message
end
Periodical = ({['arxiv'] = 'arXiv', ['biorxiv'] = 'bioRxiv', ['citeseerx'] = 'CiteSeerX', ['medrxiv'] = 'medRxiv', ['ssrn'] = 'Social Science Research Network'})[config.CitationClass];
end
-- Link the title of the work if no |url= was provided, but we have a |pmc= or a |doi= with |doi-access=free
if config.CitationClass == "journal" and not utilities.is_set (URL) and not utilities.is_set (TitleLink) and not utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) then -- TODO: remove 'none' once existing citations have been switched to 'off', so 'none' can be used as token for "no title" instead
if 'none' ~= cfg.keywords_xlate[auto_select] then -- if auto-linking not disabled
if identifiers.auto_link_urls[auto_select] then -- manual selection
URL = identifiers.auto_link_urls[auto_select]; -- set URL to be the same as identifier's external link
URL_origin = cfg.id_handlers[auto_select:upper()].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['pmc'] then -- auto-select PMC
URL = identifiers.auto_link_urls['pmc']; -- set URL to be the same as the PMC external link if not embargoed
URL_origin = cfg.id_handlers['PMC'].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['doi'] then -- auto-select DOI
URL = identifiers.auto_link_urls['doi'];
URL_origin = cfg.id_handlers['DOI'].parameters[1];
end
end
if utilities.is_set (URL) then -- set when using an identifier-created URL
if utilities.is_set (AccessDate) then -- |access-date= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_accessdate_missing_url'); -- add an error message
AccessDate = ''; -- unset
end
if utilities.is_set (ArchiveURL) then -- |archive-url= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_archive_missing_url'); -- add an error message
ArchiveURL = ''; -- unset
end
end
end
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
-- Test if citation has no title
if not utilities.is_set (Title) and not utilities.is_set (TransTitle) and not utilities.is_set (ScriptTitle) then -- has special case for cite episode
utilities.set_message ('err_citation_missing_title', {'episode' == config.CitationClass and 'series' or 'title'});
end
if utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) and
utilities.in_array (config.CitationClass, {'journal', 'citation'}) and
(utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and
('journal' == Periodical_origin or 'script-journal' == ScriptPeriodical_origin) then -- special case for journal cites
Title = ''; -- set title to empty string
utilities.set_message ('maint_untitled'); -- add maint cat
end
-- COinS metadata (see <http://ocoins.info/>) for automated parsing of citation information.
-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that
-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title
-- is the article title, and Chapter is a section within the article. So, we remap
local coins_chapter = Chapter; -- default assuming that remapping not required
local coins_title = Title; -- et tu
if 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Chapter) and utilities.is_set (Title) and utilities.is_set (Periodical) then -- if all are used then
coins_chapter = Title; -- remap
coins_title = Periodical;
end
end
local coins_author = a; -- default for coins rft.au
if 0 < #c then -- but if contributor list
coins_author = c; -- use that instead
end
-- this is the function call to COinS()
local OCinSoutput = metadata.COinS({
['Periodical'] = utilities.strip_apostrophe_markup (Periodical), -- no markup in the metadata
['Encyclopedia'] = Encyclopedia, -- just a flag; content ignored by ~/COinS
['Chapter'] = metadata.make_coins_title (coins_chapter, ScriptChapter), -- Chapter and ScriptChapter stripped of bold / italic / accept-as-written markup
['Degree'] = Degree; -- cite thesis only
['Title'] = metadata.make_coins_title (coins_title, ScriptTitle), -- Title and ScriptTitle stripped of bold / italic / accept-as-written markup
['PublicationPlace'] = PublicationPlace,
['Date'] = COinS_date.rftdate, -- COinS_date.* has correctly formatted date values if Date is valid;
['Season'] = COinS_date.rftssn,
['Quarter'] = COinS_date.rftquarter,
['Chron'] = COinS_date.rftchron,
['Series'] = Series,
['Volume'] = Volume,
['Issue'] = Issue,
['ArticleNumber'] = ArticleNumber,
['Pages'] = coins_pages or metadata.get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At, QuotePage, QuotePages}, 7)), -- pages stripped of external links
['Edition'] = Edition,
['PublisherName'] = PublisherName or Newsgroup, -- any apostrophe markup already removed from PublisherName
['URL'] = first_set ({ChapterURL, URL}, 2),
['Authors'] = coins_author,
['ID_list'] = ID_list_coins,
['RawPage'] = this_page.prefixedText,
}, config.CitationClass);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, and {{cite ssrn}} AFTER generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then -- we have set rft.jtitle in COinS to arXiv, bioRxiv, CiteSeerX, medRxiv, or ssrn now unset so it isn't displayed
Periodical = ''; -- periodical not allowed in these templates; if article has been published, use cite journal
end
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername to include some static text
if 'newsgroup' == config.CitationClass and utilities.is_set (Newsgroup) then
PublisherName = utilities.substitute (cfg.messages['newsgroup'], external_link( 'news:' .. Newsgroup, Newsgroup, Newsgroup_origin, nil ));
end
local Editors;
local EditorCount; -- used only for choosing {ed.) or (eds.) annotation at end of editor name-list
local Contributors; -- assembled contributors name list
local contributor_etal;
local Translators; -- assembled translators name list
local translator_etal;
local t = {}; -- translators list from |translator-lastn= / translator-firstn= pairs
t = extract_names (args, 'TranslatorList'); -- fetch translator list from |translatorn= / |translator-lastn=, -firstn=, -linkn=, -maskn=
local Interviewers;
local interviewers_list = {};
interviewers_list = extract_names (args, 'InterviewerList'); -- process preferred interviewers parameters
local interviewer_etal;
-- Now perform various field substitutions.
-- We also add leading spaces and surrounding markup and punctuation to the
-- various parts of the citation, but only when they are non-nil.
do
local last_first_list;
local control = {
format = NameListStyle, -- empty string, '&', 'amp', 'and', or 'vanc'
maximum = nil, -- as if display-authors or display-editors not set
mode = Mode
};
do -- do editor name list first because the now unsupported coauthors used to modify control table
if cfg.global_cs1_config_t['DisplayEditors'] then -- global setting from {{cs1 config}} overrides local setting
control.maximum , editor_etal = get_display_names (cfg.global_cs1_config_t['DisplayEditors'], #e, 'editors', editor_etal, 'cs1 config');
else
control.maximum , editor_etal = get_display_names (A['DisplayEditors'], #e, 'editors', editor_etal, A:ORIGIN ('DisplayEditors'));
end
if cfg.global_cs1_config_t['DisplayEditors'] and utilities.is_set (A['DisplayEditors']) then -- when template has |display-editors=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
Editors, EditorCount = list_people (control, e, editor_etal);
if 1 == EditorCount and (true == editor_etal or 1 < #e) then -- only one editor displayed but includes etal then
EditorCount = 2; -- spoof to display (eds.) annotation
end
end
do -- now do interviewers
if cfg.global_cs1_config_t['DisplayInterviewers'] then -- global setting from {{cs1 config}} overrides local setting
control.maximum, interviewer_etal = get_display_names (cfg.global_cs1_config_t['DisplayInterviewers'], #interviewers_list, 'interviewers', interviewer_etal, 'cs1 config');
else
control.maximum, interviewer_etal = get_display_names (A['DisplayInterviewers'], #interviewers_list, 'interviewers', interviewer_etal, A:ORIGIN ('DisplayInterviewers'));
end
if cfg.global_cs1_config_t['DisplayInterviewers'] and utilities.is_set (A['DisplayInterviewers']) then -- when template has |display-interviewers=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
Interviewers = list_people (control, interviewers_list, interviewer_etal);
end
do -- now do translators
if cfg.global_cs1_config_t['DisplayTranslators'] then -- global setting from {{cs1 config}} overrides local setting
control.maximum, translator_etal = get_display_names (cfg.global_cs1_config_t['DisplayTranslators'], #t, 'translators', translator_etal, 'cs1 config');
else
control.maximum, translator_etal = get_display_names (A['DisplayTranslators'], #t, 'translators', translator_etal, A:ORIGIN ('DisplayTranslators'));
end
if cfg.global_cs1_config_t['DisplayTranslators'] and utilities.is_set (A['DisplayTranslators']) then -- when template has |display-translators=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
Translators = list_people (control, t, translator_etal);
end
do -- now do contributors
if cfg.global_cs1_config_t['DisplayContributors'] then -- global setting from {{cs1 config}} overrides local setting
control.maximum, contributor_etal = get_display_names (cfg.global_cs1_config_t['DisplayContributors'], #c, 'contributors', contributor_etal, 'cs1 config');
else
control.maximum, contributor_etal = get_display_names (A['DisplayContributors'], #c, 'contributors', contributor_etal, A:ORIGIN ('DisplayContributors'));
end
if cfg.global_cs1_config_t['DisplayContributors'] and utilities.is_set (A['DisplayContributors']) then -- when template has |display-contributors=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
Contributors = list_people (control, c, contributor_etal);
end
do -- now do authors
if cfg.global_cs1_config_t['DisplayAuthors'] then -- global setting from {{cs1 config}} overrides local setting
control.maximum, author_etal = get_display_names (cfg.global_cs1_config_t['DisplayAuthors'], #a, 'authors', author_etal, 'cs1 config');
else
control.maximum, author_etal = get_display_names (A['DisplayAuthors'], #a, 'authors', author_etal, A:ORIGIN ('DisplayAuthors'));
end
if cfg.global_cs1_config_t['DisplayAuthors'] and utilities.is_set (A['DisplayAuthors']) then -- when template has |display-authors=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
last_first_list = list_people (control, a, author_etal);
if utilities.is_set (Authors) then
Authors, author_etal = name_has_etal (Authors, author_etal, false, 'authors'); -- find and remove variations on et al.
if author_etal then
Authors = Authors .. ' ' .. cfg.messages['et al']; -- add et al. to authors parameter
end
else
Authors = last_first_list; -- either an author name list or an empty string
end
end -- end of do
if utilities.is_set (Authors) and utilities.is_set (Collaboration) then
Authors = Authors .. ' (' .. Collaboration .. ')'; -- add collaboration after et al.
end
end
local ConferenceFormat = A['ConferenceFormat'];
local ConferenceURL = A['ConferenceURL'];
ConferenceFormat = style_format (ConferenceFormat, ConferenceURL, 'conference-format', 'conference-url');
Format = style_format (Format, URL, 'format', 'url');
-- special case for chapter format so no error message or cat when chapter not supported
if not (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia))) then
ChapterFormat = style_format (ChapterFormat, ChapterURL, 'chapter-format', 'chapter-url');
end
if not utilities.is_set (URL) then
if utilities.in_array (config.CitationClass, {"web", "podcast", "mailinglist"}) or -- |url= required for cite web, cite podcast, and cite mailinglist
('citation' == config.CitationClass and ('website' == Periodical_origin or 'script-website' == ScriptPeriodical_origin)) then -- and required for {{citation}} with |website= or |script-website=
utilities.set_message ('err_cite_web_url');
end
-- do we have |accessdate= without either |url= or |chapter-url=?
if utilities.is_set (AccessDate) and not utilities.is_set (ChapterURL) then -- ChapterURL may be set when URL is not set;
utilities.set_message ('err_accessdate_missing_url');
AccessDate = '';
end
end
local UrlStatus = is_valid_parameter_value (A['UrlStatus'], A:ORIGIN('UrlStatus'), cfg.keywords_lists['url-status'], '');
local OriginalURL
local OriginalURL_origin
local OriginalFormat
local OriginalAccess;
UrlStatus = UrlStatus:lower(); -- used later when assembling archived text
if utilities.is_set ( ArchiveURL ) then
if utilities.is_set (ChapterURL) then -- if chapter-url= is set apply archive url to it
OriginalURL = ChapterURL; -- save copy of source chapter's url for archive text
OriginalURL_origin = ChapterURL_origin; -- name of |chapter-url= parameter for error messages
OriginalFormat = ChapterFormat; -- and original |chapter-format=
if 'live' ~= UrlStatus then
ChapterURL = ArchiveURL -- swap-in the archive's URL
ChapterURL_origin = A:ORIGIN('ArchiveURL') -- name of |archive-url= parameter for error messages
ChapterFormat = ArchiveFormat or ''; -- swap in archive's format
ChapterUrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
elseif utilities.is_set (URL) then
OriginalURL = URL; -- save copy of original source URL
OriginalURL_origin = URL_origin; -- name of URL parameter for error messages
OriginalFormat = Format; -- and original |format=
OriginalAccess = UrlAccess;
if 'live' ~= UrlStatus then -- if URL set then |archive-url= applies to it
URL = ArchiveURL -- swap-in the archive's URL
URL_origin = A:ORIGIN('ArchiveURL') -- name of archive URL parameter for error messages
Format = ArchiveFormat or ''; -- swap in archive's format
UrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
end
elseif utilities.is_set (UrlStatus) then -- if |url-status= is set when |archive-url= is not set
utilities.set_message ('maint_url_status'); -- add maint cat
end
if utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or -- if any of the 'periodical' cites except encyclopedia
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) then
local chap_param;
if utilities.is_set (Chapter) then -- get a parameter name from one of these chapter related meta-parameters
chap_param = A:ORIGIN ('Chapter')
elseif utilities.is_set (TransChapter) then
chap_param = A:ORIGIN ('TransChapter')
elseif utilities.is_set (ChapterURL) then
chap_param = A:ORIGIN ('ChapterURL')
elseif utilities.is_set (ScriptChapter) then
chap_param = ScriptChapter_origin;
else utilities.is_set (ChapterFormat)
chap_param = A:ORIGIN ('ChapterFormat')
end
if utilities.is_set (chap_param) then -- if we found one
utilities.set_message ('err_chapter_ignored', {chap_param}); -- add error message
Chapter = ''; -- and set them to empty string to be safe with concatenation
TransChapter = '';
ChapterURL = '';
ScriptChapter = '';
ChapterFormat = '';
end
else -- otherwise, format chapter / article title
local no_quotes = false; -- default assume that we will be quoting the chapter parameter value
if utilities.is_set (Contribution) and 0 < #c then -- if this is a contribution with contributor(s)
if utilities.in_array (Contribution:lower(), cfg.keywords_lists.contribution) then -- and a generic contribution title
no_quotes = true; -- then render it unquoted
end
end
Chapter = format_chapter_title (ScriptChapter, ScriptChapter_origin, Chapter, Chapter_origin, TransChapter, TransChapter_origin, ChapterURL, ChapterURL_origin, no_quotes, ChapterUrlAccess); -- Contribution is also in Chapter
if utilities.is_set (Chapter) then
Chapter = Chapter .. ChapterFormat ;
if 'map' == config.CitationClass and utilities.is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType; -- map annotation here; not after title
end
Chapter = Chapter .. sepc .. ' ';
elseif utilities.is_set (ChapterFormat) then -- |chapter= not set but |chapter-format= is so ...
Chapter = ChapterFormat .. sepc .. ' '; -- ... ChapterFormat has error message, we want to see it
end
end
-- Format main title
local plain_title = false;
local accept_title;
Title, accept_title = utilities.has_accept_as_written (Title, true); -- remove accept-this-as-written markup when it wraps all of <Title>
if accept_title and ('' == Title) then -- only support forced empty for now "(())"
Title = cfg.messages['notitle']; -- replace by predefined "No title" message
-- TODO: utilities.set_message ( 'err_redundant_parameters', ...); -- issue proper error message instead of muting
ScriptTitle = ''; -- just mute for now
TransTitle = ''; -- just mute for now
plain_title = true; -- suppress text decoration for descriptive title
utilities.set_message ('maint_untitled'); -- add maint cat
end
if not accept_title then -- <Title> not wrapped in accept-as-written markup
if '...' == Title:sub (-3) then -- if ellipsis is the last three characters of |title=
Title = Title:gsub ('(%.%.%.)%.+$', '%1'); -- limit the number of dots to three
elseif not mw.ustring.find (Title, '%.%s*%a%.$') and -- end of title is not a 'dot-(optional space-)letter-dot' initialism ...
not mw.ustring.find (Title, '%s+%a%.$') then -- ...and not a 'space-letter-dot' initial (''Allium canadense'' L.)
Title = mw.ustring.gsub(Title, '%' .. sepc .. '$', ''); -- remove any trailing separator character; sepc and ms.ustring() here for languages that use multibyte separator characters
end
if utilities.is_set (ArchiveURL) and is_archived_copy (Title) then
utilities.set_message ('maint_archived_copy'); -- add maintenance category before we modify the content of Title
end
if is_generic ('generic_titles', Title) then
utilities.set_message ('err_generic_title'); -- set an error message
end
end
if (not plain_title) and (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'document', 'pressrelease', 'podcast', 'newsgroup', 'mailinglist', 'interview', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) or
('map' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)))) then -- special case for cite map when the map is in a periodical treat as an article
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from module provided quote marks
Title = utilities.wrap_style ('quoted-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle );
elseif plain_title or ('report' == config.CitationClass) then -- no styling for cite report and descriptive titles (otherwise same as above)
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle ); -- for cite report, use this form for trans-title
else
Title = utilities.wrap_style ('italic-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-italic-title', TransTitle);
end
if utilities.is_set (TransTitle) then
if utilities.is_set (Title) then
TransTitle = " " .. TransTitle;
else
utilities.set_message ('err_trans_missing_title', {'title'});
end
end
if utilities.is_set (Title) then -- TODO: is this the right place to be making Wikisource URLs?
if utilities.is_set (TitleLink) and utilities.is_set (URL) then
utilities.set_message ('err_wikilink_in_url'); -- set an error message because we can't have both
TitleLink = ''; -- unset
end
if not utilities.is_set (TitleLink) and utilities.is_set (URL) then
Title = external_link (URL, Title, URL_origin, UrlAccess) .. TransTitle .. Format;
URL = ''; -- unset these because no longer needed
Format = "";
elseif utilities.is_set (TitleLink) and not utilities.is_set (URL) then
local ws_url;
ws_url = wikisource_url_make (TitleLink); -- ignore ws_label return; not used here
if ws_url then
Title = external_link (ws_url, Title .. ' ', 'ws link in title-link'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], TitleLink, Title});
Title = Title .. TransTitle;
else
Title = utilities.make_wikilink (TitleLink, Title) .. TransTitle;
end
else
local ws_url, ws_label, L; -- Title has italic or quote markup by the time we get here which causes is_wikilink() to return 0 (not a wikilink)
ws_url, ws_label, L = wikisource_url_make (Title:gsub('^[\'"]*(.-)[\'"]*$', '%1')); -- make ws URL from |title= interwiki link (strip italic or quote markup); link portion L becomes tooltip label
if ws_url then
Title = Title:gsub ('%b[]', ws_label); -- replace interwiki link with ws_label to retain markup
Title = external_link (ws_url, Title .. ' ', 'ws link in title'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, Title});
Title = Title .. TransTitle;
else
Title = Title .. TransTitle;
end
end
else
Title = TransTitle;
end
if utilities.is_set (Place) then
Place = " " .. wrap_msg ('written', Place, use_lowercase) .. sepc .. " ";
end
local ConferenceURL_origin = A:ORIGIN('ConferenceURL'); -- get name of parameter that holds ConferenceURL
if utilities.is_set (Conference) then
if utilities.is_set (ConferenceURL) then
Conference = external_link( ConferenceURL, Conference, ConferenceURL_origin, nil );
end
Conference = sepc .. " " .. Conference .. ConferenceFormat;
elseif utilities.is_set (ConferenceURL) then
Conference = sepc .. " " .. external_link( ConferenceURL, nil, ConferenceURL_origin, nil );
end
local Position = '';
if not utilities.is_set (Position) then
local Minutes = A['Minutes'];
local Time = A['Time'];
if utilities.is_set (Minutes) then
if utilities.is_set (Time) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'minutes') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'time')});
end
Position = " " .. Minutes .. " " .. cfg.messages['minutes'];
else
if utilities.is_set (Time) then
local TimeCaption = A['TimeCaption']
if not utilities.is_set (TimeCaption) then
TimeCaption = cfg.messages['event'];
if sepc ~= '.' then
TimeCaption = TimeCaption:lower();
end
end
Position = " " .. TimeCaption .. " " .. Time;
end
end
else
Position = " " .. Position;
At = '';
end
Page, Pages, Sheet, Sheets = format_pages_sheets (Page, Pages, Sheet, Sheets, config.CitationClass, Periodical_origin, sepc, NoPP, use_lowercase);
At = utilities.is_set (At) and (sepc .. " " .. At) or "";
Position = utilities.is_set (Position) and (sepc .. " " .. Position) or "";
if config.CitationClass == 'map' then
local Sections = A['Sections']; -- Section (singular) is an alias of Chapter so set earlier
local Inset = A['Inset'];
if utilities.is_set ( Inset ) then
Inset = sepc .. " " .. wrap_msg ('inset', Inset, use_lowercase);
end
if utilities.is_set ( Sections ) then
Section = sepc .. " " .. wrap_msg ('sections', Sections, use_lowercase);
elseif utilities.is_set ( Section ) then
Section = sepc .. " " .. wrap_msg ('section', Section, use_lowercase);
end
At = At .. Inset .. Section;
end
local Others = A['Others'];
if utilities.is_set (Others) and 0 == #a and 0 == #e then -- add maint cat when |others= has value and used without |author=, |editor=
if config.CitationClass == "AV-media-notes"
or config.CitationClass == "audio-visual" then -- special maint for AV/M which has a lot of 'false' positives right now
utilities.set_message ('maint_others_avm')
else
utilities.set_message ('maint_others');
end
end
Others = utilities.is_set (Others) and (sepc .. " " .. Others) or "";
if utilities.is_set (Translators) then
Others = safe_join ({sepc .. ' ', wrap_msg ('translated', Translators, use_lowercase), Others}, sepc);
end
if utilities.is_set (Interviewers) then
Others = safe_join ({sepc .. ' ', wrap_msg ('interview', Interviewers, use_lowercase), Others}, sepc);
end
local TitleNote = A['TitleNote'];
TitleNote = utilities.is_set (TitleNote) and (sepc .. " " .. TitleNote) or "";
if utilities.is_set (Edition) then
if Edition:match ('%f[%a][Ee]d%n?%.?$') or Edition:match ('%f[%a][Ee]dition$') then -- Ed, ed, Ed., ed., Edn, edn, Edn., edn.
utilities.set_message ('err_extra_text_edition'); -- add error message
end
Edition = " " .. wrap_msg ('edition', Edition);
else
Edition = '';
end
Series = utilities.is_set (Series) and wrap_msg ('series', {sepc, Series}) or ""; -- not the same as SeriesNum
local Agency = A['Agency'];
Agency = utilities.is_set (Agency) and wrap_msg ('agency', {sepc, Agency}) or "";
Volume = format_volume_issue (Volume, Issue, ArticleNumber, config.CitationClass, Periodical_origin, sepc, use_lowercase);
if utilities.is_set (AccessDate) then
local retrv_text = " " .. cfg.messages['retrieved']
AccessDate = nowrap_date (AccessDate); -- wrap in nowrap span if date in appropriate format
if (sepc ~= ".") then retrv_text = retrv_text:lower() end -- if mode is cs2, lower case
AccessDate = utilities.substitute (retrv_text, AccessDate); -- add retrieved text
AccessDate = utilities.substitute (cfg.presentation['accessdate'], {sepc, AccessDate}); -- allow editors to hide accessdates
end
if utilities.is_set (ID) then ID = sepc .. " " .. ID; end
local Docket = A['Docket'];
if "thesis" == config.CitationClass and utilities.is_set (Docket) then
ID = sepc .. " Docket " .. Docket .. ID;
end
if "report" == config.CitationClass and utilities.is_set (Docket) then -- for cite report when |docket= is set
ID = sepc .. ' ' .. Docket; -- overwrite ID even if |id= is set
end
if utilities.is_set (URL) then
URL = " " .. external_link( URL, nil, URL_origin, UrlAccess );
end
local Quote = A['Quote'];
local TransQuote = A['TransQuote'];
local ScriptQuote = A['ScriptQuote'];
if utilities.is_set (Quote) or utilities.is_set (TransQuote) or utilities.is_set (ScriptQuote) then
if utilities.is_set (Quote) then
if Quote:sub(1, 1) == '"' and Quote:sub(-1, -1) == '"' then -- if first and last characters of quote are quote marks
Quote = Quote:sub(2, -2); -- strip them off
end
end
Quote = kern_quotes (Quote); -- kern if needed
Quote = utilities.wrap_style ('quoted-text', Quote ); -- wrap in <q>...</q> tags
if utilities.is_set (ScriptQuote) then
Quote = script_concatenate (Quote, ScriptQuote, 'script-quote'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after quote is wrapped
end
if utilities.is_set (TransQuote) then
if TransQuote:sub(1, 1) == '"' and TransQuote:sub(-1, -1) == '"' then -- if first and last characters of |trans-quote are quote marks
TransQuote = TransQuote:sub(2, -2); -- strip them off
end
Quote = Quote .. " " .. utilities.wrap_style ('trans-quoted-title', TransQuote );
end
if utilities.is_set (QuotePage) or utilities.is_set (QuotePages) then -- add page prefix
local quote_prefix = '';
if utilities.is_set (QuotePage) then
extra_text_in_page_check (QuotePage, 'quote-page'); -- add to maint cat if |quote-page= value begins with what looks like p., pp., etc.
if not NoPP then
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePage}), '', '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePage}), '', '', '';
end
elseif utilities.is_set (QuotePages) then
extra_text_in_page_check (QuotePages, 'quote-pages'); -- add to maint cat if |quote-pages= value begins with what looks like p., pp., etc.
if tonumber(QuotePages) ~= nil and not NoPP then -- if only digits, assume single page
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePages}), '', '';
elseif not NoPP then
quote_prefix = utilities.substitute (cfg.messages['pp-prefix'], {sepc, QuotePages}), '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePages}), '', '';
end
end
Quote = quote_prefix .. ": " .. Quote;
else
Quote = sepc .. " " .. Quote;
end
PostScript = ""; -- cs1|2 does not supply terminal punctuation when |quote= is set
end
-- We check length of PostScript here because it will have been nuked by
-- the quote parameters. We'd otherwise emit a message even if there wasn't
-- a displayed postscript.
-- TODO: Should the max size (1) be configurable?
-- TODO: Should we check a specific pattern?
if utilities.is_set(PostScript) and mw.ustring.len(PostScript) > 1 then
utilities.set_message ('maint_postscript')
end
local Archived;
if utilities.is_set (ArchiveURL) then
if not utilities.is_set (ArchiveDate) then -- ArchiveURL set but ArchiveDate not set
utilities.set_message ('err_archive_missing_date'); -- emit an error message
ArchiveURL = ''; -- empty string for concatenation
ArchiveDate = ''; -- empty string for concatenation
end
else
if utilities.is_set (ArchiveDate) then -- ArchiveURL not set but ArchiveDate is set
utilities.set_message ('err_archive_date_missing_url'); -- emit an error message
ArchiveURL = ''; -- empty string for concatenation
ArchiveDate = ''; -- empty string for concatenation
end
end
if utilities.is_set (ArchiveURL) then
local arch_text;
-- if not utilities.is_set (ArchiveDate) then
-- utilities.set_message ('err_archive_missing_date');
-- ArchiveDate = ''; -- empty string for concatenation
-- end
if "live" == UrlStatus then
arch_text = cfg.messages['archived'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. ' ' .. utilities.substitute ( cfg.messages['archived-live'],
{external_link( ArchiveURL, arch_text, A:ORIGIN('ArchiveURL'), nil) .. ArchiveFormat, ArchiveDate } );
else
Archived = '';
end
if not utilities.is_set (OriginalURL) then
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (OriginalURL) then -- UrlStatus is empty, 'dead', 'unfit', 'usurped', 'bot: unknown'
if utilities.in_array (UrlStatus, {'unfit', 'usurped', 'bot: unknown'}) then
arch_text = cfg.messages['archived-unfit'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. ' ' .. arch_text .. ArchiveDate; -- format already styled
if 'bot: unknown' == UrlStatus then
utilities.set_message ('maint_bot_unknown'); -- and add a category if not already added
else
utilities.set_message ('maint_unfit'); -- and add a category if not already added
end
else -- UrlStatus is empty, 'dead'
arch_text = cfg.messages['archived-dead'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. " " .. utilities.substitute ( arch_text,
{ external_link( OriginalURL, cfg.messages['original'], OriginalURL_origin, OriginalAccess ) .. OriginalFormat, ArchiveDate } ); -- format already styled
else
Archived = ''; -- unset for concatenation
end
end
else -- OriginalUrl not set
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (ArchiveFormat) then
Archived = ArchiveFormat; -- if set and ArchiveURL not set ArchiveFormat has error message
else
Archived = '';
end
-- local Lay = '';
-- local LaySource = A['LaySource'];
-- local LayURL = A['LayURL'];
-- local LayFormat = A['LayFormat'];
-- LayFormat = style_format (LayFormat, LayURL, 'lay-format', 'lay-url');
-- if utilities.is_set (LayURL) then
-- if utilities.is_set (LayDate) then LayDate = " (" .. LayDate .. ")" end
-- if utilities.is_set (LaySource) then
-- LaySource = " – ''" .. utilities.safe_for_italics (LaySource) .. "''";
-- else
-- LaySource = "";
-- end
-- if sepc == '.' then
-- Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary'], A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
-- else
-- Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary']:lower(), A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
-- end
-- elseif utilities.is_set (LayFormat) then -- Test if |lay-format= is given without giving a |lay-url=
-- Lay = sepc .. LayFormat; -- if set and LayURL not set, then LayFormat has error message
-- end
local TranscriptURL = A['TranscriptURL']
local TranscriptFormat = A['TranscriptFormat'];
TranscriptFormat = style_format (TranscriptFormat, TranscriptURL, 'transcript-format', 'transcripturl');
local Transcript = A['Transcript'];
local TranscriptURL_origin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
if utilities.is_set (Transcript) then
if utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, Transcript, TranscriptURL_origin, nil );
end
Transcript = sepc .. ' ' .. Transcript .. TranscriptFormat;
elseif utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, nil, TranscriptURL_origin, nil );
end
local Publisher;
if utilities.is_set (PublicationDate) then
PublicationDate = wrap_msg ('published', PublicationDate);
end
if utilities.is_set (PublisherName) then
if utilities.is_set (PublicationPlace) then
Publisher = sepc .. " " .. PublicationPlace .. ": " .. PublisherName .. PublicationDate;
else
Publisher = sepc .. " " .. PublisherName .. PublicationDate;
end
elseif utilities.is_set (PublicationPlace) then
Publisher= sepc .. " " .. PublicationPlace .. PublicationDate;
else
Publisher = PublicationDate;
end
-- Several of the above rely upon detecting this as nil, so do it last.
if (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical)) then
if utilities.is_set (Title) or utilities.is_set (TitleNote) then
Periodical = sepc .. " " .. format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
else
Periodical = format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
end
end
local Language = A['Language'];
if utilities.is_set (Language) then
Language = language_parameter (Language); -- format, categories, name from ISO639-1, etc.
else
Language=''; -- language not specified so make sure this is an empty string;
--[[ TODO: need to extract the wrap_msg from language_parameter
so that we can solve parentheses bunching problem with Format/Language/TitleType
]]
end
--[[
Handle the oddity that is cite speech. This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be " (Speech)" so that
the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).
]]
if "speech" == config.CitationClass then -- cite speech only
TitleNote = TitleType; -- move TitleType to TitleNote so that it renders ahead of |event=
TitleType = ''; -- and unset
if utilities.is_set (Periodical) then -- if Periodical, perhaps because of an included |website= or |journal= parameter
if utilities.is_set (Conference) then -- and if |event= is set
Conference = Conference .. sepc .. " "; -- then add appropriate punctuation to the end of the Conference variable before rendering
end
end
end
-- Piece all bits together at last. Here, all should be non-nil.
-- We build things this way because it is more efficient in LUA
-- not to keep reassigning to the same string variable over and over.
local tcommon;
local tcommon2; -- used for book cite when |contributor= is set
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
if not (utilities.is_set (Authors) or utilities.is_set (Editors)) then
Others = Others:gsub ('^' .. sepc .. ' ', ''); -- when no authors and no editors, strip leading sepc and space
end
if utilities.is_set (Others) then Others = safe_join ({Others, sepc .. " "}, sepc) end -- add terminal punctuation & space; check for dup sepc; TODO why do we need to do this here?
tcommon = safe_join( {Others, Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Edition, Publisher, Agency, Volume}, sepc );
elseif utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (Periodical) then -- special cases for book cites
if utilities.is_set (Contributors) then -- when we are citing foreword, preface, introduction, etc.
tcommon = safe_join( {Title, TitleNote}, sepc ); -- author and other stuff will come after this and before tcommon2
tcommon2 = safe_join( {Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
else
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
end
elseif 'map' == config.CitationClass then -- special cases for cite map
if utilities.is_set (Chapter) then -- map in a book; TitleType is part of Chapter
tcommon = safe_join( {Title, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
elseif utilities.is_set (Periodical) then -- map in a periodical
tcommon = safe_join( {Title, TitleType, Format, Periodical, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
else -- a sheet or stand-alone map
tcommon = safe_join( {Title, TitleType, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher}, sepc );
end
elseif 'episode' == config.CitationClass then -- special case for cite episode
tcommon = safe_join( {Title, TitleNote, TitleType, Series, Language, Edition, Publisher}, sepc );
else -- all other CS1 templates
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language,
Volume, Others, Edition, Publisher, Agency}, sepc );
end
if #ID_list > 0 then
ID_list = safe_join( { sepc .. " ", table.concat( ID_list, sepc .. " " ), ID }, sepc );
else
ID_list = ID;
end
local Via = A['Via'];
Via = utilities.is_set (Via) and wrap_msg ('via', Via) or '';
local idcommon;
if 'audio-visual' == config.CitationClass or 'episode' == config.CitationClass then -- special case for cite AV media & cite episode position transcript
-- idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Lay, Quote }, sepc );
idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Quote }, sepc );
else
-- idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Lay, Quote }, sepc );
idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Quote }, sepc );
end
local text;
local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;
local OrigDate = A['OrigDate'];
OrigDate = utilities.is_set (OrigDate) and wrap_msg ('origdate', OrigDate) or '';
if utilities.is_set (Date) then
if utilities.is_set (Authors) or utilities.is_set (Editors) then -- date follows authors or editors when authors not set
Date = " (" .. Date .. ")" .. OrigDate .. sepc .. " "; -- in parentheses
else -- neither of authors and editors set
if (string.sub(tcommon, -1, -1) == sepc) then -- if the last character of tcommon is sepc
Date = " " .. Date .. OrigDate; -- Date does not begin with sepc
else
Date = sepc .. " " .. Date .. OrigDate; -- Date begins with sepc
end
end
end
if utilities.is_set (Authors) then
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Authors termination
Authors = terminate_name_list (Authors, sepc); -- when no date, terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Editors) then
local in_text = '';
local post_text = '';
if utilities.is_set (Chapter) and 0 == #c then
in_text = cfg.messages['in'] .. ' ';
if (sepc ~= '.') then
in_text = in_text:lower(); -- lowercase for cs2
end
end
if EditorCount <= 1 then
post_text = ' (' .. cfg.messages['editor'] .. ')'; -- be consistent with no-author, no-date case
else
post_text = ' (' .. cfg.messages['editors'] .. ')';
end
Editors = terminate_name_list (in_text .. Editors .. post_text, sepc); -- terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Contributors) then -- book cite and we're citing the intro, preface, etc.
local by_text = sepc .. ' ' .. cfg.messages['by'] .. ' ';
if (sepc ~= '.') then by_text = by_text:lower() end -- lowercase for cs2
Authors = by_text .. Authors; -- author follows title so tweak it here
if utilities.is_set (Editors) and utilities.is_set (Date) then -- when Editors make sure that Authors gets terminated
Authors = terminate_name_list (Authors, sepc); -- terminate with 0 or 1 sepc and a space
end
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Contributors termination
Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc and a space
end
text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext, idcommon }, sepc );
else
text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, pgtext, idcommon }, sepc );
end
elseif utilities.is_set (Editors) then
if utilities.is_set (Date) then
if EditorCount <= 1 then
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editor'];
else
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editors'];
end
else
if EditorCount <= 1 then
Editors = Editors .. " (" .. cfg.messages['editor'] .. ")" .. sepc .. " "
else
Editors = Editors .. " (" .. cfg.messages['editors'] .. ")" .. sepc .. " "
end
end
text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );
else
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );
else
text = safe_join( {Chapter, Place, tcommon, Date, pgtext, idcommon}, sepc );
end
end
if utilities.is_set (PostScript) and PostScript ~= sepc then
text = safe_join( {text, sepc}, sepc ); -- Deals with italics, spaces, etc.
text = text:sub(1, -sepc:len() - 1);
end
text = safe_join( {text, PostScript}, sepc );
-- Now enclose the whole thing in a <cite> element
local options_t = {};
options_t.class = cite_class_attribute_make (config.CitationClass, Mode);
local Ref = is_valid_parameter_value (A['Ref'], A:ORIGIN('Ref'), cfg.keywords_lists['ref'], nil, true); -- nil when |ref=harv; A['Ref'] else
if 'none' ~= cfg.keywords_xlate[(Ref and Ref:lower()) or ''] then
local namelist_t = {}; -- holds selected contributor, author, editor name list
local year = first_set ({Year, anchor_year}, 2); -- Year first for legacy citations and for YMD dates that require disambiguation
if #c > 0 then -- if there is a contributor list
namelist_t = c; -- select it
elseif #a > 0 then -- or an author list
namelist_t = a;
elseif #e > 0 then -- or an editor list
namelist_t = e;
end
local citeref_id;
if #namelist_t > 0 then -- if there are names in namelist_t
citeref_id = make_citeref_id (namelist_t, year); -- go make the CITEREF anchor
if mw.uri.anchorEncode (citeref_id) == ((Ref and mw.uri.anchorEncode (Ref)) or '') then -- Ref may already be encoded (by {{sfnref}}) so citeref_id must be encoded before comparison
utilities.set_message ('maint_ref_duplicates_default');
end
else
citeref_id = ''; -- unset
end
options_t.id = Ref or citeref_id;
end
if string.len (text:gsub('%b<>', '')) <= 2 then -- remove html and html-like tags; then get length of what remains;
z.error_cats_t = {}; -- blank the categories list
z.error_msgs_t = {}; -- blank the error messages list
OCinSoutput = nil; -- blank the metadata string
text = ''; -- blank the the citation
utilities.set_message ('err_empty_citation'); -- set empty citation message and category
end
local render_t = {}; -- here we collect the final bits for concatenation into the rendered citation
if utilities.is_set (options_t.id) then -- here we wrap the rendered citation in <cite ...>...</cite> tags
table.insert (render_t, utilities.substitute (cfg.presentation['cite-id'], {mw.uri.anchorEncode(options_t.id), mw.text.nowiki(options_t.class), text})); -- when |ref= is set or when there is a namelist
else
table.insert (render_t, utilities.substitute (cfg.presentation['cite'], {mw.text.nowiki(options_t.class), text})); -- when |ref=none or when namelist_t empty and |ref= is missing or is empty
end
if OCinSoutput then -- blanked when citation is 'empty' so don't bother to add boilerplate metadata span
table.insert (render_t, utilities.substitute (cfg.presentation['ocins'], OCinSoutput)); -- format and append metadata to the citation
end
local template_name = ('citation' == config.CitationClass) and 'citation' or 'cite ' .. (cfg.citation_class_map_t[config.CitationClass] or config.CitationClass);
local template_link = '[[Template:' .. template_name .. '|' .. template_name .. ']]';
local msg_prefix = '<code class="cs1-code">{{' .. template_link .. '}}</code>: ';
if 0 ~= #z.error_msgs_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_e, template_link));
table.insert (render_t, ' '); -- insert a space between citation and its error messages
table.sort (z.error_msgs_t); -- sort the error messages list; sorting includes wrapping <span> and <code> tags; hidden-error sorts ahead of visible-error
local hidden = true; -- presume that the only error messages emited by this template are hidden
for _, v in ipairs (z.error_msgs_t) do -- spin through the list of error messages
if v:find ('cs1-visible-error', 1, true) then -- look for the visible error class name
hidden = false; -- found one; so don't hide the error message prefix
break; -- and done because no need to look further
end
end
z.error_msgs_t[1] = table.concat ({utilities.error_comment (msg_prefix, hidden), z.error_msgs_t[1]}); -- add error message prefix to first error message to prevent extraneous punctuation
table.insert (render_t, table.concat (z.error_msgs_t, '; ')); -- make a big string of error messages and add it to the rendering
end
if 0 ~= #z.maint_cats_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_m, template_link));
table.sort (z.maint_cats_t); -- sort the maintenance messages list
local maint_msgs_t = {}; -- here we collect all of the maint messages
if 0 == #z.error_msgs_t then -- if no error messages
table.insert (maint_msgs_t, msg_prefix); -- insert message prefix in maint message livery
end
for _, v in ipairs( z.maint_cats_t ) do -- append maintenance categories
table.insert (maint_msgs_t, -- assemble new maint message and add it to the maint_msgs_t table
table.concat ({v, ' (', utilities.substitute (cfg.messages[':cat wikilink'], v), ')'})
);
end
table.insert (render_t, utilities.substitute (cfg.presentation['hidden-maint'], table.concat (maint_msgs_t, ' '))); -- wrap the group of maint messages with proper presentation and save
end
if not no_tracking_cats then
for _, v in ipairs (z.error_cats_t) do -- append error categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
for _, v in ipairs (z.maint_cats_t) do -- append maintenance categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
for _, v in ipairs (z.prop_cats_t) do -- append properties categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
end
return table.concat (render_t); -- make a big string and done
end
--[[--------------------------< V A L I D A T E >--------------------------------------------------------------
Looks for a parameter's name in one of several whitelists.
Parameters in the whitelist can have three values:
true - active, supported parameters
false - deprecated, supported parameters
nil - unsupported parameters
]]
local function validate (name, cite_class, empty)
local name = tostring (name);
local enum_name; -- parameter name with enumerator (if any) replaced with '#'
local state;
local function state_test (state, name) -- local function to do testing of state values
if true == state then return true; end -- valid actively supported parameter
if false == state then
if empty then return nil; end -- empty deprecated parameters are treated as unknowns
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
if 'tracked' == state then
local base_name = name:gsub ('%d', ''); -- strip enumerators from parameter names that have them to get the base name
utilities.add_prop_cat ('tracked-param', {base_name}, base_name); -- add a properties category; <base_name> modifies <key>
return true;
end
return nil;
end
if name:find ('#') then -- # is a cs1|2 reserved character so parameters with # not permitted
return nil;
end
-- replace wnumerator digit(s) with # (|last25= becomes |last#=) (mw.ustring because non-Western 'local' digits)
enum_name = mw.ustring.gsub (name, '%d+$', '#'); -- where enumerator is last charaters in parameter name (these to protect |s2cid=)
enum_name = mw.ustring.gsub (enum_name, '%d+([%-l])', '#%1'); -- where enumerator is in the middle of the parameter name; |author#link= is the oddity
if 'document' == cite_class then -- special case for {{cite document}}
state = whitelist.document_parameters_t[enum_name]; -- this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
return false;
end
if utilities.in_array (cite_class, whitelist.preprint_template_list_t) then -- limited parameter sets allowed for these templates
state = whitelist.limited_parameters_t[enum_name]; -- this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
state = whitelist.preprint_arguments_t[cite_class][name]; -- look in the parameter-list for the template identified by cite_class
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end -- end limited parameter-set templates
if utilities.in_array (cite_class, whitelist.unique_param_template_list_t) then -- template-specific parameters for templates that accept parameters from the basic argument list
state = whitelist.unique_arguments_t[cite_class][name]; -- look in the template-specific parameter-lists for the template identified by cite_class
if true == state_test (state, name) then return true; end
end -- if here, fall into general validation
state = whitelist.common_parameters_t[enum_name]; -- all other templates; all normal parameters allowed; this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end
--[=[-------------------------< I N T E R _ W I K I _ C H E C K >----------------------------------------------
check <value> for inter-language interwiki-link markup. <prefix> must be a MediaWiki-recognized language
code. when these values have the form (without leading colon):
[[<prefix>:link|label]] return label as plain-text
[[<prefix>:link]] return <prefix>:link as plain-text
return value as is else
]=]
local function inter_wiki_check (parameter, value)
local prefix = value:match ('%[%[(%a+):'); -- get an interwiki prefix if one exists
local _;
if prefix and cfg.inter_wiki_map[prefix:lower()] then -- if prefix is in the map, needs preceding colon so
utilities.set_message ('err_bad_paramlink', parameter); -- emit an error message
_, value, _ = utilities.is_wikilink (value); -- extract label portion from wikilink
end
return value;
end
--[[--------------------------< M I S S I N G _ P I P E _ C H E C K >------------------------------------------
Look at the contents of a parameter. If the content has a string of characters and digits followed by an equal
sign, compare the alphanumeric string to the list of cs1|2 parameters. If found, then the string is possibly a
parameter that is missing its pipe. There are two tests made:
{{cite ... |title=Title access-date=2016-03-17}} -- the first parameter has a value and whitespace separates that value from the missing pipe parameter name
{{cite ... |title=access-date=2016-03-17}} -- the first parameter has no value (whitespace after the first = is trimmed by MediaWiki)
cs1|2 shares some parameter names with XML/HTML attributes: class=, title=, etc. To prevent false positives XML/HTML
tags are removed before the search.
If a missing pipe is detected, this function adds the missing pipe maintenance category.
]]
local function missing_pipe_check (parameter, value)
local capture;
value = value:gsub ('%b<>', ''); -- remove XML/HTML tags because attributes: class=, title=, etc.
capture = value:match ('%s+(%a[%w%-]+)%s*=') or value:match ('^(%a[%w%-]+)%s*='); -- find and categorize parameters with possible missing pipes
if capture and validate (capture) then -- if the capture is a valid parameter name
utilities.set_message ('err_missing_pipe', parameter);
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ P U N C T >--------------------------------------
look for extraneous terminal punctuation in most parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_punc (param, value)
if 'number' == type (param) then
return;
end
param = param:gsub ('%d+', '#'); -- enumerated name-list mask params allow terminal punct; normalize
if cfg.punct_skip[param] then
return; -- parameter name found in the skip table so done
end
if value:match ('[,;:]$') then
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
if value:match ('^=') then -- sometimes an extraneous '=' character appears ...
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ U R L >------------------------------------------
look for extraneous url parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_url (url_param_t)
local url_error_t = {};
check_for_url (url_param_t, url_error_t); -- extraneous url check
if 0 ~= #url_error_t then -- non-zero when there are errors
table.sort (url_error_t);
utilities.set_message ('err_param_has_ext_link', {utilities.make_sep_list (#url_error_t, url_error_t)}); -- add this error message
end
end
--[[--------------------------< C I T A T I O N >--------------------------------------------------------------
This is used by templates such as {{cite book}} to create the actual citation text.
]]
local function citation(frame)
Frame = frame; -- save a copy in case we need to display an error message in preview mode
local config = {}; -- table to store parameters from the module {{#invoke:}}
for k, v in pairs( frame.args ) do -- get parameters from the {{#invoke}} frame
config[k] = v;
-- args[k] = v; -- crude debug support that allows us to render a citation from module {{#invoke:}}; skips parameter validation; TODO: keep?
end
-- i18n: set the name that your wiki uses to identify sandbox subpages from sandbox template invoke (or can be set here)
local sandbox = ((config.SandboxPath and '' ~= config.SandboxPath) and config.SandboxPath) or '/sandbox'; -- sandbox path from {{#invoke:Citation/CS1/sandbox|citation|SandboxPath=/...}}
is_sandbox = nil ~= string.find (frame:getTitle(), sandbox, 1, true); -- is this invoke the sandbox module?
sandbox = is_sandbox and sandbox or ''; -- use i18n sandbox to load sandbox modules when this module is the sandox; live modules else
local pframe = frame:getParent()
local styles;
cfg = mw.loadData ('Module:Citation/CS1/Configuration' .. sandbox); -- load sandbox versions of support modules when {{#invoke:Citation/CS1/sandbox|...}}; live modules else
whitelist = mw.loadData ('Module:Citation/CS1/Whitelist' .. sandbox);
utilities = require ('Module:Citation/CS1/Utilities' .. sandbox);
validation = require ('Module:Citation/CS1/Date_validation' .. sandbox);
identifiers = require ('Module:Citation/CS1/Identifiers' .. sandbox);
metadata = require ('Module:Citation/CS1/COinS' .. sandbox);
styles = 'Module:Citation/CS1' .. sandbox .. '/styles.css';
utilities.set_selected_modules (cfg); -- so that functions in Utilities can see the selected cfg tables
identifiers.set_selected_modules (cfg, utilities); -- so that functions in Identifiers can see the selected cfg tables and selected Utilities module
validation.set_selected_modules (cfg, utilities); -- so that functions in Date validataion can see selected cfg tables and the selected Utilities module
metadata.set_selected_modules (cfg, utilities); -- so that functions in COinS can see the selected cfg tables and selected Utilities module
z = utilities.z; -- table of error and category tables in Module:Citation/CS1/Utilities
is_preview_mode = not utilities.is_set (frame:preprocess ('{{REVISIONID}}'));
local args = {}; -- table where we store all of the template's arguments
local suggestions = {}; -- table where we store suggestions if we need to loadData them
local error_text; -- used as a flag
local capture; -- the single supported capture when matching unknown parameters using patterns
local empty_unknowns = {}; -- sequence table to hold empty unknown params for error message listing
for k, v in pairs( pframe.args ) do -- get parameters from the parent (template) frame
v = mw.ustring.gsub (v, '^%s*(.-)%s*$', '%1'); -- trim leading/trailing whitespace; when v is only whitespace, becomes empty string
if v ~= '' then
if ('string' == type (k)) then
k = mw.ustring.gsub (k, '%d', cfg.date_names.local_digits); -- for enumerated parameters, translate 'local' digits to Western 0-9
end
if not validate( k, config.CitationClass ) then
if type (k) ~= 'string' then -- exclude empty numbered parameters
if v:match("%S+") ~= nil then
error_text = utilities.set_message ('err_text_ignored', {v});
end
elseif validate (k:lower(), config.CitationClass) then
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, k:lower()}); -- suggest the lowercase version of the parameter
else
if nil == suggestions.suggestions then -- if this table is nil then we need to load it
suggestions = mw.loadData ('Module:Citation/CS1/Suggestions' .. sandbox); --load sandbox version of suggestion module when {{#invoke:Citation/CS1/sandbox|...}}; live module else
end
for pattern, param in pairs (suggestions.patterns) do -- loop through the patterns to see if we can suggest a proper parameter
capture = k:match (pattern); -- the whole match if no capture in pattern else the capture if a match
if capture then -- if the pattern matches
param = utilities.substitute (param, capture); -- add the capture to the suggested parameter (typically the enumerator)
if validate (param, config.CitationClass) then -- validate the suggestion to make sure that the suggestion is supported by this template (necessary for limited parameter lists)
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, param}); -- set the suggestion error message
else
error_text = utilities.set_message ('err_parameter_ignored', {k}); -- suggested param not supported by this template
v = ''; -- unset
end
end
end
if not utilities.is_set (error_text) then -- couldn't match with a pattern, is there an explicit suggestion?
if (suggestions.suggestions[ k:lower() ] ~= nil) and validate (suggestions.suggestions[ k:lower() ], config.CitationClass) then
utilities.set_message ('err_parameter_ignored_suggest', {k, suggestions.suggestions[ k:lower() ]});
else
utilities.set_message ('err_parameter_ignored', {k});
v = ''; -- unset value assigned to unrecognized parameters (this for the limited parameter lists)
end
end
end
end
args[k] = v; -- save this parameter and its value
elseif not utilities.is_set (v) then -- for empty parameters
if not validate (k, config.CitationClass, true) then -- is this empty parameter a valid parameter
k = ('' == k) and '(empty string)' or k; -- when k is empty string (or was space(s) trimmed to empty string), replace with descriptive text
table.insert (empty_unknowns, utilities.wrap_style ('parameter', k)); -- format for error message and add to the list
end
-- crude debug support that allows us to render a citation from module {{#invoke:}} TODO: keep?
-- elseif args[k] ~= nil or (k == 'postscript') then -- when args[k] has a value from {{#invoke}} frame (we don't normally do that)
-- args[k] = v; -- overwrite args[k] with empty string from pframe.args[k] (template frame); v is empty string here
end -- not sure about the postscript bit; that gets handled in parameter validation; historical artifact?
end
if 0 ~= #empty_unknowns then -- create empty unknown error message
utilities.set_message ('err_param_unknown_empty', {
1 == #empty_unknowns and '' or 's',
utilities.make_sep_list (#empty_unknowns, empty_unknowns)
});
end
local url_param_t = {};
for k, v in pairs( args ) do
if 'string' == type (k) then -- don't evaluate positional parameters
has_invisible_chars (k, v); -- look for invisible characters
end
has_extraneous_punc (k, v); -- look for extraneous terminal punctuation in parameter values
missing_pipe_check (k, v); -- do we think that there is a parameter that is missing a pipe?
args[k] = inter_wiki_check (k, v); -- when language interwiki-linked parameter missing leading colon replace with wiki-link label
if 'string' == type (k) and not cfg.url_skip[k] then -- when parameter k is not positional and not in url skip table
url_param_t[k] = v; -- make a parameter/value list for extraneous url check
end
end
has_extraneous_url (url_param_t); -- look for url in parameter values where a url does not belong
return table.concat ({
frame:extensionTag ('templatestyles', '', {src=styles}),
citation0( config, args)
});
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {citation = citation};
03d0c65e9544044eef296e124f940c7cc9319972
Module:Citation/CS1/Configuration
828
159
419
418
2023-10-17T20:36:14Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/Configuration]]
Scribunto
text/plain
local lang_obj = mw.language.getContentLanguage(); -- make a language object for the local language; used here for languages and dates
--[[--------------------------< S E T T I N G S >--------------------------------------------------------------
boolean settings used to control various things. these setting located here to make them easy to find
]]
-- these settings local to this module only
local local_digits_from_mediawiki = false; -- for i18n; when true, module fills date_names['local_digits'] from MediaWiki; manual fill required else; always false at en.wiki
local local_date_names_from_mediawiki = false; -- for i18n; when true, module fills date_names['local']['long'] and date_names['local']['short'] from MediaWiki;
-- manual translation required else; ; always false at en.wiki
-- these settings exported to other modules
local use_identifier_redirects = true; -- when true use redirect name for identifier label links; always true at en.wiki
local local_lang_cat_enable = false; -- when true categorizes pages where |language=<local wiki's language>; always false at en.wiki
local date_name_auto_xlate_enable = false; -- when true translates English month-names to the local-wiki's language month names; always false at en.wiki
local date_digit_auto_xlate_enable = false; -- when true translates Western date digit to the local-wiki's language digits (date_names['local_digits']); always false at en.wiki
--[[--------------------------< U N C A T E G O R I Z E D _ N A M E S P A C E S >------------------------------
List of namespaces identifiers for namespaces that will not be included in citation error categories.
Same as setting notracking = true by default.
For wikis that have a current version of Module:cs1 documentation support, this #invoke will return an unordered
list of namespace names and their associated identifiers:
{{#invoke:cs1 documentation support|uncategorized_namespace_lister|all=<anything>}}
]]
uncategorized_namespaces_t = {[2]=true}; -- init with user namespace id
for k, _ in pairs (mw.site.talkNamespaces) do -- add all talk namespace ids
uncategorized_namespaces_t[k] = true;
end
local uncategorized_subpages = {'/[Ss]andbox', '/[Tt]estcases', '/[^/]*[Ll]og', '/[Aa]rchive'}; -- list of Lua patterns found in page names of pages we should not categorize
--[[--------------------------< M E S S A G E S >--------------------------------------------------------------
Translation table
The following contains fixed text that may be output as part of a citation.
This is separated from the main body to aid in future translations of this
module.
]]
local messages = {
['agency'] = '$1 $2', -- $1 is sepc, $2 is agency
['archived-dead'] = 'Archived from $1 on $2',
['archived-live'] = '$1 from the original on $2',
['archived-unfit'] = 'Archived from the original on ',
['archived'] = 'Archived',
['by'] = 'By', -- contributions to authored works: introduction, foreword, afterword
['cartography'] = 'Cartography by $1',
['editor'] = 'ed.',
['editors'] = 'eds.',
['edition'] = '($1 ed.)',
['episode'] = 'Episode $1',
['et al'] = 'et al.',
['in'] = 'In', -- edited works
['inactive'] = 'inactive',
['inset'] = '$1 inset',
['interview'] = 'Interviewed by $1',
['mismatch'] = '<code class="cs1-code">|$1=</code> / <code class="cs1-code">|$2=</code> mismatch', -- $1 is year param name; $2 is date param name
['newsgroup'] = '[[Usenet newsgroup|Newsgroup]]: $1',
['notitle'] = 'No title', -- for |title=(()) and (in the future) |title=none
['original'] = 'the original',
['origdate'] = ' [$1]',
['published'] = ' (published $1)',
['retrieved'] = 'Retrieved $1',
['season'] = 'Season $1',
['section'] = '§ $1',
['sections'] = '§§ $1',
['series'] = '$1 $2', -- $1 is sepc, $2 is series
['seriesnum'] = 'Series $1',
['translated'] = 'Translated by $1',
['type'] = ' ($1)', -- for titletype
['written'] = 'Written at $1',
['vol'] = '$1 Vol. $2', -- $1 is sepc; bold journal style volume is in presentation{}
['vol-no'] = '$1 Vol. $2, no. $3', -- sepc, volume, issue (alternatively insert $1 after $2, but then we'd also have to change capitalization)
['issue'] = '$1 No. $2', -- $1 is sepc
['art'] = '$1 Art. $2', -- $1 is sepc; for {{cite conference}} only
['vol-art'] = '$1 Vol. $2, art. $3', -- sepc, volume, article-number; for {{cite conference}} only
['j-vol'] = '$1 $2', -- sepc, volume; bold journal volume is in presentation{}
['j-issue'] = ' ($1)',
['j-article-num'] = ' $1', -- TODO: any punctuation here? static text?
['nopp'] = '$1 $2'; -- page(s) without prefix; $1 is sepc
['p-prefix'] = "$1 p. $2", -- $1 is sepc
['pp-prefix'] = "$1 pp. $2", -- $1 is sepc
['j-page(s)'] = ': $1', -- same for page and pages
['sheet'] = '$1 Sheet $2', -- $1 is sepc
['sheets'] = '$1 Sheets $2', -- $1 is sepc
['j-sheet'] = ': Sheet $1',
['j-sheets'] = ': Sheets $1',
['language'] = '(in $1)',
['via'] = " – via $1",
['event'] = 'Event occurs at',
['minutes'] = 'minutes in',
-- Determines the location of the help page
['help page link'] = 'Help:CS1 errors',
['help page label'] = 'help',
-- categories
['cat wikilink'] = '[[Category:$1]]', -- $1 is the category name
[':cat wikilink'] = '[[:Category:$1|link]]', -- category name as maintenance message wikilink; $1 is the category name
-- Internal errors (should only occur if configuration is bad)
['undefined_error'] = 'Called with an undefined error condition',
['unknown_ID_key'] = 'Unrecognized ID key: ', -- an ID key in id_handlers not found in ~/Identifiers func_map{}
['unknown_ID_access'] = 'Unrecognized ID access keyword: ', -- an ID access keyword in id_handlers not found in keywords_lists['id-access']{}
['unknown_argument_map'] = 'Argument map not defined for this variable',
['bare_url_no_origin'] = 'Bare URL found but origin indicator is nil or empty',
['warning_msg_e'] = '<span style="color:#d33">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">{{$1}}</code> templates have errors</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
['warning_msg_m'] = '<span style="color:#3a3">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">{{$1}}</code> templates have maintenance messages</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
}
--[[--------------------------< C I T A T I O N _ C L A S S _ M A P >------------------------------------------
this table maps the value assigned to |CitationClass= in the cs1|2 templates to the canonical template name when
the value assigned to |CitationClass= is different from the canonical template name. |CitationClass= values are
used as class attributes in the <cite> tag that encloses the citation so these names may not contain spaces while
the canonical template name may. These names are used in warning_msg_e and warning_msg_m to create links to the
template's documentation when an article is displayed in preview mode.
Most cs1|2 template |CitationClass= values at en.wiki match their canonical template names so are not listed here.
]]
local citation_class_map_t = { -- TODO: if kept, these and all other config.CitationClass 'names' require some sort of i18n
['arxiv'] = 'arXiv',
['audio-visual'] = 'AV media',
['AV-media-notes'] = 'AV media notes',
['biorxiv'] = 'bioRxiv',
['citeseerx'] = 'CiteSeerX',
['encyclopaedia'] = 'encyclopedia',
['mailinglist'] = 'mailing list',
['medrxiv'] = 'medRxiv',
['pressrelease'] = 'press release',
['ssrn'] = 'SSRN',
['techreport'] = 'tech report',
}
--[=[-------------------------< E T _ A L _ P A T T E R N S >--------------------------------------------------
This table provides Lua patterns for the phrase "et al" and variants in name text
(author, editor, etc.). The main module uses these to identify and emit the 'etal' message.
]=]
local et_al_patterns = {
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][%.;,\"']*$", -- variations on the 'et al' theme
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][Ii][AaIi][Ee]?[%.;,\"']*$", -- variations on the 'et alia', 'et alii' and 'et aliae' themes (false positive 'et aliie' unlikely to match)
"[;,]? *%f[%a]and [Oo]thers", -- an alternative to et al.
"%[%[ *[Ee][Tt]%.? *[Aa][Ll]%.? *%]%]", -- a wikilinked form
"%(%( *[Ee][Tt]%.? *[Aa][Ll]%.? *%)%)", -- a double-bracketed form (to counter partial removal of ((...)) syntax)
"[%(%[] *[Ee][Tt]%.? *[Aa][Ll]%.? *[%)%]]", -- a bracketed form
}
--[[--------------------------< P R E S E N T A T I O N >------------------------
Fixed presentation markup. Originally part of citation_config.messages it has
been moved into its own, more semantically correct place.
]]
local presentation =
{
-- .citation-comment class is specified at Help:CS1_errors#Controlling_error_message_display
['hidden-error'] = '<span class="cs1-hidden-error citation-comment">$1</span>',
['visible-error'] = '<span class="cs1-visible-error citation-comment">$1</span>',
['hidden-maint'] = '<span class="cs1-maint citation-comment">$1</span>',
['accessdate'] = '<span class="reference-accessdate">$1$2</span>', -- to allow editors to hide accessdate using personal CSS
['bdi'] = '<bdi$1>$2</bdi>', -- bidirectional isolation used with |script-title= and the like
['cite'] = '<cite class="$1">$2</cite>'; -- for use when citation does not have a namelist and |ref= not set so no id="..." attribute
['cite-id'] = '<cite id="$1" class="$2">$3</cite>'; -- for use when when |ref= is set or when citation has a namelist
['format'] = ' <span class="cs1-format">($1)</span>', -- for |format=, |chapter-format=, etc.
['interwiki'] = ' <span class="cs1-format">[in $1]</span>', -- for interwiki-language-linked author, editor, etc
['interproj'] = ' <span class="cs1-format">[at $1]</span>', -- for interwiki-project-linked author, editor, etc (:d: and :s: supported; :w: ignored)
-- various access levels, for |access=, |doi-access=, |arxiv=, ...
-- narrow no-break space   may work better than nowrap CSS. Or not? Browser support?
['ext-link-access-signal'] = '<span class="$1" title="$2">$3</span>', -- external link with appropriate lock icon
['free'] = {class='cs1-lock-free', title='Freely accessible'}, -- classes defined in Module:Citation/CS1/styles.css
['registration'] = {class='cs1-lock-registration', title='Free registration required'},
['limited'] = {class='cs1-lock-limited', title='Free access subject to limited trial, subscription normally required'},
['subscription'] = {class='cs1-lock-subscription', title='Paid subscription required'},
['interwiki-icon'] = '<span class="$1" title="$2">$3</span>',
['class-wikisource'] = 'cs1-ws-icon',
['italic-title'] = "''$1''",
['kern-left'] = '<span class="cs1-kern-left"></span>$1', -- spacing to use when title contains leading single or double quote mark
['kern-right'] = '$1<span class="cs1-kern-right"></span>', -- spacing to use when title contains trailing single or double quote mark
['nowrap1'] = '<span class="nowrap">$1</span>', -- for nowrapping an item: <span ...>yyyy-mm-dd</span>
['nowrap2'] = '<span class="nowrap">$1</span> $2', -- for nowrapping portions of an item: <span ...>dd mmmm</span> yyyy (note white space)
['ocins'] = '<span title="$1" class="Z3988"></span>',
['parameter'] = '<code class="cs1-code">|$1=</code>',
['ps_cs1'] = '.'; -- CS1 style postscript (terminal) character
['ps_cs2'] = ''; -- CS2 style postscript (terminal) character (empty string)
['quoted-text'] = '<q>$1</q>', -- for wrapping |quote= content
['quoted-title'] = '"$1"',
['sep_cs1'] = '.', -- CS1 element separator
['sep_cs2'] = ',', -- CS2 separator
['sep_nl'] = ';', -- CS1|2 style name-list separator between names is a semicolon
['sep_nl_and'] = ' and ', -- used as last nl sep when |name-list-style=and and list has 2 items
['sep_nl_end'] = '; and ', -- used as last nl sep when |name-list-style=and and list has 3+ names
['sep_name'] = ', ', -- CS1|2 style last/first separator is <comma><space>
['sep_nl_vanc'] = ',', -- Vancouver style name-list separator between authors is a comma
['sep_name_vanc'] = ' ', -- Vancouver style last/first separator is a space
['sep_list'] = ', ', -- used for |language= when list has 3+ items except for last sep which uses sep_list_end
['sep_list_pair'] = ' and ', -- used for |language= when list has 2 items
['sep_list_end'] = ', and ', -- used as last list sep for |language= when list has 3+ items
['trans-italic-title'] = "[''$1'']",
['trans-quoted-title'] = "[$1]", -- for |trans-title= and |trans-quote=
['vol-bold'] = '$1 <b>$2</b>', -- sepc, volume; for bold journal cites; for other cites ['vol'] in messages{}
}
--[[--------------------------< A L I A S E S >---------------------------------
Aliases table for commonly passed parameters.
Parameter names on the right side in the assignments in this table must have been
defined in the Whitelist before they will be recognized as valid parameter names
]]
local aliases = {
['AccessDate'] = {'access-date', 'accessdate'}, -- Used by InternetArchiveBot
['Agency'] = 'agency',
['ArchiveDate'] = {'archive-date', 'archivedate'}, -- Used by InternetArchiveBot
['ArchiveFormat'] = 'archive-format',
['ArchiveURL'] = {'archive-url', 'archiveurl'}, -- Used by InternetArchiveBot
['ArticleNumber'] = 'article-number',
['ASINTLD'] = 'asin-tld',
['At'] = 'at', -- Used by InternetArchiveBot
['Authors'] = {'authors', 'people', 'credits'},
['BookTitle'] = {'book-title', 'booktitle'},
['Cartography'] = 'cartography',
['Chapter'] = {'chapter', 'contribution', 'entry', 'article', 'section'},
['ChapterFormat'] = {'chapter-format', 'contribution-format', 'entry-format',
'article-format', 'section-format'};
['ChapterURL'] = {'chapter-url', 'contribution-url', 'entry-url', 'article-url', 'section-url', 'chapterurl'}, -- Used by InternetArchiveBot
['ChapterUrlAccess'] = {'chapter-url-access', 'contribution-url-access',
'entry-url-access', 'article-url-access', 'section-url-access'}, -- Used by InternetArchiveBot
['Class'] = 'class', -- cite arxiv and arxiv identifier
['Collaboration'] = 'collaboration',
['Conference'] = {'conference', 'event'},
['ConferenceFormat'] = 'conference-format',
['ConferenceURL'] = 'conference-url', -- Used by InternetArchiveBot
['Date'] = {'date', 'air-date', 'airdate'}, -- air-date and airdate for cite episode and cite serial only
['Degree'] = 'degree',
['DF'] = 'df',
['DisplayAuthors'] = {'display-authors', 'display-subjects'},
['DisplayContributors'] = 'display-contributors',
['DisplayEditors'] = 'display-editors',
['DisplayInterviewers'] = 'display-interviewers',
['DisplayTranslators'] = 'display-translators',
['Docket'] = 'docket',
['DoiBroken'] = 'doi-broken-date',
['Edition'] = 'edition',
['Embargo'] = 'pmc-embargo-date',
['Encyclopedia'] = {'encyclopedia', 'encyclopaedia', 'dictionary'}, -- cite encyclopedia only
['Episode'] = 'episode', -- cite serial only TODO: make available to cite episode?
['Format'] = 'format',
['ID'] = {'id', 'ID'},
['Inset'] = 'inset',
['Issue'] = {'issue', 'number'},
['Language'] = {'language', 'lang'},
['MailingList'] = {'mailing-list', 'mailinglist'}, -- cite mailing list only
['Map'] = 'map', -- cite map only
['MapFormat'] = 'map-format', -- cite map only
['MapURL'] = {'map-url', 'mapurl'}, -- cite map only -- Used by InternetArchiveBot
['MapUrlAccess'] = 'map-url-access', -- cite map only -- Used by InternetArchiveBot
['Minutes'] = 'minutes',
['Mode'] = 'mode',
['NameListStyle'] = 'name-list-style',
['Network'] = 'network',
['Newsgroup'] = 'newsgroup', -- cite newsgroup only
['NoPP'] = {'no-pp', 'nopp'},
['NoTracking'] = {'no-tracking', 'template-doc-demo'},
['Number'] = 'number', -- this case only for cite techreport
['OrigDate'] = {'orig-date', 'orig-year', 'origyear'},
['Others'] = 'others',
['Page'] = {'page', 'p'}, -- Used by InternetArchiveBot
['Pages'] = {'pages', 'pp'}, -- Used by InternetArchiveBot
['Periodical'] = {'journal', 'magazine', 'newspaper', 'periodical', 'website', 'work'},
['Place'] = {'place', 'location'},
['PostScript'] = 'postscript',
['PublicationDate'] = {'publication-date', 'publicationdate'},
['PublicationPlace'] = {'publication-place', 'publicationplace'},
['PublisherName'] = {'publisher', 'institution'},
['Quote'] = {'quote', 'quotation'},
['QuotePage'] = 'quote-page',
['QuotePages'] = 'quote-pages',
['Ref'] = 'ref',
['Scale'] = 'scale',
['ScriptChapter'] = {'script-chapter', 'script-contribution', 'script-entry',
'script-article', 'script-section'},
['ScriptMap'] = 'script-map',
['ScriptPeriodical'] = {'script-journal', 'script-magazine', 'script-newspaper',
'script-periodical', 'script-website', 'script-work'},
['ScriptQuote'] = 'script-quote',
['ScriptTitle'] = 'script-title', -- Used by InternetArchiveBot
['Season'] = 'season',
['Sections'] = 'sections', -- cite map only
['Series'] = {'series', 'version'},
['SeriesLink'] = {'series-link', 'serieslink'},
['SeriesNumber'] = {'series-number', 'series-no'},
['Sheet'] = 'sheet', -- cite map only
['Sheets'] = 'sheets', -- cite map only
['Station'] = 'station',
['Time'] = 'time',
['TimeCaption'] = 'time-caption',
['Title'] = 'title', -- Used by InternetArchiveBot
['TitleLink'] = {'title-link', 'episode-link', 'episodelink'}, -- Used by InternetArchiveBot
['TitleNote'] = {'title-note', 'department'},
['TitleType'] = {'type', 'medium'},
['TransChapter'] = {'trans-article', 'trans-chapter', 'trans-contribution',
'trans-entry', 'trans-section'},
['Transcript'] = 'transcript',
['TranscriptFormat'] = 'transcript-format',
['TranscriptURL'] = 'transcript-url', -- Used by InternetArchiveBot
['TransMap'] = 'trans-map', -- cite map only
['TransPeriodical'] = {'trans-journal', 'trans-magazine', 'trans-newspaper',
'trans-periodical', 'trans-website', 'trans-work'},
['TransQuote'] = 'trans-quote',
['TransTitle'] = 'trans-title', -- Used by InternetArchiveBot
['URL'] = {'url', 'URL'}, -- Used by InternetArchiveBot
['UrlAccess'] = 'url-access', -- Used by InternetArchiveBot
['UrlStatus'] = 'url-status', -- Used by InternetArchiveBot
['Vauthors'] = 'vauthors',
['Veditors'] = 'veditors',
['Via'] = 'via',
['Volume'] = 'volume',
['Year'] = 'year',
['AuthorList-First'] = {"first#", "author-first#", "author#-first", "author-given#", "author#-given",
"subject-first#", "subject#-first", "subject-given#", "subject#-given",
"given#"},
['AuthorList-Last'] = {"last#", "author-last#", "author#-last", "author-surname#", "author#-surname",
"subject-last#", "subject#-last", "subject-surname#", "subject#-surname",
"author#", 'host#', "subject#", "surname#"},
['AuthorList-Link'] = {"author-link#", "author#-link", "subject-link#",
"subject#-link", "authorlink#", "author#link"},
['AuthorList-Mask'] = {"author-mask#", "author#-mask", "subject-mask#", "subject#-mask"},
['ContributorList-First'] = {'contributor-first#', 'contributor#-first',
'contributor-given#', 'contributor#-given'},
['ContributorList-Last'] = {'contributor-last#', 'contributor#-last',
'contributor-surname#', 'contributor#-surname', 'contributor#'},
['ContributorList-Link'] = {'contributor-link#', 'contributor#-link'},
['ContributorList-Mask'] = {'contributor-mask#', 'contributor#-mask'},
['EditorList-First'] = {"editor-first#", "editor#-first", "editor-given#", "editor#-given"},
['EditorList-Last'] = {"editor-last#", "editor#-last", "editor-surname#",
"editor#-surname", "editor#"},
['EditorList-Link'] = {"editor-link#", "editor#-link"},
['EditorList-Mask'] = {"editor-mask#", "editor#-mask"},
['InterviewerList-First'] = {'interviewer-first#', 'interviewer#-first',
'interviewer-given#', 'interviewer#-given'},
['InterviewerList-Last'] = {'interviewer-last#', 'interviewer#-last',
'interviewer-surname#', 'interviewer#-surname', 'interviewer#'},
['InterviewerList-Link'] = {'interviewer-link#', 'interviewer#-link'},
['InterviewerList-Mask'] = {'interviewer-mask#', 'interviewer#-mask'},
['TranslatorList-First'] = {'translator-first#', 'translator#-first',
'translator-given#', 'translator#-given'},
['TranslatorList-Last'] = {'translator-last#', 'translator#-last',
'translator-surname#', 'translator#-surname', 'translator#'},
['TranslatorList-Link'] = {'translator-link#', 'translator#-link'},
['TranslatorList-Mask'] = {'translator-mask#', 'translator#-mask'},
}
--[[--------------------------< P U N C T _ S K I P >---------------------------
builds a table of parameter names that the extraneous terminal punctuation check should not check.
]]
local punct_meta_params = { -- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value
'BookTitle', 'Chapter', 'ScriptChapter', 'ScriptTitle', 'Title', 'TransChapter', 'Transcript', 'TransMap', 'TransTitle', -- title-holding parameters
'AuthorList-Mask', 'ContributorList-Mask', 'EditorList-Mask', 'InterviewerList-Mask', 'TranslatorList-Mask', -- name-list mask may have name separators
'PostScript', 'Quote', 'ScriptQuote', 'TransQuote', 'Ref', -- miscellaneous
'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'MapURL', 'TranscriptURL', 'URL', -- URL-holding parameters
}
local url_meta_params = { -- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value
'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'ID', 'MapURL', 'TranscriptURL', 'URL', -- parameters allowed to hold urls
'Page', 'Pages', 'At', 'QuotePage', 'QuotePages', -- insource locators allowed to hold urls
}
local function build_skip_table (skip_t, meta_params)
for _, meta_param in ipairs (meta_params) do -- for each meta parameter key
local params = aliases[meta_param]; -- get the parameter or the table of parameters associated with the meta parameter name
if 'string' == type (params) then
skip_t[params] = 1; -- just a single parameter
else
for _, param in ipairs (params) do -- get the parameter name
skip_t[param] = 1; -- add the parameter name to the skip table
local count;
param, count = param:gsub ('#', ''); -- remove enumerator marker from enumerated parameters
if 0 ~= count then -- if removed
skip_t[param] = 1; -- add param name without enumerator marker
end
end
end
end
return skip_t;
end
local punct_skip = {};
local url_skip = {};
--[[--------------------------< S I N G L E - L E T T E R S E C O N D - L E V E L D O M A I N S >----------
this is a list of tlds that are known to have single-letter second-level domain names. This list does not include
ccTLDs which are accepted in is_domain_name().
]]
local single_letter_2nd_lvl_domains_t = {'cash', 'company', 'foundation', 'org', 'today'};
--[[-----------< S P E C I A L C A S E T R A N S L A T I O N S >------------
This table is primarily here to support internationalization. Translations in
this table are used, for example, when an error message, category name, etc.,
is extracted from the English alias key. There may be other cases where
this translation table may be useful.
]]
local is_Latn = 'A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143';
local special_case_translation = {
['AuthorList'] = 'authors list', -- used to assemble maintenance category names
['ContributorList'] = 'contributors list', -- translation of these names plus translation of the base maintenance category names in maint_cats{} table below
['EditorList'] = 'editors list', -- must match the names of the actual categories
['InterviewerList'] = 'interviewers list', -- this group or translations used by name_has_ed_markup() and name_has_mult_names()
['TranslatorList'] = 'translators list',
-- Lua patterns to match pseudo-titles used by InternetArchiveBot and others as placeholder for unknown |title= value
['archived_copy'] = { -- used with CS1 maint: Archive[d] copy as title
['en'] = '^archived?%s+copy$', -- for English; translators: keep this because templates imported from en.wiki
['local'] = nil, -- translators: replace ['local'] = nil with lowercase translation only when bots or tools create generic titles in your language
},
-- Lua patterns to match generic titles; usually created by bots or reference filling tools
-- translators: replace ['local'] = nil with lowercase translation only when bots or tools create generic titles in your language
-- generic titles and patterns in this table should be lowercase only
-- leave ['local'] nil except when there is a matching generic title in your language
-- boolean 'true' for plain-text searches; 'false' for pattern searches
['generic_titles'] = {
['accept'] = {
},
['reject'] = {
{['en'] = {'^wayback%s+machine$', false}, ['local'] = nil},
{['en'] = {'are you a robot', true}, ['local'] = nil},
{['en'] = {'hugedomains.com', true}, ['local'] = nil},
{['en'] = {'^[%(%[{<]?no +title[>}%]%)]?$', false}, ['local'] = nil},
{['en'] = {'page not found', true}, ['local'] = nil},
{['en'] = {'subscribe to read', true}, ['local'] = nil},
{['en'] = {'^[%(%[{<]?unknown[>}%]%)]?$', false}, ['local'] = nil},
{['en'] = {'website is for sale', true}, ['local'] = nil},
{['en'] = {'^404', false}, ['local'] = nil},
{['en'] = {'internet archive wayback machine', true}, ['local'] = nil},
{['en'] = {'log into facebook', true}, ['local'] = nil},
{['en'] = {'login • instagram', true}, ['local'] = nil},
{['en'] = {'redirecting...', true}, ['local'] = nil},
{['en'] = {'usurped title', true}, ['local'] = nil}, -- added by a GreenC bot
{['en'] = {'webcite query result', true}, ['local'] = nil},
{['en'] = {'wikiwix\'s cache', true}, ['local'] = nil},
}
},
-- boolean 'true' for plain-text searches, search string must be lowercase only
-- boolean 'false' for pattern searches
-- leave ['local'] nil except when there is a matching generic name in your language
['generic_names'] = {
['accept'] = {
{['en'] = {'%[%[[^|]*%(author%) *|[^%]]*%]%]', false}, ['local'] = nil},
},
['reject'] = {
{['en'] = {'about us', true}, ['local'] = nil},
{['en'] = {'%f[%a][Aa]dvisor%f[%A]', false}, ['local'] = nil},
{['en'] = {'allmusic', true}, ['local'] = nil},
{['en'] = {'%f[%a][Aa]uthor%f[%A]', false}, ['local'] = nil},
{['en'] = {'business', true}, ['local'] = nil},
{['en'] = {'cnn', true}, ['local'] = nil},
{['en'] = {'collaborator', true}, ['local'] = nil},
{['en'] = {'contributor', true}, ['local'] = nil},
{['en'] = {'contact us', true}, ['local'] = nil},
{['en'] = {'directory', true}, ['local'] = nil},
{['en'] = {'%f[%(%[][%(%[]%s*eds?%.?%s*[%)%]]?$', false}, ['local'] = nil},
{['en'] = {'[,%.%s]%f[e]eds?%.?$', false}, ['local'] = nil},
{['en'] = {'^eds?[%.,;]', false}, ['local'] = nil},
{['en'] = {'^[%(%[]%s*[Ee][Dd][Ss]?%.?%s*[%)%]]', false}, ['local'] = nil},
{['en'] = {'%f[%a][Ee]dited%f[%A]', false}, ['local'] = nil},
{['en'] = {'%f[%a][Ee]ditors?%f[%A]', false}, ['local'] = nil},
{['en'] = {'%f[%a]]Ee]mail%f[%A]', false}, ['local'] = nil},
{['en'] = {'facebook', true}, ['local'] = nil},
{['en'] = {'google', true}, ['local'] = nil},
{['en'] = {'home page', true}, ['local'] = nil},
{['en'] = {'^[Ii]nc%.?$', false}, ['local'] = nil},
{['en'] = {'instagram', true}, ['local'] = nil},
{['en'] = {'interviewer', true}, ['local'] = nil},
{['en'] = {'linkedIn', true}, ['local'] = nil},
{['en'] = {'^[Nn]ews$', false}, ['local'] = nil},
{['en'] = {'pinterest', true}, ['local'] = nil},
{['en'] = {'policy', true}, ['local'] = nil},
{['en'] = {'privacy', true}, ['local'] = nil},
{['en'] = {'reuters', true}, ['local'] = nil},
{['en'] = {'translator', true}, ['local'] = nil},
{['en'] = {'tumblr', true}, ['local'] = nil},
{['en'] = {'twitter', true}, ['local'] = nil},
{['en'] = {'site name', true}, ['local'] = nil},
{['en'] = {'statement', true}, ['local'] = nil},
{['en'] = {'submitted', true}, ['local'] = nil},
{['en'] = {'super.?user', false}, ['local'] = nil},
{['en'] = {'%f['..is_Latn..'][Uu]ser%f[^'..is_Latn..']', false}, ['local'] = nil},
{['en'] = {'verfasser', true}, ['local'] = nil},
}
}
}
--[[--------------------------< D A T E _ N A M E S >----------------------------------------------------------
This table of tables lists local language date names and fallback English date names.
The code in Date_validation will look first in the local table for valid date names.
If date names are not found in the local table, the code will look in the English table.
Because citations can be copied to the local wiki from en.wiki, the English is
required when the date-name translation function date_name_xlate() is used.
In these tables, season numbering is defined by
Extended Date/Time Format (EDTF) Specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard
defines various divisions using numbers 21-41. CS1|2 only supports generic seasons.
EDTF does support the distinction between north and south hemisphere seasons
but CS1|2 has no way to make that distinction.
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
The standard does not address 'named' dates so, for the purposes of CS1|2,
Easter and Christmas are defined here as 98 and 99, which should be out of the
ISO 8601 (EDTF) range of uses for a while.
local_date_names_from_mediawiki is a boolean. When set to:
true – module will fetch local month names from MediaWiki for both date_names['local']['long'] and date_names['local']['short']
false – module will *not* fetch local month names from MediaWiki
Caveat lector: There is no guarantee that MediaWiki will provide short month names. At your wiki you can test
the results of the MediaWiki fetch in the debug console with this command (the result is alpha sorted):
=mw.dumpObject (p.date_names['local'])
While the module can fetch month names from MediaWiki, it cannot fetch the quarter, season, and named date names
from MediaWiki. Those must be translated manually.
]]
local local_date_names_from_mediawiki = true; -- when false, manual translation required for date_names['local']['long'] and date_names['local']['short']
-- when true, module fetches long and short month names from MediaWiki
local date_names = {
['en'] = { -- English
['long'] = {['January'] = 1, ['February'] = 2, ['March'] = 3, ['April'] = 4, ['May'] = 5, ['June'] = 6, ['July'] = 7, ['August'] = 8, ['September'] = 9, ['October'] = 10, ['November'] = 11, ['December'] = 12},
['short'] = {['Jan'] = 1, ['Feb'] = 2, ['Mar'] = 3, ['Apr'] = 4, ['May'] = 5, ['Jun'] = 6, ['Jul'] = 7, ['Aug'] = 8, ['Sep'] = 9, ['Oct'] = 10, ['Nov'] = 11, ['Dec'] = 12},
['quarter'] = {['First Quarter'] = 33, ['Second Quarter'] = 34, ['Third Quarter'] = 35, ['Fourth Quarter'] = 36},
['season'] = {['Winter'] = 24, ['Spring'] = 21, ['Summer'] = 22, ['Fall'] = 23, ['Autumn'] = 23},
['named'] = {['Easter'] = 98, ['Christmas'] = 99},
},
-- when local_date_names_from_mediawiki = false
['local'] = { -- replace these English date names with the local language equivalents
['long'] = {['January'] = 1, ['February'] = 2, ['March'] = 3, ['April'] = 4, ['May'] = 5, ['June'] = 6, ['July'] = 7, ['August'] = 8, ['September'] = 9, ['October'] = 10, ['November'] = 11, ['December'] = 12},
['short'] = {['Jan'] = 1, ['Feb'] = 2, ['Mar'] = 3, ['Apr'] = 4, ['May'] = 5, ['Jun'] = 6, ['Jul'] = 7, ['Aug'] = 8, ['Sep'] = 9, ['Oct'] = 10, ['Nov'] = 11, ['Dec'] = 12},
['quarter'] = {['First Quarter'] = 33, ['Second Quarter'] = 34, ['Third Quarter'] = 35, ['Fourth Quarter'] = 36},
['season'] = {['Winter'] = 24, ['Spring'] = 21, ['Summer'] = 22, ['Fall'] = 23, ['Autumn'] = 23},
['named'] = {['Easter'] = 98, ['Christmas'] = 99},
},
['inv_local_long'] = {}, -- used in date reformatting & translation; copy of date_names['local'].long where k/v are inverted: [1]='<local name>' etc.
['inv_local_short'] = {}, -- used in date reformatting & translation; copy of date_names['local'].short where k/v are inverted: [1]='<local name>' etc.
['inv_local_quarter'] = {}, -- used in date translation; copy of date_names['local'].quarter where k/v are inverted: [1]='<local name>' etc.
['inv_local_season'] = {}, -- used in date translation; copy of date_names['local'].season where k/v are inverted: [1]='<local name>' etc.
['inv_local_named'] = {}, -- used in date translation; copy of date_names['local'].named where k/v are inverted: [1]='<local name>' etc.
['local_digits'] = {['0'] = '0', ['1'] = '1', ['2'] = '2', ['3'] = '3', ['4'] = '4', ['5'] = '5', ['6'] = '6', ['7'] = '7', ['8'] = '8', ['9'] = '9'}, -- used to convert local language digits to Western 0-9
['xlate_digits'] = {},
}
if local_date_names_from_mediawiki then -- if fetching local month names from MediaWiki is enabled
local long_t = {};
local short_t = {};
for i=1, 12 do -- loop 12x and
local name = lang_obj:formatDate('F', '2022-' .. i .. '-1'); -- get long month name for each i
long_t[name] = i; -- save it
name = lang_obj:formatDate('M', '2022-' .. i .. '-1'); -- get short month name for each i
short_t[name] = i; -- save it
end
date_names['local']['long'] = long_t; -- write the long table – overwrites manual translation
date_names['local']['short'] = short_t; -- write the short table – overwrites manual translation
end
-- create inverted date-name tables for reformatting and/or translation
for _, invert_t in pairs {{'long', 'inv_local_long'}, {'short', 'inv_local_short'}, {'quarter', 'inv_local_quarter'}, {'season', 'inv_local_season'}, {'named', 'inv_local_named'}} do
for name, i in pairs (date_names['local'][invert_t[1]]) do -- this table is ['name'] = i
date_names[invert_t[2]][i] = name; -- invert to get [i] = 'name' for conversions from ymd
end
end
if local_digits_from_mediawiki then -- if fetching local digits from MediaWiki is enabled
local digits_t = {};
for i=0, 9 do -- loop 10x and
digits_t [lang_obj:formatNum (i)] = tostring (i); -- format the loop indexer as local lang table index and assign loop indexer (a string) as the value
end
date_names['local_digits'] = digits_t;
end
for ld, ed in pairs (date_names.local_digits) do -- make a digit translation table for simple date translation from en to local language using local_digits table
date_names.xlate_digits [ed] = ld; -- en digit becomes index with local digit as the value
end
local df_template_patterns = { -- table of redirects to {{Use dmy dates}} and {{Use mdy dates}}
'{{ *[Uu]se +(dmy) +dates *[|}]', -- 1159k -- sorted by approximate transclusion count
'{{ *[Uu]se +(mdy) +dates *[|}]', -- 212k
'{{ *[Uu]se +(MDY) +dates *[|}]', -- 788
'{{ *[Uu]se +(DMY) +dates *[|}]', -- 343
'{{ *([Mm]dy) *[|}]', -- 176
'{{ *[Uu]se *(dmy) *[|}]', -- 156 + 18
'{{ *[Uu]se *(mdy) *[|}]', -- 149 + 11
'{{ *([Dd]my) *[|}]', -- 56
'{{ *[Uu]se +(MDY) *[|}]', -- 5
'{{ *([Dd]MY) *[|}]', -- 3
'{{ *[Uu]se(mdy)dates *[|}]', -- 1
'{{ *[Uu]se +(DMY) *[|}]', -- 0
'{{ *([Mm]DY) *[|}]', -- 0
}
local title_object = mw.title.getCurrentTitle();
local content; -- done this way so that unused templates appear in unused-template-reports; self-transcluded makes them look like they are used
if 10 ~= title_object.namespace then -- all namespaces except Template
content = title_object:getContent() or ''; -- get the content of the article or ''; new pages edited w/ve do not have 'content' until saved; ve does not preview; phab:T221625
end
local function get_date_format ()
-- if title_object.namespace == 10 then -- not in template space so that unused templates appear in unused-template-reports;
if not content then -- nil content when we're in template
return nil; -- auto-formatting does not work in Template space so don't set global_df
end
for _, pattern in ipairs (df_template_patterns) do -- loop through the patterns looking for {{Use dmy dates}} or {{Use mdy dates}} or any of their redirects
local start, _, match = content:find(pattern); -- match is the three letters indicating desired date format
if match then
local use_dates_template = content:match ('%b{}', start); -- get the whole template
if use_dates_template:match ('| *cs1%-dates *= *[lsy][sy]?') then -- look for |cs1-dates=publication date length access-/archive-date length
return match:lower() .. '-' .. use_dates_template:match ('| *cs1%-dates *= *([lsy][sy]?)');
else
return match:lower() .. '-all'; -- no |cs1-dates= k/v pair; return value appropriate for use in |df=
end
end
end
end
local global_df; -- TODO: add this to <global_cs1_config_t>?
--[[-----------------< V O L U M E , I S S U E , P A G E S >------------------
These tables hold cite class values (from the template invocation) and identify those templates that support
|volume=, |issue=, and |page(s)= parameters. Cite conference and cite map require further qualification which
is handled in the main module.
]]
local templates_using_volume = {'citation', 'audio-visual', 'book', 'conference', 'encyclopaedia', 'interview', 'journal', 'magazine', 'map', 'news', 'report', 'techreport', 'thesis'}
local templates_using_issue = {'citation', 'conference', 'episode', 'interview', 'journal', 'magazine', 'map', 'news', 'podcast'}
local templates_not_using_page = {'audio-visual', 'episode', 'mailinglist', 'newsgroup', 'podcast', 'serial', 'sign', 'speech'}
--[[
These tables control when it is appropriate for {{citation}} to render |volume= and/or |issue=. The parameter
names in the tables constrain {{citation}} so that its renderings match the renderings of the equivalent cs1
templates. For example, {{cite web}} does not support |volume= so the equivalent {{citation |website=...}} must
not support |volume=.
]]
local citation_no_volume_t = { -- {{citation}} does not render |volume= when these parameters are used
'website', 'mailinglist', 'script-website',
}
local citation_issue_t = { -- {{citation}} may render |issue= when these parameters are used
'journal', 'magazine', 'newspaper', 'periodical', 'work',
'script-journal', 'script-magazine', 'script-newspaper', 'script-periodical', 'script-work',
}
--[[
Patterns for finding extra text in |volume=, |issue=, |page=, |pages=
]]
local vol_iss_pg_patterns = {
good_ppattern = '^P[^%.PpGg]', -- OK to begin with uppercase P: P7 (page 7 of section P), but not p123 (page 123); TODO: this allows 'Pages' which it should not
bad_ppatterns = { -- patterns for |page= and |pages=
'^[Pp][PpGg]?%.?[ %d]',
'^[Pp][Pp]?%. ', -- from {{p.}} and {{pp.}} templates
'^[Pp]ages?',
'^[Pp]gs.?',
},
vpatterns = { -- patterns for |volume=
'^volumes?',
'^vols?[%.:=]?'
},
ipatterns = { -- patterns for |issue=
'^issues?',
'^iss[%.:=]?',
'^numbers?',
'^nos?%A', -- don't match 'november' or 'nostradamus'
'^nr[%.:=]?',
'^n[%.:= ]' -- might be a valid issue without separator (space char is sep char here)
}
}
--[[--------------------------< K E Y W O R D S >-------------------------------
These tables hold keywords for those parameters that have defined sets of acceptable keywords.
]]
--[[-------------------< K E Y W O R D S T A B L E >--------------------------
this is a list of keywords; each key in the list is associated with a table of
synonymous keywords possibly from different languages.
for I18N: add local-language keywords to value table; do not change the key.
For example, adding the German keyword 'ja':
['affirmative'] = {'yes', 'true', 'y', 'ja'},
Because CS1|2 templates from en.wiki articles are often copied to other local wikis,
it is recommended that the English keywords remain in these tables.
]]
local keywords = {
['amp'] = {'&', 'amp', 'ampersand'}, -- |name-list-style=
['and'] = {'and', 'serial'}, -- |name-list-style=
['affirmative'] = {'yes', 'true', 'y'}, -- |no-tracking=, |no-pp= -- Used by InternetArchiveBot
['afterword'] = {'afterword'}, -- |contribution=
['bot: unknown'] = {'bot: unknown'}, -- |url-status= -- Used by InternetArchiveBot
['cs1'] = {'cs1'}, -- |mode=
['cs2'] = {'cs2'}, -- |mode=
['dead'] = {'dead', 'deviated'}, -- |url-status= -- Used by InternetArchiveBot
['dmy'] = {'dmy'}, -- |df=
['dmy-all'] = {'dmy-all'}, -- |df=
['foreword'] = {'foreword'}, -- |contribution=
['free'] = {'free'}, -- |<id>-access= -- Used by InternetArchiveBot
['harv'] = {'harv'}, -- |ref=; this no longer supported; is_valid_parameter_value() called with <invert> = true
['introduction'] = {'introduction'}, -- |contribution=
['limited'] = {'limited'}, -- |url-access= -- Used by InternetArchiveBot
['live'] = {'live'}, -- |url-status= -- Used by InternetArchiveBot
['mdy'] = {'mdy'}, -- |df=
['mdy-all'] = {'mdy-all'}, -- |df=
['none'] = {'none'}, -- |postscript=, |ref=, |title=, |type= -- Used by InternetArchiveBot
['off'] = {'off'}, -- |title= (potentially also: |title-link=, |postscript=, |ref=, |type=)
['preface'] = {'preface'}, -- |contribution=
['registration'] = {'registration'}, -- |url-access= -- Used by InternetArchiveBot
['subscription'] = {'subscription'}, -- |url-access= -- Used by InternetArchiveBot
['unfit'] = {'unfit'}, -- |url-status= -- Used by InternetArchiveBot
['usurped'] = {'usurped'}, -- |url-status= -- Used by InternetArchiveBot
['vanc'] = {'vanc'}, -- |name-list-style=
['ymd'] = {'ymd'}, -- |df=
['ymd-all'] = {'ymd-all'}, -- |df=
-- ['yMd'] = {'yMd'}, -- |df=; not supported at en.wiki
-- ['yMd-all'] = {'yMd-all'}, -- |df=; not supported at en.wiki
}
--[[------------------------< X L A T E _ K E Y W O R D S >---------------------
this function builds a list, keywords_xlate{}, of the keywords found in keywords{} where the values from keywords{}
become the keys in keywords_xlate{} and the keys from keywords{} become the values in keywords_xlate{}:
['affirmative'] = {'yes', 'true', 'y'}, -- in keywords{}
becomes
['yes'] = 'affirmative', -- in keywords_xlate{}
['true'] = 'affirmative',
['y'] = 'affirmative',
the purpose of this function is to act as a translator between a non-English keyword and its English equivalent
that may be used in other modules of this suite
]]
local function xlate_keywords ()
local out_table = {}; -- output goes here
for k, keywords_t in pairs (keywords) do -- spin through the keywords table
for _, keyword in ipairs (keywords_t) do -- for each keyword
out_table[keyword] = k; -- create an entry in the output table where keyword is the key
end
end
return out_table;
end
local keywords_xlate = xlate_keywords (); -- the list of translated keywords
--[[----------------< M A K E _ K E Y W O R D S _ L I S T >---------------------
this function assembles, for parameter-value validation, the list of keywords appropriate to that parameter.
keywords_lists{}, is a table of tables from keywords{}
]]
local function make_keywords_list (keywords_lists)
local out_table = {}; -- output goes here
for _, keyword_list in ipairs (keywords_lists) do -- spin through keywords_lists{} and get a table of keywords
for _, keyword in ipairs (keyword_list) do -- spin through keyword_list{} and add each keyword, ...
table.insert (out_table, keyword); -- ... as plain text, to the output list
end
end
return out_table;
end
--[[----------------< K E Y W O R D S _ L I S T S >-----------------------------
this is a list of lists of valid keywords for the various parameters in [key].
Generally the keys in this table are the canonical en.wiki parameter names though
some are contrived because of use in multiple differently named parameters:
['yes_true_y'], ['id-access'].
The function make_keywords_list() extracts the individual keywords from the
appropriate list in keywords{}.
The lists in this table are used to validate the keyword assignment for the
parameters named in this table's keys.
]]
local keywords_lists = {
['yes_true_y'] = make_keywords_list ({keywords.affirmative}),
['contribution'] = make_keywords_list ({keywords.afterword, keywords.foreword, keywords.introduction, keywords.preface}),
['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all']}),
-- ['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all'], keywords.yMd, keywords['yMd-all']}), -- not supported at en.wiki
['mode'] = make_keywords_list ({keywords.cs1, keywords.cs2}),
['name-list-style'] = make_keywords_list ({keywords.amp, keywords['and'], keywords.vanc}),
['ref'] = make_keywords_list ({keywords.harv}), -- inverted check; |ref=harv no longer supported
['url-access'] = make_keywords_list ({keywords.subscription, keywords.limited, keywords.registration}),
['url-status'] = make_keywords_list ({keywords.dead, keywords.live, keywords.unfit, keywords.usurped, keywords['bot: unknown']}),
['id-access'] = make_keywords_list ({keywords.free}),
}
--[[--------------------------< C S 1 _ C O N F I G _ G E T >--------------------------------------------------
fetch and validate values from {{cs1 config}} template to fill <global_cs1_config_t>
no error messages; when errors are detected, the parameter value from {{cs1 config}} is blanked.
Supports all parameters and aliases associated with the metaparameters: DisplayAuthors, DisplayContributors,
DisplayEditors, DisplayInterviewers, DisplayTranslators, NameListStyle, and Mode. The DisplayWhatever metaparameters
accept numeric values only (|display-authors=etal and the like is not supported).
]]
local global_cs1_config_t = {}; -- TODO: add value returned from get_date_format() to this table?
local function get_cs1_config ()
-- if title_object.namespace == 10 then -- not in template space so that unused templates appear in unused-template-reports;
if not content then -- nil content when we're in template
return nil; -- auto-formatting does not work in Template space so don't set global_df
end
local start = content:find('{{ *[Cc][Ss]1 config *[|}]'); -- <start> is offset into <content> when {{cs1 config}} found; nil else
if start then
local cs1_config_template = content:match ('%b{}', start); -- get the whole template
if not cs1_config_template then
return nil;
end
local params_t = mw.text.split (cs1_config_template:gsub ('^{{%s*', ''):gsub ('%s*}}$', ''), '%s*|%s*'); -- remove '{{' and '}}'; make a sequence of parameter/value pairs (split on the pipe)
table.remove (params_t, 1); -- remove the template name because it isn't a parameter/value pair
local config_meta_params_t = {'DisplayAuthors', 'DisplayContributors', 'DisplayEditors', 'DisplayInterviewers', 'DisplayTranslators', 'NameListStyle', 'Mode'};
local meta_param_map_t = {}; -- list of accepted parameter names usable in {{cs1 config}} goes here
for _, meta_param in ipairs (config_meta_params_t) do -- for i18n using <config_meta_params_t>, map template parameter names to their metaparameter equivalents
if 'table' == type (aliases[meta_param]) then -- if <meta_param> is a sequence,
for _, param in ipairs (aliases[meta_param]) do -- extract its contents
meta_param_map_t[param] = meta_param; -- and add to <meta_param_map_t>
end
else
meta_param_map_t[aliases[meta_param]] = meta_param; -- not a sequence so just add the parameter to <meta_param_map_t>
end
end
local keywords_t = {}; -- map valid keywords to their associate metaparameter; reverse form of <keyword_lists[key] for these metaparameters
for _, metaparam_t in ipairs ({{'NameListStyle', 'name-list-style'}, {'Mode', 'mode'}}) do -- only these metaparameter / keywords_lists key pairs
for _, keyword in ipairs (keywords_lists[metaparam_t[2]]) do -- spin through the list of keywords
keywords_t[keyword] = metaparam_t[1]; -- add [keyword] = metaparameter to the map
end
end
for _, param in ipairs (params_t) do -- spin through the {{cs1 config}} parameters and fill <global_cs1_config_t>
local k, v = param:match ('([^=]-)%s*=%s*(.+)'); -- <k> is the parameter name; <v> is parameter's assigned value
if k then
if k:find ('^display') then -- if <k> is one of the |display-<namelist>= parameters
if v:match ('%d+') then -- the assigned value must be digits; doesn't accept 'etal'
global_cs1_config_t[meta_param_map_t[k]]=v; -- add the display param and its value to globals table
end
else
if keywords_t[v] == meta_param_map_t[k] then -- keywords_t[v] returns nil or the metaparam name; these must be the same
global_cs1_config_t[meta_param_map_t[k]]=v; -- add the parameter and its value to globals table
end
end
end
end
end
end
get_cs1_config (); -- fill <global_cs1_config_t>
--[[---------------------< S T R I P M A R K E R S >----------------------------
Common pattern definition location for stripmarkers so that we don't have to go
hunting for them if (when) MediaWiki changes their form.
]]
local stripmarkers = {
['any'] = '\127[^\127]*UNIQ%-%-(%a+)%-[%a%d]+%-QINU[^\127]*\127', -- capture returns name of stripmarker
['math'] = '\127[^\127]*UNIQ%-%-math%-[%a%d]+%-QINU[^\127]*\127' -- math stripmarkers used in coins_cleanup() and coins_replace_math_stripmarker()
}
--[[------------< I N V I S I B L E _ C H A R A C T E R S >---------------------
This table holds non-printing or invisible characters indexed either by name or
by Unicode group. Values are decimal representations of UTF-8 codes. The table
is organized as a table of tables because the Lua pairs keyword returns table
data in an arbitrary order. Here, we want to process the table from top to bottom
because the entries at the top of the table are also found in the ranges specified
by the entries at the bottom of the table.
Also here is a pattern that recognizes stripmarkers that begin and end with the
delete characters. The nowiki stripmarker is not an error but some others are
because the parameter values that include them become part of the template's
metadata before stripmarker replacement.
]]
local invisible_defs = {
del = '\127', -- used to distinguish between stripmarker and del char
zwj = '\226\128\141', -- used with capture because zwj may be allowed
}
local invisible_chars = {
{'replacement', '\239\191\189'}, -- U+FFFD, EF BF BD
{'zero width joiner', '('.. invisible_defs.zwj .. ')'}, -- U+200D, E2 80 8D; capture because zwj may be allowed
{'zero width space', '\226\128\139'}, -- U+200B, E2 80 8B
{'hair space', '\226\128\138'}, -- U+200A, E2 80 8A
{'soft hyphen', '\194\173'}, -- U+00AD, C2 AD
{'horizontal tab', '\009'}, -- U+0009 (HT), 09
{'line feed', '\010'}, -- U+000A (LF), 0A
{'no-break space', '\194\160'}, -- U+00A0 (NBSP), C2 A0
{'carriage return', '\013'}, -- U+000D (CR), 0D
{'stripmarker', stripmarkers.any}, -- stripmarker; may or may not be an error; capture returns the stripmaker type
{'delete', '('.. invisible_defs.del .. ')'}, -- U+007F (DEL), 7F; must be done after stripmarker test; capture to distinguish isolated del chars not part of stripmarker
{'C0 control', '[\000-\008\011\012\014-\031]'}, -- U+0000–U+001F (NULL–US), 00–1F (except HT, LF, CR (09, 0A, 0D))
{'C1 control', '[\194\128-\194\159]'}, -- U+0080–U+009F (XXX–APC), C2 80 – C2 9F
-- {'Specials', '[\239\191\185-\239\191\191]'}, -- U+FFF9-U+FFFF, EF BF B9 – EF BF BF
-- {'Private use area', '[\238\128\128-\239\163\191]'}, -- U+E000–U+F8FF, EE 80 80 – EF A3 BF
-- {'Supplementary Private Use Area-A', '[\243\176\128\128-\243\191\191\189]'}, -- U+F0000–U+FFFFD, F3 B0 80 80 – F3 BF BF BD
-- {'Supplementary Private Use Area-B', '[\244\128\128\128-\244\143\191\189]'}, -- U+100000–U+10FFFD, F4 80 80 80 – F4 8F BF BD
}
--[[
Indic script makes use of zero width joiner as a character modifier so zwj
characters must be left in. This pattern covers all of the unicode characters
for these languages:
Devanagari 0900–097F – https://unicode.org/charts/PDF/U0900.pdf
Devanagari extended A8E0–A8FF – https://unicode.org/charts/PDF/UA8E0.pdf
Bengali 0980–09FF – https://unicode.org/charts/PDF/U0980.pdf
Gurmukhi 0A00–0A7F – https://unicode.org/charts/PDF/U0A00.pdf
Gujarati 0A80–0AFF – https://unicode.org/charts/PDF/U0A80.pdf
Oriya 0B00–0B7F – https://unicode.org/charts/PDF/U0B00.pdf
Tamil 0B80–0BFF – https://unicode.org/charts/PDF/U0B80.pdf
Telugu 0C00–0C7F – https://unicode.org/charts/PDF/U0C00.pdf
Kannada 0C80–0CFF – https://unicode.org/charts/PDF/U0C80.pdf
Malayalam 0D00–0D7F – https://unicode.org/charts/PDF/U0D00.pdf
plus the not-necessarily Indic scripts for Sinhala and Burmese:
Sinhala 0D80-0DFF - https://unicode.org/charts/PDF/U0D80.pdf
Myanmar 1000-109F - https://unicode.org/charts/PDF/U1000.pdf
Myanmar extended A AA60-AA7F - https://unicode.org/charts/PDF/UAA60.pdf
Myanmar extended B A9E0-A9FF - https://unicode.org/charts/PDF/UA9E0.pdf
the pattern is used by has_invisible_chars() and coins_cleanup()
]]
local indic_script = '[\224\164\128-\224\181\191\224\163\160-\224\183\191\225\128\128-\225\130\159\234\167\160-\234\167\191\234\169\160-\234\169\191]';
-- list of emoji that use a zwj character (U+200D) to combine with another emoji
-- from: https://unicode.org/Public/emoji/15.0/emoji-zwj-sequences.txt; version: 15.0; 2022-05-06
-- table created by: [[:en:Module:Make emoji zwj table]]
local emoji_t = { -- indexes are decimal forms of the hex values in U+xxxx
[9760] = true, -- U+2620 ☠ skull and crossbones
[9792] = true, -- U+2640 ♀ female sign
[9794] = true, -- U+2642 ♂ male sign
[9877] = true, -- U+2695 ⚕ staff of aesculapius
[9878] = true, -- U+2696 ⚖ scales
[9895] = true, -- U+26A7 ⚧ male with stroke and male and female sign
[9992] = true, -- U+2708 ✈ airplane
[10052] = true, -- U+2744 ❄ snowflake
[10084] = true, -- U+2764 ❤ heavy black heart
[11035] = true, -- U+2B1B ⬛ black large square
[127752] = true, -- U+1F308 🌈 rainbow
[127787] = true, -- U+1F32B 🌫 fog
[127806] = true, -- U+1F33E 🌾 ear of rice
[127859] = true, -- U+1F373 🍳 cooking
[127868] = true, -- U+1F37C 🍼 baby bottle
[127876] = true, -- U+1F384 🎄 christmas tree
[127891] = true, -- U+1F393 🎓 graduation cap
[127908] = true, -- U+1F3A4 🎤 microphone
[127912] = true, -- U+1F3A8 🎨 artist palette
[127979] = true, -- U+1F3EB 🏫 school
[127981] = true, -- U+1F3ED 🏭 factory
[128102] = true, -- U+1F466 👦 boy
[128103] = true, -- U+1F467 👧 girl
[128104] = true, -- U+1F468 👨 man
[128105] = true, -- U+1F469 👩 woman
[128139] = true, -- U+1F48B 💋 kiss mark
[128168] = true, -- U+1F4A8 💨 dash symbol
[128171] = true, -- U+1F4AB 💫 dizzy symbol
[128187] = true, -- U+1F4BB 💻 personal computer
[128188] = true, -- U+1F4BC 💼 brief case
[128293] = true, -- U+1F525 🔥 fire
[128295] = true, -- U+1F527 🔧 wrench
[128300] = true, -- U+1F52C 🔬 microscope
[128488] = true, -- U+1F5E8 🗨 left speech bubble
[128640] = true, -- U+1F680 🚀 rocket
[128658] = true, -- U+1F692 🚒 fire engine
[129309] = true, -- U+1F91D 🤝 handshake
[129455] = true, -- U+1F9AF 🦯 probing cane
[129456] = true, -- U+1F9B0 🦰 emoji component red hair
[129457] = true, -- U+1F9B1 🦱 emoji component curly hair
[129458] = true, -- U+1F9B2 🦲 emoji component bald
[129459] = true, -- U+1F9B3 🦳 emoji component white hair
[129466] = true, -- U+1F9BA 🦺 safety vest
[129468] = true, -- U+1F9BC 🦼 motorized wheelchair
[129469] = true, -- U+1F9BD 🦽 manual wheelchair
[129489] = true, -- U+1F9D1 🧑 adult
[129657] = true, -- U+1FA79 🩹 adhesive bandage
[129778] = true, -- U+1FAF2 🫲 leftwards hand
}
--[[----------------------< L A N G U A G E S U P P O R T >-------------------
These tables and constants support various language-specific functionality.
]]
--local this_wiki_code = mw.getContentLanguage():getCode(); -- get this wiki's language code
local this_wiki_code = lang_obj:getCode(); -- get this wiki's language code
if string.match (mw.site.server, 'wikidata') then
this_wiki_code = mw.getCurrentFrame():callParserFunction('int', {'lang'}); -- on Wikidata so use interface language setting instead
end
local mw_languages_by_tag_t = mw.language.fetchLanguageNames (this_wiki_code, 'all'); -- get a table of language tag/name pairs known to Wikimedia; used for interwiki tests
local mw_languages_by_name_t = {};
for k, v in pairs (mw_languages_by_tag_t) do -- build a 'reversed' table name/tag language pairs know to MediaWiki; used for |language=
v = mw.ustring.lower (v); -- lowercase for tag fetch; get name's proper case from mw_languages_by_tag_t[<tag>]
if mw_languages_by_name_t[v] then -- when name already in the table
if 2 == #k or 3 == #k then -- if tag does not have subtags
mw_languages_by_name_t[v] = k; -- prefer the shortest tag for this name
end
else -- here when name not in the table
mw_languages_by_name_t[v] = k; -- so add name and matching tag
end
end
local inter_wiki_map = {}; -- map of interwiki prefixes that are language-code prefixes
for k, v in pairs (mw.site.interwikiMap ('local')) do -- spin through the base interwiki map (limited to local)
if mw_languages_by_tag_t[v["prefix"]] then -- if the prefix matches a known language tag
inter_wiki_map[v["prefix"]] = true; -- add it to our local map
end
end
--[[--------------------< S C R I P T _ L A N G _ C O D E S >-------------------
This table is used to hold ISO 639-1 two-character and ISO 639-3 three-character
language codes that apply only to |script-title= and |script-chapter=
]]
local script_lang_codes = {
'ab', 'am', 'ar', 'be', 'bg', 'bn', 'bo', 'bs', 'dv', 'dz', 'el', 'fa', 'gu', 'he',
'hi', 'hy', 'ja', 'ka', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'lo', 'mk', 'ml', 'mn',
'mni', 'mr', 'my', 'ne', 'or', 'ota', 'pa', 'ps', 'ru', 'sd', 'si', 'sr', 'syc', 'ta',
'te', 'tg', 'th', 'ti', 'tt', 'ug', 'uk', 'ur', 'uz', 'yi', 'yue', 'zh'
};
--[[---------------< L A N G U A G E R E M A P P I N G >----------------------
These tables hold language information that is different (correct) from MediaWiki's definitions
For each ['<tag>'] = 'language name' in lang_code_remap{} there must be a matching ['language name'] = {'language name', '<tag>'} in lang_name_remap{}
lang_tag_remap{}:
key is always lowercase ISO 639-1, -2, -3 language tag or a valid lowercase IETF language tag
value is properly spelled and capitalized language name associated with <tag>
only one language name per <tag>;
key/value pair must have matching entry in lang_name_remap{}
lang_name_remap{}:
key is always lowercase language name
value is a table the holds correctly spelled and capitalized language name [1] and associated tag [2] (tag must match a tag key in lang_tag_remap{})
may have multiple keys referring to a common preferred name and tag; For example:
['kolsch'] and ['kölsch'] both refer to 'Kölsch' and 'ksh'
]]
local lang_tag_remap = { -- used for |language= and |script-title= / |script-chapter=
['als'] = 'Tosk Albanian', -- MediaWiki returns Alemannisch
['bh'] = 'Bihari', -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org
['bla'] = 'Blackfoot', -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['bn'] = 'Bengali', -- MediaWiki returns Bangla
['ca-valencia'] = 'Valencian', -- IETF variant of Catalan
['fkv'] = 'Kven', -- MediaWiki returns Kvensk
['ilo'] = 'Ilocano', -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['ksh'] = 'Kölsch', -- MediaWiki: Colognian; use IANA/ISO 639 preferred name
['ksh-x-colog'] = 'Colognian', -- override MediaWiki ksh; no IANA/ISO 639 code for Colognian; IETF private code created at Module:Lang/data
['mis-x-ripuar'] = 'Ripuarian', -- override MediaWiki ksh; no IANA/ISO 639 code for Ripuarian; IETF private code created at Module:Lang/data
['nan-tw'] = 'Taiwanese Hokkien', -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese and support en.wiki preferred name
}
local lang_name_remap = { -- used for |language=; names require proper capitalization; tags must be lowercase
['alemannisch'] = {'Swiss German', 'gsw'}, -- not an ISO or IANA language name; MediaWiki uses 'als' as a subdomain name for Alemannic Wikipedia: als.wikipedia.org
['bangla'] = {'Bengali', 'bn'}, -- MediaWiki returns Bangla (the endonym) but we want Bengali (the exonym); here we remap
['bengali'] = {'Bengali', 'bn'}, -- MediaWiki doesn't use exonym so here we provide correct language name and 639-1 code
['bhojpuri'] = {'Bhojpuri', 'bho'}, -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org
['bihari'] = {'Bihari', 'bh'}, -- MediaWiki replaces 'Bihari' with 'Bhojpuri' so 'Bihari' cannot be found
['blackfoot'] = {'Blackfoot', 'bla'}, -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['colognian'] = {'Colognian', 'ksh-x-colog'}, -- MediaWiki preferred name for ksh
['ilocano'] = {'Ilocano', 'ilo'}, -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['kolsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name (use non-diacritical o instead of umlaut ö)
['kölsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name
['kven'] = {'Kven', 'fkv'}, -- Unicode CLDR have decided not to support English language name for these two...
['kvensk'] = {'Kven', 'fkv'}, -- ...they say to refer to IANA registry for English names
['ripuarian'] = {'Ripuarian', 'mis-x-ripuar'}, -- group of dialects; no code in MediaWiki or in IANA/ISO 639
['taiwanese hokkien'] = {'Taiwanese Hokkien', 'nan-tw'}, -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese
['tosk albanian'] = {'Tosk Albanian', 'als'}, -- MediaWiki replaces 'Tosk Albanian' with 'Alemannisch' so 'Tosk Albanian' cannot be found
['valencian'] = {'Valencian', 'ca-valencia'}, -- variant of Catalan; categorizes as Valencian
}
--[[---------------< P R O P E R T I E S _ C A T E G O R I E S >----------------
Properties categories. These are used for investigating qualities of citations.
]]
local prop_cats = {
['foreign-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is foreign-language name, $2 is ISO639-1 code
['foreign-lang-source-2'] = 'CS1 foreign language sources (ISO 639-2)|$1', -- |language= category; a cat for ISO639-2 languages; $1 is the ISO 639-2 code used as a sort key
['jul-greg-uncertainty'] = 'CS1: Julian–Gregorian uncertainty', -- probably temporary cat to identify scope of template with dates 1 October 1582 – 1 January 1926
['local-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is local-language name, $2 is ISO639-1 code; not emitted when local_lang_cat_enable is false
['location-test'] = 'CS1 location test',
['long-vol'] = 'CS1: long volume value', -- probably temporary cat to identify scope of |volume= values longer than 4 characters
['script'] = 'CS1 uses $1-language script ($2)', -- |script-title=xx: has matching category; $1 is language name, $2 is ISO639-1 code
['tracked-param'] = 'CS1 tracked parameter: $1', -- $1 is base (enumerators removed) parameter name
['year-range-abbreviated'] = 'CS1: abbreviated year range', -- probably temporary cat to identify scope of |date=, |year= values using YYYY–YY form
}
--[[-------------------< T I T L E _ T Y P E S >--------------------------------
Here we map a template's CitationClass to TitleType (default values for |type= parameter)
]]
local title_types = {
['AV-media-notes'] = 'Media notes',
['document'] = 'Document',
['interview'] = 'Interview',
['mailinglist'] = 'Mailing list',
['map'] = 'Map',
['podcast'] = 'Podcast',
['pressrelease'] = 'Press release',
['report'] = 'Report',
['speech'] = 'Speech',
['techreport'] = 'Technical report',
['thesis'] = 'Thesis',
}
--[[===================<< E R R O R M E S S A G I N G >>======================
]]
--[[----------< E R R O R M E S S A G E S U P P L I M E N T S >-------------
I18N for those messages that are supplemented with additional specific text that
describes the reason for the error
TODO: merge this with special_case_translations{}?
]]
local err_msg_supl = {
['char'] = 'invalid character', -- |isbn=, |sbn=
['check'] = 'checksum', -- |isbn=, |sbn=
['flag'] = 'flag', -- |archive-url=
['form'] = 'invalid form', -- |isbn=, |sbn=
['group'] = 'invalid group id', -- |isbn=
['initials'] = 'initials', -- Vancouver
['invalid language code'] = 'invalid language code', -- |script-<param>=
['journal'] = 'journal', -- |bibcode=
['length'] = 'length', -- |isbn=, |bibcode=, |sbn=
['liveweb'] = 'liveweb', -- |archive-url=
['missing comma'] = 'missing comma', -- Vancouver
['missing prefix'] = 'missing prefix', -- |script-<param>=
['missing title part'] = 'missing title part', -- |script-<param>=
['name'] = 'name', -- Vancouver
['non-Latin char'] = 'non-Latin character', -- Vancouver
['path'] = 'path', -- |archive-url=
['prefix'] = 'invalid prefix', -- |isbn=
['punctuation'] = 'punctuation', -- Vancouver
['save'] = 'save command', -- |archive-url=
['suffix'] = 'suffix', -- Vancouver
['timestamp'] = 'timestamp', -- |archive-url=
['unknown language code'] = 'unknown language code', -- |script-<param>=
['value'] = 'value', -- |bibcode=
['year'] = 'year', -- |bibcode=
}
--[[--------------< E R R O R _ C O N D I T I O N S >---------------------------
Error condition table. This table has two sections: errors at the top, maintenance
at the bottom. Maint 'messaging' does not have a 'message' (message=nil)
The following contains a list of IDs for various error conditions defined in the
code. For each ID, we specify a text message to display, an error category to
include, and whether the error message should be wrapped as a hidden comment.
Anchor changes require identical changes to matching anchor in Help:CS1 errors
TODO: rename error_conditions{} to something more generic; create separate error
and maint tables inside that?
]]
local error_conditions = {
err_accessdate_missing_url = {
message = '<code class="cs1-code">|access-date=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'accessdate_missing_url',
category = 'CS1 errors: access-date without URL',
hidden = false
},
err_apostrophe_markup = {
message = 'Italic or bold markup not allowed in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'apostrophe_markup',
category = 'CS1 errors: markup',
hidden = false
},
err_archive_date_missing_url = {
message = '<code class="cs1-code">|archive-date=</code> requires <code class="cs1-code">|archive-url=</code>',
anchor = 'archive_date_missing_url',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_date_url_ts_mismatch = {
message = '<code class="cs1-code">|archive-date=</code> / <code class="cs1-code">|archive-url=</code> timestamp mismatch',
anchor = 'archive_date_url_ts_mismatch',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_missing_date = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|archive-date=</code>',
anchor = 'archive_missing_date',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_missing_url = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'archive_missing_url',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_url = {
message = '<code class="cs1-code">|archive-url=</code> is malformed: $1', -- $1 is error message detail
anchor = 'archive_url',
category = 'CS1 errors: archive-url',
hidden = false
},
err_arxiv_missing = {
message = '<code class="cs1-code">|arxiv=</code> required',
anchor = 'arxiv_missing',
category = 'CS1 errors: arXiv', -- same as bad arxiv
hidden = false
},
err_asintld_missing_asin = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|asin=</code>', -- $1 is parameter name
anchor = 'asintld_missing_asin',
category = 'CS1 errors: ASIN TLD',
hidden = false
},
err_bad_arxiv = {
message = 'Check <code class="cs1-code">|arxiv=</code> value',
anchor = 'bad_arxiv',
category = 'CS1 errors: arXiv',
hidden = false
},
err_bad_asin = {
message = 'Check <code class="cs1-code">|asin=</code> value',
anchor = 'bad_asin',
category ='CS1 errors: ASIN',
hidden = false
},
err_bad_asin_tld = {
message = 'Check <code class="cs1-code">|asin-tld=</code> value',
anchor = 'bad_asin_tld',
category ='CS1 errors: ASIN TLD',
hidden = false
},
err_bad_bibcode = {
message = 'Check <code class="cs1-code">|bibcode=</code> $1', -- $1 is error message detail
anchor = 'bad_bibcode',
category = 'CS1 errors: bibcode',
hidden = false
},
err_bad_biorxiv = {
message = 'Check <code class="cs1-code">|biorxiv=</code> value',
anchor = 'bad_biorxiv',
category = 'CS1 errors: bioRxiv',
hidden = false
},
err_bad_citeseerx = {
message = 'Check <code class="cs1-code">|citeseerx=</code> value',
anchor = 'bad_citeseerx',
category = 'CS1 errors: citeseerx',
hidden = false
},
err_bad_date = {
message = 'Check date values in: $1', -- $1 is a parameter name list
anchor = 'bad_date',
category = 'CS1 errors: dates',
hidden = false
},
err_bad_doi = {
message = 'Check <code class="cs1-code">|doi=</code> value',
anchor = 'bad_doi',
category = 'CS1 errors: DOI',
hidden = false
},
err_bad_hdl = {
message = 'Check <code class="cs1-code">|hdl=</code> value',
anchor = 'bad_hdl',
category = 'CS1 errors: HDL',
hidden = false
},
err_bad_isbn = {
message = 'Check <code class="cs1-code">|isbn=</code> value: $1', -- $1 is error message detail
anchor = 'bad_isbn',
category = 'CS1 errors: ISBN',
hidden = false
},
err_bad_ismn = {
message = 'Check <code class="cs1-code">|ismn=</code> value',
anchor = 'bad_ismn',
category = 'CS1 errors: ISMN',
hidden = false
},
err_bad_issn = {
message = 'Check <code class="cs1-code">|$1issn=</code> value', -- $1 is 'e' or '' for eissn or issn
anchor = 'bad_issn',
category = 'CS1 errors: ISSN',
hidden = false
},
err_bad_jfm = {
message = 'Check <code class="cs1-code">|jfm=</code> value',
anchor = 'bad_jfm',
category = 'CS1 errors: JFM',
hidden = false
},
err_bad_jstor = {
message = 'Check <code class="cs1-code">|jstor=</code> value',
anchor = 'bad_jstor',
category = 'CS1 errors: JSTOR',
hidden = false
},
err_bad_lccn = {
message = 'Check <code class="cs1-code">|lccn=</code> value',
anchor = 'bad_lccn',
category = 'CS1 errors: LCCN',
hidden = false
},
err_bad_medrxiv = {
message = 'Check <code class="cs1-code">|medrxiv=</code> value',
anchor = 'bad_medrxiv',
category = 'CS1 errors: medRxiv',
hidden = false
},
err_bad_mr = {
message = 'Check <code class="cs1-code">|mr=</code> value',
anchor = 'bad_mr',
category = 'CS1 errors: MR',
hidden = false
},
err_bad_oclc = {
message = 'Check <code class="cs1-code">|oclc=</code> value',
anchor = 'bad_oclc',
category = 'CS1 errors: OCLC',
hidden = false
},
err_bad_ol = {
message = 'Check <code class="cs1-code">|ol=</code> value',
anchor = 'bad_ol',
category = 'CS1 errors: OL',
hidden = false
},
err_bad_osti = {
message = 'Check <code class="cs1-code">|osti=</code> value',
anchor = 'bad_osti',
category = 'CS1 errors: OSTI',
hidden = false
},
err_bad_paramlink = { -- for |title-link=, |author/editor/translator-link=, |series-link=, |episode-link=
message = 'Check <code class="cs1-code">|$1=</code> value', -- $1 is parameter name
anchor = 'bad_paramlink',
category = 'CS1 errors: parameter link',
hidden = false
},
err_bad_pmc = {
message = 'Check <code class="cs1-code">|pmc=</code> value',
anchor = 'bad_pmc',
category = 'CS1 errors: PMC',
hidden = false
},
err_bad_pmid = {
message = 'Check <code class="cs1-code">|pmid=</code> value',
anchor = 'bad_pmid',
category = 'CS1 errors: PMID',
hidden = false
},
err_bad_rfc = {
message = 'Check <code class="cs1-code">|rfc=</code> value',
anchor = 'bad_rfc',
category = 'CS1 errors: RFC',
hidden = false
},
err_bad_s2cid = {
message = 'Check <code class="cs1-code">|s2cid=</code> value',
anchor = 'bad_s2cid',
category = 'CS1 errors: S2CID',
hidden = false
},
err_bad_sbn = {
message = 'Check <code class="cs1-code">|sbn=</code> value: $1', -- $1 is error message detail
anchor = 'bad_sbn',
category = 'CS1 errors: SBN',
hidden = false
},
err_bad_ssrn = {
message = 'Check <code class="cs1-code">|ssrn=</code> value',
anchor = 'bad_ssrn',
category = 'CS1 errors: SSRN',
hidden = false
},
err_bad_url = {
message = 'Check $1 value', -- $1 is parameter name
anchor = 'bad_url',
category = 'CS1 errors: URL',
hidden = false
},
err_bad_usenet_id = {
message = 'Check <code class="cs1-code">|message-id=</code> value',
anchor = 'bad_message_id',
category = 'CS1 errors: message-id',
hidden = false
},
err_bad_zbl = {
message = 'Check <code class="cs1-code">|zbl=</code> value',
anchor = 'bad_zbl',
category = 'CS1 errors: Zbl',
hidden = false
},
err_bare_url_missing_title = {
message = '$1 missing title', -- $1 is parameter name
anchor = 'bare_url_missing_title',
category = 'CS1 errors: bare URL',
hidden = false
},
err_biorxiv_missing = {
message = '<code class="cs1-code">|biorxiv=</code> required',
anchor = 'biorxiv_missing',
category = 'CS1 errors: bioRxiv', -- same as bad bioRxiv
hidden = false
},
err_chapter_ignored = {
message = '<code class="cs1-code">|$1=</code> ignored', -- $1 is parameter name
anchor = 'chapter_ignored',
category = 'CS1 errors: chapter ignored',
hidden = false
},
err_citation_missing_title = {
message = 'Missing or empty <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'citation_missing_title',
category = 'CS1 errors: missing title',
hidden = false
},
err_citeseerx_missing = {
message = '<code class="cs1-code">|citeseerx=</code> required',
anchor = 'citeseerx_missing',
category = 'CS1 errors: citeseerx', -- same as bad citeseerx
hidden = false
},
err_cite_web_url = { -- this error applies to cite web and to cite podcast
message = 'Missing or empty <code class="cs1-code">|url=</code>',
anchor = 'cite_web_url',
category = 'CS1 errors: requires URL',
hidden = false
},
err_class_ignored = {
message = '<code class="cs1-code">|class=</code> ignored',
anchor = 'class_ignored',
category = 'CS1 errors: class',
hidden = false
},
err_contributor_ignored = {
message = '<code class="cs1-code">|contributor=</code> ignored',
anchor = 'contributor_ignored',
category = 'CS1 errors: contributor',
hidden = false
},
err_contributor_missing_required_param = {
message = '<code class="cs1-code">|contributor=</code> requires <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'contributor_missing_required_param',
category = 'CS1 errors: contributor',
hidden = false
},
err_deprecated_params = {
message = 'Cite uses deprecated parameter <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'deprecated_params',
category = 'CS1 errors: deprecated parameters',
hidden = false
},
err_disp_name = {
message = 'Invalid <code class="cs1-code">|$1=$2</code>', -- $1 is parameter name; $2 is the assigned value
anchor = 'disp_name',
category = 'CS1 errors: display-names',
hidden = false,
},
err_doibroken_missing_doi = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|doi=</code>', -- $1 is parameter name
anchor = 'doibroken_missing_doi',
category = 'CS1 errors: DOI',
hidden = false
},
err_embargo_missing_pmc = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|pmc=</code>', -- $1 is parameter name
anchor = 'embargo_missing_pmc',
category = 'CS1 errors: PMC embargo',
hidden = false
},
err_empty_citation = {
message = 'Empty citation',
anchor = 'empty_citation',
category = 'CS1 errors: empty citation',
hidden = false
},
err_etal = {
message = 'Explicit use of et al. in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'explicit_et_al',
category = 'CS1 errors: explicit use of et al.',
hidden = false
},
err_extra_text_edition = {
message = '<code class="cs1-code">|edition=</code> has extra text',
anchor = 'extra_text_edition',
category = 'CS1 errors: extra text: edition',
hidden = false,
},
err_extra_text_issue = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_issue',
category = 'CS1 errors: extra text: issue',
hidden = false,
},
err_extra_text_pages = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_pages',
category = 'CS1 errors: extra text: pages',
hidden = false,
},
err_extra_text_volume = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_volume',
category = 'CS1 errors: extra text: volume',
hidden = true,
},
err_first_missing_last = {
message = '<code class="cs1-code">|$1=</code> missing <code class="cs1-code">|$2=</code>', -- $1 is first alias, $2 is matching last alias
anchor = 'first_missing_last',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
err_format_missing_url = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|$2=</code>', -- $1 is format parameter $2 is url parameter
anchor = 'format_missing_url',
category = 'CS1 errors: format without URL',
hidden = false
},
err_generic_name = {
message = '<code class="cs1-code">|$1=</code> has generic name', -- $1 is parameter name
anchor = 'generic_name',
category = 'CS1 errors: generic name',
hidden = false,
},
err_generic_title = {
message = 'Cite uses generic title',
anchor = 'generic_title',
category = 'CS1 errors: generic title',
hidden = false,
},
err_invalid_param_val = {
message = 'Invalid <code class="cs1-code">|$1=$2</code>', -- $1 is parameter name $2 is parameter value
anchor = 'invalid_param_val',
category = 'CS1 errors: invalid parameter value',
hidden = false
},
err_invisible_char = {
message = '$1 in $2 at position $3', -- $1 is invisible char $2 is parameter name $3 is position number
anchor = 'invisible_char',
category = 'CS1 errors: invisible characters',
hidden = false
},
err_medrxiv_missing = {
message = '<code class="cs1-code">|medrxiv=</code> required',
anchor = 'medrxiv_missing',
category = 'CS1 errors: medRxiv', -- same as bad medRxiv
hidden = false
},
err_missing_name = {
message = 'Missing <code class="cs1-code">|$1$2=</code>', -- $1 is modified NameList; $2 is enumerator
anchor = 'missing_name',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
err_missing_periodical = {
message = 'Cite $1 requires <code class="cs1-code">|$2=</code>', -- $1 is cs1 template name; $2 is canonical periodical parameter name for cite $1
anchor = 'missing_periodical',
category = 'CS1 errors: missing periodical',
hidden = true
},
err_missing_pipe = {
message = 'Missing pipe in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'missing_pipe',
category = 'CS1 errors: missing pipe',
hidden = false
},
err_missing_publisher = {
message = 'Cite $1 requires <code class="cs1-code">|$2=</code>', -- $1 is cs1 template name; $2 is canonical publisher parameter name for cite $1
anchor = 'missing_publisher',
category = 'CS1 errors: missing publisher',
hidden = false
},
err_param_access_requires_param = {
message = '<code class="cs1-code">|$1-access=</code> requires <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'param_access_requires_param',
category = 'CS1 errors: param-access',
hidden = false
},
err_param_has_ext_link = {
message = 'External link in <code class="cs1-code">$1</code>', -- $1 is parameter name
anchor = 'param_has_ext_link',
category = 'CS1 errors: external links',
hidden = false
},
err_parameter_ignored = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored', -- $1 is parameter name
anchor = 'parameter_ignored',
category = 'CS1 errors: unsupported parameter',
hidden = false
},
err_parameter_ignored_suggest = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored (<code class="cs1-code">|$2=</code> suggested)', -- $1 is unknown parameter $2 is suggested parameter name
anchor = 'parameter_ignored_suggest',
category = 'CS1 errors: unsupported parameter',
hidden = false
},
err_periodical_ignored = {
message = '<code class="cs1-code">|$1=</code> ignored', -- $1 is parameter name
anchor = 'periodical_ignored',
category = 'CS1 errors: periodical ignored',
hidden = false
},
err_redundant_parameters = {
message = 'More than one of $1 specified', -- $1 is error message detail
anchor = 'redundant_parameters',
category = 'CS1 errors: redundant parameter',
hidden = false
},
err_script_parameter = {
message = 'Invalid <code class="cs1-code">|$1=</code>: $2', -- $1 is parameter name $2 is script language code or error detail
anchor = 'script_parameter',
category = 'CS1 errors: script parameters',
hidden = false
},
err_ssrn_missing = {
message = '<code class="cs1-code">|ssrn=</code> required',
anchor = 'ssrn_missing',
category = 'CS1 errors: SSRN',
hidden = false
},
err_text_ignored = {
message = 'Text "$1" ignored', -- $1 is ignored text
anchor = 'text_ignored',
category = 'CS1 errors: unrecognized parameter',
hidden = false
},
err_trans_missing_title = {
message = '<code class="cs1-code">|trans-$1=</code> requires <code class="cs1-code">|$1=</code> or <code class="cs1-code">|script-$1=</code>', -- $1 is base parameter name
anchor = 'trans_missing_title',
category = 'CS1 errors: translated title',
hidden = false
},
err_param_unknown_empty = {
message = 'Cite has empty unknown parameter$1: $2', -- $1 is 's' or empty space; $2 is emty unknown param list
anchor = 'param_unknown_empty',
category = 'CS1 errors: empty unknown parameters',
hidden = false
},
err_vancouver = {
message = 'Vancouver style error: $1 in name $2', -- $1 is error detail, $2 is the nth name
anchor = 'vancouver',
category = 'CS1 errors: Vancouver style',
hidden = false
},
err_wikilink_in_url = {
message = 'URL–wikilink conflict', -- uses ndash
anchor = 'wikilink_in_url',
category = 'CS1 errors: URL–wikilink conflict', -- uses ndash
hidden = false
},
--[[--------------------------< M A I N T >-------------------------------------
maint messages do not have a message (message = nil); otherwise the structure
is the same as error messages
]]
maint_archived_copy = {
message = nil,
anchor = 'archived_copy',
category = 'CS1 maint: archived copy as title',
hidden = true,
},
maint_authors = {
message = nil,
anchor = 'authors',
category = 'CS1 maint: uses authors parameter',
hidden = true,
},
maint_bibcode = {
message = nil,
anchor = 'bibcode',
category = 'CS1 maint: bibcode',
hidden = true,
},
maint_location_no_publisher = { -- cite book, conference, encyclopedia; citation as book cite or encyclopedia cite
message = nil,
anchor = 'location_no_publisher',
category = 'CS1 maint: location missing publisher',
hidden = true,
},
maint_bot_unknown = {
message = nil,
anchor = 'bot:_unknown',
category = 'CS1 maint: bot: original URL status unknown',
hidden = true,
},
maint_date_auto_xlated = { -- date auto-translation not supported by en.wiki
message = nil,
anchor = 'date_auto_xlated',
category = 'CS1 maint: date auto-translated',
hidden = true,
},
maint_date_format = {
message = nil,
anchor = 'date_format',
category = 'CS1 maint: date format',
hidden = true,
},
maint_date_year = {
message = nil,
anchor = 'date_year',
category = 'CS1 maint: date and year',
hidden = true,
},
maint_doi_ignore = {
message = nil,
anchor = 'doi_ignore',
category = 'CS1 maint: ignored DOI errors',
hidden = true,
},
maint_doi_inactive = {
message = nil,
anchor = 'doi_inactive',
category = 'CS1 maint: DOI inactive',
hidden = true,
},
maint_doi_inactive_dated = {
message = nil,
anchor = 'doi_inactive_dated',
category = 'CS1 maint: DOI inactive as of $2$3$1', -- $1 is year, $2 is month-name or empty string, $3 is space or empty string
hidden = true,
},
maint_extra_punct = {
message = nil,
anchor = 'extra_punct',
category = 'CS1 maint: extra punctuation',
hidden = true,
},
maint_isbn_ignore = {
message = nil,
anchor = 'ignore_isbn_err',
category = 'CS1 maint: ignored ISBN errors',
hidden = true,
},
maint_issn_ignore = {
message = nil,
anchor = 'ignore_issn',
category = 'CS1 maint: ignored ISSN errors',
hidden = true,
},
maint_jfm_format = {
message = nil,
anchor = 'jfm_format',
category = 'CS1 maint: JFM format',
hidden = true,
},
maint_location = {
message = nil,
anchor = 'location',
category = 'CS1 maint: location',
hidden = true,
},
maint_mr_format = {
message = nil,
anchor = 'mr_format',
category = 'CS1 maint: MR format',
hidden = true,
},
maint_mult_names = {
message = nil,
anchor = 'mult_names',
category = 'CS1 maint: multiple names: $1', -- $1 is '<name>s list'; gets value from special_case_translation table
hidden = true,
},
maint_numeric_names = {
message = nil,
anchor = 'numeric_names',
category = 'CS1 maint: numeric names: $1', -- $1 is '<name>s list'; gets value from special_case_translation table
hidden = true,
},
maint_others = {
message = nil,
anchor = 'others',
category = 'CS1 maint: others',
hidden = true,
},
maint_others_avm = {
message = nil,
anchor = 'others_avm',
category = 'CS1 maint: others in cite AV media (notes)',
hidden = true,
},
maint_overridden_setting = {
message = nil,
anchor = 'overridden',
category = 'CS1 maint: overridden setting',
hidden = true,
},
maint_pmc_embargo = {
message = nil,
anchor = 'embargo',
category = 'CS1 maint: PMC embargo expired',
hidden = true,
},
maint_pmc_format = {
message = nil,
anchor = 'pmc_format',
category = 'CS1 maint: PMC format',
hidden = true,
},
maint_postscript = {
message = nil,
anchor = 'postscript',
category = 'CS1 maint: postscript',
hidden = true,
},
maint_ref_duplicates_default = {
message = nil,
anchor = 'ref_default',
category = 'CS1 maint: ref duplicates default',
hidden = true,
},
maint_unfit = {
message = nil,
anchor = 'unfit',
category = 'CS1 maint: unfit URL',
hidden = true,
},
maint_unknown_lang = {
message = nil,
anchor = 'unknown_lang',
category = 'CS1 maint: unrecognized language',
hidden = true,
},
maint_untitled = {
message = nil,
anchor = 'untitled',
category = 'CS1 maint: untitled periodical',
hidden = true,
},
maint_url_status = {
message = nil,
anchor = 'url_status',
category = 'CS1 maint: url-status',
hidden = true,
},
maint_zbl = {
message = nil,
anchor = 'zbl',
category = 'CS1 maint: Zbl',
hidden = true,
},
}
--[[--------------------------< I D _ H A N D L E R S >--------------------------------------------------------
The following contains a list of values for various defined identifiers. For each
identifier we specify a variety of information necessary to properly render the
identifier in the citation.
parameters: a list of parameter aliases for this identifier; first in the list is the canonical form
link: Wikipedia article name
redirect: a local redirect to a local Wikipedia article name; at en.wiki, 'ISBN (identifier)' is a redirect to 'International Standard Book Number'
q: Wikidata q number for the identifier
label: the label preceding the identifier; label is linked to a Wikipedia article (in this order):
redirect from id_handlers['<id>'].redirect when use_identifier_redirects is true
Wikidata-supplied article name for the local wiki from id_handlers['<id>'].q
local article name from id_handlers['<id>'].link
prefix: the first part of a URL that will be concatenated with a second part which usually contains the identifier
suffix: optional third part to be added after the identifier
encode: true if URI should be percent-encoded; otherwise false
COinS: identifier link or keyword for use in COinS:
for identifiers registered at info-uri.info use: info:.... where '...' is the appropriate identifier label
for identifiers that have COinS keywords, use the keyword: rft.isbn, rft.issn, rft.eissn
for |asin= and |ol=, which require assembly, use the keyword: url
for others make a URL using the value in prefix/suffix and #label, use the keyword: pre (not checked; any text other than 'info', 'rft', or 'url' works here)
set to nil to leave the identifier out of the COinS
separator: character or text between label and the identifier in the rendered citation
id_limit: for those identifiers with established limits, this property holds the upper limit
access: use this parameter to set the access level for all instances of this identifier.
the value must be a valid access level for an identifier (see ['id-access'] in this file).
custom_access: to enable custom access level for an identifier, set this parameter
to the parameter that should control it (normally 'id-access')
]]
local id_handlers = {
['ARXIV'] = {
parameters = {'arxiv', 'eprint'},
link = 'arXiv',
redirect = 'arXiv (identifier)',
q = 'Q118398',
label = 'arXiv',
prefix = 'https://arxiv.org/abs/',
encode = false,
COinS = 'info:arxiv',
separator = ':',
access = 'free', -- free to read
},
['ASIN'] = {
parameters = { 'asin', 'ASIN' },
link = 'Amazon Standard Identification Number',
redirect = 'ASIN (identifier)',
q = 'Q1753278',
label = 'ASIN',
prefix = 'https://www.amazon.',
COinS = 'url',
separator = ' ',
encode = false;
},
['BIBCODE'] = {
parameters = {'bibcode'},
link = 'Bibcode',
redirect = 'Bibcode (identifier)',
q = 'Q25754',
label = 'Bibcode',
prefix = 'https://ui.adsabs.harvard.edu/abs/',
encode = false,
COinS = 'info:bibcode',
separator = ':',
custom_access = 'bibcode-access',
},
['BIORXIV'] = {
parameters = {'biorxiv'},
link = 'bioRxiv',
redirect = 'bioRxiv (identifier)',
q = 'Q19835482',
label = 'bioRxiv',
prefix = 'https://doi.org/',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['CITESEERX'] = {
parameters = {'citeseerx'},
link = 'CiteSeerX',
redirect = 'CiteSeerX (identifier)',
q = 'Q2715061',
label = 'CiteSeerX',
prefix = 'https://citeseerx.ist.psu.edu/viewdoc/summary?doi=',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['DOI'] = { -- Used by InternetArchiveBot
parameters = { 'doi', 'DOI'},
link = 'Digital object identifier',
redirect = 'doi (identifier)',
q = 'Q25670',
label = 'doi',
prefix = 'https://doi.org/',
COinS = 'info:doi',
separator = ':',
encode = true,
custom_access = 'doi-access',
},
['EISSN'] = {
parameters = {'eissn', 'EISSN'},
link = 'International Standard Serial Number#Electronic ISSN',
redirect = 'eISSN (identifier)',
q = 'Q46339674',
label = 'eISSN',
prefix = 'https://www.worldcat.org/issn/',
COinS = 'rft.eissn',
encode = false,
separator = ' ',
},
['HDL'] = {
parameters = { 'hdl', 'HDL' },
link = 'Handle System',
redirect = 'hdl (identifier)',
q = 'Q3126718',
label = 'hdl',
prefix = 'https://hdl.handle.net/',
COinS = 'info:hdl',
separator = ':',
encode = true,
custom_access = 'hdl-access',
},
['ISBN'] = { -- Used by InternetArchiveBot
parameters = {'isbn', 'ISBN'},
link = 'International Standard Book Number',
redirect = 'ISBN (identifier)',
q = 'Q33057',
label = 'ISBN',
prefix = 'Special:BookSources/',
COinS = 'rft.isbn',
separator = ' ',
},
['ISMN'] = {
parameters = {'ismn', 'ISMN'},
link = 'International Standard Music Number',
redirect = 'ISMN (identifier)',
q = 'Q1666938',
label = 'ISMN',
prefix = '', -- not currently used;
COinS = nil, -- nil because we can't use pre or rft or info:
separator = ' ',
},
['ISSN'] = {
parameters = {'issn', 'ISSN'},
link = 'International Standard Serial Number',
redirect = 'ISSN (identifier)',
q = 'Q131276',
label = 'ISSN',
prefix = 'https://www.worldcat.org/issn/',
COinS = 'rft.issn',
encode = false,
separator = ' ',
},
['JFM'] = {
parameters = {'jfm', 'JFM'},
link = 'Jahrbuch über die Fortschritte der Mathematik',
redirect = 'JFM (identifier)',
q = '',
label = 'JFM',
prefix = 'https://zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['JSTOR'] = {
parameters = {'jstor', 'JSTOR'},
link = 'JSTOR',
redirect = 'JSTOR (identifier)',
q = 'Q1420342',
label = 'JSTOR',
prefix = 'https://www.jstor.org/stable/',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
custom_access = 'jstor-access',
},
['LCCN'] = {
parameters = {'lccn', 'LCCN'},
link = 'Library of Congress Control Number',
redirect = 'LCCN (identifier)',
q = 'Q620946',
label = 'LCCN',
prefix = 'https://lccn.loc.gov/',
COinS = 'info:lccn',
encode = false,
separator = ' ',
},
['MEDRXIV'] = {
parameters = {'medrxiv'},
link = 'medRxiv',
redirect = 'medRxiv (identifier)',
q = 'Q58465838',
label = 'medRxiv',
prefix = 'https://www.medrxiv.org/content/',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = false,
separator = ' ',
},
['MR'] = {
parameters = {'mr', 'MR'},
link = 'Mathematical Reviews',
redirect = 'MR (identifier)',
q = 'Q211172',
label = 'MR',
prefix = 'https://mathscinet.ams.org/mathscinet-getitem?mr=',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['OCLC'] = {
parameters = {'oclc', 'OCLC'},
link = 'OCLC',
redirect = 'OCLC (identifier)',
q = 'Q190593',
label = 'OCLC',
prefix = 'https://www.worldcat.org/oclc/',
COinS = 'info:oclcnum',
encode = true,
separator = ' ',
id_limit = 10030000000,
},
['OL'] = {
parameters = { 'ol', 'OL' },
link = 'Open Library',
redirect = 'OL (identifier)',
q = 'Q1201876',
label = 'OL',
prefix = 'https://openlibrary.org/',
COinS = 'url',
separator = ' ',
encode = true,
custom_access = 'ol-access',
},
['OSTI'] = {
parameters = {'osti', 'OSTI'},
link = 'Office of Scientific and Technical Information',
redirect = 'OSTI (identifier)',
q = 'Q2015776',
label = 'OSTI',
prefix = 'https://www.osti.gov/biblio/',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 23010000,
custom_access = 'osti-access',
},
['PMC'] = {
parameters = {'pmc', 'PMC'},
link = 'PubMed Central',
redirect = 'PMC (identifier)',
q = 'Q229883',
label = 'PMC',
prefix = 'https://www.ncbi.nlm.nih.gov/pmc/articles/PMC',
suffix = '',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 10700000,
access = 'free', -- free to read
},
['PMID'] = {
parameters = {'pmid', 'PMID'},
link = 'PubMed Identifier',
redirect = 'PMID (identifier)',
q = 'Q2082879',
label = 'PMID',
prefix = 'https://pubmed.ncbi.nlm.nih.gov/',
COinS = 'info:pmid',
encode = false,
separator = ' ',
id_limit = 37900000,
},
['RFC'] = {
parameters = {'rfc', 'RFC'},
link = 'Request for Comments',
redirect = 'RFC (identifier)',
q = 'Q212971',
label = 'RFC',
prefix = 'https://tools.ietf.org/html/rfc',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
id_limit = 9300,
access = 'free', -- free to read
},
['SBN'] = {
parameters = {'sbn', 'SBN'},
link = 'Standard Book Number', -- redirect to International_Standard_Book_Number#History
redirect = 'SBN (identifier)',
label = 'SBN',
prefix = 'Special:BookSources/0-', -- prefix has leading zero necessary to make 9-digit sbn a 10-digit isbn
COinS = nil, -- nil because we can't use pre or rft or info:
separator = ' ',
},
['SSRN'] = {
parameters = {'ssrn', 'SSRN'},
link = 'Social Science Research Network',
redirect = 'SSRN (identifier)',
q = 'Q7550801',
label = 'SSRN',
prefix = 'https://papers.ssrn.com/sol3/papers.cfm?abstract_id=',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 4600000,
custom_access = 'ssrn-access',
},
['S2CID'] = {
parameters = {'s2cid', 'S2CID'},
link = 'Semantic Scholar',
redirect = 'S2CID (identifier)',
q = 'Q22908627',
label = 'S2CID',
prefix = 'https://api.semanticscholar.org/CorpusID:',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
id_limit = 264000000,
custom_access = 's2cid-access',
},
['USENETID'] = {
parameters = {'message-id'},
link = 'Usenet',
redirect = 'Usenet (identifier)',
q = 'Q193162',
label = 'Usenet:',
prefix = 'news:',
encode = false,
COinS = 'pre', -- use prefix value
separator = ' ',
},
['ZBL'] = {
parameters = {'zbl', 'ZBL' },
link = 'Zentralblatt MATH',
redirect = 'Zbl (identifier)',
q = 'Q190269',
label = 'Zbl',
prefix = 'https://zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
}
--[[--------------------------< E X P O R T S >---------------------------------
]]
return {
use_identifier_redirects = use_identifier_redirects, -- booleans defined in the settings at the top of this module
local_lang_cat_enable = local_lang_cat_enable,
date_name_auto_xlate_enable = date_name_auto_xlate_enable,
date_digit_auto_xlate_enable = date_digit_auto_xlate_enable,
-- tables and variables created when this module is loaded
global_df = get_date_format (), -- this line can be replaced with "global_df = 'dmy-all'," to have all dates auto translated to dmy format.
global_cs1_config_t = global_cs1_config_t, -- global settings from {{cs1 config}}
punct_skip = build_skip_table (punct_skip, punct_meta_params),
url_skip = build_skip_table (url_skip, url_meta_params),
aliases = aliases,
special_case_translation = special_case_translation,
date_names = date_names,
err_msg_supl = err_msg_supl,
error_conditions = error_conditions,
editor_markup_patterns = editor_markup_patterns,
et_al_patterns = et_al_patterns,
id_handlers = id_handlers,
keywords_lists = keywords_lists,
keywords_xlate = keywords_xlate,
stripmarkers = stripmarkers,
invisible_chars = invisible_chars,
invisible_defs = invisible_defs,
indic_script = indic_script,
emoji_t = emoji_t,
maint_cats = maint_cats,
messages = messages,
presentation = presentation,
prop_cats = prop_cats,
script_lang_codes = script_lang_codes,
lang_tag_remap = lang_tag_remap,
lang_name_remap = lang_name_remap,
this_wiki_code = this_wiki_code,
title_types = title_types,
uncategorized_namespaces = uncategorized_namespaces_t,
uncategorized_subpages = uncategorized_subpages,
templates_using_volume = templates_using_volume,
templates_using_issue = templates_using_issue,
templates_not_using_page = templates_not_using_page,
vol_iss_pg_patterns = vol_iss_pg_patterns,
single_letter_2nd_lvl_domains_t = single_letter_2nd_lvl_domains_t,
inter_wiki_map = inter_wiki_map,
mw_languages_by_tag_t = mw_languages_by_tag_t,
mw_languages_by_name_t = mw_languages_by_name_t,
citation_class_map_t = citation_class_map_t,
citation_issue_t = citation_issue_t,
citation_no_volume_t = citation_no_volume_t,
}
f53fd0e92d88e50b26351a0835c634107a57fa76
Module:Citation/CS1/Whitelist
828
160
421
420
2023-10-17T20:36:14Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/Whitelist]]
Scribunto
text/plain
--[[--------------------------< S U P P O R T E D P A R A M E T E R S >--------------------------------------
Because a steady-state signal conveys no useful information, whitelist.basic_arguments[] list items can have three values:
true - these parameters are valid and supported parameters
false - these parameters are deprecated but still supported
tracked - these parameters are valid and supported parameters tracked in an eponymous properties category
nil - these parameters are no longer supported. remove entirely
]]
local basic_arguments_t = {
['accessdate'] = true,
['access-date'] = true,
['agency'] = true,
['archivedate'] = true,
['archive-date'] = true,
['archive-format'] = true,
['archiveurl'] = true,
['archive-url'] = true,
['article'] = true,
['article-format'] = true,
['article-number'] = true, -- {{cite journal}}, {{cite conference}}; {{citation}} when |journal= has a value
['article-url'] = true,
['article-url-access'] = true,
['arxiv'] = true, -- cite arxiv; here because allowed in cite ... as identifier
['asin'] = true,
['ASIN'] = true,
['asin-tld'] = true,
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-given'] = true,
['author-last'] = true,
['author-surname'] = true,
['authorlink'] = true,
['author-link'] = true,
['author-mask'] = true,
['authors'] = true,
['bibcode'] = true,
['bibcode-access'] = true,
['biorxiv'] = true, -- cite biorxiv; here because allowed in cite ... as identifier
['chapter'] = true,
['chapter-format'] = true,
['chapter-url'] = true,
['chapter-url-access'] = true,
['citeseerx'] = true, -- cite citeseerx; here because allowed in cite ... as identifier
['collaboration'] = true,
['contribution'] = true,
['contribution-format'] = true,
['contribution-url'] = true,
['contribution-url-access'] = true,
['contributor'] = true,
['contributor-first'] = true,
['contributor-given'] = true,
['contributor-last'] = true,
['contributor-surname'] = true,
['contributor-link'] = true,
['contributor-mask'] = true,
['date'] = true,
['department'] = true,
['df'] = true,
['dictionary'] = true,
['display-authors'] = true,
['display-contributors'] = true,
['display-editors'] = true,
['display-interviewers'] = true,
['display-subjects'] = true,
['display-translators'] = true,
['doi'] = true,
['DOI'] = true,
['doi-access'] = true,
['doi-broken-date'] = true,
['edition'] = true,
['editor'] = true,
['editor-first'] = true,
['editor-given'] = true,
['editor-last'] = true,
['editor-surname'] = true,
['editor-link'] = true,
['editor-mask'] = true,
['eissn'] = true,
['EISSN'] = true,
['encyclopaedia'] = true,
['encyclopedia'] = true,
['entry'] = true,
['entry-format'] = true,
['entry-url'] = true,
['entry-url-access'] = true,
['eprint'] = true, -- cite arxiv; here because allowed in cite ... as identifier
['first'] = true,
['format'] = true,
['given'] = true,
['hdl'] = true,
['HDL'] = true,
['hdl-access'] = true,
['host'] = true, -- unique to certain templates?
['id'] = true,
['ID'] = true,
['institution'] = true, -- constrain to cite thesis?
['interviewer'] = true,
['interviewer-first'] = true,
['interviewer-given'] = true,
['interviewer-last'] = true,
['interviewer-surname'] = true,
['interviewer-link'] = true,
['interviewer-mask'] = true,
['isbn'] = true,
['ISBN'] = true,
['ismn'] = true,
['ISMN'] = true,
['issn'] = true,
['ISSN'] = true,
['issue'] = true,
['jfm'] = true,
['JFM'] = true,
['journal'] = true,
['jstor'] = true,
['JSTOR'] = true,
['jstor-access'] = true,
['lang'] = true,
['language'] = true,
['last'] = true,
['lccn'] = true,
['LCCN'] = true,
['location'] = true,
['magazine'] = true,
['medium'] = true,
['medrxiv'] = true, -- cite medrxiv; here because allowed in cite ... as identifier
['minutes'] = true, -- constrain to cite AV media and podcast?
['mode'] = true,
['mr'] = true,
['MR'] = true,
['name-list-style'] = true,
['newspaper'] = true,
['no-pp'] = true,
['no-tracking'] = true,
['number'] = true,
['oclc'] = true,
['OCLC'] = true,
['ol'] = true,
['OL'] = true,
['ol-access'] = true,
['orig-date'] = true,
['origyear'] = true,
['orig-year'] = true,
['osti'] = true,
['OSTI'] = true,
['osti-access'] = true,
['others'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['people'] = true,
['periodical'] = true,
['place'] = true,
['pmc'] = true,
['PMC'] = true,
['pmc-embargo-date'] = true,
['pmid'] = true,
['PMID'] = true,
['postscript'] = true,
['pp'] = true,
['publication-date'] = true,
['publication-place'] = true,
['publisher'] = true,
['quotation'] = true,
['quote'] = true,
['quote-page'] = true,
['quote-pages'] = true,
['ref'] = true,
['rfc'] = true,
['RFC'] = true,
['sbn'] = true,
['SBN'] = true,
['scale'] = true,
['script-article'] = true,
['script-chapter'] = true,
['script-contribution'] = true,
['script-entry'] = true,
['script-journal'] = true,
['script-magazine'] = true,
['script-newspaper'] = true,
['script-periodical'] = true,
['script-quote'] = true,
['script-section'] = true,
['script-title'] = true,
['script-website'] = true,
['script-work'] = true,
['section'] = true,
['section-format'] = true,
['section-url'] = true,
['section-url-access'] = true,
['series'] = true,
['ssrn'] = true, -- cite ssrn; these three here because allowed in cite ... as identifier
['SSRN'] = true,
['ssrn-access'] = true,
['subject'] = true,
['subject-first'] = true,
['subject-given'] = true,
['subject-last'] = true,
['subject-link'] = true,
['subject-mask'] = true,
['subject-surname'] = true,
['surname'] = true,
['s2cid'] = true,
['S2CID'] = true,
['s2cid-access'] = true,
['template-doc-demo'] = true,
['time'] = true, -- constrain to cite av media and podcast?
['time-caption'] = true, -- constrain to cite av media and podcast?
['title'] = true,
['title-link'] = true,
['title-note'] = true,
['translator'] = true,
['translator-first'] = true,
['translator-given'] = true,
['translator-last'] = true,
['translator-surname'] = true,
['translator-link'] = true,
['translator-mask'] = true,
['trans-article'] = true,
['trans-chapter'] = true,
['trans-contribution'] = true,
['trans-entry'] = true,
['trans-journal'] = true,
['trans-magazine'] = true,
['trans-newspaper'] = true,
['trans-periodical'] = true,
['trans-quote'] = true,
['trans-section'] = true,
['trans-title'] = true,
['trans-website'] = true,
['trans-work'] = true,
['type'] = true,
['url'] = true,
['URL'] = true,
['url-access'] = true,
['url-status'] = true,
['vauthors'] = true,
['veditors'] = true,
['version'] = true,
['via'] = true,
['volume'] = true,
['website'] = true,
['work'] = true,
['year'] = true,
['zbl'] = true,
['ZBL'] = true,
}
local numbered_arguments_t = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-given#'] = true,
['author#-given'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-surname#'] = true,
['author#-surname'] = true,
['author-link#'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author#link'] = true,
['author-mask#'] = true,
['author#-mask'] = true,
['contributor#'] = true,
['contributor-first#'] = true,
['contributor#-first'] = true,
['contributor-given#'] = true,
['contributor#-given'] = true,
['contributor-last#'] = true,
['contributor#-last'] = true,
['contributor-surname#'] = true,
['contributor#-surname'] = true,
['contributor-link#'] = true,
['contributor#-link'] = true,
['contributor-mask#'] = true,
['contributor#-mask'] = true,
['editor#'] = true,
['editor-first#'] = true,
['editor#-first'] = true,
['editor-given#'] = true,
['editor#-given'] = true,
['editor-last#'] = true,
['editor#-last'] = true,
['editor-surname#'] = true,
['editor#-surname'] = true,
['editor-link#'] = true,
['editor#-link'] = true,
['editor-mask#'] = true,
['editor#-mask'] = true,
['first#'] = true,
['given#'] = true,
['host#'] = true,
['interviewer#'] = true,
['interviewer-first#'] = true,
['interviewer#-first'] = true,
['interviewer-given#'] = true,
['interviewer#-given'] = true,
['interviewer-last#'] = true,
['interviewer#-last'] = true,
['interviewer-surname#'] = true,
['interviewer#-surname'] = true,
['interviewer-link#'] = true,
['interviewer#-link'] = true,
['interviewer-mask#'] = true,
['interviewer#-mask'] = true,
['last#'] = true,
['subject#'] = true,
['subject-first#'] = true,
['subject#-first'] = true,
['subject-given#'] = true,
['subject#-given'] = true,
['subject-last#'] = true,
['subject#-last'] = true,
['subject-link#'] = true,
['subject#-link'] = true,
['subject-mask#'] = true,
['subject#-mask'] = true,
['subject-surname#'] = true,
['subject#-surname'] = true,
['surname#'] = true,
['translator#'] = true,
['translator-first#'] = true,
['translator#-first'] = true,
['translator-given#'] = true,
['translator#-given'] = true,
['translator-last#'] = true,
['translator#-last'] = true,
['translator-surname#'] = true,
['translator#-surname'] = true,
['translator-link#'] = true,
['translator#-link'] = true,
['translator-mask#'] = true,
['translator#-mask'] = true,
}
--[[--------------------------< P R E P R I N T S U P P O R T E D P A R A M E T E R S >--------------------
Cite arXiv, cite biorxiv, cite citeseerx, cite medrxiv, and cite ssrn are preprint templates that use the limited
set of parameters defined in the limited_basic_arguments and limited_numbered_arguments tables. Those lists are
supplemented with a template-specific list of parameters that are required by the particular template and may be
exclusive to one of the preprint templates. Some of these parameters may also be available to the general cs1|2
templates.
Same conventions for true/false/tracked/nil as above.
]]
local preprint_arguments_t = {
arxiv = {
['arxiv'] = true, -- cite arxiv and arxiv identifiers
['class'] = true,
['eprint'] = true, -- cite arxiv and arxiv identifiers
},
biorxiv = {
['biorxiv'] = true,
},
citeseerx = {
['citeseerx'] = true,
},
medrxiv = {
['medrxiv'] = true,
},
ssrn = {
['ssrn'] = true,
['SSRN'] = true,
['ssrn-access'] = true,
},
}
--[[--------------------------< L I M I T E D S U P P O R T E D P A R A M E T E R S >----------------------
cite arxiv, cite biorxiv, cite citeseerx, cite medrxiv, and cite ssrn templates are preprint templates so are
allowed only a limited subset of parameters allowed to all other cs1|2 templates. The limited subset is defined
here.
This list of parameters also used by {{cite document}}
Same conventions for true/false/tracked/nil as above.
]]
local limited_basic_arguments_t = {
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-given'] = true,
['author-last'] = true,
['author-surname'] = true,
['author-link'] = true,
['authorlink'] = true,
['author-mask'] = true,
['authors'] = true,
['collaboration'] = true,
['date'] = true,
['df'] = true,
['display-authors'] = true,
['first'] = true,
['given'] = true,
['language'] = true,
['last'] = true,
['mode'] = true,
['name-list-style'] = true,
['no-tracking'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['postscript'] = true,
['pp'] = true,
['quotation'] = true,
['quote'] = true,
['ref'] = true,
['surname'] = true,
['template-doc-demo'] = true,
['title'] = true,
['trans-title'] = true,
['vauthors'] = true,
['year'] = true,
}
local limited_numbered_arguments_t = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-given#'] = true,
['author#-given'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-surname#'] = true,
['author#-surname'] = true,
['author-link#'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author#link'] = true,
['author-mask#'] = true,
['author#-mask'] = true,
['first#'] = true,
['given#'] = true,
['last#'] = true,
['surname#'] = true,
}
--[[--------------------------< U N I Q U E _ A R G U M E N T S >----------------------------------------------
Some templates have unique parameters. Those templates and their unique parameters are listed here. Keys in this
table are the template's CitationClass parameter value
Same conventions for true/false/tracked/nil as above.
]]
local unique_arguments_t = {
['audio-visual'] = {
['transcript'] = true,
['transcript-format'] = true,
['transcript-url'] = true,
},
conference = {
['book-title'] = true,
['conference'] = true,
['conference-format'] = true,
['conference-url'] = true,
['event'] = true,
},
episode = {
['airdate'] = true,
['air-date'] = true,
['credits'] = true,
['episode-link'] = true, -- alias of |title-link=
['network'] = true,
['season'] = true,
['series-link'] = true,
['series-no'] = true,
['series-number'] = true,
['station'] = true,
['transcript'] = true,
['transcript-format'] = true,
['transcript-url'] = true,
},
mailinglist = {
['mailing-list'] = true,
},
map = {
['cartography'] = true,
['inset'] = true,
['map'] = true,
['map-format'] = true,
['map-url'] = true,
['map-url-access'] = true,
['script-map'] = true,
['sections'] = true,
['sheet'] = true,
['sheets'] = true,
['trans-map'] = true,
},
newsgroup = {
['message-id'] = true,
['newsgroup'] = true,
},
report = {
['docket'] = true,
},
serial = {
['airdate'] = true,
['air-date'] = true,
['credits'] = true,
['episode'] = true, -- cite serial only TODO: make available to cite episode?
['episode-link'] = true, -- alias of |title-link=
['network'] = true,
['series-link'] = true,
['station'] = true,
},
speech = {
['conference'] = true,
['conference-format'] = true,
['conference-url'] = true,
['event'] = true,
},
thesis = {
['degree'] = true,
['docket'] = true,
},
}
--[[--------------------------< C I T E _ D O C U M E N T >----------------------------------------------------
Special case for cite document. This template takes the limited basic and limited enumerated parameters plus
others that are apply only to standalone published sources that cannot be cited any other way; no url, book,
periodical, etc parameters; limited support for name lists and named identifiers.
when validating parameters in {{cite document}} templates, the basic and
]]
local document_arguments_t = {
['bibcode'] = true,
['bibcode-access'] = true,
['doi'] = true,
['DOI'] = true,
['doi-access'] = true,
['doi-broken-date'] = true,
['hdl'] = true,
['HDL'] = true,
['hdl-access'] = true,
['id'] = true,
['ID'] = true,
['jfm'] = true,
['JFM'] = true,
['lang'] = true,
['location'] = true,
['mr'] = true,
['MR'] = true,
['no-pp'] = true,
['orig-date'] = true,
['origyear'] = true,
['orig-year'] = true,
['osti'] = true,
['OSTI'] = true,
['osti-access'] = true,
['place'] = true,
['publisher'] = true,
['quote-page'] = true,
['quote-pages'] = true,
['script-quote'] = true,
['script-title'] = true,
['title-link'] = true,
['translator'] = true,
['translator-first'] = true,
['translator-given'] = true,
['translator-last'] = true,
['translator-surname'] = true,
['translator-link'] = true,
['translator-mask'] = true,
['trans-quote'] = true,
['type'] = true,
['zbl'] = true,
['ZBL'] = true,
}
local document_numbered_arguments_t = {
['translator#'] = true,
['translator-first#'] = true,
['translator#-first'] = true,
['translator-given#'] = true,
['translator#-given'] = true,
['translator-last#'] = true,
['translator#-last'] = true,
['translator-surname#'] = true,
['translator#-surname'] = true,
['translator-link#'] = true,
['translator#-link'] = true,
['translator-mask#'] = true,
['translator#-mask'] = true,
}
--[[--------------------------< L I S T _ C O M B I N E >------------------------------------------------------
makes one table from a list of tables. <lists_t> is a sequence of tables to be combined
]]
local function list_combine (lists_t)
local out_t = {};
for _, list_t in ipairs (lists_t) do -- for each list in <lists_t>
for k, v in pairs (list_t) do -- extract each k/v pair
out_t[k] = v; -- add to <out_t>
end
end
return out_t; -- and done
end
--[[--------------------------< T E M P L A T E _ L I S T _ G E T >--------------------------------------------
gets a list of the templates from table t
]]
local function template_list_get (t)
local out_t = {}; -- a table for output
for k, _ in pairs (t) do -- spin through the table and collect the keys
table.insert (out_t, k) -- add each key to the output table
end
return out_t; -- and done
end
--[[--------------------------< E X P O R T E D T A B L E S >------------------------------------------------
]]
return {
preprint_arguments_t = preprint_arguments_t,
preprint_template_list_t = template_list_get (preprint_arguments_t), -- make a template list from preprint_arguments{} table
unique_arguments_t = unique_arguments_t,
unique_param_template_list_t = template_list_get (unique_arguments_t), -- make a template list from unique_arguments{} table
document_parameters_t = list_combine ({limited_basic_arguments_t, limited_numbered_arguments_t, document_arguments_t, document_numbered_arguments_t});
common_parameters_t = list_combine ({basic_arguments_t, numbered_arguments_t});
limited_parameters_t = list_combine ({limited_basic_arguments_t, limited_numbered_arguments_t});
};
bd347271e3380cb17f22c0e3924982798e9adc07
Module:Citation/CS1/Utilities
828
161
423
422
2023-10-17T20:36:15Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/Utilities]]
Scribunto
text/plain
local z = {
error_cats_t = {}; -- for categorizing citations that contain errors
error_ids_t = {}; -- list of error identifiers; used to prevent duplication of certain errors; local to this module
error_msgs_t = {}; -- sequence table of error messages
maint_cats_t = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
prop_cats_t = {}; -- for categorizing citations based on certain properties, language of source for instance
prop_keys_t = {}; -- for adding classes to the citation's <cite> tag
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set (var)
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array (needle, haystack)
if needle == nil then
return false;
end
for n, v in ipairs (haystack) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
]]
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
local count;
if true == allow_empty then
str, count = str:gsub ('^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = str:gsub ('^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table. <args> may be a single string or a
sequence table of multiple strings.
]]
local function substitute (msg, args)
return args and mw.message.newRawMessage (msg, args):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with CSS markup according to the state of hidden. <content> may be a single string or a
sequence table of multiple strings.
]]
local function error_comment (content, hidden)
return substitute (hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content);
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate
like items; unlike items are returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and
digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and
digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash (str)
if not is_set (str) then
return str;
end
local accept; -- boolean
str = str:gsub ("(%(%(.-%)%))", function(m) return m:gsub(",", ","):gsub(";", ";") end) -- replace commas and semicolons in accept-as-written markup with similar unicode characters so they'll be ignored during the split
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace HTML numeric entity with hyphen character
str = str:gsub (' ', ' '); -- replace entity with generic keyboard space character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
item, accept = has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item
if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit
item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace
end
end
table.insert (out, item); -- add the (possibly modified) item to the output table
end
local temp_str = ''; -- concatenate the output table into a comma separated string
temp_str, accept = has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept then
temp_str = has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value
return temp_str:gsub(",", ","):gsub(";", ";");
else
return temp_str:gsub(",", ","):gsub(";", ";"); -- else, return assembled temp_str
end
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided (or link and display are the same), returns a wikilink in the form [[L]]; if neither are
provided or link is omitted, returns an empty string.
]=]
local function make_wikilink (link, display)
if not is_set (link) then return '' end
if is_set (display) and link ~= display then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
end
--[[--------------------------< S E T _ M E S S A G E >----------------------------------------------------------
Sets an error message using the ~/Configuration error_conditions{} table along with arguments supplied in the function
call, inserts the resulting message in z.error_msgs_t{} sequence table, and returns the error message.
<error_id> – key value for appropriate error handler in ~/Configuration error_conditions{} table
<arguments> – may be a single string or a sequence table of multiple strings to be subsititued into error_conditions[error_id].message
<raw> – boolean
true – causes this function to return the error message not wrapped in visible-error, hidden-error span tag;
returns error_conditions[error_id].hidden as a second return value
does not add message to z.error_msgs_t sequence table
false, nil – adds message wrapped in visible-error, hidden-error span tag to z.error_msgs_t
returns the error message wrapped in visible-error, hidden-error span tag; there is no second return value
<prefix> – string to be prepended to <message> -- TODO: remove support for these unused(?) arguments?
<suffix> – string to be appended to <message>
TODO: change z.error_cats_t and z.maint_cats_t to have the form cat_name = true? this to avoid dups without having to have an extra table
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maint_cats_t; TODO: figure out how to delete this table
local function set_message (error_id, arguments, raw, prefix, suffix)
local error_state = cfg.error_conditions[error_id];
prefix = prefix or '';
suffix = suffix or '';
if error_state == nil then
error (cfg.messages['undefined_error'] .. ': ' .. error_id); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set (error_state.category) then
if error_state.message then -- when error_state.message defined, this is an error message
table.insert (z.error_cats_t, error_state.category);
else
if not added_maint_cats[error_id] then
added_maint_cats[error_id] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (error_state.category, arguments)); -- make cat name then add to table
end
return; -- because no message, nothing more to do
end
end
local message = substitute (error_state.message, arguments);
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids_t[error_id] = true;
if z.error_ids_t['err_citation_missing_title'] and -- if missing-title error already noted
in_array (error_id, {'err_bare_url_missing_title', 'err_trans_missing_title'}) then -- and this error is one of these
return '', false; -- don't bother because one flavor of missing title is sufficient
end
message = table.concat ({prefix, message, suffix});
if true == raw then
return message, error_state.hidden; -- return message not wrapped in visible-error, hidden-error span tag
end
message = error_comment (message, error_state.hidden); -- wrap message in visible-error, hidden-error span tag
table.insert (z.error_msgs_t, message); -- add it to the messages sequence table
return message; -- and done; return value generally not used but is used as a flag in various functions of ~/Identifiers
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used to choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set (args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs (error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert (error_list, alias); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maint_cats_t using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maint_cats_t.
]]
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.prop_cats_t using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local added_prop_cats = {}; -- list of property categories that have been added to z.prop_cats_t
local function add_prop_cat (key, arguments, key_modifier)
local key_modified = key .. ((key_modifier and key_modifier) or ''); -- modify <key> with <key_modifier> if present and not nil
if not added_prop_cats [key_modified] then
added_prop_cats [key_modified] = true; -- note that we've added this category
table.insert (z.prop_cats_t, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
table.insert (z.prop_keys_t, 'cs1-prop-' .. key); -- convert key to class for use in the citation's <cite> tag
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics (str)
if not is_set (str) then return str end
if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end
if str:sub (-1, -1) == "'" then str = str .. "<span></span>"; end
return str:gsub ('\n', ' '); -- Remove newlines as they break italics.
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set (str) then
return "";
elseif in_array (key, {'italic-title', 'trans-italic-title'}) then
str = safe_for_italics (str);
end
return substitute (cfg.presentation[key], {str});
end
--[[--------------------------< M A K E _ S E P _ L I S T >------------------------------------------------------------
make a separated list of items using provided separators.
<sep_list> - typically '<comma><space>'
<sep_list_pair> - typically '<space>and<space>'
<sep_list_end> - typically '<comma><space>and<space>' or '<comma><space>&<space>'
defaults to cfg.presentation['sep_list'], cfg.presentation['sep_list_pair'], and cfg.presentation['sep_list_end']
if <sep_list_end> is specified, <sep_list> and <sep_list_pair> must also be supplied
]]
local function make_sep_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 2 >= count then
list = table.concat (list_seq, sep_list_pair); -- insert separator between two items; returns list_seq[1] then only one item
elseif 2 < count then
list = table.concat (list_seq, sep_list, 1, count - 1); -- concatenate all but last item with plain list separator
list = table.concat ({list, list_seq[count]}, sep_list_end); -- concatenate last item onto end of <list> with final separator
end
return list;
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one (args, aliases_list, error_condition, index)
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs (aliases_list) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
for i, v in ipairs (error_list) do
error_list[i] = wrap_style ('parameter', v);
end
table.insert (error_list, wrap_style ('parameter', selected));
set_message (error_condition, {make_sep_list (#error_list, error_list)});
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims whitespace from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub ("%[%[([^%[%]]*)%]%]", function(l)
return l:gsub ("^[^|]*|(.*)$", "%1" ):gsub ("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing whitespace and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wikilink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ("'''''", 1, true) then -- bold italic (5)
argument, flag = argument:gsub ("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ("''''", 1, true) then -- italic start and end without content (4)
argument, flag=argument:gsub ("%'%'%'%'", "");
elseif argument:find ("'''", 1, true) then -- bold (3)
argument, flag=argument:gsub ("%'%'%'", "");
elseif argument:find ("''", 1, true) then -- italic (2)
argument, flag = argument:gsub ("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
add_maint_cat = add_maint_cat, -- exported functions
add_prop_cat = add_prop_cat,
error_comment = error_comment,
has_accept_as_written = has_accept_as_written,
hyphen_to_dash = hyphen_to_dash,
in_array = in_array,
is_set = is_set,
is_wikilink = is_wikilink,
make_sep_list = make_sep_list,
make_wikilink = make_wikilink,
remove_wiki_link = remove_wiki_link,
safe_for_italics = safe_for_italics,
select_one = select_one,
set_message = set_message,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
substitute = substitute,
wrap_style = wrap_style,
z = z, -- exported table
}
b006801b48981b2987f20fc09cbe0dfda525e044
Module:Citation/CS1/Date validation
828
162
425
424
2023-10-17T20:36:15Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/Date_validation]]
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local add_prop_cat, is_set, in_array, set_message, substitute, wrap_style; -- imported functions from selected Module:Citation/CS1/Utilities
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< F I L E - S C O P E D E C L A R A T I O N S >--------------------------------
File-scope variables are declared here
]]
local lang_object = mw.getContentLanguage(); -- used by is_valid_accessdate(), is_valid_year(), date_name_xlate(); TODO: move to ~/Configuration?
local year_limit; -- used by is_valid_year()
--[=[-------------------------< I S _ V A L I D _ A C C E S S D A T E >----------------------------------------
returns true if:
Wikipedia start date <= accessdate < today + 2 days
Wikipedia start date is 2001-01-15T00:00:00 UTC which is 979516800 seconds after 1970-01-01T00:00:00 UTC (the start of Unix time)
accessdate is the date provided in |access-date= at time 00:00:00 UTC
today is the current date at time 00:00:00 UTC plus 48 hours
if today is 2015-01-01T00:00:00 then
adding 24 hours gives 2015-01-02T00:00:00 – one second more than today
adding 24 hours gives 2015-01-03T00:00:00 – one second more than tomorrow
This function does not work if it is fed month names for languages other than English. Wikimedia #time: parser
apparently doesn't understand non-English date month names. This function will always return false when the date
contains a non-English month name because good1 is false after the call to lang.formatDate(). To get around that
call this function with YYYY-MM-DD format dates.
]=]
local function is_valid_accessdate (accessdate)
local good1, good2;
local access_ts, tomorrow_ts; -- to hold Unix time stamps representing the dates
good1, access_ts = pcall (lang_object.formatDate, lang_object, 'U', accessdate ); -- convert accessdate value to Unix timestamp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which which tonumber() may not understand
access_ts = tonumber (access_ts) or lang_object:parseFormattedNumber (access_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to Unix time stamp
end
if 979516800 <= access_ts and access_ts < tomorrow_ts then -- Wikipedia start date <= accessdate < tomorrow's date
return true;
else
return false; -- accessdate out of range
end
end
--[[--------------------------< G E T _ M O N T H _ N U M B E R >----------------------------------------------
returns a number according to the month in a date: 1 for January, etc. Capitalization and spelling must be correct.
If not a valid month, returns 0
]]
local function get_month_number (month)
return cfg.date_names['local'].long[month] or cfg.date_names['local'].short[month] or -- look for local names first
cfg.date_names['en'].long[month] or cfg.date_names['en'].short[month] or -- failing that, look for English names
0; -- not a recognized month name
end
--[[--------------------------< G E T _ S E A S O N _ N U M B E R >--------------------------------------------
returns a number according to the sequence of seasons in a year: 21 for Spring, etc. Capitalization and spelling
must be correct. If not a valid season, returns 0.
21-24 = Spring, Summer, Autumn, Winter, independent of “Hemisphere”
returns 0 when <param> is not |date=
Season numbering is defined by Extended Date/Time Format (EDTF) specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard defines various divisions using
numbers 21-41. cs1|2 only supports generic seasons. EDTF does support the distinction between north and south
hemisphere seasons but cs1|2 has no way to make that distinction.
These additional divisions not currently supported:
25-28 = Spring - Northern Hemisphere, Summer- Northern Hemisphere, Autumn - Northern Hemisphere, Winter - Northern Hemisphere
29-32 = Spring – Southern Hemisphere, Summer– Southern Hemisphere, Autumn – Southern Hemisphere, Winter - Southern Hemisphere
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_season_number (season, param)
if 'date' ~= param then
return 0; -- season dates only supported by |date=
end
return cfg.date_names['local'].season[season] or -- look for local names first
cfg.date_names['en'].season[season] or -- failing that, look for English names
0; -- not a recognized season name
end
--[[--------------------------< G E T _ Q U A R T E R _ N U M B E R >------------------------------------------
returns a number according to the sequence of quarters in a year: 33 for first quarter, etc. Capitalization and spelling
must be correct. If not a valid quarter, returns 0.
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
returns 0 when <param> is not |date=
Quarter numbering is defined by Extended Date/Time Format (EDTF) specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard defines various divisions using
numbers 21-41. cs1|2 only supports generic seasons and quarters.
These additional divisions not currently supported:
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_quarter_number (quarter, param)
if 'date' ~= param then
return 0; -- quarter dates only supported by |date=
end
quarter = mw.ustring.gsub (quarter, ' +', ' '); -- special case replace multiple space chars with a single space char
return cfg.date_names['local'].quarter[quarter] or -- look for local names first
cfg.date_names['en'].quarter[quarter] or -- failing that, look for English names
0; -- not a recognized quarter name
end
--[[--------------------------< G E T _ P R O P E R _ N A M E _ N U M B E R >----------------------------------
returns a non-zero number if date contains a recognized proper-name. Capitalization and spelling must be correct.
returns 0 when <param> is not |date=
]]
local function get_proper_name_number (name, param)
if 'date' ~= param then
return 0; -- proper-name dates only supported by |date=
end
return cfg.date_names['local'].named[name] or -- look for local names dates first
cfg.date_names['en'].named[name] or -- failing that, look for English names
0; -- not a recognized named date
end
--[[--------------------------< G E T _ E L E M E N T _ N U M B E R <------------------------------------------
returns true if month or season or quarter or proper name is valid (properly spelled, capitalized, abbreviated)
]]
local function get_element_number (element, param)
local num;
local funcs = {get_month_number, get_season_number, get_quarter_number, get_proper_name_number}; -- list of functions to execute in order
for _, func in ipairs (funcs) do -- spin through the function list
num = func (element, param); -- call the function and get the returned number
if 0 ~= num then -- non-zero when valid month season quarter
return num; -- return that number
end
end
return nil; -- not valid
end
--[[--------------------------< I S _ V A L I D _ Y E A R >----------------------------------------------------
Function gets current year from the server and compares it to year from a citation parameter. Years more than one
year in the future are not acceptable.
Special case for |pmc-embargo-date=: years more than two years in the future are not acceptable
]]
local function is_valid_year (year, param)
if not is_set (year_limit) then
year_limit = tonumber(os.date("%Y"))+1; -- global variable so we only have to fetch it once
end
year = tonumber (year) or lang_object:parseFormattedNumber (year); -- convert to number for the comparison
if year and (100 > year) then -- years less than 100 not supported
return false;
end
if 'pmc-embargo-date' == param then -- special case for |pmc-embargo-date=
return year and (year <= tonumber(os.date("%Y"))+2) or false; -- years more than two years in the future are not accepted
end
return year and (year <= year_limit) or false;
end
--[[--------------------------< I S _ V A L I D _ D A T E >----------------------------------------------------
Returns true if day is less than or equal to the number of days in month and year is no farther into the future
than next year; else returns false.
Assumes Julian calendar prior to year 1582 and Gregorian calendar thereafter. Accounts for Julian calendar leap
years before 1582 and Gregorian leap years after 1582. Where the two calendars overlap (1582 to approximately
1923) dates are assumed to be Gregorian.
]]
local function is_valid_date (year, month, day, param)
local days_in_month = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
local month_length;
if not is_valid_year (year, param) then -- no farther into the future than next year except |pmc-embargo-date= no more than two years in the future
return false;
end
month = tonumber (month); -- required for YYYY-MM-DD dates
if (2 == month) then -- if February
month_length = 28; -- then 28 days unless
if 1582 > tonumber(year) then -- Julian calendar
if 0 == (year%4) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
else -- Gregorian calendar
if (0 == (year%4) and (0 ~= (year%100) or 0 == (year%400))) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
end
else
month_length = days_in_month[month];
end
if tonumber (day) > month_length then
return false;
end
return true;
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ R A N G E _ S T Y L E >--------------------------
Months in a range are expected to have the same style: Jan–Mar or October–December but not February–Mar or Jul–August.
This function looks in cfg.date_names{} to see if both month names are listed in the long subtable or both are
listed in the short subtable. When both have the same style (both are listed in the same table), returns true; false else
]]
local function is_valid_month_range_style (month1, month2)
if (cfg.date_names.en.long[month1] and cfg.date_names.en.long[month2]) or -- are both English names listed in the long subtable?
(cfg.date_names.en.short[month1] and cfg.date_names.en.short[month2]) or -- are both English names listed in the short subtable?
(cfg.date_names['local'].long[month1] and cfg.date_names['local'].long[month2]) or -- are both local names listed in the long subtable?
(cfg.date_names['local'].short[month1] and cfg.date_names['local'].short[month2]) then -- are both local names listed in the short subtable?
return true;
end
return false; -- names are mixed
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ S E A S O N _ R A N G E >------------------------
Check a pair of months or seasons to see if both are valid members of a month or season pair.
Month pairs are expected to be left to right, earliest to latest in time.
All season ranges are accepted as valid because there are publishers out there who have published a Summer–Spring YYYY issue, hence treat as ok
]]
local function is_valid_month_season_range(range_start, range_end, param)
local range_start_number = get_month_number (range_start);
local range_end_number;
if 0 == range_start_number then -- is this a month range?
range_start_number = get_season_number (range_start, param); -- not a month; is it a season? get start season number
range_end_number = get_season_number (range_end, param); -- get end season number
if (0 ~= range_start_number) and (0 ~= range_end_number) and (range_start_number ~= range_end_number) then
return true; -- any season pairing is accepted except when both are the same
end
return false; -- range_start and/or range_end is not a season
end
-- here when range_start is a month
range_end_number = get_month_number (range_end); -- get end month number
if range_start_number < range_end_number and -- range_start is a month; does range_start precede range_end?
is_valid_month_range_style (range_start, range_end) then -- do months have the same style?
return true; -- proper order and same style
end
return false; -- range_start month number is greater than or equal to range end number; or range end isn't a month
end
--[[--------------------------< M A K E _ C O I N S _ D A T E >------------------------------------------------
This function receives a table of date parts for one or two dates and an empty table reference declared in
Module:Citation/CS1. The function is called only for |date= parameters and only if the |date=<value> is
determined to be a valid date format. The question of what to do with invalid date formats is not answered here.
The date parts in the input table are converted to an ISO 8601 conforming date string:
single whole dates: yyyy-mm-dd
month and year dates: yyyy-mm
year dates: yyyy
ranges: yyyy-mm-dd/yyyy-mm-dd
yyyy-mm/yyyy-mm
yyyy/yyyy
Dates in the Julian calendar are reduced to year or year/year so that we don't have to do calendar conversion from
Julian to Proleptic Gregorian.
The input table has:
year, year2 – always present; if before 1582, ignore months and days if present
month, month2 – 0 if not provided, 1-12 for months, 21-24 for seasons; 99 Christmas
day, day2 – 0 if not provided, 1-31 for days
the output table receives:
rftdate: an ISO 8601 formatted date
rftchron: a free-form version of the date, usually without year which is in rftdate (season ranges and proper-name dates)
rftssn: one of four season keywords: winter, spring, summer, fall (lowercase)
rftquarter: one of four values: 1, 2, 3, 4
]]
local function make_COinS_date (input, tCOinS_date)
local date; -- one date or first date in a range
local date2 = ''; -- end of range date
input.year = tonumber (input.year) or lang_object:parseFormattedNumber (input.year); -- language-aware tonumber()
input.year2 = tonumber (input.year2) or lang_object:parseFormattedNumber (input.year2); -- COinS dates are pseudo-ISO 8601 so convert to Arabic numerals
-- start temporary Julian / Gregorian calendar uncertainty detection
local year = input.year; -- this temporary code to determine the extent of sources dated to the Julian/Gregorian
local month = tonumber(input.month); -- interstice 1 October 1582 – 1 January 1926
local day = tonumber (input.day);
if (0 ~= day) and -- day must have a value for this to be a whole date
(((1582 == year) and (10 <= month) and (12 >= month)) or -- any whole 1582 date from 1 October to 31 December or
((1926 == year) and (1 == month) and (1 == input.day)) or -- 1 January 1926 or
((1582 < year) and (1925 >= year))) then -- any date 1 January 1583 – 31 December 1925
tCOinS_date.inter_cal_cat = true; -- set category flag true
end
-- end temporary Julian / Gregorian calendar uncertainty detection
if ((1582 == year) and (10 > month)) or (1582 > year) then -- if a Julian calendar date
tCOinS_date.rftdate = tostring (input.year); -- &rft.date gets year only
return; -- done
end
-- here for all forms of Gregorian dates
if 20 < tonumber (input.month) then -- if season, quarter, or proper-name date
date = input.year; -- &rft.date gets year only
if 0 ~= input.year2 and input.year ~= input.year2 then -- if a range, only the second year portion when not the same as range start year
date = string.format ('%.4d/%.4d', input.year, input.year2) -- assemble the date range
end
local season = {[24] = 'winter', [21] = 'spring', [22] = 'summer', [23] = 'fall', [33] = '1', [34] = '2', [35] = '3', [36] = '4', [98] = 'Easter', [99] = 'Christmas'}; -- seasons lowercase, no autumn; proper-names use title case
if 0 == input.month2 then -- single season, quarter, or proper-name date
if 40 < tonumber(input.month) then
tCOinS_date.rftchron = season[input.month]; -- proper-name date; used in journal metadata only
elseif 30 < tonumber(input.month) then
tCOinS_date.rftquarter = season[input.month]; -- quarter date; used in journal metadata only
else
tCOinS_date.rftssn = season[input.month]; -- season date; used in journal metadata only
end
else -- season ranges are lumped into &rft.chron; &rft.ssn and &rft.quarter are left blank
if input.year ~= input.year2 then -- season year – season year range or season year–year
if 0 ~= input.month2 then
tCOinS_date.rftchron = string.format ('%s %s – %s %s', season[input.month], input.year, season[input.month2], input.year2); -- used in journal metadata only
end
else -- season–season year range
tCOinS_date.rftchron = season[input.month] .. '–' .. season[input.month2]; -- season–season year range; used in journal metadata only
end
end
tCOinS_date.rftdate = tostring (date);
return; -- done
end
-- here for gregorian calendar dates
if 0 ~= input.day then
date = string.format ('%s-%.2d-%.2d', input.year, tonumber(input.month), tonumber(input.day)); -- whole date
elseif 0 ~= input.month then
date = string.format ('%s-%.2d', input.year, tonumber(input.month)); -- year and month
else
date = string.format ('%s', input.year); -- just year
end
if 0 ~= input.year2 then
if 0 ~= input.day2 then
date2 = string.format ('/%s-%.2d-%.2d', input.year2, tonumber(input.month2), tonumber(input.day2)); -- whole date
elseif 0 ~= input.month2 then
date2 = string.format ('/%s-%.2d', input.year2, tonumber(input.month2)); -- year and month
else
date2 = string.format ('/%s', input.year2); -- just year
end
end
tCOinS_date.rftdate = date .. date2; -- date2 has the '/' separator
return;
end
--[[--------------------------< P A T T E R N S >--------------------------------------------------------------
this is the list of patterns for date formats that this module recognizes. Approximately the first half of these
patterns represent formats that might be reformatted into another format. Those that might be reformatted have
'indicator' letters that identify the content of the matching capture: 'd' (day), 'm' (month), 'a' (anchor year),
'y' (year); second day, month, year have a '2' suffix.
These patterns are used for both date validation and for reformatting. This table should not be moved to ~/Configuration
because changes to this table require changes to check_date() and to reformatter() and reformat_date()
]]
local patterns = {
-- year-initial numerical year-month-day
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'},
-- month-initial: month day, year
['Mdy'] = {'^(%D-) +([1-9]%d?), +((%d%d%d%d?)%a?)$', 'm', 'd', 'a', 'y'},
-- month-initial day range: month day–day, year; days are separated by endash
['Md-dy'] = {'^(%D-) +([1-9]%d?)[%-–]([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'd2', 'a', 'y'},
-- day-initial: day month year
['dMy'] = {'^([1-9]%d?) +(%D-) +((%d%d%d%d?)%a?)$', 'd', 'm', 'a', 'y'},
-- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed; not supported at en.wiki
-- ['yMd'] = {'^((%d%d%d%d?)%a?) +(%D-) +(%d%d?)$', 'a', 'y', 'm', 'd'},
-- day-range-initial: day–day month year; days are separated by endash
['d-dMy'] = {'^([1-9]%d?)[%-–]([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'd2', 'm', 'a', 'y'},
-- day initial month-day-range: day month - day month year; uses spaced endash
['dM-dMy'] = {'^([1-9]%d?) +(%D-) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'd2', 'm2', 'a', 'y'},
-- month initial month-day-range: month day – month day, year; uses spaced endash
['Md-Mdy'] = {'^(%D-) +([1-9]%d?) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$','m', 'd', 'm2', 'd2', 'a', 'y'},
-- day initial month-day-year-range: day month year - day month year; uses spaced endash
['dMy-dMy'] = {'^([1-9]%d?) +(%D-) +(%d%d%d%d) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'y', 'd2', 'm2', 'a', 'y2'},
-- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
['Mdy-Mdy'] = {'^(%D-) +([1-9]%d?), +(%d%d%d%d) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'y', 'm2', 'd2', 'a', 'y2'},
-- these date formats cannot be converted, per se, but month name can be rendered short or long
-- month/season year - month/season year; separated by spaced endash
['My-My'] = {'^(%D-) +(%d%d%d%d) +[%-–] +(%D-) +((%d%d%d%d)%a?)$', 'm', 'y', 'm2', 'a', 'y2'},
-- month/season range year; months separated by endash
['M-My'] = {'^(%D-)[%-–](%D-) +((%d%d%d%d)%a?)$', 'm', 'm2', 'a', 'y'},
-- month/season year or proper-name year; quarter year when First Quarter YYYY etc.
['My'] = {'^([^%d–]-) +((%d%d%d%d)%a?)$', 'm', 'a', 'y'}, -- this way because endash is a member of %D; %D- will match January–March 2019 when it shouldn't
-- these date formats cannot be converted
['Sy4-y2'] = {'^(%D-) +((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
['Sy-y'] = {'^(%D-) +(%d%d%d%d)[%-–]((%d%d%d%d)%a?)$'}, -- special case Winter/Summer year-year; year separated with unspaced endash
['y-y'] = {'^(%d%d%d%d?)[%-–]((%d%d%d%d?)%a?)$'}, -- year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
['y4-y2'] = {'^((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- year range: YYYY–YY; separated by unspaced endash
['y'] = {'^((%d%d%d%d?)%a?)$'}, -- year; here accept either YYY or YYYY
}
--[[--------------------------< I S _ V A L I D _ E M B A R G O _ D A T E >------------------------------------
returns true and date value if that value has proper dmy, mdy, ymd format.
returns false and 9999 (embargoed forever) when date value is not proper format; assumes that when |pmc-embargo-date= is
set, the editor intended to embargo a PMC but |pmc-embargo-date= does not hold a single date.
]]
local function is_valid_embargo_date (v)
if v:match (patterns['ymd'][1]) or -- ymd
v:match (patterns['Mdy'][1]) or -- dmy
v:match (patterns['dMy'][1]) then -- mdy
return true, v;
end
return false, '9999'; -- if here not good date so return false and set embargo date to long time in future
end
--[[--------------------------< C H E C K _ D A T E >----------------------------------------------------------
Check date format to see that it is one of the formats approved by WP:DATESNO or WP:DATERANGE. Exception: only
allowed range separator is endash. Additionally, check the date to see that it is a real date: no 31 in 30-day
months; no 29 February when not a leap year. Months, both long-form and three character abbreviations, and seasons
must be spelled correctly. Future years beyond next year are not allowed.
If the date fails the format tests, this function returns false and does not return values for anchor_year and
COinS_date. When this happens, the date parameter is (DEBUG: not?) used in the COinS metadata and the CITEREF identifier gets
its year from the year parameter if present otherwise CITEREF does not get a date value.
Inputs:
date_string - date string from date-holding parameters (date, year, publication-date, access-date, pmc-embargo-date, archive-date, lay-date)
Returns:
false if date string is not a real date; else
true, anchor_year, COinS_date
anchor_year can be used in CITEREF anchors
COinS_date is ISO 8601 format date; see make_COInS_date()
]]
local function check_date (date_string, param, tCOinS_date)
local year; -- assume that year2, months, and days are not used;
local year2 = 0; -- second year in a year range
local month = 0;
local month2 = 0; -- second month in a month range
local day = 0;
local day2 = 0; -- second day in a day range
local anchor_year;
local coins_date;
if date_string:match (patterns['ymd'][1]) then -- year-initial numerical year month day format
year, month, day = date_string:match (patterns['ymd'][1]);
if 12 < tonumber(month) or 1 > tonumber(month) or 1582 > tonumber(year) or 0 == tonumber(day) then return false; end -- month or day number not valid or not Gregorian calendar
anchor_year = year;
elseif mw.ustring.match(date_string, patterns['Mdy'][1]) then -- month-initial: month day, year
month, day, anchor_year, year = mw.ustring.match(date_string, patterns['Mdy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
elseif mw.ustring.match(date_string, patterns['Md-dy'][1]) then -- month-initial day range: month day–day, year; days are separated by endash
month, day, day2, anchor_year, year = mw.ustring.match(date_string, patterns['Md-dy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2=month; -- for metadata
year2 = year;
elseif mw.ustring.match(date_string, patterns['dMy'][1]) then -- day-initial: day month year
day, month, anchor_year, year = mw.ustring.match(date_string, patterns['dMy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
--[[ NOT supported at en.wiki
elseif mw.ustring.match(date_string, patterns['yMd'][1]) then -- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed
anchor_year, year, month, day = mw.ustring.match(date_string, patterns['yMd'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
-- end NOT supported at en.wiki ]]
elseif mw.ustring.match(date_string, patterns['d-dMy'][1]) then -- day-range-initial: day–day month year; days are separated by endash
day, day2, month, anchor_year, year = mw.ustring.match(date_string, patterns['d-dMy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2 = month; -- for metadata
year2 = year;
elseif mw.ustring.match(date_string, patterns['dM-dMy'][1]) then -- day initial month-day-range: day month - day month year; uses spaced endash
day, month, day2, month2, anchor_year, year = mw.ustring.match(date_string, patterns['dM-dMy'][1]);
if (not is_valid_month_season_range(month, month2)) or not is_valid_year(year) then return false; end -- date range order is left to right: earlier to later;
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2 = year;
elseif mw.ustring.match(date_string, patterns['Md-Mdy'][1]) then -- month initial month-day-range: month day – month day, year; uses spaced endash
month, day, month2, day2, anchor_year, year = mw.ustring.match(date_string, patterns['Md-Mdy'][1]);
if (not is_valid_month_season_range(month, month2, param)) or not is_valid_year(year) then return false; end
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2 = year;
elseif mw.ustring.match(date_string, patterns['dMy-dMy'][1]) then -- day initial month-day-year-range: day month year - day month year; uses spaced endash
day, month, year, day2, month2, anchor_year, year2 = mw.ustring.match(date_string, patterns['dMy-dMy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
if 0 == month or 0 == month2 then return false; end -- both must be valid
elseif mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]) then -- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
month, day, year, month2, day2, anchor_year, year2 = mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number(month2);
if 0 == month or 0 == month2 then return false; end -- both must be valid
elseif mw.ustring.match(date_string, patterns['Sy4-y2'][1]) then -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
local century;
month, year, century, anchor_year, year2 = mw.ustring.match(date_string, patterns['Sy4-y2'][1]);
if 'Winter' ~= month and 'Summer' ~= month then return false end; -- 'month' can only be Winter or Summer
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
year2 = century..year2; -- add the century to year2 for comparisons
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
month = get_season_number(month, param);
elseif mw.ustring.match(date_string, patterns['Sy-y'][1]) then -- special case Winter/Summer year-year; year separated with unspaced endash
month, year, anchor_year, year2 = mw.ustring.match(date_string, patterns['Sy-y'][1]);
month = get_season_number (month, param); -- <month> can only be winter or summer; also for metadata
if (month ~= cfg.date_names['en'].season['Winter']) and (month ~= cfg.date_names['en'].season['Summer']) then
return false; -- not Summer or Winter; abandon
end
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['My-My'][1]) then -- month/season year - month/season year; separated by spaced endash
month, year, month2, anchor_year, year2 = mw.ustring.match(date_string, patterns['My-My'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
if 0 ~= get_month_number(month) and 0 ~= get_month_number(month2) and is_valid_month_range_style(month, month2) then -- both must be month year, same month style
month = get_month_number(month);
month2 = get_month_number(month2);
elseif 0 ~= get_season_number(month, param) and 0 ~= get_season_number(month2, param) then -- both must be season year, not mixed
month = get_season_number(month, param);
month2 = get_season_number(month2, param);
else
return false;
end
elseif mw.ustring.match(date_string, patterns['M-My'][1]) then -- month/season range year; months separated by endash
month, month2, anchor_year, year = mw.ustring.match(date_string, patterns['M-My'][1]);
if (not is_valid_month_season_range(month, month2, param)) or (not is_valid_year(year)) then return false; end
if 0 ~= get_month_number(month) then -- determined to be a valid range so just check this one to know if month or season
month = get_month_number(month);
month2 = get_month_number(month2);
if 0 == month or 0 == month2 then return false; end
else
month = get_season_number(month, param);
month2 = get_season_number(month2, param);
end
year2 = year;
elseif mw.ustring.match(date_string, patterns['My'][1]) then -- month/season/quarter/proper-name year
month, anchor_year, year = mw.ustring.match(date_string, patterns['My'][1]);
if not is_valid_year(year) then return false; end
month = get_element_number(month, param); -- get month season quarter proper-name number or nil
if not month then return false; end -- not valid whatever it is
elseif mw.ustring.match(date_string, patterns['y-y'][1]) then -- Year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
year, anchor_year, year2 = mw.ustring.match(date_string, patterns['y-y'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['y4-y2'][1]) then -- Year range: YYYY–YY; separated by unspaced endash
local century;
year, century, anchor_year, year2 = mw.ustring.match(date_string, patterns['y4-y2'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor year from both years
if 13 > tonumber(year2) then return false; end -- don't allow 2003-05 which might be May 2003
year2 = century .. year2; -- add the century to year2 for comparisons
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
if in_array (param, {'date', 'publication-date', 'year'}) then -- here when 'valid' abbreviated year range; if one of these parameters
add_prop_cat ('year-range-abbreviated'); -- add properties cat
end
elseif mw.ustring.match(date_string, patterns['y'][1]) then -- year; here accept either YYY or YYYY
anchor_year, year = mw.ustring.match(date_string, patterns['y'][1]);
if false == is_valid_year(year) then
return false;
end
else
return false; -- date format not one of the MOS:DATE approved formats
end
if param ~= 'date' then -- CITEREF disambiguation only allowed in |date=; |year= & |publication-date= promote to date
if anchor_year:match ('%l$') then
return false;
end
end
if 'access-date' == param then -- test access-date here because we have numerical date parts
if 0 ~= year and 0 ~= month and 0 ~= day and -- all parts of a single date required
0 == year2 and 0 == month2 and 0 == day2 then -- none of these; access-date must not be a range
if not is_valid_accessdate(year .. '-' .. month .. '-' .. day) then
return false; -- return false when access-date out of bounds
end
else
return false; -- return false when access-date is a range of two dates
end
end
if 'archive-date' == param then -- test archive-date here because we have numerical date parts
if not (0 ~= year and 0 ~= month and 0 ~= day and -- all parts of a single date required
0 == year2 and 0 == month2 and 0 == day2) then -- none of these; archive-date must not be a range
return false; -- return false when archive-date is a range of two dates
end
end
local result=true; -- check whole dates for validity; assume true because not all dates will go through this test
if 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 == day2 then -- YMD (simple whole date)
result = is_valid_date (year, month, day, param); -- <param> for |pmc-embargo-date=
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 ~= day2 then -- YMD-d (day range)
result = is_valid_date (year, month, day);
result = result and is_valid_date (year, month, day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-md (day month range)
result = is_valid_date (year, month, day);
result = result and is_valid_date (year, month2, day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 ~= year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-ymd (day month year range)
result = is_valid_date(year, month, day);
result = result and is_valid_date(year2, month2, day2);
end
if false == result then return false; end
if nil ~= tCOinS_date then -- this table only passed into this function when testing |date= parameter values
make_COinS_date ({year = year, month = month, day = day, year2 = year2, month2 = month2, day2 = day2}, tCOinS_date); -- make an ISO 8601 date string for COinS
end
return true, anchor_year; -- format is good and date string represents a real date
end
--[[--------------------------< D A T E S >--------------------------------------------------------------------
Cycle the date-holding parameters in passed table date_parameters_list through check_date() to check compliance with MOS:DATE. For all valid dates, check_date() returns
true. The |date= parameter test is unique, it is the only date holding parameter from which values for anchor_year (used in CITEREF identifiers) and COinS_date (used in
the COinS metadata) are derived. The |date= parameter is the only date-holding parameter that is allowed to contain the no-date keywords "n.d." or "nd" (without quotes).
Unlike most error messages created in this module, only one error message is created by this function. Because all of the date holding parameters are processed serially,
parameters with errors are added to the <error_list> sequence table as the dates are tested.
]]
local function dates(date_parameters_list, tCOinS_date, error_list)
local anchor_year; -- will return as nil if the date being tested is not |date=
local COinS_date; -- will return as nil if the date being tested is not |date=
local embargo_date; -- if embargo date is a good dmy, mdy, ymd date then holds original value else reset to 9999
local good_date = false;
for k, v in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(v.val) then -- if the parameter has a value
v.val = mw.ustring.gsub(v.val, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
if v.val:match("^c%. [1-9]%d%d%d?%a?$") then -- special case for c. year or with or without CITEREF disambiguator - only |date= and |year=
local year = v.val:match("c%. ([1-9]%d%d%d?)%a?"); -- get the year portion so it can be tested
if 'date' == k then
anchor_year, COinS_date = v.val:match("((c%. [1-9]%d%d%d?)%a?)"); -- anchor year and COinS_date only from |date= parameter
good_date = is_valid_year(year);
elseif 'year' == k then
good_date = is_valid_year(year);
end
elseif 'date' == k then -- if the parameter is |date=
if v.val:match("^n%.d%.%a?$") then -- ToDo: I18N -- if |date=n.d. with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((n%.d%.)%a?)"); -- ToDo: I18N -- "n.d."; no error when date parameter is set to no date
elseif v.val:match("^nd%a?$") then -- ToDo: I18N -- if |date=nd with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((nd)%a?)"); -- ToDo: I18N -- "nd"; no error when date parameter is set to no date
else
good_date, anchor_year, COinS_date = check_date (v.val, k, tCOinS_date); -- go test the date
end
elseif 'year' == k then -- if the parameter is |year= it should hold only a year value
if v.val:match("^[1-9]%d%d%d?%a?$") then -- if |year = 3 or 4 digits only with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((%d+)%a?)");
end
elseif 'pmc-embargo-date' == k then -- if the parameter is |pmc-embargo-date=
good_date = check_date (v.val, k); -- go test the date
if true == good_date then -- if the date is a valid date
good_date, embargo_date = is_valid_embargo_date (v.val); -- is |pmc-embargo-date= date a single dmy, mdy, or ymd formatted date? yes: returns embargo date; no: returns 9999
end
else -- any other date-holding parameter
good_date = check_date (v.val, k); -- go test the date
end
if false == good_date then -- assemble one error message so we don't add the tracking category multiple times
table.insert (error_list, wrap_style ('parameter', v.name)); -- make parameter name suitable for error message list
end
end
end
return anchor_year, embargo_date; -- and done
end
--[[--------------------------< Y E A R _ D A T E _ C H E C K >------------------------------------------------
Compare the value provided in |year= with the year value(s) provided in |date=. This function sets a local numeric value:
0 - year value does not match the year value in date
1 - (default) year value matches the year value in date or one of the year values when date contains two years
2 - year value matches the year value in date when date is in the form YYYY-MM-DD and year is disambiguated (|year=YYYYx)
the numeric value in <result> determines the 'output' if any from this function:
0 – adds error message to error_list sequence table
1 – adds maint cat
2 – does nothing
]]
local function year_date_check (year_string, year_origin, date_string, date_origin, error_list)
local year;
local date1;
local date2;
local result = 1; -- result of the test; assume that the test passes
year = year_string:match ('(%d%d%d%d?)');
if date_string:match ('%d%d%d%d%-%d%d%-%d%d') and year_string:match ('%d%d%d%d%a') then --special case where both date and year are required YYYY-MM-DD and YYYYx
date1 = date_string:match ('(%d%d%d%d)');
year = year_string:match ('(%d%d%d%d)');
if year ~= date1 then
result = 0; -- years don't match
else
result = 2; -- years match; but because disambiguated, don't add to maint cat
end
elseif date_string:match ("%d%d%d%d?.-%d%d%d%d?") then -- any of the standard range formats of date with two three- or four-digit years
date1, date2 = date_string:match ("(%d%d%d%d?).-(%d%d%d%d?)");
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif mw.ustring.match(date_string, "%d%d%d%d[%-–]%d%d") then -- YYYY-YY date ranges
local century;
date1, century, date2 = mw.ustring.match(date_string, "((%d%d)%d%d)[%-–]+(%d%d)");
date2 = century..date2; -- convert YY to YYYY
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif date_string:match ("%d%d%d%d?") then -- any of the standard formats of date with one year
date1 = date_string:match ("(%d%d%d%d?)");
if year ~= date1 then
result = 0;
end
else -- should never get here; this function called only when no other date errors
result = 0; -- no recognizable year in date
end
if 0 == result then -- year / date mismatch
table.insert (error_list, substitute (cfg.messages['mismatch'], {year_origin, date_origin})); -- add error message to error_list sequence table
elseif 1 == result then -- redundant year / date
set_message ('maint_date_year'); -- add a maint cat
end
end
--[[--------------------------< R E F O R M A T T E R >--------------------------------------------------------
reformat 'date' into new format specified by format_param if pattern_idx (the current format of 'date') can be
reformatted. Does the grunt work for reformat_dates().
The table re_formats maps pattern_idx (current format) and format_param (desired format) to a table that holds:
format string used by string.format()
identifier letters ('d', 'm', 'y', 'd2', 'm2', 'y2') that serve as indexes into a table t{} that holds captures
from mw.ustring.match() for the various date parts specified by patterns[pattern_idx][1]
Items in patterns{} have the general form:
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'}, where:
['ymd'] is pattern_idx
patterns['ymd'][1] is the match pattern with captures for mw.ustring.match()
patterns['ymd'][2] is an indicator letter identifying the content of the first capture
patterns['ymd'][3] ... the second capture etc.
when a pattern matches a date, the captures are loaded into table t{} in capture order using the idemtifier
characters as indexes into t{} For the above, a ymd date is in t{} as:
t.y = first capture (year), t.m = second capture (month), t.d = third capture (day)
To reformat, this function is called with the pattern_idx that matches the current format of the date and with
format_param set to the desired format. This function loads table t{} as described and then calls string.format()
with the format string specified by re_format[pattern_idx][format_param][1] using values taken from t{} according
to the capture identifier letters specified by patterns[pattern_idx][format_param][n] where n is 2..
]]
local re_formats = {
['ymd'] = { -- date format is ymd; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Mdy'] = { -- date format is Mdy; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['dMy'] = { -- date format is dMy; reformat to:
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Md-dy'] = { -- date format is Md-dy; reformat to:
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- |df=dmy -> d-dMy
},
['d-dMy'] = { -- date format is d-d>y; reformat to:
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- |df=mdy -> Md-dy
},
['dM-dMy'] = { -- date format is dM-dMy; reformat to:
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- |df=mdy -> Md-Mdy
},
['Md-Mdy'] = { -- date format is Md-Mdy; reformat to:
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- |df=dmy -> dM-dMy
},
['dMy-dMy'] = { -- date format is dMy-dMy; reformat to:
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- |df=mdy -> Mdy-Mdy
},
['Mdy-Mdy'] = { -- date format is Mdy-Mdy; reformat to:
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- for long/short reformatting
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- |df=dmy -> dMy-dMy
},
['My-My'] = { -- these for long/short reformatting
['any'] = {'%s %s – %s %s', 'm', 'y', 'm2', 'y2'}, -- dmy/mdy agnostic
},
['M-My'] = { -- these for long/short reformatting
['any'] = {'%s–%s %s', 'm', 'm2', 'y'}, -- dmy/mdy agnostic
},
['My'] = { -- these for long/short reformatting
['any'] = {'%s %s', 'm', 'y'}, -- dmy/mdy agnostic
},
-- ['yMd'] = { -- not supported at en.wiki
-- ['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
-- ['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- },
}
local function reformatter (date, pattern_idx, format_param, mon_len)
if not in_array (pattern_idx, {'ymd', 'Mdy', 'Md-dy', 'dMy', 'yMd', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- not in this set of date format patterns then not a reformattable date
end
if 'ymd' == format_param and in_array (pattern_idx, {'ymd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- ymd date ranges not supported at en.wiki; no point in reformatting ymd to ymd
end
if in_array (pattern_idx, {'My', 'M-My', 'My-My'}) then -- these are not dmy/mdy so can't be 'reformatted' into either
format_param = 'any'; -- so format-agnostic
end
-- yMd is not supported at en.wiki; when yMd is supported at your wiki, uncomment the next line
-- if 'yMd' == format_param and in_array (pattern_idx, {'yMd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy'}) then -- these formats not convertable; yMd not supported at en.wiki
if 'yMd' == format_param then -- yMd not supported at en.wiki; when yMd is supported at your wiki, remove or comment-out this line
return; -- not a reformattable date
end
local c1, c2, c3, c4, c5, c6, c7; -- these hold the captures specified in patterns[pattern_idx][1]
c1, c2, c3, c4, c5, c6, c7 = mw.ustring.match (date, patterns[pattern_idx][1]); -- get the captures
local t = { -- table that holds k/v pairs of date parts from the captures and patterns[pattern_idx][2..]
[patterns[pattern_idx][2]] = c1; -- at minimum there is always one capture with a matching indicator letter
[patterns[pattern_idx][3] or 'x'] = c2; -- patterns can have a variable number of captures; each capture requires an indicator letter;
[patterns[pattern_idx][4] or 'x'] = c3; -- where there is no capture, there is no indicator letter so n in patterns[pattern_idx][n] will be nil;
[patterns[pattern_idx][5] or 'x'] = c4; -- the 'x' here spoofs an indicator letter to prevent 'table index is nil' error
[patterns[pattern_idx][6] or 'x'] = c5;
[patterns[pattern_idx][7] or 'x'] = c6;
[patterns[pattern_idx][8] or 'x'] = c7;
};
if t.a then -- if this date has an anchor year capture (all convertable date formats except ymd)
if t.y2 then -- for year range date formats
t.y2 = t.a; -- use the anchor year capture when reassembling the date
else -- here for single date formats (except ymd)
t.y = t.a; -- use the anchor year capture when reassembling the date
end
end
if tonumber(t.m) then -- if raw month is a number (converting from ymd)
if 's' == mon_len then -- if we are to use abbreviated month names
t.m = cfg.date_names['inv_local_short'][tonumber(t.m)]; -- convert it to a month name
else
t.m = cfg.date_names['inv_local_long'][tonumber(t.m)]; -- convert it to a month name
end
t.d = t.d:gsub ('0(%d)', '%1'); -- strip leading '0' from day if present
elseif 'ymd' == format_param then -- when converting to ymd
t.y = t.y:gsub ('%a', ''); -- strip CITREF disambiguator if present; anchor year already known so process can proceed; TODO: maint message?
if 1582 > tonumber (t.y) then -- ymd format dates not allowed before 1582
return;
end
t.m = string.format ('%02d', get_month_number (t.m)); -- make sure that month and day are two digits
t.d = string.format ('%02d', t.d);
elseif mon_len then -- if mon_len is set to either 'short' or 'long'
for _, mon in ipairs ({'m', 'm2'}) do -- because there can be two month names, check both
if t[mon] then
t[mon] = get_month_number (t[mon]); -- get the month number for this month (is length agnostic)
if 0 == t[mon] then return; end -- seasons and named dates can't be converted
t[mon] = (('s' == mon_len) and cfg.date_names['inv_local_short'][t[mon]]) or cfg.date_names['inv_local_long'][t[mon]]; -- fetch month name according to length
end
end
end
local new_date = string.format (re_formats[pattern_idx][format_param][1], -- format string
t[re_formats[pattern_idx][format_param][2]], -- named captures from t{}
t[re_formats[pattern_idx][format_param][3]],
t[re_formats[pattern_idx][format_param][4]],
t[re_formats[pattern_idx][format_param][5]],
t[re_formats[pattern_idx][format_param][6]],
t[re_formats[pattern_idx][format_param][7]],
t[re_formats[pattern_idx][format_param][8]]
);
return new_date;
end
--[[-------------------------< R E F O R M A T _ D A T E S >--------------------------------------------------
Reformats existing dates into the format specified by format.
format is one of several manual keywords: dmy, dmy-all, mdy, mdy-all, ymd, ymd-all. The -all version includes
access- and archive-dates; otherwise these dates are not reformatted.
This function allows automatic date formatting. In ~/Configuration, the article source is searched for one of
the {{use xxx dates}} templates. If found, xxx becomes the global date format as xxx-all. If |cs1-dates= in
{{use xxx dates}} has legitimate value then that value determines how cs1|2 dates will be rendered. Legitimate
values for |cs1-dates= are:
l - all dates are rendered with long month names
ls - publication dates use long month names; access-/archive-dates use abbreviated month names
ly - publication dates use long month names; access-/archive-dates rendered in ymd format
s - all dates are rendered with abbreviated (short) month names
sy - publication dates use abbreviated month names; access-/archive-dates rendered in ymd format
y - all dates are rendered in ymd format
the format argument for automatic date formatting will be the format specified by {{use xxx dates}} with the
value supplied by |cs1-dates so one of: xxx-l, xxx-ls, xxx-ly, xxx-s, xxx-sy, xxx-y, or simply xxx (|cs1-dates=
empty, omitted, or invalid) where xxx shall be either of dmy or mdy.
dates are extracted from date_parameters_list, reformatted (if appropriate), and then written back into the
list in the new format. Dates in date_parameters_list are presumed here to be valid (no errors). This function
returns true when a date has been reformatted, false else. Actual reformatting is done by reformatter().
]]
local function reformat_dates (date_parameters_list, format)
local all = false; -- set to false to skip access- and archive-dates
local len_p = 'l'; -- default publication date length shall be long
local len_a = 'l'; -- default access-/archive-date length shall be long
local result = false;
local new_date;
if format:match('%a+%-all') then -- manual df keyword; auto df keyword when length not specified in {{use xxx dates}};
format = format:match('(%a+)%-all'); -- extract the format
all = true; -- all dates are long format dates because this keyword doesn't specify length
elseif format:match('%a+%-[lsy][sy]?') then -- auto df keywords; internal only
all = true; -- auto df applies to all dates; use length specified by capture len_p for all dates
format, len_p, len_a = format:match('(%a+)%-([lsy])([sy]?)'); -- extract the format and length keywords
if 'y' == len_p then -- because allowed by MOS:DATEUNIFY (sort of) range dates and My dates not reformatted
format = 'ymd'; -- override {{use xxx dates}}
elseif (not is_set(len_a)) or (len_p == len_a) then -- no access-/archive-date length specified or same length as publication dates then
len_a = len_p; -- in case len_a not set
end
end -- else only publication dates and they are long
for param_name, param_val in pairs (date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) then -- if the parameter has a value
if not (not all and in_array (param_name, {'access-date', 'archive-date'})) then -- skip access- or archive-date unless format is xxx-all; yeah, ugly; TODO: find a better way
for pattern_idx, pattern in pairs (patterns) do
if mw.ustring.match (param_val.val, pattern[1]) then
if all and in_array (param_name, {'access-date', 'archive-date'}) then -- if this date is an access- or archive-date
new_date = reformatter (param_val.val, pattern_idx, (('y' == len_a) and 'ymd') or format, len_a); -- choose ymd or dmy/mdy according to len_a setting
else -- all other dates
new_date = reformatter (param_val.val, pattern_idx, format, len_p);
end
if new_date then -- set when date was reformatted
date_parameters_list[param_name].val = new_date; -- update date in date list
result = true; -- and announce that changes have been made
break;
end
end -- if
end -- for
end -- if
end -- if
end -- for
return result; -- declare boolean result and done
end
--[[--------------------------< D A T E _ H Y P H E N _ T O _ D A S H >----------------------------------------
Loops through the list of date-holding parameters and converts any hyphen to an ndash. Not called if the cs1|2
template has any date errors.
Modifies the date_parameters_list and returns true if hyphens are replaced, else returns false.
]]
local function date_hyphen_to_dash (date_parameters_list)
local result = false;
local n;
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) and
not mw.ustring.match (param_val.val, patterns.ymd[1]) then -- for those that are not ymd dates (ustring because here digits may not be Western)
param_val.val, n = param_val.val:gsub ('%-', '–'); -- replace any hyphen with ndash
if 0 ~= n then
date_parameters_list[param_name].val = param_val.val; -- update the list
result = true;
end
end
end
return result; -- so we know if any hyphens were replaced
end
--[[-------------------------< D A T E _ N A M E _ X L A T E >------------------------------------------------
Attempts to translate English date names to local-language date names using names supplied by MediaWiki's
date parser function. This is simple name-for-name replacement and may not work for all languages.
if xlat_dig is true, this function will also translate Western (English) digits to the local language's digits.
This will also translate ymd dates.
]]
local function date_name_xlate (date_parameters_list, xlt_dig)
local xlate;
local mode; -- long or short month names
local modified = false;
local date;
local sources_t = {
{cfg.date_names.en.long, cfg.date_names.inv_local_long}, -- for translating long English month names to long local month names
{cfg.date_names.en.short, cfg.date_names.inv_local_short}, -- short month names
{cfg.date_names.en.quarter, cfg.date_names.inv_local_quarter}, -- quarter date names
{cfg.date_names.en.season, cfg.date_names.inv_local_season}, -- season date nam
{cfg.date_names.en.named, cfg.date_names.inv_local_named}, -- named dates
}
local function is_xlateable (month) -- local function to get local date name that replaces existing English-language date name
for _, date_names_t in ipairs (sources_t) do -- for each sequence table in date_names_t
if date_names_t[1][month] then -- if date name is English month (long or short), quarter, season or named and
if date_names_t[2][date_names_t[1][month]] then -- if there is a matching local date name
return date_names_t[2][date_names_t[1][month]]; -- return the local date name
end
end
end
end
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(param_val.val) then -- if the parameter has a value
date = param_val.val;
for month in mw.ustring.gmatch (date, '[%a ]+') do -- iterate through all date names in the date (single date or date range)
month = mw.text.trim (month); -- this because quarterly dates contain whitespace
xlate = is_xlateable (month); -- get translate <month>; returns translation or nil
if xlate then
date = mw.ustring.gsub (date, month, xlate); -- replace the English with the translation
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
if xlt_dig then -- shall we also translate digits?
date = date:gsub ('%d', cfg.date_names.xlate_digits); -- translate digits from Western to 'local digits'
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
end
return modified;
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
add_prop_cat = utilities_page_ptr.add_prop_cat ; -- import functions from selected Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
set_message = utilities_page_ptr.set_message;
substitute = utilities_page_ptr.substitute;
wrap_style = utilities_page_ptr.wrap_style;
cfg = cfg_table_ptr; -- import tables from selected Module:Citation/CS1/Configuration
end
--[[--------------------------< A R C H I V E _ D A T E _ C H E C K >------------------------------------------
Compare value in |archive-date= with the timestamp in Wayback machine urls. Emits an error message when |archive-date=
does not match the timestamp.
]]
local function archive_date_check (archive_date, archive_url_timestamp)
local good, archive_date_ts = pcall (lang_object.formatDate, lang_object, 'Ymd', archive_date); -- |archive-date= value to YYYYMMDD format
-- local archive_date_ts = lang_object:formatDate ('Ymd', archive_date); -- |archive-date= value to YYYYMMDD format
if good then
if not archive_url_timestamp:find (archive_date_ts, 1, true) then -- plain text find; begin search at position 1
set_message ('err_archive_date_url_ts_mismatch'); -- emit an error message
end
end
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return { -- return exported functions
archive_date_check = archive_date_check,
date_hyphen_to_dash = date_hyphen_to_dash,
date_name_xlate = date_name_xlate,
dates = dates,
reformat_dates = reformat_dates,
set_selected_modules = set_selected_modules,
year_date_check = year_date_check,
}
91dea3f3d4d1691cec7700aac0057c873554b8c1
Module:Citation/CS1/Identifiers
828
163
427
426
2023-10-17T20:36:16Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/Identifiers]]
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local has_accept_as_written, is_set, in_array, set_message, select_one, -- functions in Module:Citation/CS1/Utilities
substitute, make_wikilink;
local z; -- table of tables defined in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< P A G E S C O P E V A R I A B L E S >--------------------------------------
declare variables here that have page-wide scope that are not brought in from other modules; that are created here and used here
]]
local auto_link_urls = {}; -- holds identifier URLs for those identifiers that can auto-link |title=
--============================<< H E L P E R F U N C T I O N S >>============================================
--[[--------------------------< W I K I D A T A _ A R T I C L E _ N A M E _ G E T >----------------------------
as an aid to internationalizing identifier-label wikilinks, gets identifier article names from Wikidata.
returns :<lang code>:<article title> when <q> has an <article title> for <lang code>; nil else
for identifiers that do not have q, returns nil
for wikis that do not have mw.wikibase installed, returns nil
]]
local function wikidata_article_name_get (q)
if not is_set (q) or (q and not mw.wikibase) then -- when no q number or when a q number but mw.wikibase not installed on this wiki
return nil; -- abandon
end
local wd_article;
local this_wiki_code = cfg.this_wiki_code; -- Wikipedia subdomain; 'en' for en.wikipedia.org
wd_article = mw.wikibase.getSitelink (q, this_wiki_code .. 'wiki'); -- fetch article title from WD; nil when no title available at this wiki
if wd_article then
wd_article = table.concat ({':', this_wiki_code, ':', wd_article}); -- interwiki-style link without brackets if taken from WD; leading colon required
end
return wd_article; -- article title from WD; nil else
end
--[[--------------------------< L I N K _ L A B E L _ M A K E >------------------------------------------------
common function to create identifier link label from handler table or from Wikidata
returns the first available of
1. redirect from local wiki's handler table (if enabled)
2. Wikidata (if there is a Wikidata entry for this identifier in the local wiki's language)
3. label specified in the local wiki's handler table
]]
local function link_label_make (handler)
local wd_article;
if not (cfg.use_identifier_redirects and is_set (handler.redirect)) then -- redirect has priority so if enabled and available don't fetch from Wikidata because expensive
wd_article = wikidata_article_name_get (handler.q); -- if Wikidata has an article title for this wiki, get it;
end
return (cfg.use_identifier_redirects and is_set (handler.redirect) and handler.redirect) or wd_article or handler.link;
end
--[[--------------------------< E X T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki-style external link
]]
local function external_link_id (options)
local url_string = options.id;
local ext_link;
local this_wiki_code = cfg.this_wiki_code; -- Wikipedia subdomain; 'en' for en.wikipedia.org
local wd_article; -- article title from Wikidata
if options.encode == true or options.encode == nil then
url_string = mw.uri.encode (url_string, 'PATH');
end
if options.auto_link and is_set (options.access) then
auto_link_urls[options.auto_link] = table.concat ({options.prefix, url_string, options.suffix});
end
ext_link = mw.ustring.format ('[%s%s%s %s]', options.prefix, url_string, options.suffix or "", mw.text.nowiki (options.id));
if is_set (options.access) then
ext_link = substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[options.access].class, cfg.presentation[options.access].title, ext_link}); -- add the free-to-read / paywall lock
end
return table.concat ({
make_wikilink (link_label_make (options), options.label), -- redirect, Wikidata link, or locally specified link (in that order)
options.separator or ' ',
ext_link
});
end
--[[--------------------------< I N T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki-style internal link
TODO: Does not currently need to support options.access, options.encode, auto-linking and COinS (as in external_link_id),
but may be needed in the future for :m:Interwiki_map custom-prefixes like :arxiv:, :bibcode:, :DOI:, :hdl:, :ISSN:,
:JSTOR:, :Openlibrary:, :PMID:, :RFC:.
]]
local function internal_link_id (options)
local id = mw.ustring.gsub (options.id, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
return table.concat (
{
make_wikilink (link_label_make (options), options.label), -- wiki-link the identifier label
options.separator or ' ', -- add the separator
make_wikilink (
table.concat (
{
options.prefix,
id, -- translated to Western digits
options.suffix or ''
}),
substitute (cfg.presentation['bdi'], {'', mw.text.nowiki (options.id)}) -- bdi tags to prevent Latin script identifiers from being reversed at RTL language wikis
); -- nowiki because MediaWiki still has magic links for ISBN and the like; TODO: is it really required?
});
end
--[[--------------------------< I S _ E M B A R G O E D >------------------------------------------------------
Determines if a PMC identifier's online version is embargoed. Compares the date in |pmc-embargo-date= against
today's date. If embargo date is in the future, returns the content of |pmc-embargo-date=; otherwise, returns
an empty string because the embargo has expired or because |pmc-embargo-date= was not set in this cite.
]]
local function is_embargoed (embargo)
if is_set (embargo) then
local lang = mw.getContentLanguage();
local good1, embargo_date, todays_date;
good1, embargo_date = pcall (lang.formatDate, lang, 'U', embargo);
todays_date = lang:formatDate ('U');
if good1 then -- if embargo date is a good date
if tonumber (embargo_date) >= tonumber (todays_date) then -- is embargo date is in the future?
return embargo; -- still embargoed
else
set_message ('maint_pmc_embargo'); -- embargo has expired; add main cat
return ''; -- unset because embargo has expired
end
end
end
return ''; -- |pmc-embargo-date= not set return empty string
end
--[=[-------------------------< I S _ V A L I D _ R X I V _ D A T E >------------------------------------------
for biorxiv, returns true if:
2019-12-11T00:00Z <= biorxiv_date < today + 2 days
for medrxiv, returns true if:
2020-01-01T00:00Z <= medrxiv_date < today + 2 days
The dated form of biorxiv identifier has a start date of 2019-12-11. The Unix timestamp for that date is {{#time:U|2019-12-11}} = 1576022400
The medrxiv identifier has a start date of 2020-01-01. The Unix timestamp for that date is {{#time:U|2020-01-01}} = 1577836800
<rxiv_date> is the date provided in those |biorxiv= parameter values that are dated and in |medrxiv= parameter values at time 00:00:00 UTC
<today> is the current date at time 00:00:00 UTC plus 48 hours
if today's date is 2023-01-01T00:00:00 then
adding 24 hours gives 2023-01-02T00:00:00 – one second more than today
adding 24 hours gives 2023-01-03T00:00:00 – one second more than tomorrow
inputs:
<y>, <m>, <d> – year, month, day parts of the date from the birxiv or medrxiv identifier
<select> 'b' for biorxiv, 'm' for medrxiv; defaults to 'b'
]=]
local function is_valid_rxiv_date (y, m, d, select)
if 0 == tonumber (m) and 12 < tonumber (m) then -- <m> must be a number 1–12
return false;
end
if 0 == tonumber (d) and 31 < tonumber (d) then -- <d> must be a number 1–31; TODO: account for month length and leap yer?
return false;
end
local rxiv_date = table.concat ({y, m, d}, '-'); -- make ymd date string
local good1, good2;
local rxiv_ts, tomorrow_ts; -- to hold Unix timestamps representing the dates
local lang_object = mw.getContentLanguage();
good1, rxiv_ts = pcall (lang_object.formatDate, lang_object, 'U', rxiv_date); -- convert rxiv_date value to Unix timestamp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which tonumber() may not understand
rxiv_ts = tonumber (rxiv_ts) or lang_object:parseFormattedNumber (rxiv_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to Unix timestamp
end
local limit_ts = ((select and ('m' == select)) and 1577836800) or 1576022400; -- choose the appropriate limit timesatmp
return ((limit_ts <= rxiv_ts) and (rxiv_ts < tomorrow_ts)) -- limit_ts <= rxiv_date < tomorrow's date
end
--[[--------------------------< IS _ V A L I D _ I S X N >-----------------------------------------------------
ISBN-10 and ISSN validator code calculates checksum across all ISBN/ISSN digits including the check digit.
ISBN-13 is checked in isbn().
If the number is valid the result will be 0. Before calling this function, ISBN/ISSN must be checked for length
and stripped of dashes, spaces and other non-ISxN characters.
]]
local function is_valid_isxn (isxn_str, len)
local temp = 0;
isxn_str = { isxn_str:byte(1, len) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39, 'X' → 0x58
len = len + 1; -- adjust to be a loop counter
for i, v in ipairs (isxn_str) do -- loop through all of the bytes and calculate the checksum
if v == string.byte ("X" ) then -- if checkdigit is X (compares the byte value of 'X' which is 0x58)
temp = temp + 10 * (len - i); -- it represents 10 decimal
else
temp = temp + tonumber (string.char (v) )*(len-i);
end
end
return temp % 11 == 0; -- returns true if calculation result is zero
end
--[[--------------------------< IS _ V A L I D _ I S X N _ 1 3 >-----------------------------------------------
ISBN-13 and ISMN validator code calculates checksum across all 13 ISBN/ISMN digits including the check digit.
If the number is valid, the result will be 0. Before calling this function, ISBN-13/ISMN must be checked for length
and stripped of dashes, spaces and other non-ISxN-13 characters.
]]
local function is_valid_isxn_13 (isxn_str)
local temp=0;
isxn_str = { isxn_str:byte(1, 13) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39
for i, v in ipairs (isxn_str) do
temp = temp + (3 - 2*(i % 2)) * tonumber (string.char (v) ); -- multiply odd index digits by 1, even index digits by 3 and sum; includes check digit
end
return temp % 10 == 0; -- sum modulo 10 is zero when ISBN-13/ISMN is correct
end
--[[--------------------------< N O R M A L I Z E _ L C C N >--------------------------------------------------
LCCN normalization (https://www.loc.gov/marc/lccn-namespace.html#normalization)
1. Remove all blanks.
2. If there is a forward slash (/) in the string, remove it, and remove all characters to the right of the forward slash.
3. If there is a hyphen in the string:
a. Remove it.
b. Inspect the substring following (to the right of) the (removed) hyphen. Then (and assuming that steps 1 and 2 have been carried out):
1. All these characters should be digits, and there should be six or less. (not done in this function)
2. If the length of the substring is less than 6, left-fill the substring with zeroes until the length is six.
Returns a normalized LCCN for lccn() to validate. There is no error checking (step 3.b.1) performed in this function.
]]
local function normalize_lccn (lccn)
lccn = lccn:gsub ("%s", ""); -- 1. strip whitespace
if nil ~= string.find (lccn, '/') then
lccn = lccn:match ("(.-)/"); -- 2. remove forward slash and all character to the right of it
end
local prefix
local suffix
prefix, suffix = lccn:match ("(.+)%-(.+)"); -- 3.a remove hyphen by splitting the string into prefix and suffix
if nil ~= suffix then -- if there was a hyphen
suffix = string.rep("0", 6-string.len (suffix)) .. suffix; -- 3.b.2 left fill the suffix with 0s if suffix length less than 6
lccn = prefix..suffix; -- reassemble the LCCN
end
return lccn;
end
--============================<< I D E N T I F I E R F U N C T I O N S >>====================================
--[[--------------------------< A R X I V >--------------------------------------------------------------------
See: https://arxiv.org/help/arxiv_identifier
format and error check arXiv identifier. There are three valid forms of the identifier:
the first form, valid only between date codes 9107 and 0703, is:
arXiv:<archive>.<class>/<date code><number><version>
where:
<archive> is a string of alpha characters - may be hyphenated; no other punctuation
<class> is a string of alpha characters - may be hyphenated; no other punctuation; not the same as |class= parameter which is not supported in this form
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
first digit of YY for this form can only 9 and 0
<number> is a three-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces (undocumented)
the second form, valid from April 2007 through December 2014 is:
arXiv:<date code>.<number><version>
where:
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
<number> is a four-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces
the third form, valid from January 2015 is:
arXiv:<date code>.<number><version>
where:
<date code> and <version> are as defined for 0704-1412
<number> is a five-digit number
]]
local function arxiv (options)
local id = options.id;
local class = options.Class; -- TODO: lowercase?
local handler = options.handler;
local year, month, version;
local err_msg = false; -- assume no error message
local text; -- output text
if id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%d$") or id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%dv%d+$") then -- test for the 9107-0703 format with or without version
year, month = id:match("^%a[%a%.%-]+/([90]%d)([01]%d)%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((not (90 < year or 8 > year)) or (1 > month or 12 < month)) or -- if invalid year or invalid month
((91 == year and 7 > month) or (7 == year and 3 < month)) then -- if years ok, are starting and ending months ok?
err_msg = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%dv%d+$") then -- test for the 0704-1412 with or without version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((7 > year) or (14 < year) or (1 > month or 12 < month)) or -- is year invalid or is month invalid? (doesn't test for future years)
((7 == year) and (4 > month)) then -- when year is 07, is month invalid (before April)?
err_msg = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%d%dv%d+$") then -- test for the 1501- format with or without version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((15 > year) or (1 > month or 12 < month)) then -- is year invalid or is month invalid? (doesn't test for future years)
err_msg = true; -- flag for error message
end
else
err_msg = true; -- not a recognized format; flag for error message
end
if err_msg then
options.coins_list_t['ARXIV'] = nil; -- when error, unset so not included in COinS
end
local err_msg_t = {};
if err_msg then
set_message ('err_bad_arxiv');
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access});
if is_set (class) then
if id:match ('^%d+') then
text = table.concat ({text, ' [[https://arxiv.org/archive/', class, ' ', class, ']]'}); -- external link within square brackets, not wikilink
else
set_message ('err_class_ignored');
end
end
return text;
end
--[[--------------------------< B I B C O D E >--------------------------------------------------------------------
Validates (sort of) and formats a bibcode ID.
Format for bibcodes is specified here: https://adsabs.harvard.edu/abs_doc/help_pages/data.html#bibcodes
But, this: 2015arXiv151206696F is apparently valid so apparently, the only things that really matter are length, 19 characters
and first four digits must be a year. This function makes these tests:
length must be 19 characters
characters in position
1–4 must be digits and must represent a year in the range of 1000 – next year
5 must be a letter
6–8 must be letter, digit, ampersand, or dot (ampersand cannot directly precede a dot; &. )
9–18 must be letter, digit, or dot
19 must be a letter or dot
]]
local function bibcode (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local ignore_invalid = options.accept;
local err_type;
local err_msg = '';
local year;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode,
access = access});
if 19 ~= id:len() then
err_type = cfg.err_msg_supl.length;
else
year = id:match ("^(%d%d%d%d)[%a][%w&%.][%w&%.][%w&%.][%w.]+[%a%.]$");
if not year then -- if nil then no pattern match
err_type = cfg.err_msg_supl.value; -- so value error
else
local next_year = tonumber (os.date ('%Y')) + 1; -- get the current year as a number and add one for next year
year = tonumber (year); -- convert year portion of bibcode to a number
if (1000 > year) or (year > next_year) then
err_type = cfg.err_msg_supl.year; -- year out of bounds
end
if id:find('&%.') then
err_type = cfg.err_msg_supl.journal; -- journal abbreviation must not have '&.' (if it does it's missing a letter)
end
if id:match ('.........%.tmp%.') then -- temporary bibcodes when positions 10–14 are '.tmp.'
set_message ('maint_bibcode');
end
end
end
if is_set (err_type) and not ignore_invalid then -- if there was an error detected and accept-as-written markup not used
set_message ('err_bad_bibcode', {err_type});
options.coins_list_t['BIBCODE'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< B I O R X I V >-----------------------------------------------------------------
Format bioRxiv ID and do simple error checking. Before 2019-12-11, biorXiv IDs were 10.1101/ followed by exactly
6 digits. After 2019-12-11, biorXiv IDs retained the six-digit identifier but prefixed that with a yyyy.mm.dd.
date and suffixed with an optional version identifier.
The bioRxiv ID is the string of characters:
https://doi.org/10.1101/078733 -> 10.1101/078733
or a date followed by a six-digit number followed by an optional version indicator 'v' and one or more digits:
https://www.biorxiv.org/content/10.1101/2019.12.11.123456v2 -> 10.1101/2019.12.11.123456v2
see https://www.biorxiv.org/about-biorxiv
]]
local function biorxiv (options)
local id = options.id;
local handler = options.handler;
local err_msg = true; -- flag; assume that there will be an error
local patterns = {
'^10%.1101/%d%d%d%d%d%d$', -- simple 6-digit identifier (before 2019-12-11)
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%dv%d+$', -- y.m.d. date + 6-digit identifier + version (after 2019-12-11)
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d$', -- y.m.d. date + 6-digit identifier (after 2019-12-11)
}
for _, pattern in ipairs (patterns) do -- spin through the patterns looking for a match
if id:match (pattern) then
local y, m, d = id:match (pattern); -- found a match, attempt to get year, month and date from the identifier
if m then -- m is nil when id is the six-digit form
if not is_valid_rxiv_date (y, m, d, 'b') then -- validate the encoded date; 'b' for biorxiv limit
break; -- date fail; break out early so we don't unset the error message
end
end
err_msg = nil; -- we found a match so unset the error message
break; -- and done
end
end -- err_cat remains set here when no match
if err_msg then
options.coins_list_t['BIORXIV'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_biorxiv'); -- and set the error message
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator,
encode = handler.encode, access = handler.access});
end
--[[--------------------------< C I T E S E E R X >------------------------------------------------------------
CiteSeerX use their own notion of "doi" (not to be confused with the identifiers resolved via doi.org).
The description of the structure of this identifier can be found at Help_talk:Citation_Style_1/Archive_26#CiteSeerX_id_structure
]]
local function citeseerx (options)
local id = options.id;
local handler = options.handler;
local matched;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode,
access = handler.access});
matched = id:match ("^10%.1%.1%.[1-9]%d?%d?%d?%.[1-9]%d?%d?%d?$");
if not matched then
set_message ('err_bad_citeseerx' );
options.coins_list_t['CITESEERX'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< D O I >------------------------------------------------------------------------
Formats a DOI and checks for DOI errors.
DOI names contain two parts: prefix and suffix separated by a forward slash.
Prefix: directory indicator '10.' followed by a registrant code
Suffix: character string of any length chosen by the registrant
This function checks a DOI name for: prefix/suffix. If the DOI name contains spaces or endashes, or, if it ends
with a period or a comma, this function will emit a bad_doi error message.
DOI names are case-insensitive and can incorporate any printable Unicode characters so the test for spaces, endash,
and terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in DOI names.
https://www.doi.org/doi_handbook/2_Numbering.html -- 2.2 Syntax of a DOI name
https://www.doi.org/doi_handbook/2_Numbering.html#2.2.2 -- 2.2.2 DOI prefix
]]
local function doi (options)
local id = options.id;
local inactive = options.DoiBroken
local access = options.access;
local ignore_invalid = options.accept;
local handler = options.handler;
local err_flag;
local text;
if is_set (inactive) then
local inactive_year = inactive:match("%d%d%d%d"); -- try to get the year portion from the inactive date
local inactive_month, good;
if is_set (inactive_year) then
if 4 < inactive:len() then -- inactive date has more than just a year (could be anything)
local lang_obj = mw.getContentLanguage(); -- get a language object for this wiki
good, inactive_month = pcall (lang_obj.formatDate, lang_obj, 'F', inactive); -- try to get the month name from the inactive date
if not good then
inactive_month = nil; -- something went wrong so make sure this is unset
end
end
end -- otherwise, |doi-broken-date= has something but it isn't a date
if is_set (inactive_year) and is_set (inactive_month) then
set_message ('maint_doi_inactive_dated', {inactive_year, inactive_month, ' '});
elseif is_set (inactive_year) then
set_message ('maint_doi_inactive_dated', {inactive_year, '', ''});
else
set_message ('maint_doi_inactive');
end
inactive = " (" .. cfg.messages['inactive'] .. ' ' .. inactive .. ')';
end
local registrant = mw.ustring.match (id, '^10%.([^/]+)/[^%s–]-[^%.,]$'); -- registrant set when DOI has the proper basic form
local registrant_err_patterns = { -- these patterns are for code ranges that are not supported
'^[^1-3]%d%d%d%d%.%d+$', -- 5 digits with subcode (0xxxx, 40000+); accepts: 10000–39999
'^[^1-6]%d%d%d%d$', -- 5 digits without subcode (0xxxx, 60000+); accepts: 10000–69999
'^[^1-9]%d%d%d%.%d+$', -- 4 digits with subcode (0xxx); accepts: 1000–9999
'^[^1-9]%d%d%d$', -- 4 digits without subcode (0xxx); accepts: 1000–9999
'^%d%d%d%d%d%d+', -- 6 or more digits
'^%d%d?%d?$', -- less than 4 digits without subcode (3 digits with subcode is legitimate)
'^%d%d?%.[%d%.]+', -- 1 or 2 digits with subcode
'^5555$', -- test registrant will never resolve
'[^%d%.]', -- any character that isn't a digit or a dot
}
if not ignore_invalid then
if registrant then -- when DOI has proper form
for i, pattern in ipairs (registrant_err_patterns) do -- spin through error patterns
if registrant:match (pattern) then -- to validate registrant codes
err_flag = set_message ('err_bad_doi'); -- when found, mark this DOI as bad
break; -- and done
end
end
else
err_flag = set_message ('err_bad_doi'); -- invalid directory or malformed
end
else
set_message ('maint_doi_ignore');
end
if err_flag then
options.coins_list_t['DOI'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access,
auto_link = not (err_flag or is_set (inactive) or ignore_invalid) and 'doi' or nil -- do not auto-link when |doi-broken-date= has a value or when there is a DOI error or (to play it safe, after all, auto-linking is not essential) when invalid DOIs are ignored
}) .. (inactive or '');
return text;
end
--[[--------------------------< H D L >------------------------------------------------------------------------
Formats an HDL with minor error checking.
HDL names contain two parts: prefix and suffix separated by a forward slash.
Prefix: character string using any character in the UCS-2 character set except '/'
Suffix: character string of any length using any character in the UCS-2 character set chosen by the registrant
This function checks a HDL name for: prefix/suffix. If the HDL name contains spaces, endashes, or, if it ends
with a period or a comma, this function will emit a bad_hdl error message.
HDL names are case-insensitive and can incorporate any printable Unicode characters so the test for endashes and
terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in HDLs.
Query string parameters are named here: https://www.handle.net/proxy_servlet.html. query strings are not displayed
but since '?' is an allowed character in an HDL, '?' followed by one of the query parameters is the only way we
have to detect the query string so that it isn't URL-encoded with the rest of the identifier.
]]
local function hdl (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local query_params = { -- list of known query parameters from https://www.handle.net/proxy_servlet.html
'noredirect',
'ignore_aliases',
'auth',
'cert',
'index',
'type',
'urlappend',
'locatt',
'action',
}
local hdl, suffix, param = id:match ('(.-)(%?(%a+).+)$'); -- look for query string
local found;
if hdl then -- when there are query strings, this is the handle identifier portion
for _, q in ipairs (query_params) do -- spin through the list of query parameters
if param:match ('^' .. q) then -- if the query string begins with one of the parameters
found = true; -- announce a find
break; -- and stop looking
end
end
end
if found then
id = hdl; -- found so replace id with the handle portion; this will be URL-encoded, suffix will not
else
suffix = ''; -- make sure suffix is empty string for concatenation else
end
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, suffix = suffix, separator = handler.separator, encode = handler.encode, access = access})
if nil == id:match("^[^%s–]-/[^%s–]-[^%.,]$") then -- HDL must contain a forward slash, must not contain spaces, endashes, and must not end with period or comma
set_message ('err_bad_hdl' );
options.coins_list_t['HDL'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< I S B N >----------------------------------------------------------------------
Determines whether an ISBN string is valid
]]
local function isbn (options)
local isbn_str = options.id;
local ignore_invalid = options.accept;
local handler = options.handler;
local function return_result (check, err_type) -- local function to handle the various returns
local ISBN = internal_link_id ({link = handler.link, label = handler.label, redirect = handler.redirect,
prefix = handler.prefix, id = isbn_str, separator = handler.separator});
if ignore_invalid then -- if ignoring ISBN errors
set_message ('maint_isbn_ignore'); -- add a maint category even when there is no error
else -- here when not ignoring
if not check then -- and there is an error
options.coins_list_t['ISBN'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_isbn', err_type); -- set an error message
return ISBN; -- return id text
end
end
return ISBN; -- return id text
end
if nil ~= isbn_str:match ('[^%s-0-9X]') then
return return_result (false, cfg.err_msg_supl.char); -- fail if isbn_str contains anything but digits, hyphens, or the uppercase X
end
local id = isbn_str:gsub ('[%s-]', ''); -- remove hyphens and whitespace
local len = id:len();
if len ~= 10 and len ~= 13 then
return return_result (false, cfg.err_msg_supl.length); -- fail if incorrect length
end
if len == 10 then
if id:match ('^%d*X?$') == nil then -- fail if isbn_str has 'X' anywhere but last position
return return_result (false, cfg.err_msg_supl.form);
end
if not is_valid_isxn (id, 10) then -- test isbn-10 for numerical validity
return return_result (false, cfg.err_msg_supl.check); -- fail if isbn-10 is not numerically valid
end
if id:find ('^63[01]') then -- 630xxxxxxx and 631xxxxxxx are (apparently) not valid isbn group ids but are used by amazon as numeric identifiers (asin)
return return_result (false, cfg.err_msg_supl.group); -- fail if isbn-10 begins with 630/1
end
return return_result (true, cfg.err_msg_supl.check); -- pass if isbn-10 is numerically valid
else
if id:match ('^%d+$') == nil then
return return_result (false, cfg.err_msg_supl.char); -- fail if ISBN-13 is not all digits
end
if id:match ('^97[89]%d*$') == nil then
return return_result (false, cfg.err_msg_supl.prefix); -- fail when ISBN-13 does not begin with 978 or 979
end
if id:match ('^9790') then
return return_result (false, cfg.err_msg_supl.group); -- group identifier '0' is reserved to ISMN
end
return return_result (is_valid_isxn_13 (id), cfg.err_msg_supl.check);
end
end
--[[--------------------------< A S I N >----------------------------------------------------------------------
Formats a link to Amazon. Do simple error checking: ASIN must be mix of 10 numeric or uppercase alpha
characters. If a mix, first character must be uppercase alpha; if all numeric, ASINs must be 10-digit
ISBN. If 10-digit ISBN, add a maintenance category so a bot or AWB script can replace |asin= with |isbn=.
Error message if not 10 characters, if not ISBN-10, if mixed and first character is a digit.
|asin=630....... and |asin=631....... are (apparently) not a legitimate ISBN though it checksums as one; these
do not cause this function to emit the maint_asin message
This function is positioned here because it calls isbn()
]]
local function asin (options)
local id = options.id;
local domain = options.ASINTLD;
local err_flag;
if not id:match("^[%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u]$") then
err_flag = set_message ('err_bad_asin'); -- ASIN is not a mix of 10 uppercase alpha and numeric characters
else
if id:match("^%d%d%d%d%d%d%d%d%d[%dX]$") then -- if 10-digit numeric (or 9 digits with terminal X)
if is_valid_isxn (id, 10) then -- see if ASIN value is or validates as ISBN-10
if not id:find ('^63[01]') then -- 630xxxxxxx and 631xxxxxxx are (apparently) not a valid isbn prefixes but are used by amazon as a numeric identifier
err_flag = set_message ('err_bad_asin'); -- ASIN has ISBN-10 form but begins with something other than 630/1 so probably an isbn
end
elseif not is_set (err_flag) then
err_flag = set_message ('err_bad_asin'); -- ASIN is not ISBN-10
end
elseif not id:match("^%u[%d%u]+$") then
err_flag = set_message ('err_bad_asin'); -- asin doesn't begin with uppercase alpha
end
end
if (not is_set (domain)) or in_array (domain, {'us'}) then -- default: United States
domain = "com";
elseif in_array (domain, {'jp', 'uk'}) then -- Japan, United Kingdom
domain = "co." .. domain;
elseif in_array (domain, {'z.cn'}) then -- China
domain = "cn";
elseif in_array (domain, {'au', 'br', 'mx', 'sg', 'tr'}) then -- Australia, Brazil, Mexico, Singapore, Turkey
domain = "com." .. domain;
elseif not in_array (domain, {'ae', 'ca', 'cn', 'de', 'es', 'fr', 'in', 'it', 'nl', 'pl', 'sa', 'se', 'co.jp', 'co.uk', 'com', 'com.au', 'com.br', 'com.mx', 'com.sg', 'com.tr'}) then -- Arabic Emirates, Canada, China, Germany, Spain, France, Indonesia, Italy, Netherlands, Poland, Saudi Arabia, Sweden (as of 2021-03 Austria (.at), Liechtenstein (.li) and Switzerland (.ch) still redirect to the German site (.de) with special settings, so don't maintain local ASINs for them)
err_flag = set_message ('err_bad_asin_tld'); -- unsupported asin-tld value
end
local handler = options.handler;
if not is_set (err_flag) then
options.coins_list_t['ASIN'] = handler.prefix .. domain .. "/dp/" .. id; -- asin for coins
else
options.coins_list_t['ASIN'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix .. domain .. "/dp/",
id = id, encode = handler.encode, separator = handler.separator})
end
--[[--------------------------< I S M N >----------------------------------------------------------------------
Determines whether an ISMN string is valid. Similar to ISBN-13, ISMN is 13 digits beginning 979-0-... and uses the
same check digit calculations. See https://www.ismn-international.org/download/Web_ISMN_Users_Manual_2008-6.pdf
section 2, pages 9–12.
ismn value not made part of COinS metadata because we don't have a url or isn't a COinS-defined identifier (rft.xxx)
or an identifier registered at info-uri.info (info:)
]]
local function ismn (options)
local id = options.id;
local handler = options.handler;
local text;
local valid_ismn = true;
local id_copy;
id_copy = id; -- save a copy because this testing is destructive
id = id:gsub ('[%s-]', ''); -- remove hyphens and white space
if 13 ~= id:len() or id:match ("^9790%d*$" ) == nil then -- ISMN must be 13 digits and begin with 9790
valid_ismn = false;
else
valid_ismn=is_valid_isxn_13 (id); -- validate ISMN
end
-- text = internal_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect, -- use this (or external version) when there is some place to link to
-- prefix = handler.prefix, id = id_copy, separator = handler.separator, encode = handler.encode})
text = table.concat ( -- because no place to link to yet
{
make_wikilink (link_label_make (handler), handler.label),
handler.separator,
id_copy
});
if false == valid_ismn then
options.coins_list_t['ISMN'] = nil; -- when error, unset so not included in COinS; not really necessary here because ismn not made part of COinS
set_message ('err_bad_ismn'); -- create an error message if the ISMN is invalid
end
return text;
end
--[[--------------------------< I S S N >----------------------------------------------------------------------
Validate and format an ISSN. This code fixes the case where an editor has included an ISSN in the citation but
has separated the two groups of four digits with a space. When that condition occurred, the resulting link looked
like this:
|issn=0819 4327 gives: [https://www.worldcat.org/issn/0819 4327 0819 4327] -- can't have spaces in an external link
This code now prevents that by inserting a hyphen at the ISSN midpoint. It also validates the ISSN for length
and makes sure that the checkdigit agrees with the calculated value. Incorrect length (8 digits), characters
other than 0-9 and X, or checkdigit / calculated value mismatch will all cause a check ISSN error message. The
ISSN is always displayed with a hyphen, even if the ISSN was given as a single group of 8 digits.
]]
local function issn (options)
local id = options.id;
local handler = options.handler;
local ignore_invalid = options.accept;
local issn_copy = id; -- save a copy of unadulterated ISSN; use this version for display if ISSN does not validate
local text;
local valid_issn = true;
id = id:gsub ('[%s-]', ''); -- remove hyphens and whitespace
if 8 ~= id:len() or nil == id:match ("^%d*X?$" ) then -- validate the ISSN: 8 digits long, containing only 0-9 or X in the last position
valid_issn = false; -- wrong length or improper character
else
valid_issn = is_valid_isxn (id, 8); -- validate ISSN
end
if true == valid_issn then
id = string.sub (id, 1, 4 ) .. "-" .. string.sub (id, 5 ); -- if valid, display correctly formatted version
else
id = issn_copy; -- if not valid, show the invalid ISSN with error message
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode})
if ignore_invalid then
set_message ('maint_issn_ignore');
else
if false == valid_issn then
options.coins_list_t['ISSN'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_issn', (options.hkey == 'EISSN') and 'e' or ''); -- create an error message if the ISSN is invalid
end
end
return text;
end
--[[--------------------------< J F M >-----------------------------------------------------------------------
A numerical identifier in the form nn.nnnn.nn
]]
local function jfm (options)
local id = options.id;
local handler = options.handler;
local id_num;
id_num = id:match ('^[Jj][Ff][Mm](.*)$'); -- identifier with jfm prefix; extract identifier
if is_set (id_num) then
set_message ('maint_jfm_format');
else -- plain number without JFM prefix
id_num = id; -- if here id does not have prefix
end
if id_num and id_num:match('^%d%d%.%d%d%d%d%.%d%d$') then
id = id_num; -- jfm matches pattern
else
set_message ('err_bad_jfm' ); -- set an error message
options.coins_list_t['JFM'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< J S T O R >--------------------------------------------------------------------
Format a JSTOR with some error checking
]]
local function jstor (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
if id:find ('[Jj][Ss][Tt][Oo][Rr]') or id:find ('^https?://') or id:find ('%s') then
set_message ('err_bad_jstor'); -- set an error message
options.coins_list_t['JSTOR'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
end
--[[--------------------------< L C C N >----------------------------------------------------------------------
Format LCCN link and do simple error checking. LCCN is a character string 8-12 characters long. The length of
the LCCN dictates the character type of the first 1-3 characters; the rightmost eight are always digits.
https://oclc-research.github.io/infoURI-Frozen/info-uri.info/info:lccn/reg.html
length = 8 then all digits
length = 9 then lccn[1] is lowercase alpha
length = 10 then lccn[1] and lccn[2] are both lowercase alpha or both digits
length = 11 then lccn[1] is lower case alpha, lccn[2] and lccn[3] are both lowercase alpha or both digits
length = 12 then lccn[1] and lccn[2] are both lowercase alpha
]]
local function lccn (options)
local lccn = options.id;
local handler = options.handler;
local err_flag; -- presume that LCCN is valid
local id = lccn; -- local copy of the LCCN
id = normalize_lccn (id); -- get canonical form (no whitespace, hyphens, forward slashes)
local len = id:len(); -- get the length of the LCCN
if 8 == len then
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits)
err_flag = set_message ('err_bad_lccn'); -- set an error message
end
elseif 9 == len then -- LCCN should be adddddddd
if nil == id:match("%l%d%d%d%d%d%d%d%d") then -- does it match our pattern?
err_flag = set_message ('err_bad_lccn'); -- set an error message
end
elseif 10 == len then -- LCCN should be aadddddddd or dddddddddd
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits) ...
if nil == id:match("^%l%l%d%d%d%d%d%d%d%d") then -- ... see if it matches our pattern
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
end
elseif 11 == len then -- LCCN should be aaadddddddd or adddddddddd
if not (id:match("^%l%l%l%d%d%d%d%d%d%d%d") or id:match("^%l%d%d%d%d%d%d%d%d%d%d")) then -- see if it matches one of our patterns
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
elseif 12 == len then -- LCCN should be aadddddddddd
if not id:match("^%l%l%d%d%d%d%d%d%d%d%d%d") then -- see if it matches our pattern
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
else
err_flag = set_message ('err_bad_lccn'); -- wrong length, set an error message
end
if not is_set (err_flag) and nil ~= lccn:find ('%s') then
err_flag = set_message ('err_bad_lccn'); -- lccn contains a space, set an error message
end
if is_set (err_flag) then
options.coins_list_t['LCCN'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = lccn, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< M E D R X I V >-----------------------------------------------------------------
Format medRxiv ID and do simple error checking. Similar to later bioRxiv IDs, medRxiv IDs are prefixed with a
yyyy.mm.dd. date and suffixed with an optional version identifier. Ealiest date accepted is 2020.01.01
The medRxiv ID is a date followed by an eight-digit number followed by an optional version indicator 'v' and one or more digits:
https://www.medrxiv.org/content/10.1101/2020.11.16.20232009v2 -> 10.1101/2020.11.16.20232009v2
]]
local function medrxiv (options)
local id = options.id;
local handler = options.handler;
local err_msg_flag = true; -- flag; assume that there will be an error
local patterns = {
'%d%d%d%d%d%d%d%d$', -- simple 8-digit identifier; these should be relatively rare
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d%d%dv%d+$', -- y.m.d. date + 8-digit identifier + version (2020-01-01 and later)
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d%d%d$', -- y.m.d. date + 8-digit identifier (2020-01-01 and later)
}
for _, pattern in ipairs (patterns) do -- spin through the patterns looking for a match
if id:match (pattern) then
local y, m, d = id:match (pattern); -- found a match, attempt to get year, month and date from the identifier
if m then -- m is nil when id is the 8-digit form
if not is_valid_rxiv_date (y, m, d, 'b') then -- validate the encoded date; 'b' for medrxiv limit
break; -- date fail; break out early so we don't unset the error message
end
end
err_msg_flag = nil; -- we found a match so unset the error message
break; -- and done
end
end -- <err_msg_flag> remains set here when no match
if err_msg_flag then
options.coins_list_t['MEDRXIV'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_medrxiv'); -- and set the error message
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator,
encode = handler.encode, access = handler.access});
end
--[[--------------------------< M R >--------------------------------------------------------------------------
A seven digit number; if not seven digits, zero-fill leading digits to make seven digits.
]]
local function mr (options)
local id = options.id;
local handler = options.handler;
local id_num;
local id_len;
id_num = id:match ('^[Mm][Rr](%d+)$'); -- identifier with mr prefix
if is_set (id_num) then
set_message ('maint_mr_format'); -- add maint cat
else -- plain number without mr prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
id_len = id_num and id_num:len() or 0;
if (7 >= id_len) and (0 ~= id_len) then
id = string.rep ('0', 7-id_len) .. id_num; -- zero-fill leading digits
else
set_message ('err_bad_mr'); -- set an error message
options.coins_list_t['MR'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< O C L C >----------------------------------------------------------------------
Validate and format an OCLC ID. https://www.oclc.org/batchload/controlnumber.en.html {{dead link}}
archived at: https://web.archive.org/web/20161228233804/https://www.oclc.org/batchload/controlnumber.en.html
]]
local function oclc (options)
local id = options.id;
local handler = options.handler;
local number;
if id:match('^ocm%d%d%d%d%d%d%d%d$') then -- ocm prefix and 8 digits; 001 field (12 characters)
number = id:match('ocm(%d+)'); -- get the number
elseif id:match('^ocn%d%d%d%d%d%d%d%d%d$') then -- ocn prefix and 9 digits; 001 field (12 characters)
number = id:match('ocn(%d+)'); -- get the number
elseif id:match('^on%d%d%d%d%d%d%d%d%d%d+$') then -- on prefix and 10 or more digits; 001 field (12 characters)
number = id:match('^on(%d%d%d%d%d%d%d%d%d%d+)$'); -- get the number
elseif id:match('^%(OCoLC%)[1-9]%d*$') then -- (OCoLC) prefix and variable number digits; no leading zeros; 035 field
number = id:match('%(OCoLC%)([1-9]%d*)'); -- get the number
if 9 < number:len() then
number = nil; -- constrain to 1 to 9 digits; change this when OCLC issues 10-digit numbers
end
elseif id:match('^%d+$') then -- no prefix
number = id; -- get the number
if tonumber (id) > handler.id_limit then
number = nil; -- unset when id value exceeds the limit
end
end
if number then -- proper format
id = number; -- exclude prefix, if any, from external link
else
set_message ('err_bad_oclc') -- add an error message if the id is malformed
options.coins_list_t['OCLC'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< O P E N L I B R A R Y >--------------------------------------------------------
Formats an OpenLibrary link, and checks for associated errors.
]]
local function openlibrary (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local ident, code = id:gsub('^OL', ''):match("^(%d+([AMW]))$"); -- strip optional OL prefix followed immediately by digits followed by 'A', 'M', or 'W';
local err_flag;
local prefix = { -- these are appended to the handler.prefix according to code
['A']='authors/OL',
['M']='books/OL',
['W']='works/OL',
['X']='OL' -- not a code; spoof when 'code' in id is invalid
};
if not ident then
code = 'X'; -- no code or id completely invalid
ident = id; -- copy id to ident so that we display the flawed identifier
err_flag = set_message ('err_bad_ol');
end
if not is_set (err_flag) then
options.coins_list_t['OL'] = handler.prefix .. prefix[code] .. ident; -- experiment for ol coins
else
options.coins_list_t['OL'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix .. prefix[code],
id = ident, separator = handler.separator, encode = handler.encode,
access = access});
end
--[[--------------------------< O S T I >----------------------------------------------------------------------
Format OSTI and do simple error checking. OSTIs are sequential numbers beginning at 1 and counting up. This
code checks the OSTI to see that it contains only digits and is less than test_limit specified in the configuration;
the value in test_limit will need to be updated periodically as more OSTIs are issued.
NB. 1018 is the lowest OSTI number found in the wild (so far) and resolving OK on the OSTI site
]]
local function osti (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
if id:match("[^%d]") then -- if OSTI has anything but digits
set_message ('err_bad_osti'); -- set an error message
options.coins_list_t['OSTI'] = nil; -- when error, unset so not included in COinS
else -- OSTI is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1018 > id_num or handler.id_limit < id_num then -- if OSTI is outside test limit boundaries
set_message ('err_bad_osti'); -- set an error message
options.coins_list_t['OSTI'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
end
--[[--------------------------< P M C >------------------------------------------------------------------------
Format a PMC, do simple error checking, and check for embargoed articles.
The embargo parameter takes a date for a value. If the embargo date is in the future the PMC identifier will not
be linked to the article. If the embargo date is today or in the past, or if it is empty or omitted, then the
PMC identifier is linked to the article through the link at cfg.id_handlers['PMC'].prefix.
PMC embargo date testing is done in function is_embargoed () which is called earlier because when the citation
has |pmc=<value> but does not have a |url= then |title= is linked with the PMC link. Function is_embargoed ()
returns the embargo date if the PMC article is still embargoed, otherwise it returns an empty string.
PMCs are sequential numbers beginning at 1 and counting up. This code checks the PMC to see that it contains only digits and is less
than test_limit; the value in local variable test_limit will need to be updated periodically as more PMCs are issued.
]]
local function pmc (options)
local id = options.id;
local embargo = options.Embargo; -- TODO: lowercase?
local handler = options.handler;
local err_flag;
local id_num;
local text;
id_num = id:match ('^[Pp][Mm][Cc](%d+)$'); -- identifier with PMC prefix
if is_set (id_num) then
set_message ('maint_pmc_format');
else -- plain number without PMC prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if PMC is outside test limit boundaries
err_flag = set_message ('err_bad_pmc'); -- set an error message
else
id = tostring (id_num); -- make sure id is a string
end
else -- when id format incorrect
err_flag = set_message ('err_bad_pmc'); -- set an error message
end
if is_set (embargo) and is_set (is_embargoed (embargo)) then -- is PMC is still embargoed?
text = table.concat ( -- still embargoed so no external link
{
make_wikilink (link_label_make (handler), handler.label),
handler.separator,
id,
});
else
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect, -- no embargo date or embargo has expired, ok to link to article
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access,
auto_link = not err_flag and 'pmc' or nil -- do not auto-link when PMC has error
});
end
if err_flag then
options.coins_list_t['PMC'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< P M I D >----------------------------------------------------------------------
Format PMID and do simple error checking. PMIDs are sequential numbers beginning at 1 and counting up. This
code checks the PMID to see that it contains only digits and is less than test_limit; the value in local variable
test_limit will need to be updated periodically as more PMIDs are issued.
]]
local function pmid (options)
local id = options.id;
local handler = options.handler;
if id:match("[^%d]") then -- if PMID has anything but digits
set_message ('err_bad_pmid'); -- set an error message
options.coins_list_t['PMID'] = nil; -- when error, unset so not included in COinS
else -- PMID is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if PMID is outside test limit boundaries
set_message ('err_bad_pmid'); -- set an error message
options.coins_list_t['PMID'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< R F C >------------------------------------------------------------------------
Format RFC and do simple error checking. RFCs are sequential numbers beginning at 1 and counting up. This
code checks the RFC to see that it contains only digits and is less than test_limit specified in the configuration;
the value in test_limit will need to be updated periodically as more RFCs are issued.
An index of all RFCs is here: https://tools.ietf.org/rfc/
]]
local function rfc (options)
local id = options.id;
local handler = options.handler;
if id:match("[^%d]") then -- if RFC has anything but digits
set_message ('err_bad_rfc'); -- set an error message
options.coins_list_t['RFC'] = nil; -- when error, unset so not included in COinS
else -- RFC is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if RFC is outside test limit boundaries
set_message ('err_bad_rfc'); -- set an error message
options.coins_list_t['RFC'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access});
end
--[[--------------------------< S 2 C I D >--------------------------------------------------------------------
Format an S2CID, do simple error checking
S2CIDs are sequential numbers beginning at 1 and counting up. This code checks the S2CID to see that it is only
digits and is less than test_limit; the value in local variable test_limit will need to be updated periodically
as more S2CIDs are issued.
]]
local function s2cid (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local id_num;
local text;
id_num = id:match ('^[1-9]%d*$'); -- id must be all digits; must not begin with 0; no open access flag
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if handler.id_limit < id_num then -- if S2CID is outside test limit boundaries
set_message ('err_bad_s2cid'); -- set an error message
options.coins_list_t['S2CID'] = nil; -- when error, unset so not included in COinS
end
else -- when id format incorrect
set_message ('err_bad_s2cid'); -- set an error message
options.coins_list_t['S2CID'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
return text;
end
--[[--------------------------< S B N >------------------------------------------------------------------------
9-digit form of ISBN-10; uses same check-digit validation when SBN is prefixed with an additional '0' to make 10 digits
sbn value not made part of COinS metadata because we don't have a url or isn't a COinS-defined identifier (rft.xxx)
or an identifier registered at info-uri.info (info:)
]]
local function sbn (options)
local id = options.id;
local ignore_invalid = options.accept;
local handler = options.handler;
local function return_result (check, err_type) -- local function to handle the various returns
local SBN = internal_link_id ({link = handler.link, label = handler.label, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator});
if not ignore_invalid then -- if not ignoring SBN errors
if not check then
options.coins_list_t['SBN'] = nil; -- when error, unset so not included in COinS; not really necessary here because sbn not made part of COinS
set_message ('err_bad_sbn', {err_type}); -- display an error message
return SBN;
end
else
set_message ('maint_isbn_ignore'); -- add a maint category even when there is no error (ToDo: Possibly switch to separate message for SBNs only)
end
return SBN;
end
if id:match ('[^%s-0-9X]') then
return return_result (false, cfg.err_msg_supl.char); -- fail if SBN contains anything but digits, hyphens, or the uppercase X
end
local ident = id:gsub ('[%s-]', ''); -- remove hyphens and whitespace; they interfere with the rest of the tests
if 9 ~= ident:len() then
return return_result (false, cfg.err_msg_supl.length); -- fail if incorrect length
end
if ident:match ('^%d*X?$') == nil then
return return_result (false, cfg.err_msg_supl.form); -- fail if SBN has 'X' anywhere but last position
end
return return_result (is_valid_isxn ('0' .. ident, 10), cfg.err_msg_supl.check);
end
--[[--------------------------< S S R N >----------------------------------------------------------------------
Format an SSRN, do simple error checking
SSRNs are sequential numbers beginning at 100? and counting up. This code checks the SSRN to see that it is
only digits and is greater than 99 and less than test_limit; the value in local variable test_limit will need
to be updated periodically as more SSRNs are issued.
]]
local function ssrn (options)
local id = options.id;
local handler = options.handler;
local id_num;
local text;
id_num = id:match ('^%d+$'); -- id must be all digits
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if 100 > id_num or handler.id_limit < id_num then -- if SSRN is outside test limit boundaries
set_message ('err_bad_ssrn'); -- set an error message
options.coins_list_t['SSRN'] = nil; -- when error, unset so not included in COinS
end
else -- when id format incorrect
set_message ('err_bad_ssrn'); -- set an error message
options.coins_list_t['SSRN'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = options.access});
return text;
end
--[[--------------------------< U S E N E T _ I D >------------------------------------------------------------
Validate and format a usenet message id. Simple error checking, looks for 'id-left@id-right' not enclosed in
'<' and/or '>' angle brackets.
]]
local function usenet_id (options)
local id = options.id;
local handler = options.handler;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode})
if not id:match('^.+@.+$') or not id:match('^[^<].*[^>]$') then -- doesn't have '@' or has one or first or last character is '< or '>'
set_message ('err_bad_usenet_id') -- add an error message if the message id is invalid
options.coins_list_t['USENETID'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< Z B L >-----------------------------------------------------------------------
A numerical identifier in the form nnnn.nnnnn - leading zeros in the first quartet optional
format described here: http://emis.mi.sanu.ac.rs/ZMATH/zmath/en/help/search/
temporary format is apparently eight digits. Anything else is an error
]]
local function zbl (options)
local id = options.id;
local handler = options.handler;
if id:match('^%d%d%d%d%d%d%d%d$') then -- is this identifier using temporary format?
set_message ('maint_zbl'); -- yes, add maint cat
elseif not id:match('^%d?%d?%d?%d%.%d%d%d%d%d$') then -- not temporary, is it normal format?
set_message ('err_bad_zbl'); -- no, set an error message
options.coins_list_t['ZBL'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--============================<< I N T E R F A C E F U N C T I O N S >>==========================================
--[[--------------------------< E X T R A C T _ I D S >------------------------------------------------------------
Populates ID table from arguments using configuration settings. Loops through cfg.id_handlers and searches args for
any of the parameters listed in each cfg.id_handlers['...'].parameters. If found, adds the parameter and value to
the identifier list. Emits redundant error message if more than one alias exists in args
]]
local function extract_ids (args)
local id_list = {}; -- list of identifiers found in args
for k, v in pairs (cfg.id_handlers) do -- k is uppercase identifier name as index to cfg.id_handlers; e.g. cfg.id_handlers['ISBN'], v is a table
v = select_one (args, v.parameters, 'err_redundant_parameters' ); -- v.parameters is a table of aliases for k; here we pick one from args if present
if is_set (v) then id_list[k] = v; end -- if found in args, add identifier to our list
end
return id_list;
end
--[[--------------------------< E X T R A C T _ I D _ A C C E S S _ L E V E L S >--------------------------------------
Fetches custom id access levels from arguments using configuration settings. Parameters which have a predefined access
level (e.g. arxiv) do not use this function as they are directly rendered as free without using an additional parameter.
returns a table of k/v pairs where k is same as the identifier's key in cfg.id_handlers and v is the assigned (valid) keyword
access-level values must match the case used in cfg.keywords_lists['id-access'] (lowercase unless there is some special reason for something else)
]]
local function extract_id_access_levels (args, id_list)
local id_accesses_list = {};
for k, v in pairs (cfg.id_handlers) do
local access_param = v.custom_access; -- name of identifier's access-level parameter
if is_set (access_param) then
local access_level = args[access_param]; -- get the assigned value if there is one
if is_set (access_level) then
if not in_array (access_level, cfg.keywords_lists['id-access']) then -- exact match required
set_message ('err_invalid_param_val', {access_param, access_level});
access_level = nil; -- invalid so unset
end
if not is_set (id_list[k]) then -- identifier access-level must have a matching identifier
set_message ('err_param_access_requires_param', {k:lower()}); -- parameter name is uppercase in cfg.id_handlers (k); lowercase for error message
end
id_accesses_list[k] = cfg.keywords_xlate[access_level]; -- get translated keyword
end
end
end
return id_accesses_list;
end
--[[--------------------------< B U I L D _ I D _ L I S T >----------------------------------------------------
render the identifiers into a sorted sequence table
<ID_list_coins_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value
<options_t> is a table of various k/v option pairs provided in the call to new_build_id_list();
modified by this function and passed to all identifier rendering functions
<access_levels_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value (if valid)
returns a sequence table of sorted (by hkey - 'handler' key) rendered identifier strings
]]
local function build_id_list (ID_list_coins_t, options_t, access_levels_t)
local ID_list_t = {};
local accept;
local func_map = { --function map points to functions associated with hkey identifier
['ARXIV'] = arxiv,
['ASIN'] = asin,
['BIBCODE'] = bibcode,
['BIORXIV'] = biorxiv,
['CITESEERX'] = citeseerx,
['DOI'] = doi,
['EISSN'] = issn,
['HDL'] = hdl,
['ISBN'] = isbn,
['ISMN'] = ismn,
['ISSN'] = issn,
['JFM'] = jfm,
['JSTOR'] = jstor,
['LCCN'] = lccn,
['MEDRXIV'] = medrxiv,
['MR'] = mr,
['OCLC'] = oclc,
['OL'] = openlibrary,
['OSTI'] = osti,
['PMC'] = pmc,
['PMID'] = pmid,
['RFC'] = rfc,
['S2CID'] = s2cid,
['SBN'] = sbn,
['SSRN'] = ssrn,
['USENETID'] = usenet_id,
['ZBL'] = zbl,
}
for hkey, v in pairs (ID_list_coins_t) do
v, accept = has_accept_as_written (v); -- remove accept-as-written markup if present; accept is boolean true when markup removed; false else
-- every function gets the options table with value v and accept boolean
options_t.hkey = hkey; -- ~/Configuration handler key
options_t.id = v; -- add that identifier value to the options table
options_t.accept = accept; -- add the accept boolean flag
options_t.access = access_levels_t[hkey]; -- add the access level for those that have an |<identifier-access= parameter
options_t.handler = cfg.id_handlers[hkey];
options_t.coins_list_t = ID_list_coins_t; -- pointer to ID_list_coins_t; for |asin= and |ol=; also to keep erroneous values out of the citation's metadata
options_t.coins_list_t[hkey] = v; -- id value without accept-as-written markup for metadata
if options_t.handler.access and not in_array (options_t.handler.access, cfg.keywords_lists['id-access']) then
error (cfg.messages['unknown_ID_access'] .. options_t.handler.access); -- here when handler access key set to a value not listed in list of allowed id access keywords
end
if func_map[hkey] then
local id_text = func_map[hkey] (options_t); -- call the function to get identifier text and any error message
table.insert (ID_list_t, {hkey, id_text}); -- add identifier text to the output sequence table
else
error (cfg.messages['unknown_ID_key'] .. hkey); -- here when func_map doesn't have a function for hkey
end
end
local function comp (a, b) -- used by following table.sort()
return a[1]:lower() < b[1]:lower(); -- sort by hkey
end
table.sort (ID_list_t, comp); -- sequence table of tables sort
for k, v in ipairs (ID_list_t) do -- convert sequence table of tables to simple sequence table of strings
ID_list_t[k] = v[2]; -- v[2] is the identifier rendering from the call to the various functions in func_map{}
end
return ID_list_t;
end
--[[--------------------------< O P T I O N S _ C H E C K >----------------------------------------------------
check that certain option parameters have their associated identifier parameters with values
<ID_list_coins_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value
<ID_support_t> is a sequence table of tables created in citation0() where each subtable has four elements:
[1] is the support parameter's assigned value; empty string if not set
[2] is a text string same as key in cfg.id_handlers
[3] is cfg.error_conditions key used to create error message
[4] is original ID support parameter name used to create error message
returns nothing; on error emits an appropriate error message
]]
local function options_check (ID_list_coins_t, ID_support_t)
for _, v in ipairs (ID_support_t) do
if is_set (v[1]) and not ID_list_coins_t[v[2]] then -- when support parameter has a value but matching identifier parameter is missing or empty
set_message (v[3], (v[4])); -- emit the appropriate error message
end
end
end
--[[--------------------------< I D E N T I F I E R _ L I S T S _ G E T >--------------------------------------
Creates two identifier lists: a k/v table of identifiers and their values to be used locally and for use in the
COinS metadata, and a sequence table of the rendered identifier strings that will be included in the rendered
citation.
]]
local function identifier_lists_get (args_t, options_t, ID_support_t)
local ID_list_coins_t = extract_ids (args_t); -- get a table of identifiers and their values for use locally and for use in COinS
options_check (ID_list_coins_t, ID_support_t); -- ID support parameters must have matching identifier parameters
local ID_access_levels_t = extract_id_access_levels (args_t, ID_list_coins_t); -- get a table of identifier access levels
local ID_list_t = build_id_list (ID_list_coins_t, options_t, ID_access_levels_t); -- get a sequence table of rendered identifier strings
return ID_list_t, ID_list_coins_t; -- return the tables
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
has_accept_as_written = utilities_page_ptr.has_accept_as_written; -- import functions from select Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
set_message = utilities_page_ptr.set_message;
select_one = utilities_page_ptr.select_one;
substitute = utilities_page_ptr.substitute;
make_wikilink = utilities_page_ptr.make_wikilink;
z = utilities_page_ptr.z; -- table of tables in Module:Citation/CS1/Utilities
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
auto_link_urls = auto_link_urls, -- table of identifier URLs to be used when auto-linking |title=
identifier_lists_get = identifier_lists_get, -- experiment to replace individual calls to build_id_list(), extract_ids, extract_id_access_levels
is_embargoed = is_embargoed;
set_selected_modules = set_selected_modules;
}
3cd8b5ef8d199885cc0c92aabeb5bc338fa6f42c
Module:Citation/CS1/COinS
828
164
429
428
2023-10-17T20:36:16Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/COinS]]
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local has_accept_as_written, is_set, in_array, remove_wiki_link, strip_apostrophe_markup; -- functions in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< M A K E _ C O I N S _ T I T L E >----------------------------------------------
Makes a title for COinS from Title and / or ScriptTitle (or any other name-script pairs)
Apostrophe markup (bold, italics) is stripped from each value so that the COinS metadata isn't corrupted with strings
of %27%27...
]]
local function make_coins_title (title, script)
title = has_accept_as_written (title);
if is_set (title) then
title = strip_apostrophe_markup (title); -- strip any apostrophe markup
else
title = ''; -- if not set, make sure title is an empty string
end
if is_set (script) then
script = script:gsub ('^%l%l%s*:%s*', ''); -- remove language prefix if present (script value may now be empty string)
script = strip_apostrophe_markup (script); -- strip any apostrophe markup
else
script = ''; -- if not set, make sure script is an empty string
end
if is_set (title) and is_set (script) then
script = ' ' .. script; -- add a space before we concatenate
end
return title .. script; -- return the concatenation
end
--[[--------------------------< E S C A P E _ L U A _ M A G I C _ C H A R S >----------------------------------
Returns a string where all of Lua's magic characters have been escaped. This is important because functions like
string.gsub() treat their pattern and replace strings as patterns, not literal strings.
]]
local function escape_lua_magic_chars (argument)
argument = argument:gsub("%%", "%%%%"); -- replace % with %%
argument = argument:gsub("([%^%$%(%)%.%[%]%*%+%-%?])", "%%%1"); -- replace all other Lua magic pattern characters
return argument;
end
--[[--------------------------< G E T _ C O I N S _ P A G E S >------------------------------------------------
Extract page numbers from external wikilinks in any of the |page=, |pages=, or |at= parameters for use in COinS.
]]
local function get_coins_pages (pages)
local pattern;
if not is_set (pages) then return pages; end -- if no page numbers then we're done
while true do
pattern = pages:match("%[(%w*:?//[^ ]+%s+)[%w%d].*%]"); -- pattern is the opening bracket, the URL and following space(s): "[url "
if nil == pattern then break; end -- no more URLs
pattern = escape_lua_magic_chars (pattern); -- pattern is not a literal string; escape Lua's magic pattern characters
pages = pages:gsub(pattern, ""); -- remove as many instances of pattern as possible
end
pages = pages:gsub("[%[%]]", ""); -- remove the brackets
pages = pages:gsub("–", "-" ); -- replace endashes with hyphens
pages = pages:gsub("&%w+;", "-" ); -- and replace HTML entities (– etc.) with hyphens; do we need to replace numerical entities like   and the like?
return pages;
end
--[=[-------------------------< C O I N S _ R E P L A C E _ M A T H _ S T R I P M A R K E R >------------------
There are three options for math markup rendering that depend on the editor's math preference settings. These
settings are at [[Special:Preferences#mw-prefsection-rendering]] and are
PNG images
TeX source
MathML with SVG or PNG fallback
All three are heavy with HTML and CSS which doesn't belong in the metadata.
Without this function, the metadata saved in the raw wikitext contained the rendering determined by the settings
of the last editor to save the page.
This function gets the rendered form of an equation according to the editor's preference before the page is saved. It
then searches the rendering for the text equivalent of the rendered equation and replaces the rendering with that so
that the page is saved without extraneous HTML/CSS markup and with a reasonably readable text form of the equation.
When a replacement is made, this function returns true and the value with replacement; otherwise false and the initial
value. To replace multipe equations it is necessary to call this function from within a loop.
]=]
local function coins_replace_math_stripmarker (value)
local stripmarker = cfg.stripmarkers['math'];
local rendering = value:match (stripmarker); -- is there a math stripmarker
if not rendering then -- when value doesn't have a math stripmarker, abandon this test
return false, value;
end
rendering = mw.text.unstripNoWiki (rendering); -- convert stripmarker into rendered value (or nil? ''? when math render error)
if rendering:match ('alt="[^"]+"') then -- if PNG math option
rendering = rendering:match ('alt="([^"]+)"'); -- extract just the math text
elseif rendering:match ('$%s+.+%s+%$') then -- if TeX math option; $ is legit character that is escapes as \$
rendering = rendering:match ('$%s+(.+)%s+%$') -- extract just the math text
elseif rendering:match ('<annotation[^>]+>.+</annotation>') then -- if MathML math option
rendering = rendering:match ('<annotation[^>]+>(.+)</annotation>') -- extract just the math text
else
return false, value; -- had math stripmarker but not one of the three defined forms
end
return true, value:gsub (stripmarker, rendering, 1);
end
--[[--------------------------< C O I N S _ C L E A N U P >----------------------------------------------------
Cleanup parameter values for the metadata by removing or replacing invisible characters and certain HTML entities.
2015-12-10: there is a bug in mw.text.unstripNoWiki (). It replaces math stripmarkers with the appropriate content
when it shouldn't. See https://phabricator.wikimedia.org/T121085 and Wikipedia_talk:Lua#stripmarkers_and_mw.text.unstripNoWiki.28.29
TODO: move the replacement patterns and replacement values into a table in /Configuration similar to the invisible
characters table?
]]
local function coins_cleanup (value)
local replaced = true; -- default state to get the do loop running
while replaced do -- loop until all math stripmarkers replaced
replaced, value = coins_replace_math_stripmarker (value); -- replace math stripmarker with text representation of the equation
end
value = value:gsub (cfg.stripmarkers['math'], "MATH RENDER ERROR"); -- one or more couldn't be replaced; insert vague error message
value = mw.text.unstripNoWiki (value); -- replace nowiki stripmarkers with their content
value = value:gsub ('<span class="nowrap" style="padding%-left:0%.1em;">'(s?)</span>', "'%1"); -- replace {{'}} or {{'s}} with simple apostrophe or apostrophe-s
value = value:gsub (' ', ' '); -- replace entity with plain space
value = value:gsub ('\226\128\138', ' '); -- replace hair space with plain space
if not mw.ustring.find (value, cfg.indic_script) then -- don't remove zero-width joiner characters from indic script
value = value:gsub ('‍', ''); -- remove ‍ entities
value = mw.ustring.gsub (value, '[\226\128\141\226\128\139\194\173]', ''); -- remove zero-width joiner, zero-width space, soft hyphen
end
value = value:gsub ('[\009\010\013 ]+', ' '); -- replace horizontal tab, line feed, carriage return with plain space
return value;
end
--[[--------------------------< C O I N S >--------------------------------------------------------------------
COinS metadata (see <http://ocoins.info/>) allows automated tools to parse the citation information.
]]
local function COinS(data, class)
if 'table' ~= type(data) or nil == next(data) then
return '';
end
for k, v in pairs (data) do -- spin through all of the metadata parameter values
if 'ID_list' ~= k and 'Authors' ~= k then -- except the ID_list and Author tables (author nowiki stripmarker done when Author table processed)
data[k] = coins_cleanup (v);
end
end
local ctx_ver = "Z39.88-2004";
-- treat table strictly as an array with only set values.
local OCinSoutput = setmetatable( {}, {
__newindex = function(self, key, value)
if is_set(value) then
rawset( self, #self+1, table.concat{ key, '=', mw.uri.encode( remove_wiki_link( value ) ) } );
end
end
});
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn', 'journal', 'news', 'magazine'}) or
(in_array (class, {'conference', 'interview', 'map', 'press release', 'web'}) and is_set(data.Periodical)) or
('citation' == class and is_set(data.Periodical) and not is_set (data.Encyclopedia)) then
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:journal"; -- journal metadata identifier
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) then -- set genre according to the type of citation template we are rendering
OCinSoutput["rft.genre"] = "preprint"; -- cite arxiv, cite biorxiv, cite citeseerx, cite medrxiv, cite ssrn
elseif 'conference' == class then
OCinSoutput["rft.genre"] = "conference"; -- cite conference (when Periodical set)
elseif 'web' == class then
OCinSoutput["rft.genre"] = "unknown"; -- cite web (when Periodical set)
else
OCinSoutput["rft.genre"] = "article"; -- journal and other 'periodical' articles
end
OCinSoutput["rft.jtitle"] = data.Periodical; -- journal only
OCinSoutput["rft.atitle"] = data.Title; -- 'periodical' article titles
-- these used only for periodicals
OCinSoutput["rft.ssn"] = data.Season; -- keywords: winter, spring, summer, fall
OCinSoutput["rft.quarter"] = data.Quarter; -- single digits 1->first quarter, etc.
OCinSoutput["rft.chron"] = data.Chron; -- free-form date components
OCinSoutput["rft.volume"] = data.Volume; -- does not apply to books
OCinSoutput["rft.issue"] = data.Issue;
OCinSoutput['rft.artnum'] = data.ArticleNumber; -- {{cite journal}} only
OCinSoutput["rft.pages"] = data.Pages; -- also used in book metadata
elseif 'thesis' ~= class then -- all others except cite thesis are treated as 'book' metadata; genre distinguishes
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:book"; -- book metadata identifier
if 'report' == class or 'techreport' == class then -- cite report and cite techreport
OCinSoutput["rft.genre"] = "report";
elseif 'conference' == class then -- cite conference when Periodical not set
OCinSoutput["rft.genre"] = "conference";
OCinSoutput["rft.atitle"] = data.Chapter; -- conference paper as chapter in proceedings (book)
elseif in_array (class, {'book', 'citation', 'encyclopaedia', 'interview', 'map'}) then
if is_set (data.Chapter) then
OCinSoutput["rft.genre"] = "bookitem";
OCinSoutput["rft.atitle"] = data.Chapter; -- book chapter, encyclopedia article, interview in a book, or map title
else
if 'map' == class or 'interview' == class then
OCinSoutput["rft.genre"] = 'unknown'; -- standalone map or interview
else
OCinSoutput["rft.genre"] = 'book'; -- book and encyclopedia
end
end
else -- {'audio-visual', 'AV-media-notes', 'DVD-notes', 'episode', 'interview', 'mailinglist', 'map', 'newsgroup', 'podcast', 'press release', 'serial', 'sign', 'speech', 'web'}
OCinSoutput["rft.genre"] = "unknown";
end
OCinSoutput["rft.btitle"] = data.Title; -- book only
OCinSoutput["rft.place"] = data.PublicationPlace; -- book only
OCinSoutput["rft.series"] = data.Series; -- book only
OCinSoutput["rft.pages"] = data.Pages; -- book, journal
OCinSoutput["rft.edition"] = data.Edition; -- book only
OCinSoutput["rft.pub"] = data.PublisherName; -- book and dissertation
else -- cite thesis
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:dissertation"; -- dissertation metadata identifier
OCinSoutput["rft.title"] = data.Title; -- dissertation (also patent but that is not yet supported)
OCinSoutput["rft.degree"] = data.Degree; -- dissertation only
OCinSoutput['rft.inst'] = data.PublisherName; -- book and dissertation
end
-- NB. Not currently supported are "info:ofi/fmt:kev:mtx:patent", "info:ofi/fmt:kev:mtx:dc", "info:ofi/fmt:kev:mtx:sch_svc", "info:ofi/fmt:kev:mtx:ctx"
-- and now common parameters (as much as possible)
OCinSoutput["rft.date"] = data.Date; -- book, journal, dissertation
for k, v in pairs( data.ID_list ) do -- what to do about these? For now assume that they are common to all?
if k == 'ISBN' then v = v:gsub( "[^-0-9X]", "" ); end
local id = cfg.id_handlers[k].COinS;
if string.sub( id or "", 1, 4 ) == 'info' then -- for ids that are in the info:registry
OCinSoutput["rft_id"] = table.concat{ id, "/", v };
elseif string.sub (id or "", 1, 3 ) == 'rft' then -- for isbn, issn, eissn, etc. that have defined COinS keywords
OCinSoutput[ id ] = v;
elseif 'url' == id then -- for urls that are assembled in ~/Identifiers; |asin= and |ol=
OCinSoutput["rft_id"] = table.concat ({data.ID_list[k], "#id-name=", cfg.id_handlers[k].label});
elseif id then -- when cfg.id_handlers[k].COinS is not nil so urls created here
OCinSoutput["rft_id"] = table.concat{ cfg.id_handlers[k].prefix, v, cfg.id_handlers[k].suffix or '', "#id-name=", cfg.id_handlers[k].label }; -- others; provide a URL and indicate identifier name as #fragment (human-readable, but transparent to browsers)
end
end
local last, first;
for k, v in ipairs( data.Authors ) do
last, first = coins_cleanup (v.last), coins_cleanup (v.first or ''); -- replace any nowiki stripmarkers, non-printing or invisible characters
if k == 1 then -- for the first author name only
if is_set(last) and is_set(first) then -- set these COinS values if |first= and |last= specify the first author name
OCinSoutput["rft.aulast"] = last; -- book, journal, dissertation
OCinSoutput["rft.aufirst"] = first; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation -- otherwise use this form for the first name
end
else -- for all other authors
if is_set(last) and is_set(first) then
OCinSoutput["rft.au"] = table.concat{ last, ", ", first }; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation
end
-- TODO: At present we do not report "et al.". Add anything special if this condition applies?
end
end
OCinSoutput.rft_id = data.URL;
OCinSoutput.rfr_id = table.concat{ "info:sid/", mw.site.server:match( "[^/]*$" ), ":", data.RawPage };
-- TODO: Add optional extra info:
-- rfr_dat=#REVISION<version> (referrer private data)
-- ctx_id=<data.RawPage>#<ref> (identifier for the context object)
-- ctx_tim=<ts> (timestamp in format yyyy-mm-ddThh:mm:ssTZD or yyyy-mm-dd)
-- ctx_enc=info:ofi/enc:UTF-8 (character encoding)
OCinSoutput = setmetatable( OCinSoutput, nil );
-- sort with version string always first, and combine.
-- table.sort( OCinSoutput );
table.insert( OCinSoutput, 1, "ctx_ver=" .. ctx_ver ); -- such as "Z39.88-2004"
return table.concat(OCinSoutput, "&");
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
has_accept_as_written = utilities_page_ptr.has_accept_as_written; -- import functions from selected Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
remove_wiki_link = utilities_page_ptr.remove_wiki_link;
strip_apostrophe_markup = utilities_page_ptr.strip_apostrophe_markup;
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
make_coins_title = make_coins_title,
get_coins_pages = get_coins_pages,
COinS = COinS,
set_selected_modules = set_selected_modules,
}
4fe549c532af319223cc4d9da2c6d33a786131c1
Module:Citation/CS1/styles.css
828
165
431
430
2023-10-17T20:36:16Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/styles.css]]
sanitized-css
text/css
/* Protection icon
the following line controls the page-protection icon in the upper right corner
it must remain within this comment
{{sandbox other||{{pp-template}}}}
*/
/* Overrides
Some wikis do not override user agent default styles for HTML <cite> and <q>,
unlike en.wp. On en.wp, keep these the same as [[MediaWiki:Common.css]].
The word-wrap and :target styles were moved here from Common.css.
On en.wp, keep these the same as [[Template:Citation/styles.css]].
*/
cite.citation {
font-style: inherit; /* Remove italics for <cite> */
/* Break long urls, etc., rather than overflowing box */
word-wrap: break-word;
}
.citation q {
quotes: '"' '"' "'" "'"; /* Straight quote marks for <q> */
}
/* Highlight linked elements (such as clicked references) in blue */
.citation:target {
/* ignore the linter - all browsers of interest implement this */
background-color: rgba(0, 127, 255, 0.133);
}
/* ID and URL access
Both core and Common.css have selector .mw-parser-output a[href$=".pdf"].external
for PDF pages. All TemplateStyles pages are hoisted to .mw-parser-output. We need
to have specificity equal to a[href$=".pdf"].external for locks to override PDF icon.
That's essentially 2 classes and 1 element.
the .id-lock-... selectors are for use by non-citation templates like
{{Catalog lookup link}} which do not have to handle PDF links
*/
.id-lock-free a,
.citation .cs1-lock-free a {
background: url(//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg)
right 0.1em center/9px no-repeat;
}
.id-lock-limited a,
.id-lock-registration a,
.citation .cs1-lock-limited a,
.citation .cs1-lock-registration a {
background: url(//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg)
right 0.1em center/9px no-repeat;
}
.id-lock-subscription a,
.citation .cs1-lock-subscription a {
background: url(//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg)
right 0.1em center/9px no-repeat;
}
/* Wikisource
Wikisource icon when |chapter= or |title= is wikilinked to Wikisource
as in cite wikisource
*/
.cs1-ws-icon a {
background: url(//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg)
right 0.1em center/12px no-repeat;
}
/* Errors and maintenance */
.cs1-code {
/* <code>...</code> style override: mediawiki's css definition is specified here:
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/
69cd73811f7aadd093050dbf20ed70ef0b42a713/skins%2Fcommon%2FcommonElements.css#L199
*/
color: inherit;
background: inherit;
border: none;
padding: inherit;
}
.cs1-hidden-error {
display: none;
color: #d33;
}
.cs1-visible-error {
color: #d33;
}
.cs1-maint {
display: none;
color: #3a3;
margin-left: 0.3em;
}
/* Small text size
Set small text size in one place. 0.95 (here) * 0.9 (from references list) is
~0.85, which is the lower bound for size for accessibility. Old styling for this
was just 0.85. We could write the rule so that when this template is inside
references/reflist, only then does it multiply by 0.95; else multiply by 0.85 */
.cs1-format {
font-size: 95%;
}
/* kerning */
.cs1-kern-left {
padding-left: 0.2em;
}
.cs1-kern-right {
padding-right: 0.2em;
}
/* selflinks – avoid bold font style when cs1|2 template links to the current page */
.citation .mw-selflink {
font-weight: inherit;
}
7c96feb084b1883e7b6522660da6a14bdcc94752
Template:Flatlist
10
166
433
432
2023-10-17T20:36:18Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Flatlist]]
wikitext
text/x-wiki
<templatestyles src="Hlist/styles.css"/><div class="hlist {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
{{{1}}}
</div>}}<noinclude></div>
{{documentation}}
</noinclude>
cf60aa4aef920d48fa394e786f72fe5f6dcd3169
Template:Both
10
167
435
434
2023-10-17T20:36:19Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Both]]
wikitext
text/x-wiki
{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{SAFESUBST:<noinclude />#if:{{{2|}}}|1}}}}<noinclude>
{{documentation}}
</noinclude>
57c3c0ffa811a7f31c675b2d79aedf4382e9b88d
Template:Spaces
10
168
437
436
2023-10-17T20:36:21Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Spaces]]
wikitext
text/x-wiki
<span class="nowrap">{{#iferror:{{#expr:{{{1|1}}}}}
|{{#switch:{{{1}}}
|fig= 
|en= 
|em= 
|thin= 
|hair= 
|
}}
|{{#invoke:String|rep|{{#switch:{{{2}}}
|fig= 
|en= 
|em= 
|thin= 
|hair= 
|
}}|{{{1|1}}}}}
}}</span><noinclude>
{{documentation}}
</noinclude>
a9ed762825e7579f15dcb9b171b0c1c3bf524b3f
Template:Cite web
10
169
439
438
2023-10-17T20:36:22Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Cite_web]]
wikitext
text/x-wiki
<includeonly>{{#invoke:citation/CS1|citation
|CitationClass=web
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
ea1b0f38afd9728a1cf9f2e3f540887a402fab8e
Template:Reflist
10
170
441
440
2023-10-17T20:36:23Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Reflist]]
wikitext
text/x-wiki
<templatestyles src="Reflist/styles.css" /><div class="reflist <!--
-->{{#if:{{{1|}}}{{{colwidth|}}}|reflist-columns references-column-width}} <!--
-->{{#switch:{{{liststyle|{{{group|}}}}}}|upper-alpha|upper-roman|lower-alpha|lower-greek|lower-roman=reflist-{{{liststyle|{{{group}}}}}}}} <!--
-->{{#if:{{{1|}}}|{{#iferror:{{#ifexpr: {{{1|1}}} > 1 }}||{{#switch:{{{1|}}}|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" <!-- end class
-->{{#if: {{{1|}}}<!-- start style -->
| {{#iferror: {{#ifexpr: {{{1|1}}} > 1 }} |style="column-width: {{{1}}};"}}
| {{#if: {{{colwidth|}}}|style="column-width: {{{colwidth}}};"}}
}}>
{{#tag:references|{{{refs|}}}|group={{{group|}}}|responsive={{#if:{{{1|}}}{{{colwidth|}}}|0|1}}}}</div>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using reflist with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Reflist]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | colwidth | group | liststyle | refs }}<noinclude>
{{Documentation}}
</noinclude>
8c65cc88272db6c0f5cf2b49f84d3e460e60ee5f
Template:Reflist/styles.css
10
171
443
442
2023-10-17T20:36:23Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Reflist/styles.css]]
sanitized-css
text/css
/* {{pp|small=yes}} */
/* can we remove the font size declarations? .references gets a font-size in
* common.css that is always 90, and there is nothing else in reflist out in
* the wild. May affect column sizes.
*/
.reflist {
font-size: 90%; /* Default font-size */
margin-bottom: 0.5em;
list-style-type: decimal;
}
.reflist .references {
font-size: 100%; /* Reset font-size when nested in div.reflist */
margin-bottom: 0; /* Avoid double margin when nested in div.reflist */
list-style-type: inherit; /* Enable custom list style types */
}
/* columns-2 and columns-3 are legacy for "2 or more" column view from when the
* template was implemented with column-count.
*/
.reflist-columns-2 {
column-width: 30em;
}
.reflist-columns-3 {
column-width: 25em;
}
/* Reset top margin for lists embedded in columns */
.reflist-columns {
margin-top: 0.3em;
}
.reflist-columns ol {
margin-top: 0;
}
/* Avoid elements breaking between columns */
.reflist-columns li {
page-break-inside: avoid; /* Removed from CSS in favor of break-inside c. 2020 */
break-inside: avoid-column;
}
.reflist-upper-alpha {
list-style-type: upper-alpha;
}
.reflist-upper-roman {
list-style-type: upper-roman;
}
.reflist-lower-alpha {
list-style-type: lower-alpha;
}
.reflist-lower-greek {
list-style-type: lower-greek;
}
.reflist-lower-roman {
list-style-type: lower-roman;
}
531a26d48f0e7826c61f764cfb7d5fb200032c34
Template:If empty
10
172
445
444
2023-10-17T20:36:24Z
LamayII
2
1 revision imported from [[:wikipedia:Template:If_empty]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>{{Documentation}}</noinclude>
745940b7bdde8a1585c887ee4ee5ce81d98461a4
Module:If empty
828
173
447
446
2023-10-17T20:36:25Z
LamayII
2
1 revision imported from [[:wikipedia:Module:If_empty]]
Scribunto
text/plain
local p = {}
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
for k,v in ipairs(args) do
if v ~= '' then
return v
end
end
end
return p
4790391408957dea3ff9f453834c05f6b379a45c
Template:Cite encyclopedia
10
174
449
448
2023-10-17T20:36:25Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Cite_encyclopedia]]
wikitext
text/x-wiki
<includeonly>{{#invoke:citation/CS1|citation
|CitationClass=encyclopaedia
}}</includeonly><noinclude>
{{documentation}}
[[Category:Lua-based templates]]
</noinclude>
a5fbaa0493d06b11ef4dd711383f9fd5174a4238
Template:Lang-fr
10
175
451
450
2023-10-17T20:36:25Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Lang-fr]]
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=fr
}}</includeonly><noinclude>
{{documentation|Template:Lang-x/doc}}
[[Category:Italic multilingual support templates]]
</noinclude>
d931674bb3f25747fd413f72d24d104de98129b6
Module:Side box
828
176
453
452
2023-10-17T20:36:27Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Side_box]]
Scribunto
text/plain
local yesno = require('Module:Yesno')
local p = {}
local function makeData(args)
local data = {}
-- Main table classes
data.classes = {}
if yesno(args.metadata) ~= false then
table.insert(data.classes, 'metadata')
end
if args.position and args.position:lower() == 'left' then
table.insert(data.classes, 'side-box-left')
else
table.insert(data.classes, 'side-box-right')
end
if args.collapsible then
table.insert(data.classes, 'mw-collapsible')
if args.collapsible == "collapsed" then
table.insert(data.classes, 'mw-collapsed')
end
data.collapsible = true
end
table.insert(data.classes, args.class)
-- Image
if args.image and args.image ~= 'none' then
data.image = args.image
end
-- we have to check to see if a downstream use has plainlist like
-- Template:Sister_project. also it's the default. wikitext is :(
if args.textclass == 'plainlist' or not args.textclass then
data.textclass = 'plainlist'
data.plainlist_templatestyles = 'Plainlist/styles.css'
else
data.textclass = args.textclass
end
-- Copy over data that does not need adjusting
local argsToCopy = {
-- aria qualities
'role',
'labelledby',
-- Styles
'style',
'textstyle',
'templatestyles',
-- Above row
'above',
'abovestyle',
-- Body row
'text',
'imageright',
-- Below row
'below',
}
for i, key in ipairs(argsToCopy) do
data[key] = args[key]
end
return data
end
local function renderSidebox(data)
-- Renders the sidebox HTML.
-- Table root
local root = mw.html.create('div')
root:attr('role', data.role)
:attr('aria-labelledby', data.labelledby)
:addClass('side-box')
for i, class in ipairs(data.classes or {}) do
root:addClass(class)
end
if data.style then
root:cssText(data.style)
end
local frame = mw.getCurrentFrame()
if data.plainlist_templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles', args = { src = data.plainlist_templatestyles }
})
end
-- The "above" row
if data.above then
local above = root:newline():tag('div')
above:addClass('side-box-abovebelow')
:newline()
:wikitext(data.above)
if data.textstyle then
above:cssText(data.textstyle)
end
if data.abovestyle then
above:cssText(data.abovestyle)
end
end
-- The body row
local body = root:newline():tag('div')
body:addClass('side-box-flex')
:addClass(data.collapsible and 'mw-collapsible-content')
:newline()
if data.image then
body:tag('div')
:addClass('side-box-image')
:wikitext(data.image)
end
local text = body:newline():tag('div')
text:addClass('side-box-text')
:addClass(data.textclass)
if data.textstyle then
text:cssText(data.textstyle)
end
text:wikitext(data.text)
if data.imageright then
body:newline():tag('div')
:addClass('side-box-imageright')
:wikitext(data.imageright)
end
-- The below row
if data.below then
local below = root:newline():tag('div')
below
:addClass('side-box-abovebelow')
:wikitext(data.below)
if data.textstyle then
below:cssText(data.textstyle)
end
end
root:newline()
local templatestyles = ''
if data.templatestyles then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = data.templatestyles }
}
end
return frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Side box/styles.css' }
} .. templatestyles .. tostring(root)
end
function p._main(args)
local data = makeData(args)
return renderSidebox(data)
end
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
return p
096bef4a3721857fc16eb509a4f8d75973484485
Template:Anchor
10
177
455
454
2023-10-17T20:36:28Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Anchor]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:anchor|main}}<noinclude>
{{Documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
7d65122552007ac959072bddfa6f723296c81998
Template:Ombox
10
178
457
456
2023-10-17T20:36:28Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Ombox]]
wikitext
text/x-wiki
{{#invoke:Message box|ombox}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
0e54065432d540737b9e56c4e3a8e7f74d4534ea
Module:Anchor
828
179
459
458
2023-10-17T20:36:29Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Anchor]]
Scribunto
text/plain
-- This module implements {{anchor}}.
local getArgs = require('Module:Arguments').getArgs
local tableTools = require('Module:TableTools')
local p = {}
function p.main(frame)
-- Get the positional arguments from #invoke, remove any nil values,
-- and pass them to p._main.
local args = getArgs(frame)
local argArray = tableTools.compressSparseArray(args)
return p._main(unpack(argArray))
end
function p._main(...)
-- Generate the list of anchors.
local anchors = {...}
local ret = {}
for _, anchor in ipairs(anchors) do
ret[#ret + 1] = '<span class="anchor" id="' .. anchor .. '"></span>'
end
return table.concat(ret)
end
return p
e41d3f5d2f2840528aebb9bac719873540fcb3b8
Template:Side box
10
180
461
460
2023-10-17T20:36:29Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Side_box]]
wikitext
text/x-wiki
{{#invoke:Side box|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
f02d48c7bd2f7bc64e2982d16b3578c99137d27e
Template:Sister project
10
181
463
462
2023-10-17T20:36:30Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Sister_project]]
wikitext
text/x-wiki
{{Side box
| metadata=no
| position = {{{position|}}}
| image =
{{#switch: {{{image|}}}
| none = <!-- "image=none", do nothing -->
| = <!-- No image fed, select an image -->
[[File:{{#switch: {{lc: {{{project|}}} }}
| commons|c = Commons-logo.svg
| meta|metawiki|m = Wikimedia Community Logo.svg
| wikibooks|wbk|wb|b = Wikibooks-logo-en-noslogan.svg
| wikidata|data = Wikidata-logo.svg
| wikiquote|quote|wqt|q = Wikiquote-logo.svg
| wikipedia|wp|w|iw = Wikipedia-logo-v2.svg
| wikisource|source|ws|s = Wikisource-logo.svg
| wiktionary|wikt|wkt|wdy|d = Wiktionary-logo-en-v2.svg
| wikinews|news|wnw|n = Wikinews-logo.svg
| wikispecies|species = Wikispecies-logo.svg
| wikiversity|wvy|v = Wikiversity logo 2017.svg
| wikivoyage|voyage|voy = Wikivoyage-Logo-v3-icon.svg
| mediawiki|mw = MediaWiki-2020-icon.svg
| outreachwiki|outreach = Wikimedia Outreach.png
| incubator = Incubator-notext.svg
| #default = Wikimedia-logo.svg
}}|40x40px|class=noviewer|alt=|link=
]]
| #default = {{{image|}}}
}}
| textclass = {{{textclass|plainlist}}}
| textstyle = {{{textstyle|}}}
| text = {{{text}}}
| below = {{{below|}}}
| imageright = {{{imageright|}}}
| class = plainlinks sistersitebox
}}<noinclude>{{Documentation}}<!-- Add categories and interwikis to the /doc subpage, not here! --></noinclude>
0929197ea6267d9d63d80f9f8432fe1cfbe7ace8
Module:Template wrapper
828
182
465
464
2023-10-17T20:36:31Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Template_wrapper]]
Scribunto
text/plain
require('strict');
local error_msg = '<span style=\"font-size:100%\" class=\"error\"><code style=\"color:inherit; border:inherit; padding:inherit;\">|_template=</code> missing or empty</span>';
--[[--------------------------< I S _ I N _ T A B L E >--------------------------------------------------------
scan through tbl looking for value; return true if found, false else
]]
local function is_in_table (tbl, value)
for k, v in pairs (tbl) do
if v == value then return true end
end
return false;
end
--[[--------------------------< A D D _ P A R A M E T E R >----------------------------------------------------
adds parameter name and its value to args table according to the state of boolean list argument; kv pair for
template execution; k=v string for template listing.
]]
local function add_parameter (k, v, args, list)
if list then
table.insert( args, table.concat ({k, '=', v})); -- write parameter names and values to args table as string
else
args[k] = v; -- copy parameters to args table
end
end
--[[--------------------------< A L I A S _ M A P _ G E T >----------------------------------------------------
returns a table of local template (parent frame) parameter names and the target template names that match where
in [key]=<value> pairs where:
[key] is local template parameter name (an alias)
<value> is target template parameter name (the canonical parameter name used in the working template)
The parameter |_alias-map= has the form:
|_alias-map=<list>
where <list> is a comma-separated list of alias / canonical parameter name pairs in the form
<from> : <to>
where:
<from> is the local template's parameter name (alias)
<to> is the target template's parameter name (canonical)
for enumerated parameters place an octothorp (#) where the enumerator digits are placed in the parameter names:
<from#> : <to#>
]]
local function alias_map_get (_alias_map)
local T = mw.text.split (_alias_map, '%s*,%s*'); -- convert the comma-separated list into a table of alias pairs
local mapped_aliases = {}; -- mapped aliases will go here
local l_name, t_name; -- parameter names
for _, alias_pair in ipairs (T) do -- loop through the table of alias pairs
l_name, t_name = alias_pair:match ('(.-)%s*:%s*(.+)'); -- from each pair, get local and target parameter names
if l_name and t_name then -- if both are set
if tonumber (l_name) then
l_name = tonumber (l_name); -- convert number-as-text to a number
end
mapped_aliases[l_name] = t_name; -- add them to the map table
end
end
return mapped_aliases;
end
--[[--------------------------< F R A M E _ A R G S _ G E T >--------------------------------------------------
Fetch the wrapper template's 'default' and control parameters; adds default parameters to args
returns content of |_template= parameter (name of the working template); nil else
]]
local function frame_args_get (frame_args, args, list)
local template;
for k, v in pairs (frame_args) do -- here we get the wrapper template's 'default' parameters
if 'string' == type (k) and (v and ('' ~= v)) then -- do not pass along positional or empty parameters
if '_template' == k then
template = v; -- save the name of template that we are wrapping
elseif '_exclude' ~= k and '_reuse' ~= k and '_include-positional' ~= k and '_alias-map' ~= k then -- these already handled so ignore here;
add_parameter (k, v, args, list); -- add all other parameters to args in the style dictated by list
end
end
end
return template; -- return contents of |_template= parameter
end
--[=[--------------------------< P F R A M E _ A R G S _ G E T >------------------------------------------------
Fetches the wrapper template's 'live' parameters; adds live parameters that aren't members of the exclude table to
args table; positional parameters may not be excluded
no return value
]=]
local function pframe_args_get (pframe_args, args, exclude, _include_positional, list)
for k, v in pairs (pframe_args) do
if 'string' == type (k) and not is_in_table (exclude, k) then -- do not pass along excluded parameters
if v and ('' ~= v) then -- pass along only those parameters that have assigned values
if 'unset' == v:lower() then -- special keyword to unset 'default' parameters set in the wrapper template
v = ''; -- unset the value in the args table
end
add_parameter (k, v, args, list) -- add all other parameters to args in the style dictated by list; alias map only supported for local-template parameters
end
end
end
if _include_positional then
for i, v in ipairs (pframe_args) do -- pass along positional parameters
if 'unset' == v:lower() then -- special keyword to unset 'default' parameters set in the wrapper template
v = ''; -- unset the value in the args table
end
add_parameter (i, v, args, list);
end
end
end
--[[--------------------------< _ M A I N >--------------------------------------------------------------------
Collect the various default and live parameters into args styled according to boolean list.
returns name of the working or listed template or nil for an error message
]]
local function _main (frame, args, list)
local template;
local exclude = {}; -- table of parameter names for parameters that are not passed to the working template
local reuse_list = {}; -- table of pframe parameter names whose values are modified before they are passed to the working template as the same name
local alias_map = {}; -- table that maps parameter aliases to working template canonical parameter names
local _include_positional;
if frame.args._exclude and ('' ~= frame.args._exclude) then -- if there is |_exclude= and it's not empty
exclude = mw.text.split (frame.args._exclude, "%s*,%s*"); -- make a table from its contents
end
-- TODO: |_reuse= needs a better name (|_reuse=)
if frame.args._reuse and ('' ~= frame.args._reuse) then -- if there is |_reuse= and it's not empty
reuse_list = mw.text.split (frame.args._reuse, "%s*,%s*"); -- make a table from its contents
end
if frame.args['_alias-map'] and ('' ~= frame.args['_alias-map']) then -- if there is |_alias-map= and it's not empty
alias_map = alias_map_get (frame.args['_alias-map']); -- make a table from its contents
end
template = frame_args_get (frame.args, args, list); -- get parameters provided in the {{#invoke:template wrapper|...|...}}
if nil == template or '' == template then -- this is the one parameter that is required by this module
return nil; -- not present, tell calling function to emit an error message
end
_include_positional = 'yes' == frame.args['_include-positional']; -- when true pass all positional parameters along with non-excluded named parameters to ...
-- ... the working template; positional parameters are not excludable
local _pframe_args = frame:getParent().args; -- here we get the wrapper template's 'live' parameters from pframe.args
local pframe_args = {}; -- a local table that we can modify
for k, v in pairs (_pframe_args) do -- make a copy that we can modify
pframe_args[k] = v;
end
-- here we look for pframe parameters that are aliases of canonical parameter names; when found
-- we replace the alias with the canonical. We do this here because the reuse_list works on
-- canonical parameter names so first we convert alias parameter names to canonical names and then
-- we remove those canonical names from the pframe table that are reused (provided to the working
-- template through the frame args table)
for k, v in pairs (alias_map) do -- k is alias name, v is canonical name
if pframe_args[k] then -- if pframe_args has parameter with alias name
pframe_args[v] = _pframe_args[k]; -- create new canonical name with alias' value
pframe_args[k] = nil; -- unset the alias
end
end
for k, v in pairs (pframe_args) do -- do enumerated parameter alias -> canonical translation
if 'string' == type (k) then -- only named parameters can be enumerated
if alias_map[k..'#'] then -- non-enumerated alias matches enumerated parameter pattern? enumerator at end only
pframe_args[alias_map[k..'#']:gsub('#', '')] = v; -- remove '#' and copy parameter to pframe_args table
pframe_args[k] = nil; -- unset the alias
elseif k:match ('%d+') then -- if this parameter name contains digits
local temp = k:gsub ('%d+', '#'); -- make a copy; digits replaced with single '#'
local enum = k:match ('%d+'); -- get the enumerator
if alias_map[temp] then -- if this parameter is a recognized enumerated alias
pframe_args[alias_map[temp]:gsub('#', enum)] = v; -- use canonical name and replace '#' with enumerator and add to pframe_args
pframe_args[k] = nil; -- unset the alias
end
end
end
end
-- pframe parameters that are _reused are 'reused' have the form something like this:
-- |chapter=[[wikisource:{{{chapter}}}|{{{chapter}}}]]
-- where a parameter in the wrapping template is modified and then passed to the working template
-- using the same parameter name (in this example |chapter=)
-- remove parameters that will be reused
for k, v in ipairs (reuse_list) do -- k is numerical index, v is canonical parameter name to ignore
if pframe_args[v] then -- if pframe_args has parameter that should be ignored
pframe_args[v] = nil; -- unset the ignored parameter
end
end
pframe_args_get (pframe_args, args, exclude, _include_positional, list); -- add parameters and values to args that are not listed in the exclude table
return template; -- args now has all default and live parameters, return working template name
end
--[[--------------------------< W R A P >----------------------------------------------------------------------
Template entry point. Call this function to 'execute' the working template
]]
local function wrap (frame)
local args = {}; -- table of default and live parameters and their values to be passed to the wrapped template
local template; -- the name of the working template
template = _main (frame, args, false); -- get default and live parameters and the name of the working template
if not template then -- template name is required
return error_msg; -- emit error message and abandon if template name not present
end
return frame:expandTemplate {title=template, args=args}; -- render the working template
end
--[[--------------------------< L I S T >----------------------------------------------------------------------
Template entry point. Call this function to 'display' the source for the working template. This function added
as a result of a TfD here: Wikipedia:Templates_for_discussion/Log/2018_April_28#Module:PassArguments
This function replaces a similarly named function which was used in {{cite compare}} and {{cite compare2}}
Values in the args table are numerically indexed strings in the form 'name=value'
]]
local function list(frame, do_link)
local args = {}; -- table of default and live parameters and their values to be passed to the listed template
local template; -- the name of the listed template
template = _main (frame, args, true); -- get default and live parameters and the name of the listed template
if not template then -- template name is required
return error_msg; -- emit error message and abandon if template name not present
end
if do_link then
template = ('[[%s|%s]]'):format(frame:expandTemplate{ title='Transclude', args = {template} }, template)
end
table.sort(args)
for i = 1, #args do
local stripped = args[i]:match('^' .. i .. '=([^=]*)$')
if stripped then args[i] = stripped else break end
end
return frame:preprocess(table.concat({
'<code style="color:inherit; background:inherit; border:none;">{{',
template,
('<wbr><nowiki>|%s</nowiki>'):rep(#args):format(unpack(args)), '}}</code>'})); -- render the template
end
local function link (frame)
return list(frame, true)
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
link = link,
list = list,
wrap = wrap,
};
5e3d3ed3f3988725fb0fef6b44479bacc4210f37
Template:Coord
10
183
467
466
2023-10-17T20:36:31Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Coord]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Coordinates|coord}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
05c1e2a95ff86fa91442c704f36a9f125b603492
Template:Infobox settlement/areadisp
10
184
469
468
2023-10-17T20:36:32Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_settlement/areadisp]]
wikitext
text/x-wiki
<includeonly>{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}|area}}{{#if:{{{mag|}}}|/mag}}
|metv={{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{ha|}}}|{{{ha}}}|{{{km2}}}}}
|{{#if:{{{dunam|}}}
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<1E3
|{{round<!-- convert dunams to hectares -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/10}}
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+1)
}}<!-- end round -->
|{{round<!-- convert dunams to square kilometres -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/1E3}}
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+3)
}}<!-- end round -->
}}<!-- end #ifexpr:...{{{dunam}}}...<1E3 -->
|{{#if:{{{acre|}}}
|{{round<!-- convert acres to hectares -->
|{{#expr:{{formatnum:{{{acre}}}|R}}*0.4046856422}}
|{{max<!-- output at least one sig fig -->
|{{precision|{{formatnum:{{{acre}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{acre}}}|R}}*0.4046856422}}}}
}}<!-- end max -->
}}<!-- end round -->
|{{round<!-- convert square miles to square kilometres -->
|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2.589988110336}}
|{{max<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{sqmi}}}|R}}}}-1)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2.589988110336}}}}
}}<!-- end max -->
}}<!-- end rnd -->
}}<!-- end #if:{{{acre|}}} -->
}}<!-- end #if:{{{dunam|}}} -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
|metu={{#if:{{{ha|}}}{{#if:{{{km2|}}}
|
|{{#if:{{{dunam|}}}
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<1E3|X}}
|{{{acre|}}}
}}
}}
|ha
|km<sup>2</sup>
}}
|impv={{#if:{{{acre|}}}{{{sqmi|}}}
|{{#if:{{{acre|}}}|{{{acre}}}|{{{sqmi}}}}}
|{{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{ha|}}}
|{{round<!-- convert hectares to acres -->
|{{#expr:{{formatnum:{{{ha}}}|R}}/0.4046856422}}
|({{precision|{{formatnum:{{{ha}}}|R}}}})
}}<!-- end round -->
|{{round<!-- convert square kilometres to square miles -->
|{{#expr:{{formatnum:{{{km2}}}|R}}/2.589988110336}}
|{{max<!-- output at least one sig fig -->
|{{precision|{{formatnum:{{{km2}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{km2}}}|R}}/2.589988110336}}}}
}}<!-- end max -->
}}<!-- end round -->
}}<!-- end #if:{{{ha|}}} -->
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<2589
|{{round<!-- convert dunams to acres -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/4.046856422}}
|{{max<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{dunam}}}|R}}}})
|-{{Order of magnitude|{{#expr:{{formatnum:{{{dunam}}}|R}}/4.046856422}}}}
}}<!-- end max -->
}}<!-- end round -->
|{{round<!-- convert dunams to square miles -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/2589.988110336}}
|{{max<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+3)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{dunam}}}|R}}/2589.988110336}}}}
}}<!-- end max -->
}}<!-- end round -->
}}<!-- end #ifexpr:...{{{dunam}}}...<2589 -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
}}<!-- end #if:{{{acre|}}}{{{sqmi|}}} -->
|impu={{#if:{{{acre|}}}{{#if:{{{sqmi|}}}
|
|{{{ha|}}}{{#if:{{{km2|}}}
|
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<2589|X}}
}}
}}
|acre
|sq mi
}}
|dunv={{#if:{{#ifeq:{{lc:{{{pref}}}}}|dunam|{{{dunam|}}}|no dunams}}
|{{{dunam}}}
|{{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{km2|}}}
|{{round<!-- convert square kilometres to dunams -->
|{{#expr:{{formatnum:{{{km2}}}|R}}*1E3}}
|({{precision|{{formatnum:{{{km2}}}|R}}}}-3)
}}<!-- end round -->
|{{round<!-- convert hectares to dunams -->
|{{#expr:{{formatnum:{{{ha}}}|R}}*10}}
|({{precision|{{formatnum:{{{ha}}}|R}}}}-1)
}}<!-- end round -->
}}<!-- end #if:{{{km2|}}} -->
|{{#if:{{{sqmi|}}}
|{{round<!-- convert square miles to dunams -->
|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2589.988110336}}
|{{max<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{sqmi}}}|R}}}}-4)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2589.988110336}}}}
}}<!-- end max -->
}}<!-- end round -->
|{{round<!-- convert acres to dunams -->
|{{#expr:{{formatnum:{{{acre}}}|R}}*4.046856422}}
|{{max<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{acre}}}|R}}}}-1)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{acre}}}|R}}*4.046856422}}}}
}}<!-- end max -->
}}<!-- end round -->
}}<!-- end #if:{{{sqmi|}}} -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
}}
|dunu={{#if:{{{link|}}}|[[dunam]]|dunam}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
a6ccd372b44beed9525741b6fcd5317fb970eb89
Template:Infobox settlement/columns
10
185
471
470
2023-10-17T20:36:32Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_settlement/columns]]
wikitext
text/x-wiki
<templatestyles src="Infobox settlement/columns/styles.css"/>
<div class="ib-settlement-cols">
<div class="ib-settlement-cols-row">{{#if:{{{0|}}}
|<!-- if 0
-->{{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}
|<!-- if 0 and (1 or 2 or 3 or 4 or 5)
--><div class="ib-settlement-cols-cellt">
{{#if:{{{1|}}}|<div>{{{1}}}</div>}}
{{#if:{{{2|}}}|<div>{{{2}}}</div>}}
{{#if:{{{3|}}}|<div>{{{3}}}</div>}}
{{#if:{{{4|}}}|<div>{{{4}}}</div>}}
{{#if:{{{5|}}}|<div>{{{5}}}</div>}}
</div>
}}<div class="ib-settlement-cols-cellt">{{{0}}}</div>
|<!-- if not 0
-->{{#ifexpr:({{#if:{{{1|}}}|1|0}}+{{#if:{{{2|}}}|1|0}}+{{#if:{{{3|}}}|1|0}}+{{#if:{{{4|}}}|1|0}}) > 2
|<!-- if more than two images
-->{{#if:{{{1|}}}
|<div class="ib-settlement-cols-cell">{{{1}}}</div>{{#if:{{{2|}}}||</div></div><div class="ib-settlement-cols"><!-- TODO: The "3" element case currently produces two div-tables, which is non-optimal, but someone else should figure out how to fix it; 4 and 2 cases output as one "table". --><div class="ib-settlement-cols-row">}}
}}{{#if:{{{2|}}}
|<div class="ib-settlement-cols-cell">{{{2}}}</div>{{#if:{{{1|}}}||</div></div><div class="ib-settlement-cols"><div class="ib-settlement-cols-row">}}
}}</div><div class="ib-settlement-cols-row">{{#if:{{{3|}}}
|{{#if:{{{4|}}}||</div></div><div class="ib-settlement-cols"><div class="ib-settlement-cols-row">}}<div class="ib-settlement-cols-cell">{{{3}}}</div>
}}{{#if:{{{4|}}}
|{{#if:{{{3|}}}||</div></div><div class="ib-settlement-cols"><div class="ib-settlement-cols-row">}}<div class="ib-settlement-cols-cell">{{{4}}}</div>
}}
|<!-- if two or fewer images
-->{{#if:{{{1|}}}|<div class="ib-settlement-cols-cell">{{{1}}}</div>}}<!--
-->{{#if:{{{2|}}}|<div class="ib-settlement-cols-cell">{{{2}}}</div>}}<!--
-->{{#if:{{{3|}}}|<div class="ib-settlement-cols-cell">{{{3}}}</div>}}<!--
-->{{#if:{{{4|}}}|<div class="ib-settlement-cols-cell">{{{4}}}</div>}}
}}
}}</div></div><noinclude>
{{documentation}}
</noinclude>
bdd926fcf77e5f0f9f899ac6b2e23cd7efc8584e
Template:Infobox settlement/columns/styles.css
10
186
473
472
2023-10-17T20:36:33Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_settlement/columns/styles.css]]
sanitized-css
text/css
/* {{pp|small=y}} */
.ib-settlement-cols {
text-align: center;
display: table;
width: 100%;
}
.ib-settlement-cols-row {
display: table-row;
}
.ib-settlement-cols-cell {
display: table-cell;
vertical-align: middle;
}
.ib-settlement-cols-cellt {
display: table-cell;
vertical-align: top;
}
7dbb426d519700a7c47317b5c131244df8fc62f0
Template:Infobox settlement/densdisp
10
187
475
474
2023-10-17T20:36:33Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_settlement/densdisp]]
wikitext
text/x-wiki
<includeonly>{{#if:
{{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#switch:auto
|{{{/km2}}}|{{{/sqmi}}}={{#iferror:{{#expr:-{{formatnum:{{{pop}}}|R}}}}
||{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{acre|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{dunam|}}}|R}}}}}}
+0
>0
|1}}
}}
}}
|1
}}
|1
}}
|{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}}}
|metv={{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}+0>0
|{{round|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}+0>0
|{{round|{{#expr:100*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:100*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{dunam|}}}|R}}}}}}+0>0
|{{round|{{#expr:1000*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:1000*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}+0>0
|{{round|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}/2.589988110336}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}/2.589988110336}}}}}}}}
|{{round|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}/0.004046856422}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}/0.004046856422}}}}}}}}
}}}}}}}}
|{{round
|{{#expr:{{formatnum:{{{/sqmi}}}|R}}/2.589988110336}}
|{{max
|{{precision|{{formatnum:{{{/sqmi}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{/sqmi}}}|R}}/2.589988110336}}}}
}}
}}
}}
|{{{/km2}}}
}}
|metu=km<sup>2</sup>
|impv={{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}+0>0
|{{round|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{acre|}}}|R}}}}}}+0>0
|{{round|{{#expr:640*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:640*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}+0>0
|{{round|{{#expr:2.589988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:2.589988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}+0>0
|{{round|{{#expr:258.9988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:258.9988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}}}}}}}
|{{round|{{#expr:2589.988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:2589.988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}}}}}}}
}}}}}}}}
|{{round
|{{#expr:{{formatnum:{{{/km2}}}|R}}*2.589988110336}}
|{{max
|{{#expr:{{precision|{{formatnum:{{{/km2}}}|R}}}}-1}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{/km2}}}|R}}*2.589988110336}}}}
}}
}}
}}
|{{{/sqmi}}}
}}
|impu=sq mi
|s=/
}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
8d2587f8008e5720272fd3abbbdd54f8c8dc306a
Template:Infobox settlement/impus
10
188
477
476
2023-10-17T20:36:34Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_settlement/impus]]
wikitext
text/x-wiki
<includeonly>{{formatnum:{{replace|{{{impv}}}|,|}}}}{{{s| }}}{{{impu|ft}}}{{#ifeq:{{{impv|0}}}|1||{{#ifeq:{{{s}}}|/||{{#ifeq:{{{impu}}}|acre|s}}}}}} ({{formatnum:{{replace|{{{metv}}}|,|}}}}{{{s| }}}{{{metu|m}}})</includeonly><noinclude>
{{documentation}}
</noinclude>
0244ccac23dfbd7d52720d359cd5d045d70a53bc
Template:Infobox settlement/lengthdisp
10
189
479
478
2023-10-17T20:36:34Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_settlement/lengthdisp]]
wikitext
text/x-wiki
<includeonly>{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}}}
|metv={{#if:{{{km|}}}{{{m|}}}
|{{{km|}}}{{{m|}}}
|{{#if:{{{mi|}}}
|{{round
|{{#expr:{{formatnum:{{{mi}}}|R}}*1.609344}}
|{{precision|{{formatnum:{{{mi}}}|R}}}}
}}
|{{round
|{{#expr:{{formatnum:{{{ft}}}|R}}*0.3048}}
|{{max
|{{precision|{{formatnum:{{{ft}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{ft}}}|R}}*0.3048}}}}
}}
}}
}}
}}
|metu={{#if:{{{km|}}}{{{mi|}}}|k}}m
|impv={{#if:{{{mi|}}}{{{ft|}}}
|{{{mi|}}}{{{ft|}}}
|{{#if:{{{km|}}}
|{{round
|{{#expr:{{formatnum:{{{km}}}|R}}/1.609344}}
|{{max
|{{precision|{{formatnum:{{{km}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{km}}}|R}}/1.609344}}}}
}}
}}
|{{round
|{{#expr:{{formatnum:{{{m}}}|R}}/0.3048}}
|{{precision|{{formatnum:{{{m}}}|R}}}}
}}
}}
}}
|impu={{#if:{{{km|}}}{{{mi|}}}|mi|ft}}
}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
8525c091822d9f317f267e88861faee9689a3a3f
Template:Infobox settlement/link
10
190
481
480
2023-10-17T20:36:35Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_settlement/link]]
wikitext
text/x-wiki
{{#if:{{{link|}}}<!--
-->|[[{{{link}}}|{{{type}}}]]<!--
-->|{{#ifexist:{{{type}}} of {{PAGENAME}}<!--
-->|[[{{{type}}} of {{PAGENAME}}|{{{type|}}}]]<!--
-->|{{#if:{{{name|}}}<!--
-->|{{#ifexist:{{{type}}} of {{{name}}}<!--
-->|[[{{{type}}} of {{{name}}}|{{{type|}}}]]<!--
-->|{{{type}}}<!--
-->}}<!--
-->|{{{type}}}<!--
-->}}<!--
-->}}<!--
-->}}<noinclude>
{{documentation}}
</noinclude>
7f1193f6be51d8bf296df176cd7c49b5d819202e
Template:Infobox settlement/pref
10
191
483
482
2023-10-17T20:36:35Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_settlement/pref]]
wikitext
text/x-wiki
<includeonly>{{#switch:{{ucfirst:{{{1}}}}}
|Imperial
|English
|UK|US|U.S.
|US Customary|U.S. Customary
|Standard = impus
|{{#switch:{{{2}}}
|[[United Kingdom]]|United Kingdom
|[[United States]]|United States
|[[United States of America]]|United States of America
|[[United States|United States of America]]
|[[Image:Flag of the United States.svg|20px]] [[United States]] = impus
|{{#ifeq:{{{3}}}_{{lc:{{{1}}}}}|area_dunam|dunam|metric}}
}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
7f7165e08b34afaaf9f84a31965beb8f3e8a21b8
Template:Infobox settlement/styles.css
10
192
485
484
2023-10-17T20:36:36Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_settlement/styles.css]]
sanitized-css
text/css
/* {{pp|small=y}} */
.ib-settlement {
width: 23em;
border-collapse: collapse;
line-height: 1.2em;
}
/* TODO split definitions to appropriate class names when live from HTML element */
.ib-settlement td,
.ib-settlement th {
border-top: 1px solid #a2a9b1;
padding: 0.4em 0.6em 0.4em 0.6em;
}
.ib-settlement .mergedtoprow .infobox-full-data,
.ib-settlement .mergedtoprow .infobox-header,
.ib-settlement .mergedtoprow .infobox-data,
.ib-settlement .mergedtoprow .infobox-label,
.ib-settlement .mergedtoprow .infobox-below {
border-top: 1px solid #a2a9b1;
padding: 0.4em 0.6em 0.2em 0.6em;
}
.ib-settlement .mergedrow .infobox-full-data,
.ib-settlement .mergedrow .infobox-data,
.ib-settlement .mergedrow .infobox-label {
border: 0;
padding: 0 0.6em 0.2em 0.6em;
}
.ib-settlement .mergedbottomrow .infobox-full-data,
.ib-settlement .mergedbottomrow .infobox-data,
.ib-settlement .mergedbottomrow .infobox-label {
border-top: 0;
border-bottom: 1px solid #a2a9b1;
padding: 0 0.6em 0.4em 0.6em;
}
.ib-settlement .maptable {
border: 0;
padding: 0;
}
.ib-settlement .infobox-header,
.ib-settlement .infobox-below {
text-align: left;
}
.ib-settlement .infobox-above {
font-size: 125%;
line-height: 1.3em;
}
.ib-settlement .infobox-subheader {
background-color: #cddeff;
font-weight: bold;
}
.ib-settlement-native {
font-weight: normal;
padding-top: 0.2em;
}
.ib-settlement-other-name {
font-size: 78%;
}
.ib-settlement-official {
font-weight: bold;
}
.ib-settlement-caption {
padding: 0.3em 0 0 0;
}
.ib-settlement-caption-link {
padding: 0.2em 0;
}
.ib-settlement-nickname {
display: inline;
}
.ib-settlement-fn {
font-weight: normal;
display: inline;
}
bcad428737f5a62eb7bced25a38fccbd46dde186
Template:Lang-la
10
193
487
486
2023-10-17T20:36:36Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Lang-la]]
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=la
}}</includeonly><noinclude>
{{Documentation|Template:Lang-x/doc}}
[[Category:Italic multilingual support templates]]
</noinclude>
e9fb23bc455a402a9643bb61d1c151a865c3ff66
Template:Nbsp
10
194
489
488
2023-10-17T20:36:36Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Nbsp]]
wikitext
text/x-wiki
#REDIRECT [[Template:Spaces]]
{{Redirect category shell|
{{R from move}}
{{R from alternative name}}
{{R from template shortcut}}
}}
13b85f36a53a9f13b06535afaa4c19339f1ea4b6
Template:Pluralize from text
10
195
491
490
2023-10-17T20:36:37Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Pluralize_from_text]]
wikitext
text/x-wiki
{{#invoke:Detect singular|pluralize}}<noinclude>{{documentation}}</noinclude>
305f4b531ea5639895c83cecd0fd809f7f5cf845
Template:Replace
10
196
493
492
2023-10-17T20:36:37Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Replace]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:String|replace|source={{{1}}}|{{{2}}}|{{{3}}}|plain={{{plain|true}}}|count={{{count|}}}}}<noinclude>
{{documentation}}
</noinclude>
4192ba916713e0f44fdfd0f8e0d9d105c0c85472
Template:Round
10
197
495
494
2023-10-17T20:36:38Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Round]]
wikitext
text/x-wiki
<includeonly>{{safesubst<noinclude/>:#iferror:{{#expr:{{{2|0}}}}} |
{{main other|[[Category:Pages with bad rounding precision]]}}{{hid|Bad rounding here}}<!--
-->{{safesubst<noinclude/>:#invoke:Math|precision_format| {{{1}}} | 1-{{order of magnitude|{{{1}}}}} }}|
{{safesubst<noinclude/>:#invoke:Math|precision_format| {{{1}}} | {{{2|0}}}}}}}</includeonly><noinclude>
{{documentation}}
</noinclude>
9c2874586b74824fe1beb6830b56eabe7ad936ce
Template:URL
10
198
497
496
2023-10-17T20:36:39Z
LamayII
2
1 revision imported from [[:wikipedia:Template:URL]]
wikitext
text/x-wiki
<includeonly>{{#invoke:URL|url}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using URL template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:URL]] with unknown parameter "_VALUE_"|ignoreblank=y | 1 | 2 }}<noinclude>{{documentation}}</noinclude>
5671474ce4656f07c5bdc47292d1dcbe9c70317e
Module:Check for clobbered parameters
828
199
499
498
2023-10-17T20:36:39Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Check_for_clobbered_parameters]]
Scribunto
text/plain
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
local checknested = isnotempty(args['nested'])
local delimiter = isnotempty(args['delimiter']) and args['delimiter'] or ';'
local argpairs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
local plist = mw.text.split(v, delimiter)
local pfound = {}
local count = 0
for ii, vv in ipairs(plist) do
vv = trim(vv)
if checknested and pargs[vv] or isnotempty(pargs[vv]) then
count = count + 1
table.insert(pfound, vv)
end
end
if count > 1 then
table.insert(argpairs, pfound)
end
end
end
local warnmsg = {}
local res = ''
local cat = ''
if args['cat'] and mw.ustring.match(args['cat'],'^[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]:') then
cat = args['cat']
end
local template = args['template'] and ' in ' .. args['template'] or ''
if #argpairs > 0 then
for i, v in ipairs( argpairs ) do
table.insert(
warnmsg,
mw.ustring.format(
'Using more than one of the following parameters%s: <code>%s</code>.',
template,
table.concat(v, '</code>, <code>')
)
)
if cat ~= '' then
res = res .. '[[' .. cat .. '|' .. (v[1] == '' and ' ' or '') .. v[1] .. ']]'
end
end
end
if #warnmsg > 0 then
res = require('Module:If preview')._warning({
table.concat(warnmsg, '<br>')
}) .. res
end
return res
end
return p
2d18fb6802fa261d88a0e135ab147ab9f062acde
Module:Coordinates
828
200
501
500
2023-10-17T20:36:40Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Coordinates]]
Scribunto
text/plain
--[[
This module is intended to replace the functionality of {{Coord}} and related
templates. It provides several methods, including
{{#invoke:Coordinates | coord }} : General function formatting and displaying
coordinate values.
{{#invoke:Coordinates | dec2dms }} : Simple function for converting decimal
degree values to DMS format.
{{#invoke:Coordinates | dms2dec }} : Simple function for converting DMS format
to decimal degree format.
{{#invoke:Coordinates | link }} : Export the link used to reach the tools
]]
require('strict')
local math_mod = require("Module:Math")
local coordinates = {};
local isSandbox = mw.getCurrentFrame():getTitle():find('sandbox', 1, true);
local current_page = mw.title.getCurrentTitle()
local page_name = mw.uri.encode( current_page.prefixedText, 'WIKI' );
local coord_link = 'https://geohack.toolforge.org/geohack.php?pagename=' .. page_name .. '¶ms='
--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(coords)
return mw.getCurrentFrame():extensionTag{
name = 'indicator',
args = { name = 'coordinates' },
content = '<span id="coordinates">[[Geographic coordinate system|Coordinates]]: ' .. coords .. '</span>'
}
end
--[[ Helper function, used in detecting DMS formatting ]]
local function dmsTest(first, second)
if type(first) ~= 'string' or type(second) ~= 'string' then
return nil
end
local s = (first .. second):upper()
return s:find('^[NS][EW]$') or s:find('^[EW][NS]$')
end
--[[ Wrapper function to grab args, see Module:Arguments for this function's documentation. ]]
local function makeInvokeFunc(funcName)
return function (frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Coord'
})
return coordinates[funcName](args, frame)
end
end
--[[ Helper function, handle optional args. ]]
local function optionalArg(arg, supplement)
return arg and arg .. supplement or ''
end
--[[
Formats any error messages generated for display
]]
local function errorPrinter(errors)
local result = ""
for i,v in ipairs(errors) do
result = result .. '<strong class="error">Coordinates: ' .. v[2] .. '</strong><br />'
end
return result
end
--[[
Determine the required CSS class to display coordinates
Usually geo-nondefault is hidden by CSS, unless a user has overridden this for himself
default is the mode as specificied by the user when calling the {{coord}} template
mode is the display mode (dec or dms) that we will need to determine the css class for
]]
local function displayDefault(default, mode)
if default == "" then
default = "dec"
end
if default == mode then
return "geo-default"
else
return "geo-nondefault"
end
end
--[[
specPrinter
Output formatter. Takes the structure generated by either parseDec
or parseDMS and formats it for inclusion on Wikipedia.
]]
local function specPrinter(args, coordinateSpec)
local uriComponents = coordinateSpec["param"]
if uriComponents == "" then
-- RETURN error, should never be empty or nil
return "ERROR param was empty"
end
if args["name"] then
uriComponents = uriComponents .. "&title=" .. mw.uri.encode(coordinateSpec["name"])
end
local geodmshtml = '<span class="geo-dms" title="Maps, aerial photos, and other data for this location">'
.. '<span class="latitude">' .. coordinateSpec["dms-lat"] .. '</span> '
.. '<span class="longitude">' ..coordinateSpec["dms-long"] .. '</span>'
.. '</span>'
local lat = tonumber( coordinateSpec["dec-lat"] ) or 0
local geodeclat
if lat < 0 then
-- FIXME this breaks the pre-existing precision
geodeclat = tostring(coordinateSpec["dec-lat"]):sub(2) .. "°S"
else
geodeclat = (coordinateSpec["dec-lat"] or 0) .. "°N"
end
local long = tonumber( coordinateSpec["dec-long"] ) or 0
local geodeclong
if long < 0 then
-- FIXME does not handle unicode minus
geodeclong = tostring(coordinateSpec["dec-long"]):sub(2) .. "°W"
else
geodeclong = (coordinateSpec["dec-long"] or 0) .. "°E"
end
local geodechtml = '<span class="geo-dec" title="Maps, aerial photos, and other data for this location">'
.. geodeclat .. ' '
.. geodeclong
.. '</span>'
local geonumhtml = '<span class="geo">'
.. coordinateSpec["dec-lat"] .. '; '
.. coordinateSpec["dec-long"]
.. '</span>'
local inner = '<span class="' .. displayDefault(coordinateSpec["default"], "dms" ) .. '">' .. geodmshtml .. '</span>'
.. '<span class="geo-multi-punct"> / </span>'
.. '<span class="' .. displayDefault(coordinateSpec["default"], "dec" ) .. '">';
if not args["name"] then
inner = inner .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span></span>'
else
inner = inner .. '<span class="vcard">' .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span>'
.. '<span style="display:none"> (<span class="fn org">'
.. args["name"] .. '</span>)</span></span></span>'
end
local stylesheetLink = 'Module:Coordinates' .. ( isSandbox and '/sandbox' or '' ) .. '/styles.css'
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = stylesheetLink }
} .. '<span class="plainlinks nourlexpansion">[' .. coord_link .. uriComponents ..
' ' .. inner .. ']</span>'
end
--[[ Helper function, convert decimal to degrees ]]
local function convert_dec2dms_d(coordinate)
local d = math_mod._round( coordinate, 0 ) .. "°"
return d .. ""
end
--[[ Helper function, convert decimal to degrees and minutes ]]
local function convert_dec2dms_dm(coordinate)
coordinate = math_mod._round( coordinate * 60, 0 );
local m = coordinate % 60;
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."°"
return d .. string.format( "%02d′", m )
end
--[[ Helper function, convert decimal to degrees, minutes, and seconds ]]
local function convert_dec2dms_dms(coordinate)
coordinate = math_mod._round( coordinate * 60 * 60, 0 );
local s = coordinate % 60
coordinate = math.floor( (coordinate - s) / 60 );
local m = coordinate % 60
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."°"
return d .. string.format( "%02d′", m ) .. string.format( "%02d″", s )
end
--[[
Helper function, convert decimal latitude or longitude to
degrees, minutes, and seconds format based on the specified precision.
]]
local function convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
local coord = tonumber(coordinate)
local postfix
if coord >= 0 then
postfix = firstPostfix
else
postfix = secondPostfix
end
precision = precision:lower();
if precision == "dms" then
return convert_dec2dms_dms( math.abs( coord ) ) .. postfix;
elseif precision == "dm" then
return convert_dec2dms_dm( math.abs( coord ) ) .. postfix;
elseif precision == "d" then
return convert_dec2dms_d( math.abs( coord ) ) .. postfix;
end
end
--[[
Convert DMS format into a N or E decimal coordinate
]]
local function convert_dms2dec(direction, degrees_str, minutes_str, seconds_str)
local degrees = tonumber(degrees_str)
local minutes = tonumber(minutes_str) or 0
local seconds = tonumber(seconds_str) or 0
local factor = 1
if direction == "S" or direction == "W" then
factor = -1
end
local precision = 0
if seconds_str then
precision = 5 + math.max( math_mod._precision(seconds_str), 0 );
elseif minutes_str and minutes_str ~= '' then
precision = 3 + math.max( math_mod._precision(minutes_str), 0 );
else
precision = math.max( math_mod._precision(degrees_str), 0 );
end
local decimal = factor * (degrees+(minutes+seconds/60)/60)
return string.format( "%." .. precision .. "f", decimal ) -- not tonumber since this whole thing is string based.
end
--[[
Checks input values to for out of range errors.
]]
local function validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, source, strong )
local errors = {};
lat_d = tonumber( lat_d ) or 0;
lat_m = tonumber( lat_m ) or 0;
lat_s = tonumber( lat_s ) or 0;
long_d = tonumber( long_d ) or 0;
long_m = tonumber( long_m ) or 0;
long_s = tonumber( long_s ) or 0;
if strong then
if lat_d < 0 then
table.insert(errors, {source, "latitude degrees < 0 with hemisphere flag"})
end
if long_d < 0 then
table.insert(errors, {source, "longitude degrees < 0 with hemisphere flag"})
end
--[[
#coordinates is inconsistent about whether this is an error. If globe: is
specified, it won't error on this condition, but otherwise it will.
For not simply disable this check.
if long_d > 180 then
table.insert(errors, {source, "longitude degrees > 180 with hemisphere flag"})
end
]]
end
if lat_d > 90 then
table.insert(errors, {source, "latitude degrees > 90"})
end
if lat_d < -90 then
table.insert(errors, {source, "latitude degrees < -90"})
end
if lat_m >= 60 then
table.insert(errors, {source, "latitude minutes >= 60"})
end
if lat_m < 0 then
table.insert(errors, {source, "latitude minutes < 0"})
end
if lat_s >= 60 then
table.insert(errors, {source, "latitude seconds >= 60"})
end
if lat_s < 0 then
table.insert(errors, {source, "latitude seconds < 0"})
end
if long_d >= 360 then
table.insert(errors, {source, "longitude degrees >= 360"})
end
if long_d <= -360 then
table.insert(errors, {source, "longitude degrees <= -360"})
end
if long_m >= 60 then
table.insert(errors, {source, "longitude minutes >= 60"})
end
if long_m < 0 then
table.insert(errors, {source, "longitude minutes < 0"})
end
if long_s >= 60 then
table.insert(errors, {source, "longitude seconds >= 60"})
end
if long_s < 0 then
table.insert(errors, {source, "longitude seconds < 0"})
end
return errors;
end
--[[
parseDec
Transforms decimal format latitude and longitude into the
structure to be used in displaying coordinates
]]
local function parseDec( lat, long, format )
local coordinateSpec = {}
local errors = {}
if not long then
return nil, {{"parseDec", "Missing longitude"}}
elseif not tonumber(long) then
return nil, {{"parseDec", "Longitude could not be parsed as a number: " .. long}}
end
errors = validate( lat, nil, nil, long, nil, nil, 'parseDec', false );
coordinateSpec["dec-lat"] = lat;
coordinateSpec["dec-long"] = long;
local mode = coordinates.determineMode( lat, long );
coordinateSpec["dms-lat"] = convert_dec2dms( lat, "N", "S", mode) -- {{coord/dec2dms|{{{1}}}|N|S|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
coordinateSpec["dms-long"] = convert_dec2dms( long, "E", "W", mode) -- {{coord/dec2dms|{{{2}}}|E|W|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dec"
end
return coordinateSpec, errors
end
--[[
parseDMS
Transforms degrees, minutes, seconds format latitude and longitude
into the a structure to be used in displaying coordinates
]]
local function parseDMS( lat_d, lat_m, lat_s, lat_f, long_d, long_m, long_s, long_f, format )
local coordinateSpec, errors, backward = {}, {}
lat_f = lat_f:upper();
long_f = long_f:upper();
-- Check if specified backward
if lat_f == 'E' or lat_f == 'W' then
lat_d, long_d, lat_m, long_m, lat_s, long_s, lat_f, long_f, backward = long_d, lat_d, long_m, lat_m, long_s, lat_s, long_f, lat_f, true;
end
errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true );
if not long_d then
return nil, {{"parseDMS", "Missing longitude" }}
elseif not tonumber(long_d) then
return nil, {{"parseDMS", "Longitude could not be parsed as a number:" .. long_d }}
end
if not lat_m and not lat_s and not long_m and not long_s and #errors == 0 then
if math_mod._precision( lat_d ) > 0 or math_mod._precision( long_d ) > 0 then
if lat_f:upper() == 'S' then
lat_d = '-' .. lat_d;
end
if long_f:upper() == 'W' then
long_d = '-' .. long_d;
end
return parseDec( lat_d, long_d, format );
end
end
coordinateSpec["dms-lat"] = lat_d.."°"..optionalArg(lat_m,"′") .. optionalArg(lat_s,"″") .. lat_f
coordinateSpec["dms-long"] = long_d.."°"..optionalArg(long_m,"′") .. optionalArg(long_s,"″") .. long_f
coordinateSpec["dec-lat"] = convert_dms2dec(lat_f, lat_d, lat_m, lat_s) -- {{coord/dms2dec|{{{4}}}|{{{1}}}|0{{{2}}}|0{{{3}}}}}
coordinateSpec["dec-long"] = convert_dms2dec(long_f, long_d, long_m, long_s) -- {{coord/dms2dec|{{{8}}}|{{{5}}}|0{{{6}}}|0{{{7}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dms"
end
return coordinateSpec, errors, backward
end
--[[
Check the input arguments for coord to determine the kind of data being provided
and then make the necessary processing.
]]
local function formatTest(args)
local result, errors
local backward, primary = false, false
local function getParam(args, lim)
local ret = {}
for i = 1, lim do
ret[i] = args[i] or ''
end
return table.concat(ret, '_')
end
if not args[1] then
-- no lat logic
return errorPrinter( {{"formatTest", "Missing latitude"}} )
elseif not tonumber(args[1]) then
-- bad lat logic
return errorPrinter( {{"formatTest", "Unable to parse latitude as a number:" .. args[1]}} )
elseif not args[4] and not args[5] and not args[6] then
-- dec logic
result, errors = parseDec(args[1], args[2], args.format)
if not result then
return errorPrinter(errors);
end
-- formatting for geohack: geohack expects D_N_D_E notation or D;D notation
-- wikiminiatlas doesn't support D;D notation
-- #coordinates parserfunction doesn't support negative decimals with NSWE
result.param = table.concat({
math.abs(tonumber(args[1])),
((tonumber(args[1]) or 0) < 0) and 'S' or 'N',
math.abs(tonumber(args[2])),
((tonumber(args[2]) or 0) < 0) and 'W' or 'E',
args[3] or ''}, '_')
elseif dmsTest(args[4], args[8]) then
-- dms logic
result, errors, backward = parseDMS(args[1], args[2], args[3], args[4],
args[5], args[6], args[7], args[8], args.format)
if args[10] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 9)
elseif dmsTest(args[3], args[6]) then
-- dm logic
result, errors, backward = parseDMS(args[1], args[2], nil, args[3],
args[4], args[5], nil, args[6], args['format'])
if args[8] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 7)
elseif dmsTest(args[2], args[4]) then
-- d logic
result, errors, backward = parseDMS(args[1], nil, nil, args[2],
args[3], nil, nil, args[4], args.format)
if args[6] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 5)
else
-- Error
return errorPrinter({{"formatTest", "Unknown argument format"}}) .. '[[Category:Pages with malformed coordinate tags]]'
end
result.name = args.name
local extra_param = {'dim', 'globe', 'scale', 'region', 'source', 'type'}
for _, v in ipairs(extra_param) do
if args[v] then
table.insert(errors, {'formatTest', 'Parameter: "' .. v .. '=" should be "' .. v .. ':"' })
end
end
local ret = specPrinter(args, result)
if #errors > 0 then
ret = ret .. ' ' .. errorPrinter(errors) .. '[[Category:Pages with malformed coordinate tags]]'
end
return ret, backward
end
--[[
Generate Wikidata tracking categories.
]]
local function makeWikidataCategories(qid)
local ret
local qid = qid or mw.wikibase.getEntityIdForCurrentPage()
if mw.wikibase and current_page.namespace == 0 then
if qid and mw.wikibase.entityExists(qid) and mw.wikibase.getBestStatements(qid, "P625") and mw.wikibase.getBestStatements(qid, "P625")[1] then
local snaktype = mw.wikibase.getBestStatements(qid, "P625")[1].mainsnak.snaktype
if snaktype == 'value' then
-- coordinates exist both here and on Wikidata, and can be compared.
ret = 'Coordinates on Wikidata'
elseif snaktype == 'somevalue' then
ret = 'Coordinates on Wikidata set to unknown value'
elseif snaktype == 'novalue' then
ret = 'Coordinates on Wikidata set to no value'
end
else
-- We have to either import the coordinates to Wikidata or remove them here.
ret = 'Coordinates not on Wikidata'
end
end
if ret then
return string.format('[[Category:%s]]', ret)
else
return ''
end
end
--[[
link
Simple function to export the coordinates link for other uses.
Usage:
{{#invoke:Coordinates | link }}
]]
function coordinates.link(frame)
return coord_link;
end
--[[
dec2dms
Wrapper to allow templates to call dec2dms directly.
Usage:
{{#invoke:Coordinates | dec2dms | decimal_coordinate | positive_suffix |
negative_suffix | precision }}
decimal_coordinate is converted to DMS format. If positive, the positive_suffix
is appended (typical N or E), if negative, the negative suffix is appended. The
specified precision is one of 'D', 'DM', or 'DMS' to specify the level of detail
to use.
]]
coordinates.dec2dms = makeInvokeFunc('_dec2dms')
function coordinates._dec2dms(args)
local coordinate = args[1]
local firstPostfix = args[2] or ''
local secondPostfix = args[3] or ''
local precision = args[4] or ''
return convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
end
--[[
Helper function to determine whether to use D, DM, or DMS
format depending on the precision of the decimal input.
]]
function coordinates.determineMode( value1, value2 )
local precision = math.max( math_mod._precision( value1 ), math_mod._precision( value2 ) );
if precision <= 0 then
return 'd'
elseif precision <= 2 then
return 'dm';
else
return 'dms';
end
end
--[[
dms2dec
Wrapper to allow templates to call dms2dec directly.
Usage:
{{#invoke:Coordinates | dms2dec | direction_flag | degrees |
minutes | seconds }}
Converts DMS values specified as degrees, minutes, seconds too decimal format.
direction_flag is one of N, S, E, W, and determines whether the output is
positive (i.e. N and E) or negative (i.e. S and W).
]]
coordinates.dms2dec = makeInvokeFunc('_dms2dec')
function coordinates._dms2dec(args)
local direction = args[1]
local degrees = args[2]
local minutes = args[3]
local seconds = args[4]
return convert_dms2dec(direction, degrees, minutes, seconds)
end
--[[
coord
Main entry point for Lua function to replace {{coord}}
Usage:
{{#invoke:Coordinates | coord }}
{{#invoke:Coordinates | coord | lat | long }}
{{#invoke:Coordinates | coord | lat | lat_flag | long | long_flag }}
...
Refer to {{coord}} documentation page for many additional parameters and
configuration options.
Note: This function provides the visual display elements of {{coord}}. In
order to load coordinates into the database, the {{#coordinates:}} parser
function must also be called, this is done automatically in the Lua
version of {{coord}}.
]]
coordinates.coord = makeInvokeFunc('_coord')
function coordinates._coord(args)
if not tonumber(args[1]) and not args[2] then
args[3] = args[1]; args[1] = nil
local entity = mw.wikibase.getEntityObject(args.qid)
if entity
and entity.claims
and entity.claims.P625
and entity.claims.P625[1].mainsnak.snaktype == 'value'
then
local precision = entity.claims.P625[1].mainsnak.datavalue.value.precision
args[1] = entity.claims.P625[1].mainsnak.datavalue.value.latitude
args[2] = entity.claims.P625[1].mainsnak.datavalue.value.longitude
if precision then
precision = -math_mod._round(math.log(precision)/math.log(10),0)
args[1] = math_mod._round(args[1],precision)
args[2] = math_mod._round(args[2],precision)
end
end
end
local contents, backward = formatTest(args)
local Notes = args.notes or ''
local Display = args.display and args.display:lower() or 'inline'
-- it and ti are short for inline,title and title,inline
local function isInline(s)
-- Finds whether coordinates are displayed inline.
return s:find('inline') ~= nil or s == 'i' or s == 'it' or s == 'ti'
end
local function isInTitle(s)
-- Finds whether coordinates are displayed in the title.
return s:find('title') ~= nil or s == 't' or s == 'it' or s == 'ti'
end
local function coord_wrapper(in_args)
-- Calls the parser function {{#coordinates:}}.
return mw.getCurrentFrame():callParserFunction('#coordinates', in_args) or ''
end
local text = ''
if isInline(Display) then
text = text .. '<span class="geo-inline">' .. contents .. Notes .. '</span>'
end
if isInTitle(Display) then
-- Add to output since indicator content is invisible to Lua later on
if not isInline(Display) then
text = text .. '<span class="geo-inline-hidden noexcerpt">' .. contents .. Notes .. '</span>'
end
text = text .. displaytitle(contents .. Notes) .. makeWikidataCategories(args.qid)
end
if not args.nosave then
local page_title, count = mw.title.getCurrentTitle(), 1
if backward then
local tmp = {}
while not string.find((args[count-1] or ''), '[EW]') do tmp[count] = (args[count] or ''); count = count+1 end
tmp.count = count; count = 2*(count-1)
while count >= tmp.count do table.insert(tmp, 1, (args[count] or '')); count = count-1 end
for i, v in ipairs(tmp) do args[i] = v end
else
while count <= 9 do args[count] = (args[count] or ''); count = count+1 end
end
if isInTitle(Display) and not page_title.isTalkPage and page_title.subpageText ~= 'doc' and page_title.subpageText ~= 'testcases' then args[10] = 'primary' end
args.notes, args.format, args.display = nil
text = text .. coord_wrapper(args)
end
return text
end
--[[
coord2text
Extracts a single value from a transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coord2text | {{Coord}} | parameter }}
Valid values for the second parameter are: lat (signed integer), long (signed integer), type, scale, dim, region, globe, source
]]
function coordinates._coord2text(coord,type)
if coord == '' or type == '' or not type then return nil end
type = mw.text.trim(type)
if type == 'lat' or type == 'long' then
local result, negative = mw.text.split((mw.ustring.match(coord,'[%.%d]+°[NS] [%.%d]+°[EW]') or ''), ' ')
if type == 'lat' then
result, negative = result[1], 'S'
else
result, negative = result[2], 'W'
end
result = mw.text.split(result, '°')
if result[2] == negative then result[1] = '-'..result[1] end
return result[1]
else
return mw.ustring.match(coord, 'params=.-_' .. type .. ':(.-)[ _]')
end
end
function coordinates.coord2text(frame)
return coordinates._coord2text(frame.args[1],frame.args[2])
end
--[[
coordinsert
Injects some text into the Geohack link of a transclusion of {{Coord}} (if that text isn't already in the transclusion). Outputs the modified transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coordinsert | {{Coord}} | parameter:value | parameter:value | … }}
Do not make Geohack unhappy by inserting something which isn't mentioned in the {{Coord}} documentation.
]]
function coordinates.coordinsert(frame)
-- for the 2nd or later integer parameter (the first is the coord template, as above)
for i, v in ipairs(frame.args) do
if i ~= 1 then
-- if we cannot find in the coord_template the i_th coordinsert parameter e.g. region
if not mw.ustring.find(frame.args[1], (mw.ustring.match(frame.args[i], '^(.-:)') or '')) then
-- find from the params= up to the first possibly-present underscore
-- and append the i_th coordinsert parameter and a space
-- IDK why we're adding a space but it does seem somewhat convenient
frame.args[1] = mw.ustring.gsub(frame.args[1], '(params=.-)_? ', '%1_'..frame.args[i]..' ')
end
end
end
if frame.args.name then
-- if we can't find the vcard class
if not mw.ustring.find(frame.args[1], '<span class="vcard">') then
-- take something that looks like a coord template and add the vcard span with class and fn org class
local namestr = frame.args.name
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(<span class="geo%-default">)(<span[^<>]*>[^<>]*</span><span[^<>]*>[^<>]*<span[^<>]*>[^<>]*</span></span>)(</span>)',
'%1<span class="vcard">%2<span style="display:none"> (<span class="fn org">' .. namestr .. '</span>)</span></span>%3'
)
-- then find anything from coordinates parameters to the 'end' and attach the title parameter
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(¶ms=[^&"<>%[%] ]*) ',
'%1&title=' .. mw.uri.encode(namestr) .. ' '
)
end
end
-- replace the existing indicator with a new indicator using the modified content
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(<span class="geo%-inline[^"]*">(.+)</span>)\127[^\127]*UNIQ%-%-indicator%-%x+%-%-?QINU[^\127]*\127',
function (inline, coord) return inline .. displaytitle(coord) end
)
return frame.args[1]
end
return coordinates
6162d7e98fcf6faab5809049e0a48bb3e67d88e3
Module:Coordinates/styles.css
828
201
503
502
2023-10-17T20:36:40Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Coordinates/styles.css]]
sanitized-css
text/css
/* {{pp-template}} */
/* Geographical coordinates defaults. The classes "geo", "longitude", and
"latitude" are used by the [[Geo microformat]]. */
.geo-default,
.geo-dms,
.geo-dec {
display: inline;
}
.geo-nondefault,
.geo-multi-punct,
.geo-inline-hidden {
display: none;
}
.longitude,
.latitude {
white-space: nowrap;
}
1b5d036501a9f6bc9dcf3c9117e8d6bc97507290
Module:Detect singular
828
202
505
504
2023-10-17T20:36:41Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Detect_singular]]
Scribunto
text/plain
local p = {}
local getArgs = require('Module:Arguments').getArgs
local yesNo = require('Module:Yesno')
local getPlain = require('Module:Text').Text().getPlain
-- function to determine whether "sub" occurs in "s"
local function plainFind(s, sub)
return mw.ustring.find(s, sub, 1, true)
end
-- function to count the number of times "pattern" (a regex) occurs in "s"
local function countMatches(s, pattern)
local _, count = mw.ustring.gsub(s, pattern, '')
return count
end
local singular = 1
local likelyPlural = 2
local plural = 3
-- Determine whether a string is singular or plural (i.e., it represents one
-- item or many)
-- Arguments:
-- origArgs[1]: string to process
-- origArgs.no_comma: if false, use commas to detect plural (default false)
-- origArgs.parse_links: if false, treat wikilinks as opaque singular objects (default false)
-- Returns:
-- singular, likelyPlural, or plural (see constants above), or nil for completely unknown
function p._main(origArgs)
origArgs = type(origArgs) == 'table' and origArgs or {}
local args = {}
-- canonicalize boolean arguments
for key, default in pairs({no_comma=false,parse_links=false,any_comma=false,no_and=false}) do
if origArgs[key] == nil then
args[key] = default
else
args[key] = yesNo(origArgs[key],default)
end
end
local checkComma = not args.no_comma
local checkAnd = not args.no_and
local rewriteLinks = not args.parse_links
local anyComma = args.any_comma
local s = origArgs[1] -- the input string
if not s then
return nil -- empty input returns nil
end
s = tostring(s)
s = mw.text.decode(s,true) --- replace HTML entities (to avoid spurious semicolons)
if plainFind(s,'data-plural="0"') then -- magic data string to return true
return singular
end
if plainFind(s,'data-plural="1"') then -- magic data string to return false
return plural
end
-- count number of list items
local numListItems = countMatches(s,'<%s*li')
-- if exactly one, then singular, if more than one, then plural
if numListItems == 1 then
return singular
end
if numListItems > 1 then
return plural
end
-- if "list of" occurs inside of wlink, then it's plural
if mw.ustring.find(s:lower(), '%[%[[^%]]*list of[^%]]+%]%]') then
return plural
end
-- fix for trailing br tags passed through [[template:marriage]]
s = mw.ustring.gsub(s, '<%s*br[^>]*>%s*(</div>)', '%1')
-- replace all wikilinks with fixed string
if rewriteLinks then
s = mw.ustring.gsub(s,'%b[]','WIKILINK')
end
-- Five conditions: any one of them can make the string a likely plural or plural
local hasBreak = mw.ustring.find(s,'<%s*br')
-- For the last 4, evaluate on string stripped of wikimarkup
s = getPlain(s)
local hasBullets = countMatches(s,'%*+') > 1
local multipleQids = mw.ustring.find(s,'Q%d+[%p%s]+Q%d+') -- has multiple QIDs in a row
if hasBullets or multipleQids then
return plural
end
local commaPattern = anyComma and '[,;]' or '%D[,;]%D' -- semi-colon similar to comma
local hasComma = checkComma and mw.ustring.find(s, commaPattern)
local hasAnd = checkAnd and mw.ustring.find(s,'[,%s]and%s')
if hasBreak or hasComma or hasAnd then
return likelyPlural
end
return singular
end
function p._pluralize(args)
args = type(args) == 'table' and args or {}
local singularForm = args[3] or args.singular or ""
local pluralForm = args[4] or args.plural or ""
local likelyForm = args.likely or pluralForm
local link = args[5] or args.link
if link then
link = tostring(link)
singularForm = '[['..link..'|'..singularForm..']]'
pluralForm = '[['..link..'|'..pluralForm..']]'
likelyForm = '[['..link..'|'..likelyForm..']]'
end
if args[2] then
return pluralForm
end
local detect = p._main(args)
if detect == nil then
return "" -- return blank on complete failure
end
if detect == singular then
return singularForm
elseif detect == likelyPlural then
return likelyForm
else
return pluralForm
end
end
function p.main(frame)
local args = getArgs(frame)
-- For template, return 1 if singular, blank if plural or empty
local result = p._main(args)
if result == nil then
return 1
end
return result == singular and 1 or ""
end
function p.pluralize(frame)
local args = getArgs(frame)
return p._pluralize(args)
end
return p
6afb2e8c0bd8ddff094e2861b836521ee4a5a779
Module:Location map
828
203
507
506
2023-10-17T20:36:41Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Location_map]]
Scribunto
text/plain
require('strict')
local p = {}
local getArgs = require('Module:Arguments').getArgs
local function round(n, decimals)
local pow = 10^(decimals or 0)
return math.floor(n * pow + 0.5) / pow
end
function p.getMapParams(map, frame)
if not map then
error('The name of the location map definition to use must be specified', 2)
end
local moduletitle = mw.title.new('Module:Location map/data/' .. map)
if not moduletitle then
error(string.format('%q is not a valid name for a location map definition', map), 2)
elseif moduletitle.exists then
local mapData = mw.loadData('Module:Location map/data/' .. map)
return function(name, params)
if name == nil then
return 'Module:Location map/data/' .. map
elseif mapData[name] == nil then
return ''
elseif params then
return mw.message.newRawMessage(tostring(mapData[name]), unpack(params)):plain()
else
return mapData[name]
end
end
else
error('Unable to find the specified location map definition: "Module:Location map/data/' .. map .. '" does not exist', 2)
end
end
function p.data(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local params = {}
for k,v in ipairs(args) do
if k > 2 then
params[k-2] = v
end
end
return map(args[2], #params ~= 0 and params)
end
local hemisphereMultipliers = {
longitude = { W = -1, w = -1, E = 1, e = 1 },
latitude = { S = -1, s = -1, N = 1, n = 1 }
}
local function decdeg(degrees, minutes, seconds, hemisphere, decimal, direction)
if decimal then
if degrees then
error('Decimal and DMS degrees cannot both be provided for ' .. direction, 2)
elseif minutes then
error('Minutes can only be provided with DMS degrees for ' .. direction, 2)
elseif seconds then
error('Seconds can only be provided with DMS degrees for ' .. direction, 2)
elseif hemisphere then
error('A hemisphere can only be provided with DMS degrees for ' .. direction, 2)
end
local retval = tonumber(decimal)
if retval then
return retval
end
error('The value "' .. decimal .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not minutes then
error('Seconds were provided for ' .. direction .. ' without minutes also being provided', 2)
elseif not degrees then
if minutes then
error('Minutes were provided for ' .. direction .. ' without degrees also being provided', 2)
elseif hemisphere then
error('A hemisphere was provided for ' .. direction .. ' without degrees also being provided', 2)
end
return nil
end
decimal = tonumber(degrees)
if not decimal then
error('The degree value "' .. degrees .. '" provided for ' .. direction .. ' is not valid', 2)
elseif minutes and not tonumber(minutes) then
error('The minute value "' .. minutes .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not tonumber(seconds) then
error('The second value "' .. seconds .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal + (minutes or 0)/60 + (seconds or 0)/3600
if hemisphere then
local multiplier = hemisphereMultipliers[direction][hemisphere]
if not multiplier then
error('The hemisphere "' .. hemisphere .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal * multiplier
end
return decimal
end
-- Finds a parameter in a transclusion of {{Coord}}.
local function coord2text(para,coord) -- this should be changed for languages which do not use Arabic numerals or the degree sign
local lat, long = mw.ustring.match(coord,'<span class="p%-latitude latitude">([^<]+)</span><span class="p%-longitude longitude">([^<]+)</span>')
if lat then
return tonumber(para == 'longitude' and long or lat)
end
local result = mw.text.split(mw.ustring.match(coord,'%-?[%.%d]+°[NS] %-?[%.%d]+°[EW]') or '', '[ °]')
if para == 'longitude' then result = {result[3], result[4]} end
if not tonumber(result[1]) or not result[2] then
mw.log('Malformed coordinates value')
mw.logObject(para, 'para')
mw.logObject(coord, 'coord')
return error('Malformed coordinates value', 2)
end
return tonumber(result[1]) * hemisphereMultipliers[para][result[2]]
end
-- effectively make removeBlanks false for caption and maplink, and true for everything else
-- if useWikidata is present but blank, convert it to false instead of nil
-- p.top, p.bottom, and their callers need to use this
function p.valueFunc(key, value)
if value then
value = mw.text.trim(value)
end
if value ~= '' or key == 'caption' or key == 'maplink' then
return value
elseif key == 'useWikidata' then
return false
end
end
local function getContainerImage(args, map)
if args.AlternativeMap then
return args.AlternativeMap
elseif args.relief and map('image1') ~= '' then
return map('image1')
else
return map('image')
end
end
function p.top(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local width
local default_as_number = tonumber(mw.ustring.match(tostring(args.default_width),"%d*"))
if not args.width then
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
elseif mw.ustring.sub(args.width, -2) == 'px' then
width = mw.ustring.sub(args.width, 1, -3)
else
width = args.width
end
local width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
if width_as_number == 0 then
-- check to see if width is junk. If it is, then use default calculation
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
end
if args.max_width ~= "" and args.max_width ~= nil then
-- check to see if width bigger than max_width
local max_as_number = tonumber(mw.ustring.match(args.max_width,"%d*")) or 0;
if width_as_number>max_as_number and max_as_number>0 then
width = args.max_width;
end
end
local retval = frame:extensionTag{name = 'templatestyles', args = {src = 'Module:Location map/styles.css'}}
if args.float == 'center' then
retval = retval .. '<div class="center">'
end
if args.caption and args.caption ~= '' and args.border ~= 'infobox' then
retval = retval .. '<div class="locmap noviewer noresize thumb '
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'tleft'
elseif args.float == '"center"' or args.float == 'center' or args.float == '"none"' or args.float == 'none' then
retval = retval .. 'tnone'
else
retval = retval .. 'tright'
end
retval = retval .. '"><div class="thumbinner" style="width:' .. (width + 2) .. 'px'
if args.border == 'none' then
retval = retval .. ';border:none'
elseif args.border then
retval = retval .. ';border-color:' .. args.border
end
retval = retval .. '"><div style="position:relative;width:' .. width .. 'px' .. (args.border ~= 'none' and ';border:1px solid lightgray">' or '">')
else
retval = retval .. '<div class="locmap" style="width:' .. width .. 'px;'
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'float:left;clear:left'
elseif args.float == '"center"' or args.float == 'center' then
retval = retval .. 'float:none;clear:both;margin-left:auto;margin-right:auto'
elseif args.float == '"none"' or args.float == 'none' then
retval = retval .. 'float:none;clear:none'
else
retval = retval .. 'float:right;clear:right'
end
retval = retval .. '"><div style="width:' .. width .. 'px;padding:0"><div style="position:relative;width:' .. width .. 'px">'
end
local image = getContainerImage(args, map)
local currentTitle = mw.title.getCurrentTitle()
retval = string.format(
'%s[[File:%s|%spx|%s%s|class=notpageimage]]',
retval,
image,
width,
args.alt or ((args.label or currentTitle.text) .. ' is located in ' .. map('name')),
args.maplink and ('|link=' .. args.maplink) or ''
)
if args.caption and args.caption ~= '' then
if (currentTitle.namespace == 0) and mw.ustring.find(args.caption, '##') then
retval = retval .. '[[Category:Pages using location map with a double number sign in the caption]]'
end
end
if args.overlay_image then
return retval .. '<div style="position:absolute;top:0;left:0">[[File:' .. args.overlay_image .. '|' .. width .. 'px|class=notpageimage]]</div>'
else
return retval
end
end
function p.bottom(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local retval = '</div>'
local currentTitle = mw.title.getCurrentTitle()
if not args.caption or args.border == 'infobox' then
if args.border then
retval = retval .. '<div style="padding-top:0.2em">'
else
retval = retval .. '<div style="font-size:91%;padding-top:3px">'
end
retval = retval
.. (args.caption or (args.label or currentTitle.text) .. ' (' .. map('name') .. ')')
.. '</div>'
elseif args.caption ~= '' then
-- This is not the pipe trick. We're creating a link with no text on purpose, so that CSS can give us a nice image
retval = retval .. '<div class="thumbcaption"><div class="magnify">[[:File:' .. getContainerImage(args, map) .. '|class=notpageimage| ]]</div>' .. args.caption .. '</div>'
end
if args.switcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">' .. args.switcherLabel .. '</span>'
elseif args.autoSwitcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">Show map of ' .. map('name') .. '</span>'
end
retval = retval .. '</div></div>'
if args.caption_undefined then
mw.log('Removed parameter caption_undefined used.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with removed parameters|caption_undefined]]'
end
end
if map('skew') ~= '' or map('lat_skew') ~= '' or map('crosses180') ~= '' or map('type') ~= '' then
mw.log('Removed parameter used in map definition ' .. map())
if currentTitle.namespace == 0 then
local key = (map('skew') ~= '' and 'skew' or '') ..
(map('lat_skew') ~= '' and 'lat_skew' or '') ..
(map('crosses180') ~= '' and 'crosses180' or '') ..
(map('type') ~= '' and 'type' or '')
retval = retval .. '[[Category:Location maps with removed parameters|' .. key .. ' ]]'
end
end
if string.find(map('name'), '|', 1, true) then
mw.log('Pipe used in name of map definition ' .. map())
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with a name containing a pipe]]'
end
end
if args.float == 'center' then
retval = retval .. '</div>'
end
return retval
end
local function markOuterDiv(x, y, imageDiv, labelDiv)
return mw.html.create('div')
:addClass('od')
:cssText('top:' .. round(y, 3) .. '%;left:' .. round(x, 3) .. '%')
:node(imageDiv)
:node(labelDiv)
end
local function markImageDiv(mark, marksize, label, link, alt, title)
local builder = mw.html.create('div')
:addClass('id')
:cssText('left:-' .. round(marksize / 2) .. 'px;top:-' .. round(marksize / 2) .. 'px')
:attr('title', title)
if marksize ~= 0 then
builder:wikitext(string.format(
'[[File:%s|%dx%dpx|%s|link=%s%s|class=notpageimage]]',
mark,
marksize,
marksize,
label,
link,
alt and ('|alt=' .. alt) or ''
))
end
return builder
end
local function markLabelDiv(label, label_size, label_width, position, background, x, marksize)
if tonumber(label_size) == 0 then
return mw.html.create('div'):addClass('l0'):wikitext(label)
end
local builder = mw.html.create('div')
:cssText('font-size:' .. label_size .. '%;width:' .. label_width .. 'em')
local distance = round(marksize / 2 + 1)
if position == 'top' then -- specified top
builder:addClass('pv'):cssText('bottom:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em')
elseif position == 'bottom' then -- specified bottom
builder:addClass('pv'):cssText('top:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em')
elseif position == 'left' or (tonumber(x) > 70 and position ~= 'right') then -- specified left or autodetected to left
builder:addClass('pl'):cssText('right:' .. distance .. 'px')
else -- specified right or autodetected to right
builder:addClass('pr'):cssText('left:' .. distance .. 'px')
end
builder = builder:tag('div')
:wikitext(label)
if background then
builder:cssText('background-color:' .. background)
end
return builder:done()
end
local function getX(longitude, left, right)
local width = (right - left) % 360
if width == 0 then
width = 360
end
local distanceFromLeft = (longitude - left) % 360
-- the distance needed past the map to the right equals distanceFromLeft - width. the distance needed past the map to the left equals 360 - distanceFromLeft. to minimize page stretching, go whichever way is shorter
if distanceFromLeft - width / 2 >= 180 then
distanceFromLeft = distanceFromLeft - 360
end
return 100 * distanceFromLeft / width
end
local function getY(latitude, top, bottom)
return 100 * (top - latitude) / (top - bottom)
end
function p.mark(frame, args, map)
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map~'})
end
local mapnames = {}
if not map then
if args[1] then
map = {}
for mapname in mw.text.gsplit(args[1], '#', true) do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
mapnames[#mapnames + 1] = mapname
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
args[1] = 'World'
end
end
if type(map) == 'table' then
local outputs = {}
local oldargs = args[1]
for k,v in ipairs(map) do
args[1] = mapnames[k]
outputs[k] = tostring(p.mark(frame, args, v))
end
args[1] = oldargs
return table.concat(outputs, '#PlaceList#') .. '#PlaceList#'
end
local x, y, longitude, latitude
longitude = decdeg(args.lon_deg, args.lon_min, args.lon_sec, args.lon_dir, args.long, 'longitude')
latitude = decdeg(args.lat_deg, args.lat_min, args.lat_sec, args.lat_dir, args.lat, 'latitude')
if args.excludefrom then
-- If this mark is to be excluded from certain maps entirely (useful in the context of multiple maps)
for exclusionmap in mw.text.gsplit(args.excludefrom, '#', true) do
-- Check if this map is excluded. If so, return an empty string.
if args[1] == exclusionmap then
return ''
end
end
end
local builder = mw.html.create()
local currentTitle = mw.title.getCurrentTitle()
if args.coordinates then
-- Temporarily removed to facilitate infobox conversion. See [[Wikipedia:Coordinates in infoboxes]]
-- if longitude or latitude then
-- error('Coordinates from [[Module:Coordinates]] and individual coordinates cannot both be provided')
-- end
longitude = coord2text('longitude', args.coordinates)
latitude = coord2text('latitude', args.coordinates)
elseif not longitude and not latitude and args.useWikidata then
-- If they didn't provide either coordinate, try Wikidata. If they provided one but not the other, don't.
local entity = mw.wikibase.getEntity()
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1].mainsnak.snaktype == 'value' then
local value = entity.claims.P625[1].mainsnak.datavalue.value
longitude, latitude = value.longitude, value.latitude
end
if args.link and (currentTitle.namespace == 0) then
builder:wikitext('[[Category:Location maps with linked markers with coordinates from Wikidata]]')
end
end
if not longitude then
error('No value was provided for longitude')
elseif not latitude then
error('No value was provided for latitude')
end
if currentTitle.namespace > 0 then
if (not args.lon_deg) ~= (not args.lat_deg) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Degrees]]')
elseif (not args.lon_min) ~= (not args.lat_min) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Minutes]]')
elseif (not args.lon_sec) ~= (not args.lat_sec) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Seconds]]')
elseif (not args.lon_dir) ~= (not args.lat_dir) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Hemisphere]]')
elseif (not args.long) ~= (not args.lat) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Decimal]]')
end
end
if ((tonumber(args.lat_deg) or 0) < 0) and ((tonumber(args.lat_min) or 0) ~= 0 or (tonumber(args.lat_sec) or 0) ~= 0 or (args.lat_dir and args.lat_dir ~='')) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if ((tonumber(args.lon_deg) or 0) < 0) and ((tonumber(args.lon_min) or 0) ~= 0 or (tonumber(args.lon_sec) or 0) ~= 0 or (args.lon_dir and args.lon_dir ~= '')) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if (((tonumber(args.lat_min) or 0) < 0) or ((tonumber(args.lat_sec) or 0) < 0)) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if (((tonumber(args.lon_min) or 0) < 0) or ((tonumber(args.lon_sec) or 0) < 0)) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if args.skew or args.lon_shift or args.markhigh then
mw.log('Removed parameter used in invocation.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
local key = (args.skew and 'skew' or '') ..
(args.lon_shift and 'lon_shift' or '') ..
(args.markhigh and 'markhigh' or '')
builder:wikitext('[[Category:Location maps with removed parameters|' .. key ..' ]]')
end
end
if map('x') ~= '' then
x = tonumber(mw.ext.ParserFunctions.expr(map('x', { latitude, longitude })))
else
x = tonumber(getX(longitude, map('left'), map('right')))
end
if map('y') ~= '' then
y = tonumber(mw.ext.ParserFunctions.expr(map('y', { latitude, longitude })))
else
y = tonumber(getY(latitude, map('top'), map('bottom')))
end
if (x < 0 or x > 100 or y < 0 or y > 100) and not args.outside then
mw.log('Mark placed outside map boundaries without outside flag set. x = ' .. x .. ', y = ' .. y)
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
local key = currentTitle.prefixedText
builder:wikitext('[[Category:Location maps with marks outside map and outside parameter not set|' .. key .. ' ]]')
end
end
local mark = args.mark or map('mark')
if mark == '' then
mark = 'Red pog.svg'
end
local marksize = tonumber(args.marksize) or tonumber(map('marksize')) or 8
local imageDiv = markImageDiv(mark, marksize, args.label or mw.title.getCurrentTitle().text, args.link or '', args.alt, args[2])
local labelDiv
if args.label and args.position ~= 'none' then
labelDiv = markLabelDiv(args.label, args.label_size or 91, args.label_width or 6, args.position, args.background, x, marksize)
end
return builder:node(markOuterDiv(x, y, imageDiv, labelDiv))
end
local function switcherSeparate(s)
if s == nil then return {} end
local retval = {}
for i in string.gmatch(s .. '#', '([^#]*)#') do
i = mw.text.trim(i)
retval[#retval + 1] = (i ~= '' and i)
end
return retval
end
function p.main(frame, args, map)
local caption_list = {}
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map', valueFunc = p.valueFunc})
end
if args.useWikidata == nil then
args.useWikidata = true
end
if not map then
if args[1] then
map = {}
for mapname in string.gmatch(args[1], '[^#]+') do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
end
if args['caption'] then
if args['caption'] == "" then
while #caption_list < #map do
caption_list[#caption_list + 1] = args['caption']
end
else
for caption in mw.text.gsplit(args['caption'], '##', true) do
caption_list[#caption_list + 1] = caption
end
end
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
end
end
if type(map) == 'table' then
local altmaps = switcherSeparate(args.AlternativeMap)
if #altmaps > #map then
error(string.format('%d AlternativeMaps were provided, but only %d maps were provided', #altmaps, #map))
end
local overlays = switcherSeparate(args.overlay_image)
if #overlays > #map then
error(string.format('%d overlay_images were provided, but only %d maps were provided', #overlays, #map))
end
if #caption_list > #map then
error(string.format('%d captions were provided, but only %d maps were provided', #caption_list, #map))
end
local outputs = {}
args.autoSwitcherLabel = true
for k,v in ipairs(map) do
args.AlternativeMap = altmaps[k]
args.overlay_image = overlays[k]
args.caption = caption_list[k]
outputs[k] = p.main(frame, args, v)
end
return '<div class="switcher-container">' .. table.concat(outputs) .. '</div>'
else
return p.top(frame, args, map) .. tostring( p.mark(frame, args, map) ) .. p.bottom(frame, args, map)
end
end
return p
7291f35931f7e18eb3de0e5668f94abf73d34135
Module:Location map/styles.css
828
204
509
508
2023-10-17T20:36:42Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Location_map/styles.css]]
sanitized-css
text/css
/* {{pp|small=yes}} */
.locmap .od {
position: absolute;
}
.locmap .id {
position: absolute;
line-height: 0;
}
.locmap .l0 {
font-size: 0;
position: absolute;
}
.locmap .pv {
line-height: 110%;
position: absolute;
text-align: center;
}
.locmap .pl {
line-height: 110%;
position: absolute;
top: -0.75em;
text-align: right;
}
.locmap .pr {
line-height: 110%;
position: absolute;
top: -0.75em;
text-align: left;
}
.locmap .pv > div {
display: inline;
padding: 1px;
}
.locmap .pl > div {
display: inline; /* inline does not impact floated elements */
padding: 1px;
float: right;
}
.locmap .pr > div {
display: inline; /* inline does not impact floated elements */
padding: 1px;
float: left;
}
1af8c3b5ae1ff654548b74f76b5208f6b360c5a1
Module:Math
828
205
511
510
2023-10-17T20:36:42Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Math]]
Scribunto
text/plain
--[[
This module provides a number of basic mathematical operations.
]]
local yesno, getArgs -- lazily initialized
local p = {} -- Holds functions to be returned from #invoke, and functions to make available to other Lua modules.
local wrap = {} -- Holds wrapper functions that process arguments from #invoke. These act as intemediary between functions meant for #invoke and functions meant for Lua.
--[[
Helper functions used to avoid redundant code.
]]
local function err(msg)
-- Generates wikitext error messages.
return mw.ustring.format('<strong class="error">Formatting error: %s</strong>', msg)
end
local function unpackNumberArgs(args)
-- Returns an unpacked list of arguments specified with numerical keys.
local ret = {}
for k, v in pairs(args) do
if type(k) == 'number' then
table.insert(ret, v)
end
end
return unpack(ret)
end
local function makeArgArray(...)
-- Makes an array of arguments from a list of arguments that might include nils.
local args = {...} -- Table of arguments. It might contain nils or non-number values, so we can't use ipairs.
local nums = {} -- Stores the numbers of valid numerical arguments.
local ret = {}
for k, v in pairs(args) do
v = p._cleanNumber(v)
if v then
nums[#nums + 1] = k
args[k] = v
end
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[#ret + 1] = args[num]
end
return ret
end
local function fold(func, ...)
-- Use a function on all supplied arguments, and return the result. The function must accept two numbers as parameters,
-- and must return a number as an output. This number is then supplied as input to the next function call.
local vals = makeArgArray(...)
local count = #vals -- The number of valid arguments
if count == 0 then return
-- Exit if we have no valid args, otherwise removing the first arg would cause an error.
nil, 0
end
local ret = table.remove(vals, 1)
for _, val in ipairs(vals) do
ret = func(ret, val)
end
return ret, count
end
--[[
Fold arguments by selectively choosing values (func should return when to choose the current "dominant" value).
]]
local function binary_fold(func, ...)
local value = fold((function(a, b) if func(a, b) then return a else return b end end), ...)
return value
end
--[[
random
Generate a random number
Usage:
{{#invoke: Math | random }}
{{#invoke: Math | random | maximum value }}
{{#invoke: Math | random | minimum value | maximum value }}
]]
function wrap.random(args)
local first = p._cleanNumber(args[1])
local second = p._cleanNumber(args[2])
return p._random(first, second)
end
function p._random(first, second)
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))
-- math.random will throw an error if given an explicit nil parameter, so we need to use if statements to check the params.
if first and second then
if first <= second then -- math.random doesn't allow the first number to be greater than the second.
return math.random(first, second)
end
elseif first then
return math.random(first)
else
return math.random()
end
end
--[[
order
Determine order of magnitude of a number
Usage:
{{#invoke: Math | order | value }}
]]
function wrap.order(args)
local input_string = (args[1] or args.x or '0');
local input_number = p._cleanNumber(input_string);
if input_number == nil then
return err('order of magnitude input appears non-numeric')
else
return p._order(input_number)
end
end
function p._order(x)
if x == 0 then return 0 end
return math.floor(math.log10(math.abs(x)))
end
--[[
precision
Detemines the precision of a number using the string representation
Usage:
{{ #invoke: Math | precision | value }}
]]
function wrap.precision(args)
local input_string = (args[1] or args.x or '0');
local trap_fraction = args.check_fraction;
local input_number;
if not yesno then
yesno = require('Module:Yesno')
end
if yesno(trap_fraction, true) then -- Returns true for all input except nil, false, "no", "n", "0" and a few others. See [[Module:Yesno]].
local pos = string.find(input_string, '/', 1, true);
if pos ~= nil then
if string.find(input_string, '/', pos + 1, true) == nil then
local denominator = string.sub(input_string, pos+1, -1);
local denom_value = tonumber(denominator);
if denom_value ~= nil then
return math.log10(denom_value);
end
end
end
end
input_number, input_string = p._cleanNumber(input_string);
if input_string == nil then
return err('precision input appears non-numeric')
else
return p._precision(input_string)
end
end
function p._precision(x)
if type(x) == 'number' then
x = tostring(x)
end
x = string.upper(x)
local decimal = x:find('%.')
local exponent_pos = x:find('E')
local result = 0;
if exponent_pos ~= nil then
local exponent = string.sub(x, exponent_pos + 1)
x = string.sub(x, 1, exponent_pos - 1)
result = result - tonumber(exponent)
end
if decimal ~= nil then
result = result + string.len(x) - decimal
return result
end
local pos = string.len(x);
while x:byte(pos) == string.byte('0') do
pos = pos - 1
result = result - 1
if pos <= 0 then
return 0
end
end
return result
end
--[[
max
Finds the maximum argument
Usage:
{{#invoke:Math| max | value1 | value2 | ... }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.max(args)
return p._max(unpackNumberArgs(args))
end
function p._max(...)
local max_value = binary_fold((function(a, b) return a > b end), ...)
if max_value then
return max_value
end
end
--[[
median
Find the median of set of numbers
Usage:
{{#invoke:Math | median | number1 | number2 | ...}}
OR
{{#invoke:Math | median }}
]]
function wrap.median(args)
return p._median(unpackNumberArgs(args))
end
function p._median(...)
local vals = makeArgArray(...)
local count = #vals
table.sort(vals)
if count == 0 then
return 0
end
if p._mod(count, 2) == 0 then
return (vals[count/2] + vals[count/2+1])/2
else
return vals[math.ceil(count/2)]
end
end
--[[
min
Finds the minimum argument
Usage:
{{#invoke:Math| min | value1 | value2 | ... }}
OR
{{#invoke:Math| min }}
When used with no arguments, it takes its input from the parent
frame. Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.min(args)
return p._min(unpackNumberArgs(args))
end
function p._min(...)
local min_value = binary_fold((function(a, b) return a < b end), ...)
if min_value then
return min_value
end
end
--[[
sum
Finds the sum
Usage:
{{#invoke:Math| sum | value1 | value2 | ... }}
OR
{{#invoke:Math| sum }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.sum(args)
return p._sum(unpackNumberArgs(args))
end
function p._sum(...)
local sums, count = fold((function(a, b) return a + b end), ...)
if not sums then
return 0
else
return sums
end
end
--[[
average
Finds the average
Usage:
{{#invoke:Math| average | value1 | value2 | ... }}
OR
{{#invoke:Math| average }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.average(args)
return p._average(unpackNumberArgs(args))
end
function p._average(...)
local sum, count = fold((function(a, b) return a + b end), ...)
if not sum then
return 0
else
return sum / count
end
end
--[[
round
Rounds a number to specified precision
Usage:
{{#invoke:Math | round | value | precision }}
--]]
function wrap.round(args)
local value = p._cleanNumber(args[1] or args.value or 0)
local precision = p._cleanNumber(args[2] or args.precision or 0)
if value == nil or precision == nil then
return err('round input appears non-numeric')
else
return p._round(value, precision)
end
end
function p._round(value, precision)
local rescale = math.pow(10, precision or 0);
return math.floor(value * rescale + 0.5) / rescale;
end
--[[
log10
returns the log (base 10) of a number
Usage:
{{#invoke:Math | log10 | x }}
]]
function wrap.log10(args)
return math.log10(args[1])
end
--[[
mod
Implements the modulo operator
Usage:
{{#invoke:Math | mod | x | y }}
--]]
function wrap.mod(args)
local x = p._cleanNumber(args[1])
local y = p._cleanNumber(args[2])
if not x then
return err('first argument to mod appears non-numeric')
elseif not y then
return err('second argument to mod appears non-numeric')
else
return p._mod(x, y)
end
end
function p._mod(x, y)
local ret = x % y
if not (0 <= ret and ret < y) then
ret = 0
end
return ret
end
--[[
gcd
Calculates the greatest common divisor of multiple numbers
Usage:
{{#invoke:Math | gcd | value 1 | value 2 | value 3 | ... }}
--]]
function wrap.gcd(args)
return p._gcd(unpackNumberArgs(args))
end
function p._gcd(...)
local function findGcd(a, b)
local r = b
local oldr = a
while r ~= 0 do
local quotient = math.floor(oldr / r)
oldr, r = r, oldr - quotient * r
end
if oldr < 0 then
oldr = oldr * -1
end
return oldr
end
local result, count = fold(findGcd, ...)
return result
end
--[[
precision_format
Rounds a number to the specified precision and formats according to rules
originally used for {{template:Rnd}}. Output is a string.
Usage:
{{#invoke: Math | precision_format | number | precision }}
]]
function wrap.precision_format(args)
local value_string = args[1] or 0
local precision = args[2] or 0
return p._precision_format(value_string, precision)
end
function p._precision_format(value_string, precision)
-- For access to Mediawiki built-in formatter.
local lang = mw.getContentLanguage();
local value
value, value_string = p._cleanNumber(value_string)
precision = p._cleanNumber(precision)
-- Check for non-numeric input
if value == nil or precision == nil then
return err('invalid input when rounding')
end
local current_precision = p._precision(value)
local order = p._order(value)
-- Due to round-off effects it is neccesary to limit the returned precision under
-- some circumstances because the terminal digits will be inaccurately reported.
if order + precision >= 14 then
if order + p._precision(value_string) >= 14 then
precision = 13 - order;
end
end
-- If rounding off, truncate extra digits
if precision < current_precision then
value = p._round(value, precision)
current_precision = p._precision(value)
end
local formatted_num = lang:formatNum(math.abs(value))
local sign
-- Use proper unary minus sign rather than ASCII default
if value < 0 then
sign = '−'
else
sign = ''
end
-- Handle cases requiring scientific notation
if string.find(formatted_num, 'E', 1, true) ~= nil or math.abs(order) >= 9 then
value = value * math.pow(10, -order)
current_precision = current_precision + order
precision = precision + order
formatted_num = lang:formatNum(math.abs(value))
else
order = 0;
end
formatted_num = sign .. formatted_num
-- Pad with zeros, if needed
if current_precision < precision then
local padding
if current_precision <= 0 then
if precision > 0 then
local zero_sep = lang:formatNum(1.1)
formatted_num = formatted_num .. zero_sep:sub(2,2)
padding = precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
else
padding = precision - current_precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
end
-- Add exponential notation, if necessary.
if order ~= 0 then
-- Use proper unary minus sign rather than ASCII default
if order < 0 then
order = '−' .. lang:formatNum(math.abs(order))
else
order = lang:formatNum(order)
end
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">×</span>10<sup>' .. order .. '</sup>'
end
return formatted_num
end
--[[
divide
Implements the division operator
Usage:
{{#invoke:Math | divide | x | y | round= | precision= }}
--]]
function wrap.divide(args)
local x = args[1]
local y = args[2]
local round = args.round
local precision = args.precision
if not yesno then
yesno = require('Module:Yesno')
end
return p._divide(x, y, yesno(round), precision)
end
function p._divide(x, y, round, precision)
if y == nil or y == "" then
return err("Empty divisor")
elseif not tonumber(y) then
if type(y) == 'string' and string.sub(y, 1, 1) == '<' then
return y
else
return err("Not a number: " .. y)
end
elseif x == nil or x == "" then
return err("Empty dividend")
elseif not tonumber(x) then
if type(x) == 'string' and string.sub(x, 1, 1) == '<' then
return x
else
return err("Not a number: " .. x)
end
else
local z = x / y
if round then
return p._round(z, 0)
elseif precision then
return p._round(z, precision)
else
return z
end
end
end
--[[
Helper function that interprets the input numerically. If the
input does not appear to be a number, attempts evaluating it as
a parser functions expression.
]]
function p._cleanNumber(number_string)
if type(number_string) == 'number' then
-- We were passed a number, so we don't need to do any processing.
return number_string, tostring(number_string)
elseif type(number_string) ~= 'string' or not number_string:find('%S') then
-- We were passed a non-string or a blank string, so exit.
return nil, nil;
end
-- Attempt basic conversion
local number = tonumber(number_string)
-- If failed, attempt to evaluate input as an expression
if number == nil then
local success, result = pcall(mw.ext.ParserFunctions.expr, number_string)
if success then
number = tonumber(result)
number_string = tostring(number)
else
number = nil
number_string = nil
end
else
number_string = number_string:match("^%s*(.-)%s*$") -- String is valid but may contain padding, clean it.
number_string = number_string:match("^%+(.*)$") or number_string -- Trim any leading + signs.
if number_string:find('^%-?0[xX]') then
-- Number is using 0xnnn notation to indicate base 16; use the number that Lua detected instead.
number_string = tostring(number)
end
end
return number, number_string
end
--[[
Wrapper function that does basic argument processing. This ensures that all functions from #invoke can use either the current
frame or the parent frame, and it also trims whitespace for all arguments and removes blank arguments.
]]
local mt = { __index = function(t, k)
return function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return wrap[k](getArgs(frame)) -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.
end
end }
return setmetatable(p, mt)
2bbe734d898299f65412963a3c1782e9fcc4d9ca
Module:Text
828
206
513
512
2023-10-17T20:36:42Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Text]]
Scribunto
text/plain
local yesNo = require("Module:Yesno")
local Text = { serial = "2022-07-21",
suite = "Text" }
--[=[
Text utilities
]=]
-- local globals
local PatternCJK = false
local PatternCombined = false
local PatternLatin = false
local PatternTerminated = false
local QuoteLang = false
local QuoteType = false
local RangesLatin = false
local SeekQuote = false
local function initLatinData()
if not RangesLatin then
RangesLatin = { { 7, 687 },
{ 7531, 7578 },
{ 7680, 7935 },
{ 8194, 8250 } }
end
if not PatternLatin then
local range
PatternLatin = "^["
for i = 1, #RangesLatin do
range = RangesLatin[ i ]
PatternLatin = PatternLatin ..
mw.ustring.char( range[ 1 ], 45, range[ 2 ] )
end -- for i
PatternLatin = PatternLatin .. "]*$"
end
end
local function initQuoteData()
-- Create quote definitions
if not QuoteLang then
QuoteLang =
{ af = "bd",
ar = "la",
be = "labd",
bg = "bd",
ca = "la",
cs = "bd",
da = "bd",
de = "bd",
dsb = "bd",
et = "bd",
el = "lald",
en = "ld",
es = "la",
eu = "la",
-- fa = "la",
fi = "rd",
fr = "laSPC",
ga = "ld",
he = "ldla",
hr = "bd",
hsb = "bd",
hu = "bd",
hy = "labd",
id = "rd",
is = "bd",
it = "ld",
ja = "x300C",
ka = "bd",
ko = "ld",
lt = "bd",
lv = "bd",
nl = "ld",
nn = "la",
no = "la",
pl = "bdla",
pt = "lald",
ro = "bdla",
ru = "labd",
sk = "bd",
sl = "bd",
sq = "la",
sr = "bx",
sv = "rd",
th = "ld",
tr = "ld",
uk = "la",
zh = "ld",
["de-ch"] = "la",
["en-gb"] = "lsld",
["en-us"] = "ld",
["fr-ch"] = "la",
["it-ch"] = "la",
["pt-br"] = "ldla",
["zh-tw"] = "x300C",
["zh-cn"] = "ld" }
end
if not QuoteType then
QuoteType =
{ bd = { { 8222, 8220 }, { 8218, 8217 } },
bdla = { { 8222, 8220 }, { 171, 187 } },
bx = { { 8222, 8221 }, { 8218, 8217 } },
la = { { 171, 187 }, { 8249, 8250 } },
laSPC = { { 171, 187 }, { 8249, 8250 }, true },
labd = { { 171, 187 }, { 8222, 8220 } },
lald = { { 171, 187 }, { 8220, 8221 } },
ld = { { 8220, 8221 }, { 8216, 8217 } },
ldla = { { 8220, 8221 }, { 171, 187 } },
lsld = { { 8216, 8217 }, { 8220, 8221 } },
rd = { { 8221, 8221 }, { 8217, 8217 } },
x300C = { { 0x300C, 0x300D },
{ 0x300E, 0x300F } } }
end
end -- initQuoteData()
local function fiatQuote( apply, alien, advance )
-- Quote text
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code
-- advance -- number, with level 1 or 2
local r = apply and tostring(apply) or ""
alien = alien or "en"
advance = tonumber(advance) or 0
local suite
initQuoteData()
local slang = alien:match( "^(%l+)-" )
suite = QuoteLang[alien] or slang and QuoteLang[slang] or QuoteLang["en"]
if suite then
local quotes = QuoteType[ suite ]
if quotes then
local space
if quotes[ 3 ] then
space = " "
else
space = ""
end
quotes = quotes[ advance ]
if quotes then
r = mw.ustring.format( "%s%s%s%s%s",
mw.ustring.char( quotes[ 1 ] ),
space,
apply,
space,
mw.ustring.char( quotes[ 2 ] ) )
end
else
mw.log( "fiatQuote() " .. suite )
end
end
return r
end -- fiatQuote()
Text.char = function ( apply, again, accept )
-- Create string from codepoints
-- Parameter:
-- apply -- table (sequence) with numerical codepoints, or nil
-- again -- number of repetitions, or nil
-- accept -- true, if no error messages to be appended
-- Returns: string
local r = ""
apply = type(apply) == "table" and apply or {}
again = math.floor(tonumber(again) or 1)
if again < 1 then
return ""
end
local bad = { }
local codes = { }
for _, v in ipairs( apply ) do
local n = tonumber(v)
if not n or (n < 32 and n ~= 9 and n ~= 10) then
table.insert(bad, tostring(v))
else
table.insert(codes, math.floor(n))
end
end
if #bad > 0 then
if not accept then
r = tostring( mw.html.create( "span" )
:addClass( "error" )
:wikitext( "bad codepoints: " .. table.concat( bad, " " )) )
end
return r
end
if #codes > 0 then
r = mw.ustring.char( unpack( codes ) )
if again > 1 then
r = r:rep(again)
end
end
return r
end -- Text.char()
local function trimAndFormat(args, fmt)
local result = {}
if type(args) ~= 'table' then
args = {args}
end
for _, v in ipairs(args) do
v = mw.text.trim(tostring(v))
if v ~= "" then
table.insert(result,fmt and mw.ustring.format(fmt, v) or v)
end
end
return result
end
Text.concatParams = function ( args, apply, adapt )
-- Concat list items into one string
-- Parameter:
-- args -- table (sequence) with numKey=string
-- apply -- string (optional); separator (default: "|")
-- adapt -- string (optional); format including "%s"
-- Returns: string
local collect = { }
return table.concat(trimAndFormat(args,adapt), apply or "|")
end -- Text.concatParams()
Text.containsCJK = function ( s )
-- Is any CJK code within?
-- Parameter:
-- s -- string
-- Returns: true, if CJK detected
s = s and tostring(s) or ""
if not patternCJK then
patternCJK = mw.ustring.char( 91,
4352, 45, 4607,
11904, 45, 42191,
43072, 45, 43135,
44032, 45, 55215,
63744, 45, 64255,
65072, 45, 65103,
65381, 45, 65500,
131072, 45, 196607,
93 )
end
return mw.ustring.find( s, patternCJK ) ~= nil
end -- Text.containsCJK()
Text.removeDelimited = function (s, prefix, suffix)
-- Remove all text in s delimited by prefix and suffix (inclusive)
-- Arguments:
-- s = string to process
-- prefix = initial delimiter
-- suffix = ending delimiter
-- Returns: stripped string
s = s and tostring(s) or ""
prefix = prefix and tostring(prefix) or ""
suffix = suffix and tostring(suffix) or ""
local prefixLen = mw.ustring.len(prefix)
local suffixLen = mw.ustring.len(suffix)
if prefixLen == 0 or suffixLen == 0 then
return s
end
local i = s:find(prefix, 1, true)
local r = s
local j
while i do
j = r:find(suffix, i + prefixLen)
if j then
r = r:sub(1, i - 1)..r:sub(j+suffixLen)
else
r = r:sub(1, i - 1)
end
i = r:find(prefix, 1, true)
end
return r
end
Text.getPlain = function ( adjust )
-- Remove wikisyntax from string, except templates
-- Parameter:
-- adjust -- string
-- Returns: string
local r = Text.removeDelimited(adjust,"<!--","-->")
r = r:gsub( "(</?%l[^>]*>)", "" )
:gsub( "'''", "" )
:gsub( "''", "" )
:gsub( " ", " " )
return r
end -- Text.getPlain()
Text.isLatinRange = function (s)
-- Are characters expected to be latin or symbols within latin texts?
-- Arguments:
-- s = string to analyze
-- Returns: true, if valid for latin only
s = s and tostring(s) or "" --- ensure input is always string
initLatinData()
return mw.ustring.match(s, PatternLatin) ~= nil
end -- Text.isLatinRange()
Text.isQuote = function ( s )
-- Is this character any quotation mark?
-- Parameter:
-- s = single character to analyze
-- Returns: true, if s is quotation mark
s = s and tostring(s) or ""
if s == "" then
return false
end
if not SeekQuote then
SeekQuote = mw.ustring.char( 34, -- "
39, -- '
171, -- laquo
187, -- raquo
8216, -- lsquo
8217, -- rsquo
8218, -- sbquo
8220, -- ldquo
8221, -- rdquo
8222, -- bdquo
8249, -- lsaquo
8250, -- rsaquo
0x300C, -- CJK
0x300D, -- CJK
0x300E, -- CJK
0x300F ) -- CJK
end
return mw.ustring.find( SeekQuote, s, 1, true ) ~= nil
end -- Text.isQuote()
Text.listToText = function ( args, adapt )
-- Format list items similar to mw.text.listToText()
-- Parameter:
-- args -- table (sequence) with numKey=string
-- adapt -- string (optional); format including "%s"
-- Returns: string
return mw.text.listToText(trimAndFormat(args, adapt))
end -- Text.listToText()
Text.quote = function ( apply, alien, advance )
-- Quote text
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code, or nil
-- advance -- number, with level 1 or 2, or nil
-- Returns: quoted string
apply = apply and tostring(apply) or ""
local mode, slang
if type( alien ) == "string" then
slang = mw.text.trim( alien ):lower()
else
slang = mw.title.getCurrentTitle().pageLanguage
if not slang then
-- TODO FIXME: Introduction expected 2017-04
slang = mw.language.getContentLanguage():getCode()
end
end
if advance == 2 then
mode = 2
else
mode = 1
end
return fiatQuote( mw.text.trim( apply ), slang, mode )
end -- Text.quote()
Text.quoteUnquoted = function ( apply, alien, advance )
-- Quote text, if not yet quoted and not empty
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code, or nil
-- advance -- number, with level 1 or 2, or nil
-- Returns: string; possibly quoted
local r = mw.text.trim( apply and tostring(apply) or "" )
local s = mw.ustring.sub( r, 1, 1 )
if s ~= "" and not Text.isQuote( s, advance ) then
s = mw.ustring.sub( r, -1, 1 )
if not Text.isQuote( s ) then
r = Text.quote( r, alien, advance )
end
end
return r
end -- Text.quoteUnquoted()
Text.removeDiacritics = function ( adjust )
-- Remove all diacritics
-- Parameter:
-- adjust -- string
-- Returns: string; all latin letters should be ASCII
-- or basic greek or cyrillic or symbols etc.
local cleanup, decomposed
if not PatternCombined then
PatternCombined = mw.ustring.char( 91,
0x0300, 45, 0x036F,
0x1AB0, 45, 0x1AFF,
0x1DC0, 45, 0x1DFF,
0xFE20, 45, 0xFE2F,
93 )
end
decomposed = mw.ustring.toNFD( adjust and tostring(adjust) or "" )
cleanup = mw.ustring.gsub( decomposed, PatternCombined, "" )
return mw.ustring.toNFC( cleanup )
end -- Text.removeDiacritics()
Text.sentenceTerminated = function ( analyse )
-- Is string terminated by dot, question or exclamation mark?
-- Quotation, link termination and so on granted
-- Parameter:
-- analyse -- string
-- Returns: true, if sentence terminated
local r
if not PatternTerminated then
PatternTerminated = mw.ustring.char( 91,
12290,
65281,
65294,
65311 )
.. "!%.%?…][\"'%]‹›«»‘’“”]*$"
end
if mw.ustring.find( analyse, PatternTerminated ) then
r = true
else
r = false
end
return r
end -- Text.sentenceTerminated()
Text.ucfirstAll = function ( adjust)
-- Capitalize all words
-- Arguments:
-- adjust = string to adjust
-- Returns: string with all first letters in upper case
adjust = adjust and tostring(adjust) or ""
local r = mw.text.decode(adjust,true)
local i = 1
local c, j, m
m = (r ~= adjust)
r = " "..r
while i do
i = mw.ustring.find( r, "%W%l", i )
if i then
j = i + 1
c = mw.ustring.upper( mw.ustring.sub( r, j, j ) )
r = string.format( "%s%s%s",
mw.ustring.sub( r, 1, i ),
c,
mw.ustring.sub( r, i + 2 ) )
i = j
end
end -- while i
r = r:sub( 2 )
if m then
r = mw.text.encode(r)
end
return r
end -- Text.ucfirstAll()
Text.uprightNonlatin = function ( adjust )
-- Ensure non-italics for non-latin text parts
-- One single greek letter might be granted
-- Precondition:
-- adjust -- string
-- Returns: string with non-latin parts enclosed in <span>
local r
initLatinData()
if mw.ustring.match( adjust, PatternLatin ) then
-- latin only, horizontal dashes, quotes
r = adjust
else
local c
local j = false
local k = 1
local m = false
local n = mw.ustring.len( adjust )
local span = "%s%s<span dir='auto' style='font-style:normal'>%s</span>"
local flat = function ( a )
-- isLatin
local range
for i = 1, #RangesLatin do
range = RangesLatin[ i ]
if a >= range[ 1 ] and a <= range[ 2 ] then
return true
end
end -- for i
end -- flat()
local focus = function ( a )
-- char is not ambivalent
local r = ( a > 64 )
if r then
r = ( a < 8192 or a > 8212 )
else
r = ( a == 38 or a == 60 ) -- '&' '<'
end
return r
end -- focus()
local form = function ( a )
return string.format( span,
r,
mw.ustring.sub( adjust, k, j - 1 ),
mw.ustring.sub( adjust, j, a ) )
end -- form()
r = ""
for i = 1, n do
c = mw.ustring.codepoint( adjust, i, i )
if focus( c ) then
if flat( c ) then
if j then
if m then
if i == m then
-- single greek letter.
j = false
end
m = false
end
if j then
local nx = i - 1
local s = ""
for ix = nx, 1, -1 do
c = mw.ustring.sub( adjust, ix, ix )
if c == " " or c == "(" then
nx = nx - 1
s = c .. s
else
break -- for ix
end
end -- for ix
r = form( nx ) .. s
j = false
k = i
end
end
elseif not j then
j = i
if c >= 880 and c <= 1023 then
-- single greek letter?
m = i + 1
else
m = false
end
end
elseif m then
m = m + 1
end
end -- for i
if j and ( not m or m < n ) then
r = form( n )
else
r = r .. mw.ustring.sub( adjust, k )
end
end
return r
end -- Text.uprightNonlatin()
Text.test = function ( about )
local r
if about == "quote" then
initQuoteData()
r = { }
r.QuoteLang = QuoteLang
r.QuoteType = QuoteType
end
return r
end -- Text.test()
-- Export
local p = { }
for _, func in ipairs({'containsCJK','isLatinRange','isQuote','sentenceTerminated'}) do
p[func] = function (frame)
return Text[func]( frame.args[ 1 ] or "" ) and "1" or ""
end
end
for _, func in ipairs({'getPlain','removeDiacritics','ucfirstAll','uprightNonlatin'}) do
p[func] = function (frame)
return Text[func]( frame.args[ 1 ] or "" )
end
end
function p.char( frame )
local params = frame:getParent().args
local story = params[ 1 ]
local codes, lenient, multiple
if not story then
params = frame.args
story = params[ 1 ]
end
if story then
local items = mw.text.split( mw.text.trim(story), "%s+" )
if #items > 0 then
local j
lenient = (yesNo(params.errors) == false)
codes = { }
multiple = tonumber( params[ "*" ] )
for _, v in ipairs( items ) do
j = tonumber((v:sub( 1, 1 ) == "x" and "0" or "") .. v)
table.insert( codes, j or v )
end
end
end
return Text.char( codes, multiple, lenient )
end
function p.concatParams( frame )
local args
local template = frame.args.template
if type( template ) == "string" then
template = mw.text.trim( template )
template = ( template == "1" )
end
if template then
args = frame:getParent().args
else
args = frame.args
end
return Text.concatParams( args,
frame.args.separator,
frame.args.format )
end
function p.listToFormat(frame)
local lists = {}
local pformat = frame.args["format"]
local sep = frame.args["sep"] or ";"
-- Parameter parsen: Listen
for k, v in pairs(frame.args) do
local knum = tonumber(k)
if knum then lists[knum] = v end
end
-- Listen splitten
local maxListLen = 0
for i = 1, #lists do
lists[i] = mw.text.split(lists[i], sep)
if #lists[i] > maxListLen then maxListLen = #lists[i] end
end
-- Ergebnisstring generieren
local result = ""
local result_line = ""
for i = 1, maxListLen do
result_line = pformat
for j = 1, #lists do
result_line = mw.ustring.gsub(result_line, "%%s", lists[j][i], 1)
end
result = result .. result_line
end
return result
end
function p.listToText( frame )
local args
local template = frame.args.template
if type( template ) == "string" then
template = mw.text.trim( template )
template = ( template == "1" )
end
if template then
args = frame:getParent().args
else
args = frame.args
end
return Text.listToText( args, frame.args.format )
end
function p.quote( frame )
local slang = frame.args[2]
if type( slang ) == "string" then
slang = mw.text.trim( slang )
if slang == "" then
slang = false
end
end
return Text.quote( frame.args[ 1 ] or "",
slang,
tonumber( frame.args[3] ) )
end
function p.quoteUnquoted( frame )
local slang = frame.args[2]
if type( slang ) == "string" then
slang = mw.text.trim( slang )
if slang == "" then
slang = false
end
end
return Text.quoteUnquoted( frame.args[ 1 ] or "",
slang,
tonumber( frame.args[3] ) )
end
function p.zip(frame)
local lists = {}
local seps = {}
local defaultsep = frame.args["sep"] or ""
local innersep = frame.args["isep"] or ""
local outersep = frame.args["osep"] or ""
-- Parameter parsen
for k, v in pairs(frame.args) do
local knum = tonumber(k)
if knum then lists[knum] = v else
if string.sub(k, 1, 3) == "sep" then
local sepnum = tonumber(string.sub(k, 4))
if sepnum then seps[sepnum] = v end
end
end
end
-- sofern keine expliziten Separatoren angegeben sind, den Standardseparator verwenden
for i = 1, math.max(#seps, #lists) do
if not seps[i] then seps[i] = defaultsep end
end
-- Listen splitten
local maxListLen = 0
for i = 1, #lists do
lists[i] = mw.text.split(lists[i], seps[i])
if #lists[i] > maxListLen then maxListLen = #lists[i] end
end
local result = ""
for i = 1, maxListLen do
if i ~= 1 then result = result .. outersep end
for j = 1, #lists do
if j ~= 1 then result = result .. innersep end
result = result .. (lists[j][i] or "")
end
end
return result
end
function p.failsafe()
return Text.serial
end
p.Text = function ()
return Text
end -- p.Text
return p
07f1fc4d39342fd92bdae1c5463bbfede7eeda1a
Module:URL
828
207
515
514
2023-10-17T20:36:43Z
LamayII
2
1 revision imported from [[:wikipedia:Module:URL]]
Scribunto
text/plain
--
-- This module implements {{URL}}
--
-- See unit tests at [[Module:URL/testcases]]
local p = {}
local function safeUri(s)
local success, uri = pcall(function()
return mw.uri.new(s)
end)
if success then
return uri
end
end
local function extractUrl(args)
for name, val in pairs(args) do
if name ~= 2 and name ~= "msg" then
local url = name .. "=" .. val;
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
local uri = safeUri(url);
if uri and uri.host then
return url
end
end
end
end
function p._url(url, text, msg)
url = mw.text.trim(url or '')
text = mw.text.trim(text or '')
local nomsg = (msg or ''):sub(1,1):lower() == "n" or msg == 'false' -- boolean: true if msg is "false" or starts with n or N
if url == '' then
if text == '' then
if nomsg then
return nil
else
return mw.getCurrentFrame():expandTemplate{ title = 'tlx', args = { 'URL', "''example.com''", "''optional display text''" } }
end
else
return text
end
end
-- If the URL contains any unencoded spaces, encode them, because MediaWiki will otherwise interpret a space as the end of the URL.
url = mw.ustring.gsub(url, '%s', function(s) return mw.uri.encode(s, 'PATH') end)
-- If there is an empty query string or fragment id, remove it as it will cause mw.uri.new to throw an error
url = mw.ustring.gsub(url, '#$', '')
url = mw.ustring.gsub(url, '%?$', '')
-- If it's an HTTP[S] URL without the double slash, fix it.
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
local uri = safeUri(url)
-- Handle URL's without a protocol and URL's that are protocol-relative,
-- e.g. www.example.com/foo or www.example.com:8080/foo, and //www.example.com/foo
if uri and (not uri.protocol or (uri.protocol and not uri.host)) and url:sub(1, 2) ~= '//' then
url = 'http://' .. url
uri = safeUri(url)
end
if text == '' then
if uri then
if uri.path == '/' then uri.path = '' end
local port = ''
if uri.port then port = ':' .. uri.port end
text = mw.ustring.lower(uri.host or '') .. port .. (uri.relativePath or '')
-- Add <wbr> before _/.-# sequences
text = mw.ustring.gsub(text,"(/+)","<wbr/>%1") -- This entry MUST be the first. "<wbr/>" has a "/" in it, you know.
text = mw.ustring.gsub(text,"(%.+)","<wbr/>%1")
-- text = mw.ustring.gsub(text,"(%-+)","<wbr/>%1") -- DISABLED for now
text = mw.ustring.gsub(text,"(%#+)","<wbr/>%1")
text = mw.ustring.gsub(text,"(_+)","<wbr/>%1")
else -- URL is badly-formed, so just display whatever was passed in
text = url
end
end
return mw.ustring.format('<span class="url">[%s %s]</span>', url, text)
end
--[[
The main entry point for calling from Template:URL.
--]]
function p.url(frame)
local templateArgs = frame.args
local parentArgs = frame:getParent().args
local url = templateArgs[1] or parentArgs[1]
local text = templateArgs[2] or parentArgs[2] or ''
local msg = templateArgs.msg or parentArgs.msg or ''
url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or ''
return p._url(url, text, msg)
end
--[[
The entry point for calling from the forked Template:URL2.
This function returns no message by default.
It strips out wiki-link markup, html tags, and everything after a space.
--]]
function p.url2(frame)
local templateArgs = frame.args
local parentArgs = frame:getParent().args
local url = templateArgs[1] or parentArgs[1]
local text = templateArgs[2] or parentArgs[2] or ''
-- default to no message
local msg = templateArgs.msg or parentArgs.msg or 'no'
url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or ''
-- if the url came from a Wikidata call, it might have a pen icon appended
-- we want to keep that and add it back at the end.
local u1, penicon = mw.ustring.match( url, "(.*)( <span class='penicon.*)" )
if penicon then url = u1 end
-- strip out html tags and [ ] from url
url = (url or ''):gsub("<[^>]*>", ""):gsub("[%[%]]", "")
-- truncate anything after a space
url = url:gsub("%%20", " "):gsub(" .*", "")
return (p._url(url, text, msg) or "") .. (penicon or "")
end
return p
8d7a4c6fe04a01815e940475cf64b28e1ef48cfb
Template:Collapsible list
10
208
517
516
2023-10-17T20:36:43Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Collapsible_list]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:collapsible list|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
aff61df28bcc6c3457d6aa36ada4fffe68c409a9
Module:Collapsible list
828
209
519
518
2023-10-17T20:36:44Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Collapsible_list]]
Scribunto
text/plain
local p = {}
local function getListItem( data )
if not type( data ) == 'string' then
return ''
end
return mw.ustring.format( '<li style="line-height: inherit; margin: 0">%s</li>', data )
end
-- Returns an array containing the keys of all positional arguments
-- that contain data (i.e. non-whitespace values).
local function getArgNums( args )
local nums = {}
for k, v in pairs( args ) do
if type( k ) == 'number' and
k >= 1 and
math.floor( k ) == k and
type( v ) == 'string' and
mw.ustring.match( v, '%S' ) then
table.insert( nums, k )
end
end
table.sort( nums )
return nums
end
-- Formats a list of classes, styles or other attributes.
local function formatAttributes( attrType, ... )
local attributes = { ... }
local nums = getArgNums( attributes )
local t = {}
for i, num in ipairs( nums ) do
table.insert( t, attributes[ num ] )
end
if #t == 0 then
return '' -- Return the blank string so concatenation will work.
end
return mw.ustring.format( ' %s="%s"', attrType, table.concat( t, ' ' ) )
end
-- TODO: use Module:List. Since the update for this comment is routine,
-- this is blocked without a consensus discussion by
-- [[MediaWiki_talk:Common.css/Archive_15#plainlist_+_hlist_indentation]]
-- if we decide hlist in plainlist in this template isn't an issue, we can use
-- module:list directly
-- [https://en.wikipedia.org/w/index.php?title=Module:Collapsible_list/sandbox&oldid=1130172480]
-- is an implementation (that will code rot slightly I expect)
local function buildList( args )
-- Get the list items.
local listItems = {}
local argNums = getArgNums( args )
for i, num in ipairs( argNums ) do
table.insert( listItems, getListItem( args[ num ] ) )
end
if #listItems == 0 then
return ''
end
listItems = table.concat( listItems )
-- hack around mw-collapsible show/hide jumpiness by looking for text-alignment
-- by setting a margin if centered
local textAlignmentCentered = 'text%-align%s*:%s*center'
local centeredTitle = (args.title_style and args.title_style:lower():match(textAlignmentCentered)
or args.titlestyle and args.titlestyle:lower():match(textAlignmentCentered))
local centeredTitleSpacing
if centeredTitle then
centeredTitleSpacing = 'margin: 0 4em'
else
centeredTitleSpacing = ''
end
-- Get class, style and title data.
local collapsibleContainerClass = formatAttributes(
'class',
'collapsible-list',
'mw-collapsible',
not args.expand and 'mw-collapsed'
)
local collapsibleContainerStyle = formatAttributes(
'style',
-- mostly work around .infobox-full-data defaulting to centered
'text-align: left;',
args.frame_style,
args.framestyle
)
local collapsibleTitleStyle = formatAttributes(
'style',
'line-height: 1.6em; font-weight: bold;',
args.title_style,
args.titlestyle
)
local jumpyTitleStyle = formatAttributes(
'style',
centeredTitleSpacing
)
local title = args.title or 'List'
local ulclass = formatAttributes( 'class', 'mw-collapsible-content', args.hlist and 'hlist' )
local ulstyle = formatAttributes(
'style',
'margin-top: 0; margin-bottom: 0; line-height: inherit;',
not args.bullets and 'list-style: none; margin-left: 0;',
args.list_style,
args.liststyle
)
local hlist_templatestyles = ''
if args.hlist then
hlist_templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
end
-- Build the list.
return mw.ustring.format(
'%s<div%s%s>\n<div%s><div%s>%s</div></div>\n<ul%s%s>%s</ul>\n</div>',
hlist_templatestyles, collapsibleContainerClass, collapsibleContainerStyle,
collapsibleTitleStyle, jumpyTitleStyle, title, ulclass, ulstyle, listItems
)
end
function p.main( frame )
local origArgs
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
for k, v in pairs( frame.args ) do
origArgs = frame.args
break
end
else
origArgs = frame
end
local args = {}
for k, v in pairs( origArgs ) do
if type( k ) == 'number' or v ~= '' then
args[ k ] = v
end
end
return buildList( args )
end
return p
5b7e779e7529bcb12a219726ef6c948ea98874fd
Module:ISO 3166
828
210
521
520
2023-10-17T20:36:44Z
LamayII
2
1 revision imported from [[:wikipedia:Module:ISO_3166]]
Scribunto
text/plain
-- to enable us to replicate the current functioning of Country extract, we need to deal with:
-- 2 {{<name>}} DONE!
-- 3 [[<name>]] DONE!
-- 4 [[<name>|<junk>]] DONE!
-- 5 [[image:flag of <country>.[svg|gif|png|jpg]|\d+px]] DONE!
local p = {}
local getArgs = require("Module:Arguments").getArgs
local data = mw.loadData("Module:ISO 3166/data/National")
--[[----------F I N D N A M E----------]]-- -- Finds the name in the database
local function findname(code,cdata,qry)
local sqry = p.strip(qry)
if cdata["name"] and sqry==p.strip(cdata["name"])
or cdata["isoname"] and sqry==p.strip(cdata["isoname"])
or not cdata["nocode"] and sqry==code
or sqry==cdata["alpha3"] or sqry==cdata["numeric"]
then
return true
end
for _,tname in pairs(cdata["isonames"] or {}) do
if sqry==p.strip(tname) then
return true
end
end
for _,tname in pairs(cdata["altnames"] or {}) do
if sqry==p.strip(tname) then
return true
end
end
return false
end
--[[----------I S O N A M E----------]]-- -- Find the ISO name of a country/region
local function isoname(data,code,lang)
if data[code]["isonames"] then
local name = data[code]["isodisplaynames"] and data[code]["isodisplaynames"][lang]
or data[code]["isonames"][lang]
or data[code]["isodisplaynames"] and data[code]["isodisplaynames"][data[code]["defaultlang"] or data["defaultlang"]]
or data[code]["isonames"][data[code]["defaultlang"] or data["defaultlang"]]
or data[code]["isodisplaynames"] and data[code]["isodisplaynames"]["en"]
or data[code]["isonames"]["en"]
if name then return name end
for _,iname in pairs(data[code]["isonames"]) do return iname end
return data[code]["isodisplayname"] or data[code]["isoname"]
else
return data[code]["isodisplayname"] or data[code]["isoname"]
end
end
--[[----------S T R I P----------]]-- -- Removes junk from the input
function p.strip(text)
local accents = {["À"]="A",["Á"]="A",["Â"]="A",["Ã"]="A", -- accent list
["Ä"]="A",["Å"]="A",["Ç"]="C",["È"]="E",["É"]="E",
["Ê"]="E",["Ë"]="E",["Ì"]="I",["Í"]="I",["Î"]="I",
["Ï"]="I",["Ñ"]="N",["Ò"]="O",["Ó"]="O",["Ô"]="O",
["Õ"]="O",["Ö"]="O",["Ø"]="O",["Ù"]="U",["Ú"]="U",
["Û"]="U",["Ü"]="U",["Ý"]="Y"
}
local remove = {"NATION OF","COUNTRY OF","TERRITORY OF", -- text to be removed list
"FLAG OF","FLAG","KINGDOM OF","STATE OF"," STATE ",
"PROVINCE OF","PROVINCE","TERRITORY"
}
local patterns = {[".+:"]="",["|.+"]="",["%(.-%)"]="", -- patterns to follow (order may matter)
["%..*"]="",["^THE "]="",["%_"]=" ",["%-"]=" ",
["%d%d?%d?PX"]="",
}
text = mw.ustring.upper(text) -- Case insensitivity
text = mw.ustring.gsub(text,"[À-Ý]",accents) -- Deaccent
for pattern,value in pairs(patterns) do -- Follow patterns
text = mw.ustring.gsub(text,pattern,value)
end
for _,words in pairs(remove) do -- Remove unneeded words
text = mw.ustring.gsub(text,words,"")
end
text = mw.ustring.gsub(text,"%W","") -- Remove non alpha-numeric
return text
end
--[[----------P . C A L L S T R I P ---------]]-- -- Calls P.strip but using Module:Arguments
function p.callstrip(frame)
local args = getArgs(frame)
return p.strip(args[1]) or ""
end
--[[----------P . L U A C O D E---------]]-- -- Makes the ISO code of a country
function p.luacode(args)
if string.find(args[1] or '',"%-") then
args[1], args[2] = string.match(args[1] or '',"^([^%-]*)%-(.*)$")
end
if args[1] then args[1] = p.strip(args[1]) end
if args[2] then args[2] = p.strip(args[2]) end
if args["codetype"]=="3" then
args["codetype"]="alpha3"
end
local eot = args.error or ""
local catnocountry = (args.nocat and args.nocat == 'true') and ''
or '[[Category:Wikipedia page with obscure country]]'
local catnosubdivision = (args.nocat and args.nocat == 'true') and ''
or '[[Category:Wikipedia page with obscure subdivision]]'
if not args[1] then
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry = '' end
return catnocountry, '<span style="font-size:100%" class="error">"No parameter for the country given"</span>'
end
if not args[2] then --3166-1 code
for alpha2,cdata in pairs(data) do
if findname(alpha2,cdata,args[1]) then
if args["codetype"]=="numeric" or args["codetype"]=="alpha3" then
return cdata[args["codetype"]]
else
return alpha2
end
end
end
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry = '' end
return catnocountry
else --3166-2 code
for alpha2,cdata in pairs(data) do
if findname(alpha2,cdata,args[1]) then
if mw.ustring.match(alpha2,"GB") then -- For England, Wales etc.
alpha2 = "GB"
end
local sdata = mw.loadData("Module:ISO 3166/data/"..alpha2)
local empty = true
for scode,scdata in pairs(sdata) do
if type(scdata)=="table" then
empty = false
if findname(scode,scdata,args[2]) then
return alpha2.."-"..scode
end
end
end
if mw.title.getCurrentTitle().namespace ~= 0 then catnosubdivision = '' end
return catnosubdivision
end
end
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry = '' end
return catnocountry
end
end
--[[----------P . C O D E---------]]-- -- Calls P.Luacode but using Module:Arguments
function p.code(frame)
return p.luacode(getArgs(frame)) or ""
end
--[[----------P . N U M E R I C---------]]-- -- Calls P.Luacode but using Module:Arguments and setting it to output a numeric value
function p.numeric(frame)
local args = getArgs(frame)
args["codetype"]="numeric"
return p.luacode(args) or ""
end
--[[----------P . L U A N A M E---------]]-- -- Makes the ISO/common name of a country
function p.luaname(args)
local code1 = p.luacode(args)
local code2 = ''
if string.find(code1,"%-") then
code1, code2 = string.match(code1,"^([^%-]*)%-(.*)$")
end
if string.find(code1,"^%u%u$") then
if code2=="" then --3166-1 alpha-2 code
if data[code1] then
return (args.isoname or args.lang) and isoname(data,code1,args.lang)
or (data[code1]["displayname"] or data[code1]["name"])
else
return '[[Category:Wikipedia page with obscure country]]'
end
else --3166-2 code
local sdata
if data[code1] then
sdata = mw.loadData("Module:ISO 3166/data/"..code1)
else
return '[[Category:Wikipedia page with obscure country]]'
end
if sdata[code2] then
return (args.isoname or args.lang) and isoname(sdata,code2,args.lang)
or (sdata[code2]["displayname"] or sdata[code2]["name"])
else
return '[[Category:Wikipedia page with obscure country]]'
end
end
end
end
--[[----------P . N A M E---------]]-- -- Calls P.Luaname but using Module:Arguments
function p.name(frame)
return p.luaname(getArgs(frame)) or ""
end
--[[----------P . G E O C O O R D I N S E R T---------]]-- -- Wrapper for Module:Coordinates.coordinsert
function p.geocoordinsert(frame)
-- {{#invoke:ISO 3166|geocoordinsert|{{coord|...}}
-- |country=..|subdivision1=...|subdivision2=...
-- |type=...|scale=...|dim=...|source=...|globe=...
-- }}
local args = frame.args
local subdivisionqueried = false
local catnocountry = (args.nocat and args.nocat == 'true') and ''
or '[[Category:Wikipedia page with obscure country]]'
local catnosubdivision = (args.nocat and args.nocat == 'true') and ''
or '[[Category:Wikipedia page with obscure subdivision]]' or ''
local tracking = ''
local targs = {}
targs[1] = args[1] or ''
for i, v in pairs(args) do
if i == 'country' and not mw.ustring.find(targs[1], 'region:') then
local country = v
local k, region = 1, ''
-- look for a valid subdivision
while region == '' and k < 3 do
local subdivision = args['subdivision' .. k] or ''
if subdivision ~= '' then
region = p.luacode({country, subdivision, nocat = 'true'})
subdivisionqueried = true
end
k = k + 1
end
-- subdivision lookup failed or never attempted, try country only
if region == '' then
region = p.luacode({country, nocat = 'true'})
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry, catnosubdivision = '', '' end
if region == '' then
tracking = tracking .. catnocountry
elseif subdivisionqueried == true then
tracking = tracking .. catnosubdivision
end
end
-- something worked, add it to the targs
if region ~= '' then
targs[#targs + 1] = 'region:' .. region
end
elseif i == 'type' or i == 'scale' or i == 'dim'
or i == 'source' or i == 'globe' then
targs[#targs + 1] = i .. ':' .. v
end
end
-- call Module:Coordinates.coordinsert if there is something to insert
if #targs > 1 then
local coordinsert = require('Module:Coordinates').coordinsert
return coordinsert({args = targs}) .. tracking
end
-- otherwise, just return the coordinates
return targs[1] .. tracking
end
return p
6bc354f2610f29e712065cbe3ea814144fa3a600
Module:ISO 3166/data/National
828
211
523
522
2023-10-17T20:36:45Z
LamayII
2
1 revision imported from [[:wikipedia:Module:ISO_3166/data/National]]
Scribunto
text/plain
return {
["AD"] = {alpha3="AND",numeric="020",name="Andorra"},
["AE"] = {alpha3="ARE",numeric="784",name="United Arab Emirates",altnames={"UAE"}},
["AF"] = {alpha3="AFG",numeric="004",name="Afghanistan"},
["AG"] = {alpha3="ATG",numeric="028",name="Antigua and Barbuda"},
["AI"] = {alpha3="AIA",numeric="660",name="Anguilla"},
["AL"] = {alpha3="ALB",numeric="008",name="Albania"},
["AM"] = {alpha3="ARM",numeric="051",name="Armenia"},
["AO"] = {alpha3="AGO",numeric="024",name="Angola"},
["AQ"] = {alpha3="ATA",numeric="010",name="Antarctica"},
["AR"] = {alpha3="ARG",numeric="032",name="Argentina"},
["AS"] = {alpha3="ASM",numeric="016",name="American Samoa"},
["AT"] = {alpha3="AUT",numeric="040",name="Austria"},
["AU"] = {alpha3="AUS",numeric="036",name="Australia"},
["AW"] = {alpha3="ABW",numeric="533",name="Aruba"},
["AX"] = {alpha3="ALA",numeric="248",name="Åland Islands",altnames={"Aland Islands","Åland","Aland"}},
["AZ"] = {alpha3="AZE",numeric="031",name="Azerbaijan"},
["BA"] = {alpha3="BIH",numeric="070",name="Bosnia and Herzegovina",altnames={"Bosnia"}},
["BB"] = {alpha3="BRB",numeric="052",name="Barbados"},
["BD"] = {alpha3="BGD",numeric="050",name="Bangladesh"},
["BE"] = {alpha3="BEL",numeric="056",name="Belgium"},
["BF"] = {alpha3="BFA",numeric="854",name="Burkina Faso"},
["BG"] = {alpha3="BGR",numeric="100",name="Bulgaria"},
["BH"] = {alpha3="BHR",numeric="048",name="Bahrain"},
["BI"] = {alpha3="BDI",numeric="108",name="Burundi"},
["BJ"] = {alpha3="BEN",numeric="204",name="Benin"},
["BL"] = {alpha3="BLM",numeric="652",name="Saint Barthélemy",altnames={"St Barthelemy"}},
["BM"] = {alpha3="BMU",numeric="060",name="Bermuda"},
["BN"] = {alpha3="BRN",numeric="096",name="Brunei",isoname="Brunei Darussalam"},
["BO"] = {alpha3="BOL",numeric="068",name="Bolivia",isoname="Bolivia (Plurinational State of)"},
["BQ"] = {alpha3="BES",numeric="535",name="Caribbean Netherlands",isoname="Bonaire, Sint Eustatius and Saba"},
["BR"] = {alpha3="BRA",numeric="076",name="Brazil"},
["BS"] = {alpha3="BHS",numeric="044",name="Bahamas"},
["BT"] = {alpha3="BTN",numeric="064",name="Bhutan"},
["BV"] = {alpha3="BVT",numeric="074",name="Bouvet Island"},
["BW"] = {alpha3="BWA",numeric="072",name="Botswana"},
["BY"] = {alpha3="BLR",numeric="112",name="Belarus"},
["BZ"] = {alpha3="BLZ",numeric="084",name="Belize"},
["CA"] = {alpha3="CAN",numeric="124",name="Canada"},
["CC"] = {alpha3="CCK",numeric="166",name="Cocos (Keeling) Islands",altnames={"Cocos Islands","Keeling Islands"}},
["CD"] = {alpha3="COD",numeric="180",name="Democratic Republic of the Congo",isoname="Congo, Democratic Republic of the",altnames={"Congo-Kinshasa","DRC","DR Congo"}},
["CF"] = {alpha3="CAF",numeric="140",name="Central African Republic",altnames={"CAR"}},
["CG"] = {alpha3="COG",numeric="178",name="Republic of the Congo",isoname="Congo",altnames={"Congo-Brazzaville"}},
["CH"] = {alpha3="CHE",numeric="756",name="Switzerland"},
["CI"] = {alpha3="CIV",numeric="384",name="Côte d'Ivoire",altnames={"Ivory Coast"}},
["CK"] = {alpha3="COK",numeric="184",name="Cook Islands"},
["CL"] = {alpha3="CHL",numeric="152",name="Chile"},
["CM"] = {alpha3="CMR",numeric="120",name="Cameroon"},
["CN"] = {alpha3="CHN",numeric="156",name="China",altnames={"People's Republic of China","PRC"}},
["CO"] = {alpha3="COL",numeric="170",name="Colombia"},
["CR"] = {alpha3="CRI",numeric="188",name="Costa Rica"},
["CU"] = {alpha3="CUB",numeric="192",name="Cuba"},
["CV"] = {alpha3="CPV",numeric="132",name="Cabo Verde",altnames={"Cape Verde"}},
["CW"] = {alpha3="CUW",numeric="531",name="Curaçao",altnames={"Curacao"}},
["CX"] = {alpha3="CXR",numeric="162",name="Christmas Island"},
["CY"] = {alpha3="CYP",numeric="196",name="Cyprus"},
["CZ"] = {alpha3="CZE",numeric="203",name="Czech Republic",isoname="Czechia"},
["DE"] = {alpha3="DEU",numeric="276",name="Germany"},
["DJ"] = {alpha3="DJI",numeric="262",name="Djibouti"},
["DK"] = {alpha3="DNK",numeric="208",name="Denmark"},
["DM"] = {alpha3="DMA",numeric="212",name="Dominica"},
["DO"] = {alpha3="DOM",numeric="214",name="Dominican Republic"},
["DZ"] = {alpha3="DZA",numeric="012",name="Algeria"},
["EC"] = {alpha3="ECU",numeric="218",name="Ecuador"},
["EE"] = {alpha3="EST",numeric="233",name="Estonia"},
["EG"] = {alpha3="EGY",numeric="818",name="Egypt"},
["EH"] = {alpha3="ESH",numeric="732",name="Western Sahara"},
["ER"] = {alpha3="ERI",numeric="232",name="Eritrea"},
["ES"] = {alpha3="ESP",numeric="724",name="Spain"},
["ET"] = {alpha3="ETH",numeric="231",name="Ethiopia"},
["FI"] = {alpha3="FIN",numeric="246",name="Finland"},
["FJ"] = {alpha3="FJI",numeric="242",name="Fiji"},
["FK"] = {alpha3="FLK",numeric="238",name="Falkland Islands",isoname="Falkland Islands (Malvinas)",altnames={"Falklands","Islas Malvinas","Malvinas","Malvinas Islands"}},
["FM"] = {alpha3="FSM",numeric="583",name="Federated States of Micronesia",isoname="Micronesia (Federated States of)",altnames={"Micronesia"}},
["FO"] = {alpha3="FRO",numeric="234",name="Faroe Islands",altnames={"Faroer","Faeroer"}},
["FR"] = {alpha3="FRA",numeric="250",name="France"},
["GA"] = {alpha3="GAB",numeric="266",name="Gabon"},
["GB"] = {alpha3="GBR",numeric="826",name="United Kingdom",isoname="United Kingdom of Great Britain and Northern Ireland",altnames={"UK","Great Britain"}},
["GB-ENG"] = {alpha3="ENG",numeric="000",name="England"}, --Considered to be a country
["GB-NIR"] = {alpha3="NIR",numeric="000",name="Northern Ireland"}, --Considered to be a country
["GB-SCT"] = {alpha3="SCT",numeric="000",name="Scotland"}, --Considered to be a country
["GB-WLS"] = {alpha3="WLS",numeric="000",name="Wales"}, --Considered to be a country
["GB-EAW"] = {alpha3="EAW",numeric="000",name="England and Wales"}, --Considered to be a country
["GD"] = {alpha3="GRD",numeric="308",name="Grenada"},
["GE"] = {alpha3="GEO",numeric="268",name="Georgia"},
["GF"] = {alpha3="GUF",numeric="254",name="French Guiana"},
["GG"] = {alpha3="GGY",numeric="831",name="Guernsey"},
["GH"] = {alpha3="GHA",numeric="288",name="Ghana"},
["GI"] = {alpha3="GIB",numeric="292",name="Gibraltar"},
["GL"] = {alpha3="GRL",numeric="304",name="Greenland"},
["GM"] = {alpha3="GMB",numeric="270",name="Gambia"},
["GN"] = {alpha3="GIN",numeric="324",name="Guinea"},
["GP"] = {alpha3="GLP",numeric="312",name="Guadeloupe"},
["GQ"] = {alpha3="GNQ",numeric="226",name="Equatorial Guinea"},
["GR"] = {alpha3="GRC",numeric="300",name="Greece"},
["GS"] = {alpha3="SGS",numeric="239",name="South Georgia and the South Sandwich Islands"},
["GT"] = {alpha3="GTM",numeric="320",name="Guatemala"},
["GU"] = {alpha3="GUM",numeric="316",name="Guam"},
["GW"] = {alpha3="GNB",numeric="624",name="Guinea-Bissau"},
["GY"] = {alpha3="GUY",numeric="328",name="Guyana"},
["HK"] = {alpha3="HKG",numeric="344",name="Hong Kong",altnames={"Hong Kong SAR","HKSAR"}},
["HM"] = {alpha3="HMD",numeric="334",name="Heard Island and McDonald Islands",altnames={"Heard and McDonald Islands"}},
["HN"] = {alpha3="HND",numeric="340",name="Honduras"},
["HR"] = {alpha3="HRV",numeric="191",name="Croatia"},
["HT"] = {alpha3="HTI",numeric="332",name="Haiti"},
["HU"] = {alpha3="HUN",numeric="348",name="Hungary"},
["ID"] = {alpha3="IDN",numeric="360",name="Indonesia"},
["IE"] = {alpha3="IRL",numeric="372",name="Ireland",altnames={"Republic of Ireland"}},
["IL"] = {alpha3="ISR",numeric="376",name="Israel"},
["IM"] = {alpha3="IMN",numeric="833",name="Isle of Man"},
["IN"] = {alpha3="IND",numeric="356",name="India"},
["IO"] = {alpha3="IOT",numeric="086",name="British Indian Ocean Territory"},
["IQ"] = {alpha3="IRQ",numeric="368",name="Iraq"},
["IR"] = {alpha3="IRN",numeric="364",name="Iran",isoname="Iran (Islamic Republic of)"},
["IS"] = {alpha3="ISL",numeric="352",name="Iceland"},
["IT"] = {alpha3="ITA",numeric="380",name="Italy"},
["JE"] = {alpha3="JEY",numeric="832",name="Jersey"},
["JM"] = {alpha3="JAM",numeric="388",name="Jamaica"},
["JO"] = {alpha3="JOR",numeric="400",name="Jordan"},
["JP"] = {alpha3="JPN",numeric="392",name="Japan"},
["KE"] = {alpha3="KEN",numeric="404",name="Kenya"},
["KG"] = {alpha3="KGZ",numeric="417",name="Kyrgyzstan"},
["KH"] = {alpha3="KHM",numeric="116",name="Cambodia"},
["KI"] = {alpha3="KIR",numeric="296",name="Kiribati"},
["KM"] = {alpha3="COM",numeric="174",name="Comoros"},
["KN"] = {alpha3="KNA",numeric="659",name="Saint Kitts and Nevis",altnames={"St Kitts and Nevis"}},
["KP"] = {alpha3="PRK",numeric="408",name="North Korea",isoname="Korea (Democratic People's Republic of)",altnames={"Democratic People's Republic of Korea"}},
["KR"] = {alpha3="KOR",numeric="410",name="South Korea",isoname="Korea, Republic of",altnames={"Republic of Korea"}},
["KW"] = {alpha3="KWT",numeric="414",name="Kuwait"},
["KY"] = {alpha3="CYM",numeric="136",name="Cayman Islands"},
["KZ"] = {alpha3="KAZ",numeric="398",name="Kazakhstan"},
["LA"] = {alpha3="LAO",numeric="418",name="Laos",isoname="Lao People's Democratic Republic"},
["LB"] = {alpha3="LBN",numeric="422",name="Lebanon"},
["LC"] = {alpha3="LCA",numeric="662",name="Saint Lucia",altnames={"St Lucia"}},
["LI"] = {alpha3="LIE",numeric="438",name="Liechtenstein"},
["LK"] = {alpha3="LKA",numeric="144",name="Sri Lanka"},
["LR"] = {alpha3="LBR",numeric="430",name="Liberia"},
["LS"] = {alpha3="LSO",numeric="426",name="Lesotho"},
["LT"] = {alpha3="LTU",numeric="440",name="Lithuania"},
["LU"] = {alpha3="LUX",numeric="442",name="Luxembourg"},
["LV"] = {alpha3="LVA",numeric="428",name="Latvia"},
["LY"] = {alpha3="LBY",numeric="434",name="Libya"},
["MA"] = {alpha3="MAR",numeric="504",name="Morocco"},
["MC"] = {alpha3="MCO",numeric="492",name="Monaco"},
["MD"] = {alpha3="MDA",numeric="498",name="Moldova",isoname="Moldova, Republic of"},
["ME"] = {alpha3="MNE",numeric="499",name="Montenegro"},
["MF"] = {alpha3="MAF",numeric="663",name="Saint-Martin",isoname="Saint Martin (French part)",altnames={"St Martin","St Martin (French part)","Collectivity of Saint Martin","Collectivity of St Martin"}},
["MG"] = {alpha3="MDG",numeric="450",name="Madagascar"},
["MH"] = {alpha3="MHL",numeric="584",name="Marshall Islands"},
["MK"] = {alpha3="MKD",numeric="807",name="North Macedonia",altnames={"Republic of North Macedonia","Macedonia","Republic of Macedonia","Macedonia, the former Yugoslav Republic of"}},
["ML"] = {alpha3="MLI",numeric="466",name="Mali"},
["MM"] = {alpha3="MMR",numeric="104",name="Myanmar",altnames={"Burma"}},
["MN"] = {alpha3="MNG",numeric="496",name="Mongolia"},
["MO"] = {alpha3="MAC",numeric="446",name="Macau",isoname="Macao",altnames={"Macau SAR","Macao SAR"}},
["MP"] = {alpha3="MNP",numeric="580",name="Northern Mariana Islands"},
["MQ"] = {alpha3="MTQ",numeric="474",name="Martinique"},
["MR"] = {alpha3="MRT",numeric="478",name="Mauritania"},
["MS"] = {alpha3="MSR",numeric="500",name="Montserrat"},
["MT"] = {alpha3="MLT",numeric="470",name="Malta"},
["MU"] = {alpha3="MUS",numeric="480",name="Mauritius"},
["MV"] = {alpha3="MDV",numeric="462",name="Maldives"},
["MW"] = {alpha3="MWI",numeric="454",name="Malawi"},
["MX"] = {alpha3="MEX",numeric="484",name="Mexico"},
["MY"] = {alpha3="MYS",numeric="458",name="Malaysia"},
["MZ"] = {alpha3="MOZ",numeric="508",name="Mozambique"},
["NA"] = {alpha3="NAM",numeric="516",name="Namibia"},
["NC"] = {alpha3="NCL",numeric="540",name="New Caledonia"},
["NE"] = {alpha3="NER",numeric="562",name="Niger"},
["NF"] = {alpha3="NFK",numeric="574",name="Norfolk Island"},
["NG"] = {alpha3="NGA",numeric="566",name="Nigeria"},
["NI"] = {alpha3="NIC",numeric="558",name="Nicaragua"},
["NL"] = {alpha3="NLD",numeric="528",name="Netherlands"},
["NO"] = {alpha3="NOR",numeric="578",name="Norway"},
["NP"] = {alpha3="NPL",numeric="524",name="Nepal"},
["NR"] = {alpha3="NRU",numeric="520",name="Nauru"},
["NU"] = {alpha3="NIU",numeric="570",name="Niue"},
["NZ"] = {alpha3="NZL",numeric="554",name="New Zealand",altnames={"Aotearoa"}},
["OM"] = {alpha3="OMN",numeric="512",name="Oman"},
["PA"] = {alpha3="PAN",numeric="591",name="Panama"},
["PE"] = {alpha3="PER",numeric="604",name="Peru"},
["PF"] = {alpha3="PYF",numeric="258",name="French Polynesia"},
["PG"] = {alpha3="PNG",numeric="598",name="Papua New Guinea"},
["PH"] = {alpha3="PHL",numeric="608",name="Philippines"},
["PK"] = {alpha3="PAK",numeric="586",name="Pakistan"},
["PL"] = {alpha3="POL",numeric="616",name="Poland"},
["PM"] = {alpha3="SPM",numeric="666",name="Saint Pierre and Miquelon",altnames={"St Pierre and Miquelon"}},
["PN"] = {alpha3="PCN",numeric="612",name="Pitcairn"},
["PR"] = {alpha3="PRI",numeric="630",name="Puerto Rico"},
["PS"] = {alpha3="PSE",numeric="275",name="Palestine",isoname="Palestine, State of",altnames={"State of Palestine"}},
["PT"] = {alpha3="PRT",numeric="620",name="Portugal"},
["PW"] = {alpha3="PLW",numeric="585",name="Palau"},
["PY"] = {alpha3="PRY",numeric="600",name="Paraguay"},
["QA"] = {alpha3="QAT",numeric="634",name="Qatar"},
["RE"] = {alpha3="REU",numeric="638",name="Réunion"},
["RO"] = {alpha3="ROU",numeric="642",name="Romania"},
["RS"] = {alpha3="SRB",numeric="688",name="Serbia"},
["RU"] = {alpha3="RUS",numeric="643",name="Russia",isoname="Russian Federation"},
["RW"] = {alpha3="RWA",numeric="646",name="Rwanda"},
["SA"] = {alpha3="SAU",numeric="682",name="Saudi Arabia"},
["SB"] = {alpha3="SLB",numeric="090",name="Solomon Islands"},
["SC"] = {alpha3="SYC",numeric="690",name="Seychelles"},
["SD"] = {alpha3="SDN",numeric="729",name="Sudan"},
["SE"] = {alpha3="SWE",numeric="752",name="Sweden"},
["SG"] = {alpha3="SGP",numeric="702",name="Singapore"},
["SH"] = {alpha3="SHN",numeric="654",name="Saint Helena, Ascension and Tristan da Cunha"},
["SI"] = {alpha3="SVN",numeric="705",name="Slovenia"},
["SJ"] = {alpha3="SJM",numeric="744",name="Svalbard and Jan Mayen"},
["SK"] = {alpha3="SVK",numeric="703",name="Slovakia"},
["SL"] = {alpha3="SLE",numeric="694",name="Sierra Leone"},
["SM"] = {alpha3="SMR",numeric="674",name="San Marino"},
["SN"] = {alpha3="SEN",numeric="686",name="Senegal"},
["SO"] = {alpha3="SOM",numeric="706",name="Somalia"},
["SR"] = {alpha3="SUR",numeric="740",name="Suriname"},
["SS"] = {alpha3="SSD",numeric="728",name="South Sudan"},
["ST"] = {alpha3="STP",numeric="678",name="São Tomé and Príncipe",isoname="Sao Tome and Principe",altnames={"Democratic Republic of Sao Tome and Principe"}},
["SV"] = {alpha3="SLV",numeric="222",name="El Salvador"},
["SX"] = {alpha3="SXM",numeric="534",name="Sint Maarten",isoname="Sint Maarten (Dutch part)",altnames={"St Maarten","Saint Martin (Dutch part)","St Martin (Dutch part)"}},
["SY"] = {alpha3="SYR",numeric="760",name="Syria",isoname="Syrian Arab Republic"},
["SZ"] = {alpha3="SWZ",numeric="748",name="Eswatini",altnames={"Swaziland"}},
["TC"] = {alpha3="TCA",numeric="796",name="Turks and Caicos Islands"},
["TD"] = {alpha3="TCD",numeric="148",name="Chad"},
["TF"] = {alpha3="ATF",numeric="260",name="French Southern and Antarctic Lands",isoname="French Southern Territories"},
["TG"] = {alpha3="TGO",numeric="768",name="Togo"},
["TH"] = {alpha3="THA",numeric="764",name="Thailand"},
["TJ"] = {alpha3="TJK",numeric="762",name="Tajikistan"},
["TK"] = {alpha3="TKL",numeric="772",name="Tokelau"},
["TL"] = {alpha3="TLS",numeric="626",name="Timor-Leste",altnames={"East Timor"}},
["TM"] = {alpha3="TKM",numeric="795",name="Turkmenistan"},
["TN"] = {alpha3="TUN",numeric="788",name="Tunisia"},
["TO"] = {alpha3="TON",numeric="776",name="Tonga"},
["TR"] = {alpha3="TUR",numeric="792",name="Turkey",isoname="Türkiye"},
["TT"] = {alpha3="TTO",numeric="780",name="Trinidad and Tobago"},
["TV"] = {alpha3="TUV",numeric="798",name="Tuvalu"},
["TW"] = {alpha3="TWN",numeric="158",name="Taiwan",isoname="Taiwan, Province of China",altnames={"Republic of China"}},
["TZ"] = {alpha3="TZA",numeric="834",name="Tanzania",isoname="Tanzania, United Republic of"},
["UA"] = {alpha3="UKR",numeric="804",name="Ukraine"},
["UG"] = {alpha3="UGA",numeric="800",name="Uganda"},
["UM"] = {alpha3="UMI",numeric="581",name="United States Minor Outlying Islands"},
["US"] = {alpha3="USA",numeric="840",name="United States",isoname="United States of America",altnames={"US","USA","U.S."}},
["UY"] = {alpha3="URY",numeric="858",name="Uruguay"},
["UZ"] = {alpha3="UZB",numeric="860",name="Uzbekistan"},
["VA"] = {alpha3="VAT",numeric="336",name="Vatican City",isoname="Holy See",altnames={"Holy See (Vatican City State)","Vatican City State"}},
["VC"] = {alpha3="VCT",numeric="670",name="Saint Vincent and the Grenadines",altnames={"St Vincent and the Grenadines"}},
["VE"] = {alpha3="VEN",numeric="862",name="Venezuela",isoname="Venezuela (Bolivarian Republic of)"},
["VG"] = {alpha3="VGB",numeric="092",name="British Virgin Islands",isoname="Virgin Islands (British)",altnames={"UK Virgin Islands","BVI"}},
["VI"] = {alpha3="VIR",numeric="850",name="United States Virgin Islands",isoname="Virgin Islands (U.S.)",altnames={"US Virgin Islands","USVI"}},
["VN"] = {alpha3="VNM",numeric="704",name="Vietnam",isoname="Viet Nam"},
["VU"] = {alpha3="VUT",numeric="548",name="Vanuatu"},
["WF"] = {alpha3="WLF",numeric="876",name="Wallis and Futuna"},
["WS"] = {alpha3="WSM",numeric="882",name="Samoa"},
["YE"] = {alpha3="YEM",numeric="887",name="Yemen"},
["YT"] = {alpha3="MYT",numeric="175",name="Mayotte"},
["ZA"] = {alpha3="ZAF",numeric="710",name="South Africa"},
["ZM"] = {alpha3="ZMB",numeric="894",name="Zambia"},
["ZW"] = {alpha3="ZWE",numeric="716",name="Zimbabwe"}
}
1ae753fe1fa53ce062b0a008dbc9778d589666f0
Module:TNT
828
22
525
52
2023-10-17T20:36:46Z
LamayII
2
1 revision imported from [[:wikipedia:Module:TNT]]
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
params[k - 2] = mw.text.trim(v)
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in ipairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in ipairs(data.data) do
local newVal = {}
local name = nil
for pos, columnName in ipairs(names) do
if columnName == 'name' then
name = row[pos]
else
newVal[columnName] = row[pos]
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
2c570369c78089aef29c72768918373f61b7075d
Template:Precision
10
212
527
526
2023-10-17T20:36:46Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Precision]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Math|precision|{{{1|0}}}|check_fraction=true}}</includeonly><noinclude>
{{documentation}}
</noinclude>
944a0e5e6c5ace1e2a418c7969c645313b30395a
Template:Max
10
213
529
528
2023-10-17T20:36:47Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Max]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Math|max}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
f052e3a9b5b08740be624045e49f31d86e09f0ad
Template:Order of magnitude
10
214
531
530
2023-10-17T20:36:48Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Order_of_magnitude]]
wikitext
text/x-wiki
<includeonly>{{safesubst:<noinclude/>#ifexpr:{{{1|0}}}=0
|{{safesubst:<noinclude/>#ifexpr:abs{{{1|0}}}1=1
|0
|{{safesubst:<noinclude/>#expr:floor((ln(abs{{{1}}}1)/ln10)+1)}}
}}
|{{safesubst:<noinclude/>#expr:floor((ln(abs({{{1|0}}}) )/ln 10)+1E((abs{{{1|0}}}>1E100 or abs{{{1|0}}}<1E-100)-14))}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
cede5694e8ebb404ecdd17ae1f8e1c5d19562728
Template:Location map
10
215
533
532
2023-10-17T20:36:48Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Location_map]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Location map|main}}</includeonly><noinclude>{{documentation}}</noinclude>
732416b8068d2dc3549db5aa5ffa786beb502886
Template:Polparty
10
216
535
534
2023-10-17T20:36:49Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Polparty]]
wikitext
text/x-wiki
{{#switch: {{ucfirst:{{{1}}}}}
| AT | Austria | [[Austria]] = {{#switch: {{uc:{{{2}}}}}
| SPÖ = [[Social Democratic Party of Austria|SPÖ]]
| ÖVP = [[Austrian People's Party|ÖVP]]
| FPÖ = [[Freedom Party of Austria|FPÖ]]
| BZÖ = [[Alliance for the Future of Austria|BZÖ]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Greens | Grün | Grüne = [[The Greens – The Green Alternative|Green]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| AU | Australia | [[Australia]] = {{#switch: {{uc:{{{2}}}}}
| ALP = [[Australian Labor Party|ALP]]
| CLP = [[Country Liberal Party|CLP]]
| LP = [[Liberal Party of Australia|Lib.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Democrats | Dem = [[Australian Democrats|Dem.]]
| Greens | Green = [[Australian Greens|Greens]]
| Labor | Lab = [[Australian Labor Party|ALP]]
| Liberal | Lib = [[Liberal Party of Australia|Lib.]]
| National | Nat = [[National Party of Australia|Nat.]]
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| CA | Canada | [[Canada]] = {{#switch: {{uc:{{{2}}}}}
| BQ = [[Bloc Québécois|BQ]]
| CPC = [[Conservative Party of Canada|CPC]]
| LPC = [[Liberal Party of Canada|LPC]]
| NDP = [[New Democratic Party|NDP]]
| GPC = [[Green Party of Canada|Green]]
| FPNP = [[First Peoples National Party of Canada|FPNP]]
| CHP = [[Christian Heritage Party of Canada|CHP]]
| WBP = [[Western Block Party|WBP]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| CZ | Czechia | [[Czechia]] | [[Czech Republic]] | Czech Republic = {{#switch: {{uc:{{{2}}}}}
| ODS = [[Civic Democratic Party (Czech Republic)|ODS]]
| CSSD = [[Czech Social Democratic Party|ČSSD]]
| KSCM = [[Communist Party of Bohemia and Moravia|KSČM]]
| KDU-CSL = [[Christian and Democratic Union – Czechoslovak People's Party|KDU-ČSL]]
| ANO = [[ANO 2011|ANO]]
| TOP09 = [[TOP 09]]
| STAN = [[Mayors and Independents|STAN]]
| Pirati = [[Czech Pirate Party|Piráti]]
| SPD = [[Freedom and Direct Democracy|SPD]]
| SZ = [[Green Party (Czech Republic)|Greens]]
| US-DEU = [[Freedom Union–Democratic Union|US-DEU]]
| LIRA = [[Liberal Reform Party|LIRA]]
| SNK = [[SNK European Democrats|SNK ED]]
| NEZDEM = [[Independent Democrats (Czech Republic)|Ind. Dem.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| DE | Germany | [[Germany]] = {{#switch: {{uc:{{{2}}}}}
| CDU = [[Christian Democratic Union of Germany|CDU]]
| CSU = [[Christian Social Union in Bavaria|CSU]]
| SPD = [[Social Democratic Party of Germany|SPD]]
| FDP = [[Free Democratic Party (Germany)|FDP]]
| PDS = [[The Left (Germany)|Left]]
| FW |FWG = [[Free Voters|FW]]
| DDP = [[German Democratic Party|DDP]]
| NS | NSDAP = [[Nazi Party|NSDAP]]
| ODP | ÖDP = [[Ecological Democratic Party|ÖDP]]
| AfD | AFD = [[Alternative for Germany|AfD]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Left | Linke | The Left = [[The Left (Germany)|Left]]
| Green | Greens | Grün | Grüne | Bündnis 90/Die Grünen = [[Alliance 90/The Greens|Greens]]
| Freie Wähler | Freie wähler = [[Free Voters|FW]]
| Centre | Zentrum = [[Centre Party (Germany)|Centre]]
| Volt = [[Volt Germany|Volt]]
| PARTEI = [[die PARTEI|PARTEI]]
| Pirates | Piraten = [[Pirate Party Germany|Pirates]]
| Nazi = [[Nazi Party|NSDAP]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| NL | Netherlands | [[Netherlands]] | The Netherlands | [[The Netherlands]] | Holland = {{#switch: {{uc:{{{2}}}}}
| CDA = [[Christian Democratic Appeal|CDA]]
| CU = [[ChristianUnion|CU]]
| D66 = [[Democrats 66|D66]]
| GL = [[GreenLeft|GL]]
| PVV = [[Party for Freedom|PVV]]
| SGP = [[Reformed Political Party|SGP]]
| SP = [[Socialist Party (Netherlands)|SP]]
| VVD = [[People's Party for Freedom and Democracy|VVD]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Groen = [[GreenLeft|GL]]
| PvdA | Pvda = [[Labour Party (Netherlands)|PvdA]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| CH | Switzerland | [[Switzerland]] = {{#switch: {{uc:{{{2}}}}}
| FDP | PRD | RAD | FDP/PRD = [[Free Democratic Party of Switzerland|FDP/PRD]]
| PLR = [[Free Democratic Party of Switzerland|FDP/PRD/PLR]]
| PLC = [[Free Democratic Party of Switzerland|FDP/PRD/PLC]]
| SPS | PSS | SP | PS | SP/PS | SPS/PSS | SOC = [[Social Democratic Party of Switzerland|SPS/PSS]]
| SVP | UDC | SVP/UDC = [[Swiss People's Party|SVP/UDC]]
| PPS = [[Swiss People's Party|SVP/UDC/PPS]]
| CVP | PDC | CVP/PDC = [[Christian Democratic People's Party of Switzerland|CVP/PDC]]
| PPD = [[Christian Democratic People's Party of Switzerland|CVP/PDC/PPD]]
| PCD = [[Christian Democratic People's Party of Switzerland|CVP/PDC/PCD]]
| GPS | PES = [[Green Party of Switzerland|GPS/PES]]
| GLP = [[Green Liberal Party of Switzerland|GLP]]
| PLS | LPS | LIB = [[Liberal Party of Switzerland|LPS/PLS]]
| EVP | PEV = [[Evangelical People's Party of Switzerland|EVP/PEV]]
| Ticino League | Lega = [[Ticino League]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green = [[Green Party of Switzerland|GPS]]
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = [[List of political parties in Switzerland|{{{2}}}]] }}
}}
| RO | Romania | [[Romania]] = {{#switch: {{uc:{{{2}}}}}
| PSD = [[Social Democratic Party (Romania)|PSD]]
| PNL = [[National Liberal Party (Romania)|PNL]]
| UDMR | RMDSZ = [[Democratic Alliance of Hungarians in Romania|UDMR]]
| PNȚ-CD | PNT-CD = [[Christian Democratic National Peasants' Party|PNȚ-CD]]
| ALDE = [[Alliance of Liberals and Democrats (Romania)|ALDE]]
| PDL = [[Democratic Liberal Party (Romania)|PDL]]
| FDGR = [[Democratic Forum of Germans in Romania|FDGR]]
| PD = [[Democratic Party (Romania)|PD]]
| PCM | MPP | HCP = [[Hungarian Civic Party (Romania)|PCM]]
| PND = [[National Democratic Party (Romania)|PND]]
| PRM = [[Greater Romania Party|PRM]]
| USL = [[Social Liberal Union|USL]]
| PMP = [[People's Movement Party|PMP]]
| UNPR = [[National Union for the Progress of Romania|UNPR]]
| PPMT | EMNP = [[Hungarian People's Party of Transylvania|PPMT]]
| PC = [[Conservative Party (Romania)|PC]]
| PER = [[Ecologist Party of Romania|PER]]
| PSRO = [[Romanian Social Party|PSRO]]
| PRO = [[PRO Romania|PRO]]
| PLUS = [[Freedom, Unity and Solidarity Party|PLUS]]
| USR = [[Save Romania Union|USR]]
| USR PLUS = [[USR PLUS]]
| AD = [[The Right Alternative|AD]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| TR | Turkey | [[Turkey]] = {{#switch: {{uc:{{{2}}}}}
| AKP = [[Justice and Development Party (Turkey)|AKP]]
| CHP = [[Republican People's Party|CHP]]
| HDP = [[Peoples' Democratic Party (Turkey)|HDP]]
| MHP = [[Nationalist Movement Party|MHP]]
| İYİ | IYI = [[Good Party|İYİ]]
| SP = [[Felicity Party|SP]]
| TKP = [[Communist Party of Turkey (modern)|TKP]]
| BBP = [[Great Unity Party|BBP]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| US | United States | [[United States]] | USA | [[USA]] = {{#switch: {{uc:{{{2}}}}}
| D = [[Democratic Party (United States)|D]]
| R = [[Republican Party (United States)|R]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Democrat = [[Democratic Party (United States)|D]]
| Republican = [[Republican Party (United States)|R]]
| Independent | Ind | Neutral = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| ZA | South Africa | [[South Africa]] = {{#switch: {{uc:{{{2}}}}}
| ANC | African National Congress = [[African National Congress|ANC]]
| DA | Democratic Alliance = [[Democratic Alliance (South Africa)|DA]]
| IFP | Inkatha Freedom Party = [[Inkatha Freedom Party|IFP]]
| NFP | National Freedom Party = [[National Freedom Party|NFP]]
| COPE | Congress of the People = [[Congress of the People (South African political party)|COPE]]
| FF+ | Freedom Front Plus = [[Freedom Front Plus]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Greens | Grün | Grüne = [[The Greens – The Green Alternative|Green]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent politician|Ind.]]
| #default = {{{2}}} }}
}}
| Independent | [[Independent]] | Ind | Ind. | Neutral = [[Independent politician|Ind.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2|{{{1|}}}}}} }}
}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
24a6705d4a914d795e49dc847104481597d47019
Module:Uses Wikidata
828
217
537
536
2023-10-17T20:36:50Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Uses_Wikidata]]
Scribunto
text/plain
local p = {}
function p.usesProperty(frame)
local args = frame.getParent(frame).args or nil
if mw.text.trim(args[1] or '') == '' then
args = frame.args
end
local result = '<ul>'
local ii = 1
while true do
local p_num = mw.text.trim(args[ii] or '')
if p_num ~= '' then
local label = mw.wikibase.getLabel(p_num) or "NO LABEL"
result = result .. "<li>[[File:Disc Plain blue dark.svg|middle|4px|link=|alt=]] <b><i>[[d:Property talk:" .. p_num .. "|" .. label .. " (" .. string.upper(p_num) .. ")]]</i></b> (see <span class='plainlinks'>[https://query.wikidata.org/embed.html#SELECT%20%3FWikidata_item_%20%3FWikidata_item_Label%20%3Fvalue%20%3FvalueLabel%20%3FEnglish_Wikipedia_article%20%23Show%20data%20in%20this%20order%0A%7B%0A%09%3FWikidata_item_%20wdt%3A" .. p_num .. "%20%3Fvalue%20.%20%23Collecting%20all%20items%20which%20have%20" .. p_num .. "%20data%2C%20from%20whole%20Wikidata%20item%20pages%0A%09OPTIONAL%20%7B%3FEnglish_Wikipedia_article%20schema%3Aabout%20%3FWikidata_item_%3B%20schema%3AisPartOf%20%3Chttps%3A%2F%2Fen.wikipedia.org%2F%3E%20.%7D%20%23If%20collected%20item%20has%20link%20to%20English%20Wikipedia%2C%20show%20that%0A%09SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%20%7D%20%23Show%20label%20in%20this%20language.%20%22en%22%20is%20English.%20%20%20%0A%7D%0ALIMIT%201000 uses]</span>)</li>"
ii = ii + 1
else break
end
end
result = result.."</ul>"
return result
end
function p.tuProperty(frame)
local parent = frame.getParent(frame)
local result = '<ul>'
local ii = 1
while true do
local p_num = mw.text.trim(parent.args[ii] or '')
if p_num ~= '' then
local label = mw.wikibase.getLabel(p_num) or "NO LABEL"
result = result .. "<li><span style='font-size:90%;line-height:1;'>●</span> <b>[[d:Property:" .. p_num .. "|" .. label .. "]]</b> <span style='font-size:90%;'>([[d:Property talk:" .. string.upper(p_num) .. "|" .. p_num .. "]])</span></li>"
ii = ii + 1
else break
end
end
result = result.."</ul>"
return result
end
return p
8b704fdbc00fb94538c56f18c5c01f1e72963ea9
Module:Location map/data/USA
828
218
539
538
2023-10-17T20:36:51Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Location_map/data/USA]]
Scribunto
text/plain
return {
name = 'the United States',
x = '50.0 + 124.03149777329222 * ((1.9694462586094064-($1 * pi / 180)) * sin(0.6010514667026994 * ($2 + 96) * pi / 180))',
y = '50.0 + 1.6155950752393982 * 124.03149777329222 * ( 0.02613325650382181 - (1.3236744353715044 - (1.9694462586094064 - ($1 * pi / 180)) * cos(0.6010514667026994 * ($2 + 96) * pi / 180)))',
image = 'Usa edcp location map.svg',
image1 = 'Usa edcp relief location map.png'
}
d2c98c333c13b7dc164dbaccae5a3365c15aa096
Template:GNIS URL
10
219
541
540
2023-10-17T20:36:52Z
LamayII
2
1 revision imported from [[:wikipedia:Template:GNIS_URL]]
wikitext
text/x-wiki
{{#switch:{{{type|}}}
|antarid=https://web.archive.org/web/2020/https://geonames.usgs.gov/apex/f?p=gnispq:5:::NO::P5_ANTAR_ID:{{urlencode:{{{1|{{{id|}}}}}}}}
|retired|archived=https://web.archive.org/web/2020/https://geonames.usgs.gov/apex/f?p=gnispq:3:::NO::P3_FID:{{urlencode:{{{1|{{{id|}}}}}}}}
|#default=https://edits.nationalmap.gov/apps/gaz-domestic/public/summary/{{urlencode:{{{1|{{{id|}}}}}}}}}}<noinclude>
{{Documentation}}
</noinclude>
dfd131ef230ab495032d2706ae5a243072ffd3bf
Template:Cite gnis
10
220
543
542
2023-10-17T20:36:52Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Cite_gnis]]
wikitext
text/x-wiki
<includeonly>{{#if: {{{1|{{{id|}}}}}}
| {{#if: {{{2|{{{title|{{{name|}}}}}}}}}
| {{#invoke:Template wrapper|wrap|_template=cite encyclopedia
|_exclude=type,id,links
|_alias-map=2:entry,3:access-date,4:date,title:entry,name:entry,entrydate:date,entry-date:date
|entry-url={{GNIS URL|{{{1|{{{id|}}}}}}|type={{{type|}}}}}
|encyclopedia={{#ifeq:{{{links|}}}|off
| Geographic Names Information System
| [[Geographic Names Information System]]}}
|publisher={{#ifeq:{{{links|}}}|off
| United States Geological Survey
| [[United States Geological Survey]], [[United States Department of the Interior]]}}
}}
| {{Citation error|no {{para|name}} specified|cite gnis|nocat={{main other||true}}}}
}}
| {{Citation error|no {{para|id}} specified|cite gnis|nocat={{main other||true}}}}
}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
</noinclude>
aeda754dbc81d9f8afc8137e281196e096705d9d
Template:Subpage other
10
221
545
544
2023-10-17T20:36:53Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Subpage_other]]
wikitext
text/x-wiki
{{#ifeq:{{SUBPAGENAME}}|{{ROOTPAGENAME}}|{{{2|}}}|{{{1|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
ebcb508ec39c25594f4151c4e32c01eeb5732f3d
Module:ISO 3166/data/US
828
222
547
546
2023-10-17T20:36:53Z
LamayII
2
1 revision imported from [[:wikipedia:Module:ISO_3166/data/US]]
Scribunto
text/plain
return {
lang = "en",
["AK"] = {name="Alaska"},
["AL"] = {name="Alabama"},
["AR"] = {name="Arkansas"},
["AZ"] = {name="Arizona"},
["CA"] = {name="California"},
["CO"] = {name="Colorado"},
["CT"] = {name="Connecticut"},
["DE"] = {name="Delaware"},
["FL"] = {name="Florida"},
["GA"] = {name="Georgia"},
["HI"] = {name="Hawaii"},
["IA"] = {name="Iowa"},
["ID"] = {name="Idaho"},
["IL"] = {name="Illinois"},
["IN"] = {name="Indiana"},
["KS"] = {name="Kansas"},
["KY"] = {name="Kentucky"},
["LA"] = {name="Louisiana"},
["MA"] = {name="Massachusetts"},
["MD"] = {name="Maryland"},
["ME"] = {name="Maine"},
["MI"] = {name="Michigan"},
["MN"] = {name="Minnesota"},
["MO"] = {name="Missouri"},
["MS"] = {name="Mississippi"},
["MT"] = {name="Montana"},
["NC"] = {name="North Carolina"},
["ND"] = {name="North Dakota"},
["NE"] = {name="Nebraska"},
["NH"] = {name="New Hampshire"},
["NJ"] = {name="New Jersey"},
["NM"] = {name="New Mexico"},
["NV"] = {name="Nevada"},
["NY"] = {name="New York",altnames={"New York State"}},
["OH"] = {name="Ohio"},
["OK"] = {name="Oklahoma"},
["OR"] = {name="Oregon"},
["PA"] = {name="Pennsylvania"},
["RI"] = {name="Rhode Island"},
["SC"] = {name="South Carolina"},
["SD"] = {name="South Dakota"},
["TN"] = {name="Tennessee"},
["TX"] = {name="Texas"},
["UT"] = {name="Utah"},
["VA"] = {name="Virginia"},
["VT"] = {name="Vermont"},
["WA"] = {name="Washington"},
["WI"] = {name="Wisconsin"},
["WV"] = {name="West Virginia"},
["WY"] = {name="Wyoming"},
["DC"] = {name="District of Columbia",altnames={"Washington, D.C."}},
["AS"] = {name="American Samoa"},
["GU"] = {name="Guam"},
["MP"] = {name="Northern Mariana Islands"},
["PR"] = {name="Puerto Rico"},
["UM"] = {name="United States Minor Outlying Islands"},
["VI"] = {name="United States Virgin Islands",isoname="Virgin Islands, U.S.",altnames={"U.S. Virgin Islands","Virgin Islands"}}
}
f532f1d1b625073d0985d6aefc216c2d99fc851c
Template:FIPS
10
223
549
548
2023-10-17T20:36:54Z
LamayII
2
1 revision imported from [[:wikipedia:Template:FIPS]]
wikitext
text/x-wiki
{{#ifeq: {{#invoke:String|len|s={{{cs|}}}}} | 10
| [https://data.census.gov/cedsci/profile?g=0600000US{{{cs}}} {{{cs}}}]
| {{#ifeq: {{#invoke:String|len|s={{{p|}}}}} | 10
| [https://data.census.gov/cedsci/profile?g=1600000US{{#invoke:String|sub|{{{p}}}|1|2}}{{#invoke:String|sub|{{{p}}}|6|10}} {{{p}}}]
| [{{#if:{{{county|}}}{{{3|}}}
|https://data.census.gov/cedsci/profile?g=0600000US{{{state|{{{1}}}}}}{{{county|{{{3}}}}}}{{{place|{{{2}}}}}}
|https://data.census.gov/cedsci/profile?g=1600000US{{{state|{{{1}}}}}}{{{place|{{{2}}}}}}
}} {{{state|{{{1}}}}}}-{{{place|{{{2}}}}}}]
}}
}}<noinclude>
{{Documentation}}
</noinclude>
6e59843d2ffa6d2c85f0b7e9a7394c23fa8a4956
Template:GNIS 4
10
224
551
550
2023-10-17T20:36:54Z
LamayII
2
1 revision imported from [[:wikipedia:Template:GNIS_4]]
wikitext
text/x-wiki
[{{GNIS URL|{{if empty|{{{1|}}}|{{{id|}}}}}|type={{{type|}}}}} {{if empty|{{{1|}}}{{{id|}}}}}]<noinclude>
{{Documentation}}
</noinclude>
4d099b7c9e3a904e189294a92d36ba0acec287e9
Template:Lang-mia
10
225
553
552
2023-10-17T20:36:55Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Lang-mia]]
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=mia
}}</includeonly><noinclude>
{{Documentation|Template:Lang-x/doc}}
[[Category:Algonquian multilingual support templates]]
</noinclude>
30122b9ca33b90f7d8ca4c25656d1f1f3704745d
Template:Module other
10
226
555
554
2023-10-17T20:36:58Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Module_other]]
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Module}}
| module
| other
}}
}}
| module = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
503694836c1b07142e63fd35d8be69ec8bb9ffe7
Template:Uses TemplateStyles
10
32
557
74
2023-10-17T20:36:58Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Uses_TemplateStyles]]
wikitext
text/x-wiki
<div style="width:250px;float:right;clear:right;margin:0 0 1em 1em;border:1px solid black;-moz-border-radius:10px;-webkit-border-radius:10px;padding:10px 10px 10px 10px; background:#FFFFFF;">
<p style="margin:0 3% 0 3%;text-align:center;font-size:94%">
[[File:Farm-Fresh css add.svg|left|30px]] '''This template uses [[Help:TemplateStyles|TemplateStyles]]''' <br />
{{{1|}}}
</p></div><includeonly>{{#ifeq:{{SUBPAGENAME}}|doc||[[Category:Templates that use TemplateStyles|{{PAGENAME}}]]}}</includeonly><noinclude>
{{clr}}
{{Documentation}}</noinclude>
fed44ca463856190bcf6280438ed7ea020ad82c3
Module:Uses TemplateStyles
828
227
559
558
2023-10-17T20:36:59Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Uses_TemplateStyles]]
Scribunto
text/plain
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local TNT = require('Module:TNT')
local p = {}
local function format(msg, ...)
return TNT.format('I18n/Uses TemplateStyles', msg, ...)
end
local function getConfig()
return mw.loadData('Module:Uses TemplateStyles/config')
end
local function renderBox(tStyles)
local boxArgs = {
type = 'notice',
small = true,
image = string.format('[[File:Farm-Fresh css add.svg|32px|alt=%s]]', format('logo-alt'))
}
if #tStyles < 1 then
boxArgs.text = string.format('<strong class="error">%s</strong>', format('error-emptylist'))
else
local cfg = getConfig()
local tStylesLinks = {}
for i, ts in ipairs(tStyles) do
local link = string.format('[[:%s]]', ts)
local sandboxLink = nil
local tsTitle = mw.title.new(ts)
if tsTitle and cfg['sandbox_title'] then
local tsSandboxTitle = mw.title.new(string.format(
'%s:%s/%s/%s', tsTitle.nsText, tsTitle.baseText, cfg['sandbox_title'], tsTitle.subpageText))
if tsSandboxTitle and tsSandboxTitle.exists then
sandboxLink = format('sandboxlink', link, ':' .. tsSandboxTitle.prefixedText)
end
end
tStylesLinks[i] = sandboxLink or link
end
local tStylesList = mList.makeList('bulleted', tStylesLinks)
boxArgs.text = format(
mw.title.getCurrentTitle():inNamespaces(828,829) and 'header-module' or 'header-template') ..
'\n' .. tStylesList
end
return mMessageBox.main('mbox', boxArgs)
end
local function renderTrackingCategories(args, tStyles, titleObj)
if yesno(args.nocat) then
return ''
end
local cfg = getConfig()
local cats = {}
-- Error category
if #tStyles < 1 and cfg['error_category'] then
cats[#cats + 1] = cfg['error_category']
end
-- TemplateStyles category
titleObj = titleObj or mw.title.getCurrentTitle()
if (titleObj.namespace == 10 or titleObj.namespace == 828)
and not cfg['subpage_blacklist'][titleObj.subpageText]
then
local category = args.category or cfg['default_category']
if category then
cats[#cats + 1] = category
end
if not yesno(args.noprotcat) and (cfg['protection_conflict_category'] or cfg['padlock_pattern']) then
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
local addedLevelCat = false
local addedPadlockCat = false
for i, ts in ipairs(tStyles) do
local tsTitleObj = mw.title.new(ts)
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
if cfg['padlock_pattern'] and tsProt and not addedPadlockCat then
local content = tsTitleObj:getContent()
if not content:find(cfg['padlock_pattern']) then
cats[#cats + 1] = cfg['missing_padlock_category']
addedPadlockCat = true
end
end
if cfg['protection_conflict_category'] and currentProt and tsProt ~= currentProt and not addedLevelCat then
currentProt = cfg['protection_hierarchy'][currentProt] or 0
tsProt = cfg['protection_hierarchy'][tsProt] or 0
if tsProt < currentProt then
addedLevelCat = true
cats[#cats + 1] = cfg['protection_conflict_category']
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
function p._main(args, cfg)
local tStyles = mTableTools.compressSparseArray(args)
local box = renderBox(tStyles)
local trackingCategories = renderTrackingCategories(args, tStyles)
return box .. trackingCategories
end
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
return p
71ca57c37849f38e3c5ee30061bdae730963e48e
Module:Uses TemplateStyles/config
828
228
561
560
2023-10-17T20:36:59Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Uses_TemplateStyles/config]]
Scribunto
text/plain
local cfg = {} -- Don’t touch this line.
-- Subpage blacklist: these subpages will not be categorized (except for the
-- error category, which is always added if there is an error).
-- For example “Template:Foo/doc” matches the `doc = true` rule, so it will have
-- no categories. “Template:Foo” and “Template:Foo/documentation” match no rules,
-- so they *will* have categories. All rules should be in the
-- ['<subpage name>'] = true,
-- format.
cfg['subpage_blacklist'] = {
['doc'] = true,
['sandbox'] = true,
['sandbox2'] = true,
['testcases'] = true,
}
-- Sandbox title: if the stylesheet’s title is <template>/<stylesheet>.css, the
-- stylesheet’s sandbox is expected to be at <template>/<sandbox_title>/<stylesheet>.css
-- Set to nil to disable sandbox links.
cfg['sandbox_title'] = 'sandbox'
-- Error category: this category is added if the module call contains errors
-- (e.g. no stylesheet listed). A category name without namespace, or nil
-- to disable categorization (not recommended).
cfg['error_category'] = 'Uses TemplateStyles templates with errors'
-- Default category: this category is added if no custom category is specified
-- in module/template call. A category name without namespace, or nil
-- to disable categorization.
cfg['default_category'] = 'Templates using TemplateStyles'
-- Protection conflict category: this category is added if the protection level
-- of any stylesheet is lower than the protection level of the template. A category name
-- without namespace, or nil to disable categorization (not recommended).
cfg['protection_conflict_category'] = 'Templates using TemplateStyles with a different protection level'
-- Hierarchy of protection levels, used to determine whether one protection level is lower
-- than another and thus should populate protection_conflict_category. No protection is treated as zero
cfg['protection_hierarchy'] = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
-- Padlock pattern: Lua pattern to search on protected stylesheets for, or nil
-- to disable padlock check.
cfg['padlock_pattern'] = '{{pp-'
-- Missing padlock category: this category is added if a protected stylesheet
-- doesn’t contain any padlock template (specified by the above Lua pattern).
-- A category name without namespace (no nil allowed) if the pattern is not nil,
-- unused (and thus may be nil) otherwise.
cfg['missing_padlock_category'] = 'Templates using TemplateStyles without padlocks'
return cfg -- Don’t touch this line.
58e7a37c44f6ea3f6b8af54a559d696cc7256493
Template:Uses Wikidata
10
229
563
562
2023-10-17T20:37:00Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Uses_Wikidata]]
wikitext
text/x-wiki
{{Sister project
| position = {{{position|}}}
| project = data
| text = This {{module other|module|template}} uses {{#if:{{{section|}}} | one or more [[Wikidata]] properties; see {{Section link||{{{section}}}}} for details. | the [[Wikidata]] propert{{#if:{{{2|}}}|ies|y}}:
{{#invoke:Uses Wikidata|usesProperty}}
}}}}<includeonly>{{#switch:{{SUBPAGENAME}}
|sandbox |testcases |doc= <!--no category-->
|#default={{module other |[[Category:Modules using data from Wikidata]] |{{template other |[[Category:Templates using data from Wikidata]]}} }}
}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage -->
</noinclude>
dd057e93ccd4b8fe8d6acd82c6d1d3ee2589a36a
Template:UF-hcard-geo
10
230
565
564
2023-10-17T20:37:00Z
LamayII
2
1 revision imported from [[:wikipedia:Template:UF-hcard-geo]]
wikitext
text/x-wiki
The HTML markup produced by this template includes an [[HCard| hCard microformat]], which makes the place-name and location [[Parsing|parsable]] by computers, either acting automatically to catalogue articles across Wikipedia, or via a browser tool operated by a person, to (for example) add the subject to an address book. Within the hCard is a [[Geo (microformat)|Geo microformat]], which additionally makes the [[Geographic coordinate system|coordinates]] (latitude & longitude) parsable, so that they can be, say, looked up on a map, or downloaded to a [[Global Positioning System|GPS]] unit. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
=== Sub-templates ===
If the place or venue has "established", "founded", "opened" or similar dates, use {{tl|start date}} for the earliest of those dates [[Wikipedia:WikiProject Microformats/dates|unless the date is before 1583 CE]].
If it has a URL, use {{tl|URL}}.
'''Please do not remove instances of these sub-templates.'''
=== Classes ===
hCard uses HTML classes including:
{{Flatlist|
*adr
*agent
*category
*county-name
*extended-address
*fn
*label
*locality
*nickname
*note
*org
*region
*street-address
*uid
*url
*vcard
}}
Geo is produced by calling {{tl|coord}}, and uses HTML classes:
{{Flatlist|
*geo
*latitude
*longitude
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''
=== Precision ===
When giving coordinates, '''please use an [[Wikipedia:WikiProject Geographical coordinates#Precision|appropriate level of precision]]'''. Do '''not''' use {{tl|coord}}'s {{para|name}} parameter.<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |
[[Category:Templates with coordinates fields]]
[[Category:Templates generating hCards and Geo]]
}}</includeonly><noinclude>__NOTOC__{{doc}}</noinclude>
b2e64e922ddf0a9b1b20a214e99d2d1a8d7f81c4
Template:Auto short description
10
231
567
566
2023-10-17T20:37:02Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Auto_short_description]]
wikitext
text/x-wiki
{{Ombox
| type = notice
| text = This template {{#if:{{{sometimes|}}}|sometimes{{sp}}}}adds an automatically generated '''[[Wikipedia:Short description|short description]]'''{{#if:{{{category|}}}|{{sp}}({{{category}}})|}}{{#if:{{{conditions|}}}|{{space}}{{{conditions}}}}}. If the automatic short description is not optimal, replace it by adding {{tl|Short description}} at the top of the article.
}}<includeonly>{{Subpage other|<!-- do not categorise -->|[[Category:Templates that generate short descriptions{{#if:{{{category|}}}|{{sp}}for {{{category}}}|}}]]}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
4ef114404749d204ef6574916944eb2d8478640e
Module:Side box/styles.css
828
232
569
568
2023-10-17T20:37:02Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Side_box/styles.css]]
sanitized-css
text/css
/* {{pp|small=y}} */
.side-box {
margin: 4px 0;
box-sizing: border-box;
border: 1px solid #aaa;
font-size: 88%;
line-height: 1.25em;
background-color: #f9f9f9;
display: flow-root;
}
.side-box-abovebelow,
.side-box-text {
padding: 0.25em 0.9em;
}
.side-box-image {
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.side-box-imageright {
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* roughly the skin's sidebar + size of side box */
@media (min-width: 500px) {
.side-box-flex {
display: flex;
align-items: center;
}
.side-box-text {
flex: 1;
}
}
@media (min-width: 720px) {
.side-box {
width: 238px;
}
.side-box-right {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin-left: 1em;
}
/* derives from mbox classes, which do not float left in mbox-small-left
* so far as I can tell, that was a deliberate decision, since only .ambox
* supports mbox-left
*/
.side-box-left {
/* @noflip */
margin-right: 1em;
}
}
5be55dbc33007e62deac23036c134ed064dbe603
Template:Infobox settlement/doc
10
233
571
570
2023-10-17T20:37:08Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_settlement/doc]]
wikitext
text/x-wiki
{{Documentation subpage}}
<!--Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[Wikipedia:Wikidata]])-->
{{Auto short description}}
{{High-use}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Coordinates|Module:Check for unknown parameters|Module:Settlement short description}}
{{Uses TemplateStyles|Template:Infobox settlement/styles.css}}
{{Uses Wikidata|P41|P94|P158|P625|P856}}
This template should be used to produce an [[WP:Infobox|Infobox]] for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, et cetera—in fact, any subdivision below the level of a country, for which {{tl|Infobox country}} should be used. Parameters are described in the table below. For questions, see the [[Template talk:Infobox settlement|talk page]]. For a US city guideline, see [[WP:USCITIES]].
The template is aliased or used as a sub-template for several infobox front-end templates.
==Usage==
* '''Important''': Please enter all numeric values in a raw, unformatted fashion. References and {{tl|citation needed}} tags are to be included in their respective section footnotes field. Numeric values that are not "raw" may create an "Expression error". Raw values will be automatically formatted by the template. If you find a raw value is not formatted in your usage of the template, please post a notice on the discussion page for this template.
* An expression error may also occur when any coordinate parameter has a value, but one or more coordinate parameters are blank or invalid.
Basic blank template, ready to cut and paste. See the next section for a copy of the template with all parameters and comments. See the table below that for a full description of each parameter.
===Using metric units===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name = <!-- Settlement name in local language(s), if different from the English name -->
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|image_flag =
|flag_alt =
|image_seal =
|seal_alt =
|image_shield =
|shield_alt =
|etymology =
|nickname =
|motto =
|image_map =
|map_alt =
|map_caption =
|pushpin_map =
|pushpin_map_alt =
|pushpin_map_caption =
|pushpin_mapsize =
|pushpin_label_position =
|coordinates = <!-- {{coord|latitude|longitude|type:city|display=inline,title}} -->
|coor_pinpoint =
|coordinates_footnotes =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|subdivision_type3 =
|subdivision_name3 =
|established_title =
|established_date =
|founder =
|seat_type =
|seat =
|government_footnotes =
|government_type =
|governing_body =
|leader_party =
|leader_title =
|leader_name =
|leader_title1 =
|leader_name1 =
|leader_title2 =
|leader_name2 =
|leader_title3 =
|leader_name3 =
|leader_title4 =
|leader_name4 =
|unit_pref = Metric
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
|area_footnotes =
|area_urban_footnotes = <!-- <ref> </ref> -->
|area_rural_footnotes = <!-- <ref> </ref> -->
|area_metro_footnotes = <!-- <ref> </ref> -->
|area_note =
|area_water_percent =
|area_rank =
|area_blank1_title =
|area_blank2_title =
<!-- square kilometers -->
|area_total_km2 =
|area_land_km2 =
|area_water_km2 =
|area_urban_km2 =
|area_rural_km2 =
|area_metro_km2 =
|area_blank1_km2 =
|area_blank2_km2 =
<!-- hectares -->
|area_total_ha =
|area_land_ha =
|area_water_ha =
|area_urban_ha =
|area_rural_ha =
|area_metro_ha =
|area_blank1_ha =
|area_blank2_ha =
|length_km =
|width_km =
|dimensions_footnotes =
|elevation_footnotes =
|elevation_m =
|population_footnotes =
|population_as_of =
|population_total =
|population_density_km2 = auto
|population_note =
|population_demonym =
|timezone1 =
|utc_offset1 =
|timezone1_DST =
|utc_offset1_DST =
|postal_code_type =
|postal_code =
|area_code_type =
|area_code =
|area_codes = <!-- for multiple area codes -->
|iso_code =
|website = <!-- {{URL|example.com}} -->
|module =
|footnotes =
}}
</syntaxhighlight>
===Using non-metric units===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name =
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|image_flag =
|flag_alt =
|image_seal =
|seal_alt =
|image_shield =
|shield_alt =
|etymology =
|nickname =
|motto =
|image_map =
|map_alt =
|map_caption =
|pushpin_map =
|pushpin_map_alt =
|pushpin_map_caption =
|pushpin_label_position =
|coordinates = <!-- {{coord|latitude|longitude|type:city|display=inline,title}} -->
|coor_pinpoint =
|coordinates_footnotes =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|subdivision_type3 =
|subdivision_name3 =
|established_title =
|established_date =
|founder =
|seat_type =
|seat =
|government_footnotes =
|leader_party =
|leader_title =
|leader_name =
|unit_pref = US<!-- or UK -->
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
|area_footnotes =
|area_urban_footnotes = <!-- <ref> </ref> -->
|area_rural_footnotes = <!-- <ref> </ref> -->
|area_metro_footnotes = <!-- <ref> </ref> -->
|area_note =
|area_water_percent =
|area_rank =
|area_blank1_title =
|area_blank2_title =
<!-- square miles -->
|area_total_sq_mi =
|area_land_sq_mi =
|area_water_sq_mi =
|area_urban_sq_mi =
|area_rural_sq_mi =
|area_metro_sq_mi =
|area_blank1_sq_mi =
|area_blank2_sq_mi =
<!-- acres -->
|area_total_acre =
|area_land_acre =
|area_water_acre =
|area_urban_acre =
|area_rural_acre =
|area_metro_acre =
|area_blank1_acre =
|area_blank2_acre =
|length_mi =
|width_mi =
|dimensions_footnotes =
|elevation_footnotes =
|elevation_ft =
|population_footnotes =
|population_as_of =
|population_total =
|population_density_sq_mi = auto
|population_note =
|population_demonym =
|timezone1 =
|utc_offset1 =
|timezone1_DST =
|utc_offset1_DST =
|postal_code_type =
|postal_code =
|area_code_type =
|area_code =
|iso_code =
|website = <!-- {{URL|example.com}} -->
|module =
|footnotes =
}}
</syntaxhighlight>
===Short version===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name =
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|etymology =
|nickname =
|coordinates = <!-- {{Coord}} -->
|population_total =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|website = <!-- {{URL|example.com}} -->
}}
</syntaxhighlight>
===Complete empty syntax, with comments===
This copy of the template lists all parameters except for some of the repeating numbered parameters which are noted in the comments. Comments here should be brief; see the table below for full descriptions of each parameter.
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Infobox settlement
| name = <!-- at least one of the first two fields must be filled in -->
| official_name =
| native_name = <!-- if different from the English name -->
| native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| other_name =
| settlement_type = <!-- such as Town, Village, City, Borough etc. -->
<!-- transliteration(s) -->
| translit_lang1 =
| translit_lang1_type =
| translit_lang1_info =
| translit_lang1_type1 =
| translit_lang1_info1 =
| translit_lang1_type2 =
| translit_lang1_info2 = <!-- etc., up to translit_lang1_type6 / translit_lang1_info6 -->
| translit_lang2 =
| translit_lang2_type =
| translit_lang2_info =
| translit_lang2_type1 =
| translit_lang2_info1 =
| translit_lang2_type2 =
| translit_lang2_info2 = <!-- etc., up to translit_lang2_type6 / translit_lang2_info6 -->
<!-- images, nickname, motto -->
| image_skyline =
| imagesize =
| image_alt =
| image_caption =
| image_flag =
| flag_size =
| flag_alt =
| flag_border =
| flag_link =
| image_seal =
| seal_size =
| seal_alt =
| seal_link =
| seal_type =
| image_shield =
| shield_size =
| shield_alt =
| shield_link =
| image_blank_emblem =
| blank_emblem_type =
| blank_emblem_size =
| blank_emblem_alt =
| blank_emblem_link =
| etymology =
| nickname =
| nicknames =
| motto =
| mottoes =
| anthem =
<!-- maps and coordinates -->
| image_map =
| mapsize =
| map_alt =
| map_caption =
| image_map1 =
| mapsize1 =
| map_alt1 =
| map_caption1 =
| pushpin_map = <!-- name of a location map as per Template:Location_map -->
| pushpin_mapsize =
| pushpin_map_alt =
| pushpin_map_caption =
| pushpin_map_caption_notsmall =
| pushpin_label = <!-- only necessary if "name" or "official_name" are too long -->
| pushpin_label_position = <!-- position of the pushpin label: left, right, top, bottom, none -->
| pushpin_outside =
| pushpin_relief =
| pushpin_image =
| pushpin_overlay =
| coordinates = <!-- {{Coord}} -->
| coor_pinpoint = <!-- to specify exact location of coordinates (was coor_type) -->
| coordinates_footnotes = <!-- for references: use <ref> tags -->
| grid_name = <!-- name of a regional grid system -->
| grid_position = <!-- position on the regional grid system -->
<!-- location -->
| subdivision_type = Country
| subdivision_name = <!-- the name of the country -->
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 = <!-- etc., subdivision_type6 / subdivision_name6 -->
<!-- established -->
| established_title = <!-- Founded -->
| established_date = <!-- requires established_title= -->
| established_title1 = <!-- Incorporated (town) -->
| established_date1 = <!-- requires established_title1= -->
| established_title2 = <!-- Incorporated (city) -->
| established_date2 = <!-- requires established_title2= -->
| established_title3 =
| established_date3 = <!-- requires established_title3= -->
| established_title4 =
| established_date4 = <!-- requires established_title4= -->
| established_title5 =
| established_date5 = <!-- requires established_title5= -->
| established_title6 =
| established_date6 = <!-- requires established_title6= -->
| established_title7 =
| established_date7 = <!-- requires established_title7= -->
| extinct_title =
| extinct_date =
| founder =
| named_for =
<!-- seat, smaller parts -->
| seat_type = <!-- defaults to: Seat -->
| seat =
| seat1_type = <!-- defaults to: Former seat -->
| seat1 =
| parts_type = <!-- defaults to: Boroughs -->
| parts_style = <!-- list, coll (collapsed list), para (paragraph format) -->
| parts = <!-- parts text, or header for parts list -->
| p1 =
| p2 = <!-- etc., up to p50: for separate parts to be listed-->
<!-- government type, leaders -->
| government_footnotes = <!-- for references: use <ref> tags -->
| government_type =
| governing_body =
| leader_party =
| leader_title =
| leader_name = <!-- add &nbsp; (no-break space) to disable automatic links -->
| leader_title1 =
| leader_name1 = <!-- etc., up to leader_title4 / leader_name4 -->
<!-- display settings -->
| total_type = <!-- to set a non-standard label for total area and population rows -->
| unit_pref = <!-- enter: Imperial, to display imperial before metric -->
<!-- area -->
| area_footnotes = <!-- for references: use <ref> tags -->
| dunam_link = <!-- If dunams are used, this specifies which dunam to link. -->
| area_total_km2 = <!-- ALL fields with measurements have automatic unit conversion -->
| area_total_sq_mi = <!-- see table @ Template:Infobox settlement for details -->
| area_total_ha =
| area_total_acre =
| area_total_dunam = <!-- used in Middle East articles only -->
| area_land_km2 =
| area_land_sq_mi =
| area_land_ha =
| area_land_acre =
| area_land_dunam = <!-- used in Middle East articles only -->
| area_water_km2 =
| area_water_sq_mi =
| area_water_ha =
| area_water_acre =
| area_water_dunam = <!-- used in Middle East articles only -->
| area_water_percent =
| area_urban_footnotes = <!-- for references: use <ref> tags -->
| area_urban_km2 =
| area_urban_sq_mi =
| area_urban_ha =
| area_urban_acre =
| area_urban_dunam = <!-- used in Middle East articles only -->
| area_rural_footnotes = <!-- for references: use <ref> tags -->
| area_rural_km2 =
| area_rural_sq_mi =
| area_rural_ha =
| area_rural_acre =
| area_rural_dunam = <!-- used in Middle East articles only -->
| area_metro_footnotes = <!-- for references: use <ref> tags -->
| area_metro_km2 =
| area_metro_sq_mi =
| area_metro_ha =
| area_metro_acre =
| area_metro_dunam = <!-- used in Middle East articles only -->
| area_rank =
| area_blank1_title =
| area_blank1_km2 =
| area_blank1_sq_mi =
| area_blank1_ha =
| area_blank1_acre =
| area_blank1_dunam = <!-- used in Middle East articles only -->
| area_blank2_title =
| area_blank2_km2 =
| area_blank2_sq_mi =
| area_blank2_ha =
| area_blank2_acre =
| area_blank2_dunam = <!-- used in Middle East articles only -->
| area_note =
<!-- dimensions -->
| dimensions_footnotes = <!-- for references: use <ref> tags -->
| length_km =
| length_mi =
| width_km =
| width_mi =
<!-- elevation -->
| elevation_footnotes = <!-- for references: use <ref> tags -->
| elevation_m =
| elevation_ft =
| elevation_point = <!-- for denoting the measurement point -->
| elevation_max_footnotes = <!-- for references: use <ref> tags -->
| elevation_max_m =
| elevation_max_ft =
| elevation_max_point = <!-- for denoting the measurement point -->
| elevation_max_rank =
| elevation_min_footnotes = <!-- for references: use <ref> tags -->
| elevation_min_m =
| elevation_min_ft =
| elevation_min_point = <!-- for denoting the measurement point -->
| elevation_min_rank =
<!-- population -->
| population_footnotes = <!-- for references: use <ref> tags -->
| population_as_of =
| population_total =
| pop_est_footnotes =
| pop_est_as_of =
| population_est =
| population_rank =
| population_density_km2 = <!-- for automatic calculation of any density field, use: auto -->
| population_density_sq_mi =
| population_urban_footnotes =
| population_urban =
| population_density_urban_km2 =
| population_density_urban_sq_mi =
| population_rural_footnotes =
| population_rural =
| population_density_rural_km2 =
| population_density_rural_sq_mi =
| population_metro_footnotes =
| population_metro =
| population_density_metro_km2 =
| population_density_metro_sq_mi =
| population_density_rank =
| population_blank1_title =
| population_blank1 =
| population_density_blank1_km2 =
| population_density_blank1_sq_mi =
| population_blank2_title =
| population_blank2 =
| population_density_blank2_km2 =
| population_density_blank2_sq_mi =
| population_demonym = <!-- demonym, e.g. Liverpudlian for someone from Liverpool -->
| population_demonyms =
| population_note =
<!-- demographics (section 1) -->
| demographics_type1 =
| demographics1_footnotes = <!-- for references: use <ref> tags -->
| demographics1_title1 =
| demographics1_info1 = <!-- etc., up to demographics1_title7 / demographics1_info7 -->
<!-- demographics (section 2) -->
| demographics_type2 =
| demographics2_footnotes = <!-- for references: use <ref> tags -->
| demographics2_title1 =
| demographics2_info1 = <!-- etc., up to demographics2_title10 / demographics2_info10 -->
<!-- time zone(s) -->
| timezone_link =
| timezone1_location =
| timezone1 =
| utc_offset1 =
| timezone1_DST =
| utc_offset1_DST =
| timezone2_location =
| timezone2 =
| utc_offset2 =
| timezone2_DST =
| utc_offset2_DST =
| timezone3_location =
| timezone3 =
| utc_offset3 =
| timezone3_DST =
| utc_offset3_DST =
| timezone4_location =
| timezone4 =
| utc_offset4 =
| timezone4_DST =
| utc_offset4_DST =
| timezone5_location =
| timezone5 =
| utc_offset5 =
| timezone5_DST =
| utc_offset5_DST =
<!-- postal codes, area code -->
| postal_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal_code =
| postal2_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal2_code =
| area_code_type = <!-- defaults to: Area code(s) -->
| area_code =
| area_codes =
| geocode =
| iso_code =
| registration_plate_type =
| registration_plate =
| code1_name =
| code1_info =
| code2_name =
| code2_info =
<!-- blank fields (section 1) -->
| blank_name_sec1 =
| blank_info_sec1 =
| blank1_name_sec1 =
| blank1_info_sec1 =
| blank2_name_sec1 =
| blank2_info_sec1 = <!-- etc., up to blank7_name_sec1 / blank7_info_sec1 -->
<!-- blank fields (section 2) -->
| blank_name_sec2 =
| blank_info_sec2 =
| blank1_name_sec2 =
| blank1_info_sec2 =
| blank2_name_sec2 =
| blank2_info_sec2 = <!-- etc., up to blank7_name_sec2 / blank7_info_sec2 -->
<!-- website, footnotes -->
| website = <!-- {{URL|example.com}} -->
| module =
| footnotes =
}}
</syntaxhighlight>
==Parameter names and descriptions==
{| class="wikitable" style="background: white"
| colspan=3 style="background: orange; text-align: center;" |
===Name and transliteration===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
| '''name''' || optional || This is the usual name in English. If it's not specified, the infobox will use the '''official_name''' as a title unless this too is missing, in which case the page name will be used.
|- style="vertical-align:top;"
| '''official_name''' || optional || The official name in English. Avoid using '''official_name''' if it leads to redundancy with '''name''' and '''settlement_type'''. Use '''official_name''' if the official name is unusual or cannot be simply deduced from the name and settlement type.
|- style="vertical-align:top;"
| '''native_name''' || optional || Name in the local language, if different from '''name''', and if not English. In this case "native" does not mean indigenous but is related to de facto language that is not English. This will display below the name/official name.
|- style="vertical-align:top;"
| '''native_name_lang''' || optional || Use [[List of ISO 639-1 codes|ISO 639-1 code]], e.g. "fr" for French. If there is more than one native name, in different languages, enter those names using {{tl|lang}}, instead.
|- style="vertical-align:top;"
| '''other_name''' || optional || For places with a former or more common name like Bombay or Saigon
|- style="vertical-align:top;"
| '''settlement_type''' || optional || Any type can be entered, such as City, Town, Village, Hamlet, Municipality, Reservation, etc. If set, will be displayed under the names. Might also be used as a label for total population/area (defaulting to ''City''), if needed to distinguish from ''Urban'', ''Rural'' or ''Metro'' (if urban, rural or metro figures are not present, the label is ''Total'' unless '''total_type''' is set).
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Transliteration(s)
|- style="vertical-align:top;"
| '''translit_lang1''' || optional || Will place the "entry" before the word "transliteration(s)". Can be used to specify a particular language like in [[Dêlêg]] or one may just enter "Other", like in [[Gaza City|Gaza]]'s article.
|- style="vertical-align:top;"
| '''translit_lang1_type'''<br />'''translit_lang1_type1'''<br />to<br />'''translit_lang1_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang1_info'''<br />'''translit_lang1_info1'''<br />to<br />'''translit_lang1_info6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2''' || optional || Will place a second transliteration. See [[Dêlêg]]
|- style="vertical-align:top;"
| '''translit_lang2_type'''<br />'''translit_lang2_type1'''<br />to<br />'''translit_lang2_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2_info'''<br />'''translit_lang2_info1'''<br />to<br />'''translit_lang2_info6''' || optional ||
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Images, nickname, motto===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Image
|- style="vertical-align:top;"
| '''image_skyline''' || optional || Primary image representing the settlement. Commonly a photo of the settlement’s skyline.
|- style="vertical-align:top;"
| '''imagesize''' || optional || Can be used to tweak the size of the image_skyline up or down. This can be helpful if an editor wants to make the infobox wider. If used, '''px''' must be specified; default size is 250px.
|- style="vertical-align:top;"
| '''image_alt''' || optional || [[Alt text]] for the image, used by visually impaired readers who cannot see the image. See [[WP:ALT]].
|- style="vertical-align:top;"
| '''image_caption''' || optional || Will place a caption under the image_skyline (if present)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Flag image
|- style="vertical-align:top;"
| '''image_flag''' || optional || Used for a flag.
|- style="vertical-align:top;"
| '''flag_size''' || optional || Can be used to tweak the size of the image_flag up or down from 100px as desired. If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''flag_alt''' || optional || Alt text for the flag.
|- style="vertical-align:top;"
| '''flag_border''' || optional || Set to 'no' to remove the border from the flag
|- style="vertical-align:top;"
| '''flag_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seal image
|- style="vertical-align:top;"
| '''image_seal''' || optional || If the place has an official seal.
|- style="vertical-align:top;"
| '''seal_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''seal_alt''' || optional || Alt text for the seal.
|- style="vertical-align:top;"
| '''seal_link'''<br />'''seal_type''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Coat of arms image
|- style="vertical-align:top;"
| '''image_shield''' || optional || Can be used for a place with a coat of arms.
|- style="vertical-align:top;"
| '''shield_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''shield_alt''' || optional || Alt text for the shield.
|- style="vertical-align:top;"
| '''shield_link''' || optional || Can be used if a wiki article if known but is not automatically linked by the template. See [[Coquitlam, British Columbia]]'s infobox for an example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Logo or emblem image
|- style="vertical-align:top;"
| '''image_blank_emblem''' || optional || Can be used if a place has an official logo, crest, emblem, etc.
|- style="vertical-align:top;"
| '''blank_emblem_type''' || optional || Caption beneath "image_blank_emblem" to specify what type of emblem it is.
|- style="vertical-align:top;"
| '''blank_emblem_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''blank_emblem_alt''' || optional || Alt text for blank emblem.
|- style="vertical-align:top;"
| '''blank_emblem_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Nickname, motto
|- style="vertical-align:top;"
| '''etymology''' || optional || origin of name
|- style="vertical-align:top;"
| '''nickname''' || optional || well-known nickname
|- style="vertical-align:top;"
| '''nicknames''' || optional || if more than one well-known nickname, use this
|- style="vertical-align:top;"
| '''motto''' || optional || Will place the motto under the nicknames
|- style="vertical-align:top;"
| '''mottoes''' || optional || if more than one motto, use this
|- style="vertical-align:top;"
| '''anthem''' || optional || Will place the anthem (song) under the nicknames
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Maps, coordinates===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Map images
|- style="vertical-align:top;"
| '''image_map''' || optional ||
|- style="vertical-align:top;"
| '''mapsize''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt''' || optional || Alt text for map.
|- style="vertical-align:top;"
| '''map_caption''' || optional ||
|- style="vertical-align:top;"
| '''image_map1''' || optional || A secondary map image. The field '''image_map''' must be filled in first. Example see: [[Bloomsburg, Pennsylvania]].
|- style="vertical-align:top;"
| '''mapsize1''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt1''' || optional || Alt text for secondary map.
|- style="vertical-align:top;"
| '''map_caption1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Pushpin map(s), coordinates
|- style="vertical-align:top;"
| '''pushpin_map''' || optional || The name of a location map as per [[Template:Location map]] (e.g. ''Indonesia'' or ''Russia''). The coordinate fields (from {{para|coordinates}}) position a pushpin coordinate marker and label on the map '''automatically'''. Example: [[Padang, Indonesia]]. To show multiple pushpin maps, provide a list of maps separated by #, e.g., ''California#USA''
|- style="vertical-align:top;"
| '''pushpin_mapsize''' || optional || Must be entered as only a number—'''do not use px'''. The default value is 250.<br/>''Equivalent to <code>width</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_alt''' || optional || Alt text for pushpin map; used by [[screen reader]]s, see [[WP:ALT]].<br/>''Equivalent to <code>alt</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_caption''' || optional || Fill out if a different caption from ''map_caption'' is desired.<br/>''Equivalent to <code>caption</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_caption_notsmall''' || optional || <!-- add documentation here -->
|- style="vertical-align:top;"
| '''pushpin_label''' || optional || The text of the label to display next to the identifying mark; a [[Wiki markup|wikilink]] can be used. If not specified, the label will be the text assigned to the ''name'' or ''official_name'' parameters (if {{para|pushpin_label_position|none}}, no label is displayed).<br/>''Equivalent to <code>label</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_label_position''' || optional || The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are {left, right, top, bottom, none}. If this field is not specified, the default value is ''right''.<br/>''Equivalent to <code>position</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_outside''' || optional || ''Equivalent to <code>outside</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_relief''' || optional || Set this to <code>y</code> or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available). <br/>''Equivalent to <code>relief</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_image''' || optional || Allows the use of an alternative map; the image must have the same edge coordinates as the location map template.<br/>''Equivalent to <code>AlternativeMap</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_overlay''' || optional || Can be used to specify an image to be superimposed on the regular pushpin map.<br/>''Equivalent to <code>overlay_image</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''coordinates''' || optional || Latitude and longitude. Use {{tl|Coord}}. See the documentation for {{tl|Coord}} for more details on usage.
|- style="vertical-align:top;"
| '''coor_pinpoint''' || optional || If needed, to specify more exactly where (or what) coordinates are given (e.g. ''Town Hall'') or a specific place in a larger area (e.g. a city in a county). Example: In the article [[Masovian Voivodeship]], <code>coor_pinpoint=Warsaw</code> specifies [[Warsaw]].
|- style="vertical-align:top;"
| '''coordinates_footnotes''' || optional || Reference(s) for coordinates, placed within <code><nowiki><ref> </ref></nowiki></code> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''grid_name'''<br />'''grid_position''' || optional || Name of a regional grid system and position on the regional grid
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Location, established, seat, subdivisions, government, leaders===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Location
|- style="vertical-align:top;"
| {{anchor|subdivision_type}}'''subdivision_type''' || optional || almost always <code><nowiki>Country</nowiki></code>
|- style="vertical-align:top;"
| '''subdivision_name''' || optional || Depends on the subdivision_type — use the name in text form, sample: <code>United States</code>. Per [[MOS:INFOBOXFLAG]], flag icons or flag templates may be used in this field
|- style="vertical-align:top;"
| '''subdivision_type1'''<br />to<br />'''subdivision_type6''' || optional || Can be State/Province, region, county. These labels are for subdivisions ''above'' the level of the settlement described in the article. For subdivisions ''below'' or ''within'' the place described in the article, use {{para|parts_type}}.
|- style="vertical-align:top;"
| '''subdivision_name1'''<br />to<br />'''subdivision_name6''' || optional || Use the name in text form, sample: <code>Florida</code> or <code><nowiki>[[Florida]]</nowiki></code>. Per [[MOS:INFOBOXFLAG]], flag icons or flag templates should '''not''' be used in these fields
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Established
|- style="vertical-align:top;"
| '''established_title''' || optional || Example: Founded
|- style="vertical-align:top;"
| '''established_date''' || optional || Requires established_title=
|- style="vertical-align:top;"
| '''established_title1''' || optional || Example: Incorporated (town) <br/>[Note that "established_title1" is distinct from "established_title"; you can think of "established_title" as behaving like "established_title0".]
|- style="vertical-align:top;"
| '''established_date1''' || optional || [See note for "established_title1".] Requires established_title1=
|- style="vertical-align:top;"
| '''established_title2''' || optional || Example: Incorporated (city)
|- style="vertical-align:top;"
| '''established_date2''' || optional || Requires established_title2=
|- style="vertical-align:top;"
| '''established_title3''' || optional ||
|- style="vertical-align:top;"
| '''established_date3''' || optional || Requires established_title3=
|- style="vertical-align:top;"
| '''established_title4''' || optional ||
|- style="vertical-align:top;"
| '''established_date4''' || optional || Requires established_title4=
|- style="vertical-align:top;"
| '''established_title5''' || optional ||
|- style="vertical-align:top;"
| '''established_date5''' || optional || Requires established_title5=
|- style="vertical-align:top;"
| '''established_title6''' || optional ||
|- style="vertical-align:top;"
| '''established_date6''' || optional || Requires established_title6=
|- style="vertical-align:top;"
| '''established_title7''' || optional ||
|- style="vertical-align:top;"
| '''established_date7''' || optional || Requires established_title7=
|- style="vertical-align:top;"
| '''extinct_title''' || optional || For when a settlement ceases to exist
|- style="vertical-align:top;"
| '''extinct_date''' || optional || Requires extinct_title=
|- style="vertical-align:top;"
| '''founder''' || optional || Who the settlement was founded by
|- style="vertical-align:top;"
| '''named_for''' || optional || The source of the name of the settlement (a person, a place, et cetera)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seat of government
|- style="vertical-align:top;"
| '''seat_type''' || optional || The label for the seat of government (defaults to ''Seat'').
|- style="vertical-align:top;"
| '''seat''' || optional || The seat of government.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Smaller parts (e.g. boroughs of a city)
|- style="vertical-align:top;"
| '''parts_type''' || optional || The label for the smaller subdivisions (defaults to ''Boroughs'').
|- style="vertical-align:top;"
| '''parts_style''' || optional || Set to ''list'' to display as a collapsible list, ''coll'' as a collapsed list, or ''para'' to use paragraph style. Default is ''list'' for up to 5 items, otherwise ''coll''.
|- style="vertical-align:top;"
| '''parts''' || optional || Text or header of the list of smaller subdivisions.
|- style="vertical-align:top;"
| '''p1'''<br />'''p2'''<br />to<br />'''p50''' || optional || The smaller subdivisions to be listed. Example: [[Warsaw]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Government type, leaders
|- style="vertical-align:top;"
| '''government_footnotes''' || optional || Reference(s) for government, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''government_type''' || optional || Examples: [[Mayor–council government]], [[Council–manager government]], [[City commission government]], ...
|- style="vertical-align:top;"
| '''governing_body''' || optional || Name of the place's governing body
|- style="vertical-align:top;"
| '''leader_party''' || optional || Political party of the place's leader
|- style="vertical-align:top;"
| '''leader_title''' || optional || First title of the place's leader, e.g. Mayor
|- style="vertical-align:top;"
| '''leader_name''' || optional || Name of the place's leader
|- style="vertical-align:top;"
| '''leader_title1'''<br />to<br />'''leader_title4''' || optional ||
|- style="vertical-align:top;"
| '''leader_name1'''<br />to<br />'''leader_name4''' || optional || For long lists use {{tl|Collapsible list}}. See [[Halifax Regional Municipality|Halifax]] for an example.
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Geographic information===
|- style="vertical-align:top;"
| colspan=3 | These fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they should enter both values in their respective fields.
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Display settings
|- style="vertical-align:top;"
| '''total_type''' || optional || Specifies what "total" area and population figure refer to, e.g. ''Greater London''. This overrides other labels for total population/area. To make the total area and population display on the same line as the words "Area" and "Population", with no "Total" or similar label, set the value of this parameter to '''&nbsp;'''.
|- style="vertical-align:top;"
| '''unit_pref''' || optional || To change the unit order to ''imperial (metric)'', enter '''imperial'''. The default display style is ''metric (imperial)''. However, the template will swap the order automatically if the '''subdivision_name''' equals some variation of the US or the UK.<br />For the middle east, a unit preference of [[dunam]] can be entered (only affects total area). <br /> All values must be entered in a '''raw format: no commas, spaces, or unit symbols'''. The template will format them automatically.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Area
|- style="vertical-align:top;"
| '''area_footnotes''' || optional || Reference(s) for area, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''dunam_link''' || optional || If dunams are used, the default is to link the word ''dunams'' in the total area section. This can be changed by setting <code>dunam_link</code> to another measure (e.g. <code>dunam_link=water</code>). Linking can also be turned off by setting the parameter to something else (e.g. <code>dunam_link=none</code> or <code>dunam_link=off</code>).
|- style="vertical-align:top;"
| '''area_total_km2''' || optional || Total area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_total_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_total_ha''' || optional || Total area in hectares—symbol: ha. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display acres if area_total_acre is empty.
|- style="vertical-align:top;"
| '''area_total_sq_mi''' || optional || Total area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_total_km2 is empty.
|- style="vertical-align:top;"
| '''area_total_acre''' || optional || Total area in acres. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display hectares if area_total_ha is empty.
|- style="vertical-align:top;"
| '''area_total_dunam''' || optional || Total area in dunams, which is wiki-linked. Used in middle eastern places like Israel, Gaza, and the West Bank. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers or hectares and square miles or acreds if area_total_km2, area_total_ha, area_total_sq_mi, and area_total_acre are empty. Examples: [[Gaza City|Gaza]] and [[Ramallah]]
|- style="vertical-align:top;"
| '''area_land_km2''' || optional || Land area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_land_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_land_sq_mi''' || optional || Land area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_land_km2 is empty.
|- style="vertical-align:top;"
| '''area_land_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_land_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_land_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_km2''' || optional || Water area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_water_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_water_sq_mi''' || optional || Water area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_water_km2 is empty.
|- style="vertical-align:top;"
| '''area_water_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_water_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_water_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_percent''' || optional || percent of water without the "%"
|- style="vertical-align:top;"
| '''area_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_urban_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_urban_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
|- style="vertical-align:top;"
| '''area_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_rural_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_rural_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_metro_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_metro_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_rank''' || optional || The settlement's area, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''area_blank1_title''' || optional || Example see London
|- style="vertical-align:top;"
| '''area_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank1_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank1_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank2_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank2_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_note''' || optional || A place for additional information such as the name of the source.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Dimensions
|- style="vertical-align:top;"
| '''dimensions_footnotes''' || optional || Reference(s) for dimensions, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''length_km''' || optional || Raw number entered in kilometers. Will automatically convert to display length in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''length_mi''' || optional || Raw number entered in miles. Will automatically convert to display length in kilometers if length_km is empty.
|- style="vertical-align:top;"
| '''width_km''' || optional || Raw number entered in kilometers. Will automatically convert to display width in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''width_mi''' || optional || Raw number entered in miles. Will automatically convert to display width in kilometers if length_km is empty.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Elevation
|- style="vertical-align:top;"
| '''elevation_footnotes''' || optional || Reference(s) for elevation, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''elevation_m''' || optional || Raw number entered in meters. Will automatically convert to display elevation in feet if elevation_ft is empty. However, if a range in elevation (i.e. 5–50 m ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_ft''' || optional || Raw number, entered in feet. Will automatically convert to display the average elevation in meters if '''elevation_m''' field is empty. However, if a range in elevation (e.g. 50–500 ft ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_max_footnotes'''<br />'''elevation_min_footnotes''' || optional || Same as above, but for the "max" and "min" elevations. See [[City of Leeds]].
|- style="vertical-align:top;"
| '''elevation_max_m'''<br />'''elevation_max_ft'''<br />'''elevation_max_rank'''<br />'''elevation_min_m'''<br />'''elevation_min_ft'''<br />'''elevation_min_rank''' || optional || Used to give highest & lowest elevations and rank, instead of just a single value. Example: [[Halifax Regional Municipality]].
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Population, demographics===
|- style="vertical-align:top;"
| colspan=3 | The density fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they can enter both values in their respective fields. '''To calculate density with respect to the total area automatically, type ''auto'' in place of any density value.'''
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Population
|- style="vertical-align:top;"
| '''population_total''' || optional || Actual population (see below for estimates) preferably consisting of digits only (without any commas)
|- style="vertical-align:top;"
| '''population_as_of''' || optional || The year for the population total (usually a census year)
|- style="vertical-align:top;"
| '''population_footnotes''' || optional || Reference(s) for population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_est''' || optional || Population estimate.
|- style="vertical-align:top;"
| '''pop_est_as_of''' || optional || The year or month & year of the population estimate
|- style="vertical-align:top;"
| '''pop_est_footnotes''' || optional || Reference(s) for population estimate, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_urban''' || optional ||
|- style="vertical-align:top;"
| '''population_urban_footnotes''' || optional || Reference(s) for urban population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rural''' || optional ||
|- style="vertical-align:top;"
| '''population_rural_footnotes''' || optional || Reference(s) for rural population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_metro''' || optional ||
|- style="vertical-align:top;"
| '''population_metro_footnotes''' || optional || Reference(s) for metro population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rank''' || optional || The settlement's population, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_density_rank''' || optional || The settlement's population density, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_blank1_title''' || optional || Can be used for estimates. Example: [[Windsor, Ontario]]
|- style="vertical-align:top;"
| '''population_blank1''' || optional || The population value for blank1_title
|- style="vertical-align:top;"
| '''population_density_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_demonym''' || optional || A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example, a citizen in [[Liverpool]] is known as a [[Liverpudlian]].
|- style="vertical-align:top;"
| '''population_demonyms''' || optional || If more than one demonym, use this
|- style="vertical-align:top;"
| '''population_note''' || optional || A place for additional information such as the name of the source. See [[Windsor, Ontario]] for example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 1)
|- style="vertical-align:top;"
| '''demographics_type1''' || optional || Section Header. For example: Ethnicity
|- style="vertical-align:top;"
| '''demographics1_footnotes''' || optional || Reference(s) for demographics section 1, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics1_title1'''<br />to<br />'''demographics1_title7''' || optional || Titles related to demographics_type1. For example: White, Black, Hispanic...
|- style="vertical-align:top;"
| '''demographics1_info1'''<br />to<br />'''demographics1_info7''' || optional || Information related to the "titles". For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 2)
|- style="vertical-align:top;"
| '''demographics_type2''' || optional || A second section header. For example: Languages
|- style="vertical-align:top;"
| '''demographics2_footnotes''' || optional || Reference(s) for demographics section 2, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics2_title1'''<br />to<br />'''demographics2_title10''' || optional || Titles related to '''demographics_type2'''. For example: English, French, Arabic...
|- style="vertical-align:top;"
| '''demographics2_info1'''<br />to<br />'''demographics2_info10''' || optional || Information related to the "titles" for type2. For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Other information===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Time zone(s)
|- style="vertical-align:top;"
| '''timezone1''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1''' || optional || Plain text, e.g. "+05:00" or "-08:00". Auto-linked, so do not include references or additional text.
|- style="vertical-align:top;"
| '''timezone1_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1_DST''' || optional ||
|- style="vertical-align:top;"
| '''timezone2''' || optional || A second timezone field for larger areas such as a Province.
|- style="vertical-align:top;"
| '''utc_offset2''' || optional ||
|- style="vertical-align:top;"
| '''timezone2_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset2_DST''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Postal code(s) & area code
|- style="vertical-align:top;"
| '''postal_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal_code''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code''' || optional ||
|- style="vertical-align:top;"
| '''area_code_type''' || optional || If left blank/not used template will default to "[[Telephone numbering plan|Area code(s)]]"
|- style="vertical-align:top;"
| '''area_code''' || optional || Refers to the telephone dialing code for the settlement, ''not'' a geographic area code.
|- style="vertical-align:top;"
| '''area_codes''' || optional || If more than one area code, use this
|- style="vertical-align:top;"
| '''geocode''' || optional || See [[Geocode]]
|- style="vertical-align:top;"
| '''iso_code''' || optional || See [[ISO 3166]]
|- style="vertical-align:top;"
| '''registration_plate_type''' || optional || If left blank/not used template will default to "[[Vehicle registration plate|Vehicle registration]]"
|- style="vertical-align:top;"
| '''registration_plate''' || optional || See [[Vehicle registration plate]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 1)
|- style="vertical-align:top;"
| '''blank_name_sec1''' || optional || Fields used to display other information. The name is displayed in bold on the left side of the infobox.
|- style="vertical-align:top;"
| '''blank_info_sec1''' || optional || The information associated with the ''blank_name'' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see: [[Warsaw]]
|- style="vertical-align:top;"
| '''blank1_name_sec1'''<br />to<br />'''blank7_name_sec1''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec1'''<br />to<br />'''blank7_info_sec1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 2)
|- style="vertical-align:top;"
| '''blank_name_sec2''' || optional || For a second section of blank fields
|- style="vertical-align:top;"
| '''blank_info_sec2''' || optional || Example: [[Beijing]]
|- style="vertical-align:top;"
| '''blank1_name_sec2'''<br />to<br />'''blank7_name_sec2''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec2'''<br />to<br />'''blank7_info_sec2''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Website, footnotes
|- style="vertical-align:top;"
| '''website''' || optional || External link to official website, Use {{Tl|URL}}, thus: <nowiki>{{URL|example.com}}</nowiki>
|- style="vertical-align:top;"
| '''module''' || optional || To embed infoboxes at the bottom of the infobox
|- style="vertical-align:top;"
| '''footnotes''' || optional || Text to be displayed at the bottom of the infobox
|- style="vertical-align:top;"
| '''short_description''' || optional || [[WP:SHORTDESC|specify custom short description]]; if not specified, one will be automatically generated, e.g. "Place in Israel".
|}
<!-- End of parameter name/description table -->
==Examples==
;Example 1:
<!-- NOTE: This differs from the actual Chicago infobox in order to provide examples. -->
{{Infobox settlement
| name = Chicago
| settlement_type = [[City (Illinois)|City]]
| image_skyline = Chicago montage.jpg
| imagesize = 275px <!--default is 250px-->
| image_caption = Clockwise from top: [[Downtown Chicago]], the [[Chicago Theatre]], the [[Chicago 'L']], [[Navy Pier]], [[Millennium Park]], the [[Field Museum]], and the [[Willis Tower|Willis (formerly Sears) Tower]]
| image_flag = Flag of Chicago, Illinois.svg
| image_seal = Seal of Chicago, Illinois.svg
| etymology = {{lang-mia|shikaakwa}} ("wild onion" or "wild garlic")
| nickname = [[Origin of Chicago's "Windy City" nickname|The Windy City]], The Second City, Chi-Town, Chi-City, Hog Butcher for the World, City of the Big Shoulders, The City That Works, and others found at [[List of nicknames for Chicago]]
| motto = {{lang-la|Urbs in Horto}} (City in a Garden), Make Big Plans (Make No Small Plans), I Will
| image_map = US-IL-Chicago.png
| map_caption = Location in the [[Chicago metropolitan area]] and Illinois
| pushpin_map = USA
| pushpin_map_caption = Location in the United States
| coordinates = {{coord|41|50|15|N|87|40|55|W}}
| coordinates_footnotes = <ref name="USCB Gazetteer 2010"/>
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = [[Illinois]]
| subdivision_type2 = [[List of counties in Illinois|Counties]]
| subdivision_name2 = [[Cook County, Illinois|Cook]], [[DuPage County, Illinois|DuPage]]
| established_title = Settled
| established_date = 1770s
| established_title2 = [[Municipal corporation|Incorporated]]
| established_date2 = March 4, 1837
| founder =
| named_for = {{lang-mia|shikaakwa}}<br /> ("Wild onion")
| government_type = [[Mayor–council government|Mayor–council]]
| leader_title = [[Mayor of Chicago|Mayor]]
| leader_name = [[Rahm Emanuel]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[City council|Council]]
| leader_name1 = [[Chicago City Council]]
| unit_pref = Imperial
| area_footnotes = <ref name="USCB Gazetteer 2010">{{cite web | url = https://www.census.gov/geo/www/gazetteer/files/Gaz_places_national.txt | title = 2010 United States Census Gazetteer for Places: January 1, 2010 | format = text | work = 2010 United States Census | publisher = [[United States Census Bureau]] | date = April 2010 | access-date = August 1, 2012}}</ref>
| area_total_sq_mi = 234.114
| area_land_sq_mi = 227.635
| area_water_sq_mi = 6.479
| area_water_percent = 3
| area_urban_sq_mi = 2123
| area_metro_sq_mi = 10874
| elevation_footnotes = <ref name="GNIS"/>
| elevation_ft = 594
| elevation_m = 181
| population_footnotes = <ref name="USCB PopEstCities 2011">{{cite web | url = https://www.census.gov/popest/data/cities/totals/2011/tables/SUB-EST2011-01.csv | title = Annual Estimates of the Resident Population for Incorporated Places Over 50,000, Ranked by July 1, 2011 Population | format = [[comma-separated values|CSV]] | work = 2011 Population Estimates | publisher = [[United States Census Bureau]], Population Division | date = June 2012 | access-date = August 1, 2012}}</ref><ref name="USCB Metro 2010">{{cite web | url=https://www.census.gov/prod/cen2010/briefs/c2010br-01.pdf | title = Population Change for the Ten Most Populous and Fastest Growing Metropolitan Statiscal Areas: 2000 to 2010 | date = March 2011 | publisher = [[U.S. Census Bureau]] | page = 6 |access-date = April 12, 2011}}</ref>
| population_as_of = [[2010 United States census|2010]]
| population_total = 2695598
| pop_est_footnotes =
| pop_est_as_of = 2011
| population_est = 2707120
| population_rank = [[List of United States cities by population|3rd US]]
| population_density_sq_mi = 11,892.4<!-- 2011 population_est / area_land_sq_mi -->
| population_urban = 8711000
| population_density_urban_sq_mi = auto
| population_metro = 9461105
| population_density_metro_sq_mi = auto
| population_demonym = Chicagoan
| timezone = [[Central Standard Time|CST]]
| utc_offset = −06:00
| timezone_DST = [[Central Daylight Time|CDT]]
| utc_offset_DST = −05:00
| area_code_type = [[North American Numbering Plan|Area codes]]
| area_codes = [[Area code 312|312]], [[Area code 773|773]], [[Area code 872|872]]
| blank_name = [[Federal Information Processing Standards|FIPS]] code
| blank_info = {{FIPS|17|14000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS 4|423587}}, {{GNIS 4|428803}}
| website = {{URL|www.cityofchicago.org}}
| footnotes = <ref name="GNIS">{{Cite gnis|428803|City of Chicago|April 12, 2011}}</ref>
}}
<syntaxhighlight lang="wikitext" style="overflow:auto; white-space: pre-wrap;">
<!-- NOTE: This differs from the actual Chicago infobox in order to provide examples. -->
{{Infobox settlement
| name = Chicago
| settlement_type = [[City (Illinois)|City]]
| image_skyline = Chicago montage.jpg
| imagesize = 275px <!--default is 250px-->
| image_caption = Clockwise from top: [[Downtown Chicago]], the [[Chicago Theatre]], the [[Chicago 'L']], [[Navy Pier]], [[Millennium Park]], the [[Field Museum]], and the [[Willis Tower|Willis (formerly Sears) Tower]]
| image_flag = Flag of Chicago, Illinois.svg
| image_seal = Seal of Chicago, Illinois.svg
| etymology = {{lang-mia|shikaakwa}} ("wild onion" or "wild garlic")
| nickname = [[Origin of Chicago's "Windy City" nickname|The Windy City]], The Second City, Chi-Town, Chi-City, Hog Butcher for the World, City of the Big Shoulders, The City That Works, and others found at [[List of nicknames for Chicago]]
| motto = {{lang-la|Urbs in Horto}} (City in a Garden), Make Big Plans (Make No Small Plans), I Will
| image_map = US-IL-Chicago.png
| map_caption = Location in the [[Chicago metropolitan area]] and Illinois
| pushpin_map = USA
| pushpin_map_caption = Location in the United States
| coordinates = {{coord|41|50|15|N|87|40|55|W}}
| coordinates_footnotes = <ref name="USCB Gazetteer 2010"/>
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = [[Illinois]]
| subdivision_type2 = [[List of counties in Illinois|Counties]]
| subdivision_name2 = [[Cook County, Illinois|Cook]], [[DuPage County, Illinois|DuPage]]
| established_title = Settled
| established_date = 1770s
| established_title2 = [[Municipal corporation|Incorporated]]
| established_date2 = March 4, 1837
| founder =
| named_for = {{lang-mia|shikaakwa}}<br /> ("Wild onion")
| government_type = [[Mayor–council government|Mayor–council]]
| leader_title = [[Mayor of Chicago|Mayor]]
| leader_name = [[Rahm Emanuel]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[City council|Council]]
| leader_name1 = [[Chicago City Council]]
| unit_pref = Imperial
| area_footnotes = <ref name="USCB Gazetteer 2010">{{cite web | url = https://www.census.gov/geo/www/gazetteer/files/Gaz_places_national.txt | title = 2010 United States Census Gazetteer for Places: January 1, 2010 | format = text | work = 2010 United States Census | publisher = [[United States Census Bureau]] | date = April 2010 | access-date = August 1, 2012}}</ref>
| area_total_sq_mi = 234.114
| area_land_sq_mi = 227.635
| area_water_sq_mi = 6.479
| area_water_percent = 3
| area_urban_sq_mi = 2123
| area_metro_sq_mi = 10874
| elevation_footnotes = <ref name="GNIS"/>
| elevation_ft = 594
| elevation_m = 181
| population_footnotes = <ref name="USCB PopEstCities 2011">{{cite web | url = https://www.census.gov/popest/data/cities/totals/2011/tables/SUB-EST2011-01.csv | title = Annual Estimates of the Resident Population for Incorporated Places Over 50,000, Ranked by July 1, 2011 Population | format = [[comma-separated values|CSV]] | work = 2011 Population Estimates | publisher = [[United States Census Bureau]], Population Division | date = June 2012 | access-date = August 1, 2012}}</ref><ref name="USCB Metro 2010">{{cite web | url=https://www.census.gov/prod/cen2010/briefs/c2010br-01.pdf | title = Population Change for the Ten Most Populous and Fastest Growing Metropolitan Statiscal Areas: 2000 to 2010 | date = March 2011 | publisher = [[U.S. Census Bureau]] | page = 6 |access-date = April 12, 2011}}</ref>
| population_as_of = [[2010 United States census|2010]]
| population_total = 2695598
| pop_est_footnotes =
| pop_est_as_of = 2011
| population_est = 2707120
| population_rank = [[List of United States cities by population|3rd US]]
| population_density_sq_mi = 11,892.4<!-- 2011 population_est / area_land_sq_mi -->
| population_urban = 8711000
| population_density_urban_sq_mi = auto
| population_metro = 9461105
| population_density_metro_sq_mi = auto
| population_demonym = Chicagoan
| timezone = [[Central Standard Time|CST]]
| utc_offset = −06:00
| timezone_DST = [[Central Daylight Time|CDT]]
| utc_offset_DST = −05:00
| area_code_type = [[North American Numbering Plan|Area codes]]
| area_codes = [[Area code 312|312]], [[Area code 773|773]], [[Area code 872|872]]
| blank_name = [[Federal Information Processing Standards|FIPS]] code
| blank_info = {{FIPS|17|14000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS 4|423587}}, {{GNIS 4|428803}}
| website = {{URL|www.cityofchicago.org}}
| footnotes = <ref name="GNIS">{{Cite gnis|428803|City of Chicago|April 12, 2011}}</ref>
}}
</syntaxhighlight>
'''References'''
{{reflist}}
{{clear}}
----
;Example 2:
{{Infobox settlement
| name = Detroit
| settlement_type = [[City (Michigan)|City]]
| image_skyline = Detroit Montage.jpg
| imagesize = 290px
| image_caption = Images from top to bottom, left to right: [[Downtown Detroit]] skyline, [[Spirit of Detroit]], [[Greektown Historic District|Greektown]], [[Ambassador Bridge]], [[Michigan Soldiers' and Sailors' Monument]], [[Fox Theatre (Detroit)|Fox Theatre]], and [[Comerica Park]].
| image_flag = Flag of Detroit.svg
| image_seal = Seal of Detroit.svg
| etymology = {{lang-fr|détroit}} ([[strait]])
| nickname = The Motor City, Motown, Renaissance City, The D, Hockeytown, The Automotive Capital of the World, Rock City, The 313
| motto = ''Speramus Meliora; Resurget Cineribus''<br /><small>([[Latin]]: We Hope For Better Things; It Shall Rise From the Ashes)</small>
| image_map = Wayne County Michigan Incorporated and Unincorporated areas Detroit highlighted.svg
| mapsize = 250x200px
| map_caption = Location within [[Wayne County, Michigan|Wayne County]] and the state of [[Michigan]]
| pushpin_map = USA
| pushpin_map_caption = Location within the [[contiguous United States]]
| coordinates = {{coord|42|19|53|N|83|2|45|W}}
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = [[Michigan]]
| subdivision_type2 = [[List of counties in Michigan|County]]
| subdivision_name2 = [[Wayne County, Michigan|Wayne]]
| established_title = Founded
| established_date = 1701
| established_title2 = Incorporated
| established_date2 = 1806
| government_footnotes = <!-- for references: use<ref> tags -->
| government_type = [[Mayor–council government|Mayor–council]]
| leader_title = [[List of mayors of Detroit|Mayor]]
| leader_name = [[Mike Duggan]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[Detroit City Council|City Council]]
| leader_name1 = {{collapsible list|bullets=yes
| title = Members
| 1 = [[Charles Pugh]] – Council President
| 2 = [[Gary Brown (Detroit politician)|Gary Brown]] – Council President Pro-Tem
| 3 = [[JoAnn Watson]]
| 4 = [[Kenneth Cockrel, Jr.]]
| 5 = [[Saunteel Jenkins]]
| 6 = [[Andre Spivey]]
| 7 = [[James Tate (Detroit politician)|James Tate]]
| 8 = [[Brenda Jones (Detroit politician)|Brenda Jones]]
| 9 = [[Kwame Kenyatta]]
}}
| unit_pref = Imperial
| area_footnotes =
| area_total_sq_mi = 142.87
| area_total_km2 = 370.03
| area_land_sq_mi = 138.75
| area_land_km2 = 359.36
| area_water_sq_mi = 4.12
| area_water_km2 = 10.67
| area_urban_sq_mi = 1295
| area_metro_sq_mi = 3913
| elevation_footnotes =
| elevation_ft = 600
| population_footnotes =
| population_as_of = 2011
| population_total = 706585
| population_rank = [[List of United States cities by population|18th in U.S.]]
| population_urban = 3863924
| population_metro = 4285832 (US: [[List of United States metropolitan statistical areas|13th]])
| population_blank1_title = [[Combined statistical area|CSA]]
| population_blank1 = 5207434 (US: [[List of United States combined statistical areas|11th]])
| population_density_sq_mi= {{#expr:713777/138.8 round 0}}
| population_demonym = Detroiter
| population_note =
| timezone = [[Eastern Time Zone (North America)|EST]]
| utc_offset = −5
| timezone_DST = [[Eastern Daylight Time|EDT]]
| utc_offset_DST = −4
| postal_code_type =
| postal_code =
| area_code = [[Area code 313|313]]
| blank_name = [[Federal Information Processing Standards|FIPS code]]
| blank_info = {{FIPS|26|22000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS 4|1617959}}, {{GNIS 4|1626181}}
| website = [http://www.detroitmi.gov/ DetroitMI.gov]
| footnotes =
}}
<syntaxhighlight lang="wikitext" style="overflow:auto; white-space: pre-wrap;">
{{Infobox settlement
| name = Detroit
| settlement_type = [[City (Michigan)|City]]
| official_name = City of Detroit
| image_skyline = Detroit Montage.jpg
| imagesize = 290px
| image_caption = Images from top to bottom, left to right: [[Downtown Detroit]] skyline, [[Spirit of Detroit]], [[Greektown Historic District|Greektown]], [[Ambassador Bridge]], [[Michigan Soldiers' and Sailors' Monument]], [[Fox Theatre (Detroit)|Fox Theatre]], and [[Comerica Park]].
| image_flag = Flag of Detroit, Michigan.svg
| image_seal = Seal of Detroit, Michigan.svg
| etymology = {{lang-fr|détroit}} ([[strait]])
| nickname = The Motor City, Motown, Renaissance City, The D, Hockeytown, The Automotive Capital of the World, Rock City, The 313
| motto = ''Speramus Meliora; Resurget Cineribus''<br /><small>([[Latin]]: We Hope For Better Things; It Shall Rise From the Ashes)</small>
| image_map = Wayne County Michigan Incorporated and Unincorporated areas Detroit highlighted.svg
| mapsize = 250x200px
| map_caption = Location within [[Wayne County, Michigan|Wayne County]] and the state of [[Michigan]]
| pushpin_map = USA
| pushpin_map_caption = Location within the [[contiguous United States]]
| coordinates = {{coord|42|19|53|N|83|2|45|W}}
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = Michigan
| subdivision_type2 = [[List of counties in Michigan|County]]
| subdivision_name2 = [[Wayne County, Michigan|Wayne]]
| established_title = Founded
| established_date = 1701
| established_title2 = Incorporated
| established_date2 = 1806
| government_footnotes = <!-- for references: use<ref> tags -->
| government_type = [[Mayor-council government|Mayor-Council]]
| leader_title = [[List of mayors of Detroit|Mayor]]
| leader_name = [[Mike Duggan]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[Detroit City Council|City Council]]
| leader_name1 = {{collapsible list|bullets=yes
| title = Members
| 1 = [[Charles Pugh]] – Council President
| 2 = [[Gary Brown (Detroit politician)|Gary Brown]] – Council President Pro-Tem
| 3 = [[JoAnn Watson]]
| 4 = [[Kenneth Cockrel, Jr.]]
| 5 = [[Saunteel Jenkins]]
| 6 = [[Andre Spivey]]
| 7 = [[James Tate (Detroit politician)|James Tate]]
| 8 = [[Brenda Jones (Detroit politician)|Brenda Jones]]
| 9 = [[Kwame Kenyatta]]
}}
| unit_pref = Imperial
| area_footnotes =
| area_total_sq_mi = 142.87
| area_total_km2 = 370.03
| area_land_sq_mi = 138.75
| area_land_km2 = 359.36
| area_water_sq_mi = 4.12
| area_water_km2 = 10.67
| area_urban_sq_mi = 1295
| area_metro_sq_mi = 3913
| elevation_footnotes =
| elevation_ft = 600
| population_footnotes =
| population_as_of = 2011
| population_total = 706585
| population_rank = [[List of United States cities by population|18th in U.S.]]
| population_urban = 3863924
| population_metro = 4285832 (US: [[List of United States metropolitan statistical areas|13th]])
| population_blank1_title = [[Combined statistical area|CSA]]
| population_blank1 = 5207434 (US: [[List of United States combined statistical areas|11th]])
| population_density_sq_mi= {{#expr:713777/138.8 round 0}}
| population_demonym = Detroiter
| population_note =
| timezone = [[Eastern Time Zone (North America)|EST]]
| utc_offset = −5
| timezone_DST = [[Eastern Daylight Time|EDT]]
| utc_offset_DST = −4
| postal_code_type =
| postal_code =
| area_code = [[Area code 313|313]]
| blank_name = [[Federal Information Processing Standards|FIPS code]]
| blank_info = {{FIPS|26|22000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS 4|1617959}}, {{GNIS 4|1626181}}
| website = [http://www.detroitmi.gov/ DetroitMI.gov]
| footnotes =
}}
</syntaxhighlight>
{{clear}}
==Supporting templates==
The following is a list of sub-templates used by Infobox settlement. See the [{{fullurl:Special:PrefixIndex|prefix=Infobox+settlement%2F&namespace=10&hideredirects=1}} current list of all sub-templates] for documentation, sandboxes, testcases, etc.
# {{tl|Infobox settlement/areadisp}}
# {{tl|Infobox settlement/densdisp}}
# {{tl|Infobox settlement/dunam}}
# {{tl|Infobox settlement/dunam/mag}}
# {{tl|Infobox settlement/impus}}
# {{tl|Infobox settlement/impus/mag}}
# {{tl|Infobox settlement/lengthdisp}}
# {{tl|Infobox settlement/link}}
# {{tl|Infobox settlement/metric}}
# {{tl|Infobox settlement/metric/mag}}
# {{tl|Infobox settlement/pref}}
==Microformat==
{{UF-hcard-geo}}
== TemplateData ==
{{TemplateData header}}
{{collapse top|title=TemplateData}}
<templatedata>
{
"description": "Infobox for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, etc.",
"format": "{{_\n| __________________ = _\n}}\n",
"params": {
"name": {
"label": "Common name",
"description": "This is the usual name in English. If it's not specified, the infobox will use the 'official_name' as a title unless this too is missing, in which case the page name will be used.",
"type": "string",
"suggested": true
},
"official_name": {
"label": "Official name",
"description": "The official name in English, if different from 'name'.",
"type": "string",
"suggested": true
},
"native_name": {
"label": "Native name",
"description": "This will display under the name/official name.",
"type": "string",
"example": "Distrito Federal de México"
},
"native_name_lang": {
"label": "Native name language",
"description": "Use ISO 639-1 code, e.g. 'fr' for French. If there is more than one native name in different languages, enter those names using {{lang}} instead.",
"type": "string",
"example": "zh"
},
"other_name": {
"label": "Other name",
"description": "For places with a former or more common name like Bombay or Saigon.",
"type": "string"
},
"settlement_type": {
"label": "Type of settlement",
"description": "Any type can be entered, such as 'City', 'Town', 'Village', 'Hamlet', 'Municipality', 'Reservation', etc. If set, will be displayed under the names, provided either 'name' or 'official_name' is filled in. Might also be used as a label for total population/area (defaulting to 'City'), if needed to distinguish from 'Urban', 'Rural' or 'Metro' (if urban, rural or metro figures are not present, the label is 'Total' unless 'total_type' is set).",
"type": "string",
"aliases": [
"type"
]
},
"translit_lang1": {
"label": "Transliteration from language 1",
"description": "Will place the entry before the word 'transliteration(s)'. Can be used to specify a particular language, like in Dêlêg, or one may just enter 'Other', like in Gaza's article.",
"type": "string"
},
"translit_lang1_type": {
"label": "Transliteration type for language 1",
"type": "line",
"example": "[[Hanyu pinyin]]",
"description": "The type of transliteration used for the first language."
},
"translit_lang1_info": {
"label": "Transliteration language 1 info",
"description": "Parameters 'translit_lang2_info1' ... 'translit_lang2_info6' are also available, but not documented here.",
"type": "string"
},
"translit_lang2": {
"label": "Transliteration language 2",
"description": "Will place a second transliteration. See Dêlêg.",
"type": "string"
},
"image_skyline": {
"label": "Image",
"description": "Primary image representing the settlement. Commonly a photo of the settlement’s skyline.",
"type": "wiki-file-name"
},
"imagesize": {
"label": "Image size",
"description": "Can be used to tweak the size of 'image_skyline' up or down. This can be helpful if an editor wants to make the infobox wider. If used, 'px' must be specified; default size is 250px.",
"type": "string"
},
"image_alt": {
"label": "Image alt text",
"description": "Alt (hover) text for the image, used by visually impaired readers who cannot see the image.",
"type": "string"
},
"image_caption": {
"label": "Image caption",
"description": "Will place a caption under 'image_skyline' (if present).",
"type": "content"
},
"image_flag": {
"label": "Flag image",
"description": "Used for a flag.",
"type": "wiki-file-name"
},
"flag_size": {
"label": "Flag size",
"description": "Can be used to tweak the size of 'image_flag' up or down from 100px as desired. If used, 'px' must be specified; default size is 100px.",
"type": "string"
},
"flag_alt": {
"label": "Flag alt text",
"description": "Alt text for the flag.",
"type": "string"
},
"flag_border": {
"label": "Flag border?",
"description": "Set to 'no' to remove the border from the flag.",
"type": "boolean",
"example": "no"
},
"flag_link": {
"label": "Flag link",
"type": "string",
"description": "Link to the flag."
},
"image_seal": {
"label": "Official seal image",
"description": "An image of an official seal, if the place has one.",
"type": "wiki-file-name"
},
"seal_size": {
"label": "Seal size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string"
},
"seal_alt": {
"label": "Seal alt text",
"description": "Alt (hover) text for the seal.",
"type": "string"
},
"seal_link": {
"label": "Seal link",
"type": "string",
"description": "Link to the seal."
},
"image_shield": {
"label": "Coat of arms/shield image",
"description": "Can be used for a place with a coat of arms.",
"type": "wiki-file-name"
},
"shield_size": {
"label": "Shield size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"example": "200px"
},
"shield_alt": {
"label": "Shield alt text",
"description": "Alternate text for the shield.",
"type": "string"
},
"shield_link": {
"label": "Shield link",
"description": "Can be used if a wiki article if known but is not automatically linked by the template. See Coquitlam, British Columbia's infobox for an example.",
"type": "string"
},
"image_blank_emblem": {
"label": "Blank emblem image",
"description": "Can be used if a place has an official logo, crest, emblem, etc.",
"type": "wiki-file-name"
},
"blank_emblem_type": {
"label": "Blank emblem type",
"description": "Caption beneath 'image_blank_emblem' to specify what type of emblem it is.",
"type": "string",
"example": "Logo"
},
"blank_emblem_size": {
"label": "Blank emblem size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"example": "200px"
},
"blank_emblem_alt": {
"label": "Blank emblem alt text",
"description": "Alt text for blank emblem.",
"type": "string"
},
"blank_emblem_link": {
"label": "Blank emblem link",
"type": "string",
"description": "A link to the emblem of custom type."
},
"nickname": {
"label": "Nickname",
"description": "Well-known nickname(s).",
"type": "string",
"example": "Sin City"
},
"motto": {
"label": "Motto",
"description": "Will place the motto under the nicknames.",
"type": "string"
},
"anthem": {
"label": "Anthem",
"description": "Will place the anthem (song) under the nicknames.",
"type": "string",
"example": "[[Hatikvah]]"
},
"image_map": {
"label": "Map image",
"description": "A map of the region, or a map with the region highlighted within a parent region.",
"type": "wiki-file-name"
},
"mapsize": {
"label": "Map size",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string"
},
"map_alt": {
"label": "Map alt text",
"description": "Alternate (hover) text for the map.",
"type": "string"
},
"map_caption": {
"label": "Map caption",
"type": "content",
"description": "Caption for the map displayed."
},
"image_map1": {
"label": "Map 2 image",
"description": "A secondary map image. The field 'image_map' must be filled in first. For an example, see [[Bloomsburg, Pennsylvania]].",
"example": "File:Columbia County Pennsylvania Incorporated and Unincorporated areas Bloomsburg Highlighted.svg",
"type": "wiki-file-name"
},
"mapsize1": {
"label": "Map 2 size",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string",
"example": "300px"
},
"map_alt1": {
"label": "Map 2 alt text",
"description": "Alt (hover) text for the second map.",
"type": "string"
},
"map_caption1": {
"label": "Map 2 caption",
"type": "content",
"description": "Caption of the second map."
},
"pushpin_map": {
"label": "Pushpin map",
"description": "The name of a location map (e.g. 'Indonesia' or 'Russia'). The coordinates information (from the coordinates parameter) positions a pushpin coordinate marker and label on the map automatically. For an example, see Padang, Indonesia.",
"type": "string",
"example": "Indonesia"
},
"pushpin_mapsize": {
"label": "Pushpin map size",
"description": "Must be entered as only a number—do not use 'px'. The default value is 250.",
"type": "number",
"example": "200"
},
"pushpin_map_alt": {
"label": "Pushpin map alt text",
"description": "Alt (hover) text for the pushpin map.",
"type": "string"
},
"pushpin_map_caption": {
"label": "Pushpin map caption",
"description": "Fill out if a different caption from 'map_caption' is desired.",
"type": "string",
"example": "Map showing Bloomsburg in Pennsylvania"
},
"pushpin_label": {
"label": "Pushpin label",
"type": "line",
"example": "Bloomsburg",
"description": "Label of the pushpin."
},
"pushpin_label_position": {
"label": "Pushpin label position",
"description": "The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are 'left', 'right', 'top', 'bottom', and 'none'. If this field is not specified, the default value is 'right'.",
"type": "string",
"example": "left",
"default": "right"
},
"pushpin_outside": {
"label": "Pushpin outside?",
"type": "line"
},
"pushpin_relief": {
"label": "Pushpin relief",
"description": "Set this to 'y' or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available).",
"type": "string",
"example": "y"
},
"pushpin_image": {
"label": "Pushpin image",
"type": "wiki-file-name",
"description": "Image to use for the pushpin."
},
"pushpin_overlay": {
"label": "Pushpin overlay",
"description": "Can be used to specify an image to be superimposed on the regular pushpin map.",
"type": "wiki-file-name"
},
"coordinates": {
"label": "Coordinates",
"description": "Latitude and longitude. Use {{Coord}}. See the documentation for {{Coord}} for more details on usage.",
"type": "wiki-template-name",
"example": "{{coord|41|50|15|N|87|40|55|W}}"
},
"coor_pinpoint": {
"label": "Coordinate pinpoint",
"description": "If needed, to specify more exactly where (or what) coordinates are given (e.g. 'Town Hall') or a specific place in a larger area (e.g. a city in a county). Example: Masovian Voivodeship.",
"type": "string"
},
"coordinates_footnotes": {
"label": "Coordinates footnotes",
"description": "Reference(s) for coordinates. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"subdivision_type": {
"label": "Subdivision type 1",
"description": "Almost always 'Country'.",
"type": "string",
"example": "[[List of sovereign states|Country]]"
},
"subdivision_name": {
"label": "Subdivision name 1",
"description": "Depends on 'subdivision_type'. Use the name in text form, e.g., 'United States'. Per MOS:INFOBOXFLAG, flag icons or flag templates may be used in this field.",
"type": "string"
},
"subdivision_type1": {
"label": "Subdivision type 2",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type2": {
"label": "Subdivision type 3",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type3": {
"label": "Subdivision type 4",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type4": {
"label": "Subdivision type 5",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type5": {
"label": "Subdivision type 6",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type6": {
"label": "Subdivision type 7",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_name1": {
"label": "Subdivision name 2",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Connecticut]]"
},
"subdivision_name2": {
"label": "Subdivision name 3",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Florida]]"
},
"subdivision_name3": {
"label": "Subdivision name 4",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Utah]]"
},
"subdivision_name4": {
"label": "Subdivision name 5",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[California]]"
},
"subdivision_name5": {
"label": "Subdivision name 6",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Vermont]]"
},
"subdivision_name6": {
"label": "Subdivision name 7",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Wyoming]]"
},
"established_title": {
"label": "First establishment event",
"description": "Title of the first establishment event.",
"type": "string",
"example": "First settled"
},
"established_date": {
"label": "First establishment date",
"type": "date",
"description": "Date of the first establishment event."
},
"established_title1": {
"label": "Second establishment event",
"description": "Title of the second establishment event.",
"type": "string",
"example": "Incorporated as a town"
},
"established_date1": {
"label": "Second establishment date",
"type": "date",
"description": "Date of the second establishment event."
},
"established_title2": {
"label": "Third establishment event",
"description": "Title of the third establishment event.",
"type": "string",
"example": "Incorporated as a city"
},
"established_date2": {
"label": "Third establishment date",
"type": "date",
"description": "Date of the third establishment event."
},
"established_title3": {
"label": "Fourth establishment event",
"type": "string",
"description": "Title of the fourth establishment event.",
"example": "Incorporated as a county"
},
"established_date3": {
"label": "Fourth establishment date",
"type": "date",
"description": "Date of the fourth establishment event."
},
"extinct_title": {
"label": "Extinction event title",
"description": "For when a settlement ceases to exist.",
"type": "string",
"example": "[[Sack of Rome]]"
},
"extinct_date": {
"label": "Extinction date",
"type": "string",
"description": "Date the settlement ceased to exist."
},
"founder": {
"label": "Founder",
"description": "Who the settlement was founded by.",
"type": "string"
},
"named_for": {
"label": "Named for",
"description": "The source of the name of the settlement (a person, a place, et cetera).",
"type": "string",
"example": "[[Ho Chi Minh]]"
},
"seat_type": {
"label": "Seat of government type",
"description": "The label for the seat of government (defaults to 'Seat').",
"type": "string",
"default": "Seat"
},
"seat": {
"label": "Seat of government",
"description": "The seat of government.",
"type": "string",
"example": "[[White House]]"
},
"parts_type": {
"label": "Type of smaller subdivisions",
"description": "The label for the smaller subdivisions (defaults to 'Boroughs').",
"type": "string",
"default": "Boroughs"
},
"parts_style": {
"label": "Parts style",
"description": "Set to 'list' to display as a collapsible list, 'coll' as a collapsed list, or 'para' to use paragraph style. Default is 'list' for up to 5 items, otherwise 'coll'.",
"type": "string",
"example": "list"
},
"parts": {
"label": "Smaller subdivisions",
"description": "Text or header of the list of smaller subdivisions.",
"type": "string"
},
"p1": {
"label": "Smaller subdivision 1",
"description": "The smaller subdivisions to be listed. Parameters 'p1' to 'p50' can also be used.",
"type": "string"
},
"government_footnotes": {
"label": "Government footnotes",
"description": "Reference(s) for government. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"government_type": {
"label": "Government type",
"description": "The place's type of government.",
"type": "string",
"example": "[[Mayor–council government]]"
},
"governing_body": {
"label": "Governing body",
"description": "Name of the place's governing body.",
"type": "wiki-page-name",
"example": "Legislative Council of Hong Kong"
},
"leader_party": {
"label": "Leader political party",
"description": "Political party of the place's leader.",
"type": "string"
},
"leader_title": {
"label": "Leader title",
"description": "First title of the place's leader, e.g. 'Mayor'.",
"type": "string",
"example": "[[Governor (United States)|Governor]]"
},
"leader_name": {
"label": "Leader's name",
"description": "Name of the place's leader.",
"type": "string",
"example": "[[Jay Inslee]]"
},
"leader_title1": {
"label": "Leader title 1",
"description": "First title of the place's leader, e.g. 'Mayor'.",
"type": "string",
"example": "Mayor"
},
"leader_name1": {
"label": "Leader name 1",
"description": "Additional names for leaders. Parameters 'leader_name1' .. 'leader_name4' are available. For long lists, use {{Collapsible list}}.",
"type": "string"
},
"total_type": {
"label": "Total type",
"description": "Specifies what total area and population figure refer to, e.g. 'Greater London'. This overrides other labels for total population/area. To make the total area and population display on the same line as the words ''Area'' and ''Population'', with no ''Total'' or similar label, set the value of this parameter to ' '.",
"type": "string"
},
"unit_pref": {
"label": "Unit preference",
"description": "To change the unit order to 'imperial (metric)', enter 'imperial'. The default display style is 'metric (imperial)'. However, the template will swap the order automatically if the 'subdivision_name' equals some variation of the US or the UK. For the Middle East, a unit preference of dunam can be entered (only affects total area). All values must be entered in a raw format (no commas, spaces, or unit symbols). The template will format them automatically.",
"type": "string",
"example": "imperial"
},
"area_footnotes": {
"label": "Area footnotes",
"description": "Reference(s) for area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"dunam_link": {
"label": "Link dunams?",
"description": "If dunams are used, the default is to link the word ''dunams'' in the total area section. This can be changed by setting 'dunam_link' to another measure (e.g. 'dunam_link=water'). Linking can also be turned off by setting the parameter to something else (e.g., 'dunam_link=none' or 'dunam_link=off').",
"type": "boolean",
"example": "none"
},
"area_total_km2": {
"label": "Total area (km2)",
"description": "Total area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_total_sq_mi' is empty.",
"type": "number"
},
"area_total_sq_mi": {
"label": "Total area (sq. mi)",
"description": "Total area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_total_km2' is empty.",
"type": "number"
},
"area_total_ha": {
"label": "Total area (hectares)",
"description": "Total area in hectares (symbol: ha). Value must be entered in raw format (no commas or spaces). Auto-converted to display acres if 'area_total_acre' is empty.",
"type": "number"
},
"area_total_acre": {
"label": "Total area (acres)",
"description": "Total area in acres. Value must be entered in raw format (no commas or spaces). Auto-converted to display hectares if 'area_total_ha' is empty.",
"type": "number"
},
"area_total_dunam": {
"label": "Total area (dunams)",
"description": "Total area in dunams, which is wikilinked. Used in Middle Eastern places like Israel, Gaza, and the West Bank. Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers or hectares and square miles or acres if 'area_total_km2', 'area_total_ha', 'area_total_sq_mi', and 'area_total_acre' are empty. Examples: Gaza and Ramallah.",
"type": "number"
},
"area_land_km2": {
"label": "Land area (sq. km)",
"description": "Land area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_land_sq_mi' is empty.",
"type": "number"
},
"area_land_sq_mi": {
"label": "Land area (sq. mi)",
"description": "Land area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_land_km2' is empty.",
"type": "number"
},
"area_land_ha": {
"label": "Land area (hectares)",
"description": "The place's land area in hectares.",
"type": "number"
},
"area_land_dunam": {
"label": "Land area (dunams)",
"description": "The place's land area in dunams.",
"type": "number"
},
"area_land_acre": {
"label": "Land area (acres)",
"description": "The place's land area in acres.",
"type": "number"
},
"area_water_km2": {
"label": "Water area (sq. km)",
"description": "Water area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_water_sq_mi' is empty.",
"type": "number"
},
"area_water_sq_mi": {
"label": "Water area (sq. mi)",
"description": "Water area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_water_km2' is empty.",
"type": "number"
},
"area_water_ha": {
"label": "Water area (hectares)",
"description": "The place's water area in hectares.",
"type": "number"
},
"area_water_dunam": {
"label": "Water area (dunams)",
"description": "The place's water area in dunams.",
"type": "number"
},
"area_water_acre": {
"label": "Water area (acres)",
"description": "The place's water area in acres.",
"type": "number"
},
"area_water_percent": {
"label": "Percent water area",
"description": "Percent of water without the %.",
"type": "number",
"example": "21"
},
"area_urban_km2": {
"label": "Urban area (sq. km)",
"type": "number",
"description": "Area of the place's urban area in square kilometers."
},
"area_urban_sq_mi": {
"label": "Urban area (sq. mi)",
"type": "number",
"description": "Area of the place's urban area in square miles."
},
"area_urban_ha": {
"label": "Urban area (hectares)",
"description": "Area of the place's urban area in hectares.",
"type": "number"
},
"area_urban_dunam": {
"label": "Urban area (dunams)",
"description": "Area of the place's urban area in dunams.",
"type": "number"
},
"area_urban_acre": {
"label": "Urban area (acres)",
"description": "Area of the place's urban area in acres.",
"type": "number"
},
"area_urban_footnotes": {
"label": "Urban area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_rural_km2": {
"label": "Rural area (sq. km)",
"type": "number",
"description": "Area of the place's rural area in square kilometers."
},
"area_rural_sq_mi": {
"label": "Rural area (sq. mi)",
"type": "number",
"description": "Area of the place's rural area in square miles."
},
"area_rural_ha": {
"label": "Rural area (hectares)",
"description": "Area of the place's rural area in hectares.",
"type": "number"
},
"area_rural_dunam": {
"label": "Rural area (dunams)",
"description": "Area of the place's rural area in dunams.",
"type": "number"
},
"area_rural_acre": {
"label": "Rural area (acres)",
"description": "Area of the place's rural area in acres.",
"type": "number"
},
"area_rural_footnotes": {
"label": "Rural area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_metro_km2": {
"label": "Metropolitan area (sq. km)",
"type": "number",
"description": "Area of the place's metropolitan area in square kilometers."
},
"area_metro_sq_mi": {
"label": "Metropolitan area (sq. mi)",
"type": "number",
"description": "Area of the place's metropolitan area in square miles."
},
"area_metro_ha": {
"label": "Metropolitan area (hectares)",
"description": "Area of the place's metropolitan area in hectares.",
"type": "number"
},
"area_metro_dunam": {
"label": "Metropolitan area (dunams)",
"description": "Area of the place's metropolitan area in dunams.",
"type": "number"
},
"area_metro_acre": {
"label": "Metropolitan area (acres)",
"description": "Area of the place's metropolitan area in acres.",
"type": "number"
},
"area_metro_footnotes": {
"label": "Metropolitan area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_rank": {
"label": "Area rank",
"description": "The settlement's area, as ranked within its parent sub-division.",
"type": "string"
},
"area_blank1_title": {
"label": "First blank area section title",
"description": "Title of the place's first custom area section.",
"type": "string",
"example": "see [[London]]"
},
"area_blank1_km2": {
"label": "Area blank 1 (sq. km)",
"type": "number",
"description": "Area of the place's first blank area section in square kilometers."
},
"area_blank1_sq_mi": {
"label": "Area blank 1 (sq. mi)",
"type": "number",
"description": "Area of the place's first blank area section in square miles."
},
"area_blank1_ha": {
"label": "Area blank 1 (hectares)",
"description": "Area of the place's first blank area section in hectares.",
"type": "number"
},
"area_blank1_dunam": {
"label": "Area blank 1 (dunams)",
"description": "Area of the place's first blank area section in dunams.",
"type": "number"
},
"area_blank1_acre": {
"label": "Area blank 1 (acres)",
"description": "Area of the place's first blank area section in acres.",
"type": "number"
},
"area_blank2_title": {
"label": "Second blank area section title",
"type": "string",
"description": "Title of the place's second custom area section."
},
"area_blank2_km2": {
"label": "Area blank 2 (sq. km)",
"type": "number",
"description": "Area of the place's second blank area section in square kilometers."
},
"area_blank2_sq_mi": {
"label": "Area blank 2 (sq. mi)",
"type": "number",
"description": "Area of the place's second blank area section in square miles."
},
"area_blank2_ha": {
"label": "Area blank 2 (hectares)",
"description": "Area of the place's third blank area section in hectares.",
"type": "number"
},
"area_blank2_dunam": {
"label": "Area blank 2 (dunams)",
"description": "Area of the place's third blank area section in dunams.",
"type": "number"
},
"area_blank2_acre": {
"label": "Area blank 2 (acres)",
"description": "Area of the place's third blank area section in acres.",
"type": "number"
},
"area_note": {
"label": "Area footnotes",
"description": "A place for additional information such as the name of the source.",
"type": "content",
"example": "<ref name=\"CenPopGazetteer2016\">{{cite web|title=2016 U.S. Gazetteer Files|url=https://www2.census.gov/geo/docs/maps-data/data/gazetteer/2016_Gazetteer/2016_gaz_place_42.txt|publisher=United States Census Bureau|access-date=August 13, 2017}}</ref>"
},
"dimensions_footnotes": {
"label": "Dimensions footnotes",
"description": "Reference(s) for dimensions. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"length_km": {
"label": "Length in km",
"description": "Raw number entered in kilometers. Will automatically convert to display length in miles if 'length_mi' is empty.",
"type": "number"
},
"length_mi": {
"label": "Length in miles",
"description": "Raw number entered in miles. Will automatically convert to display length in kilometers if 'length_km' is empty.",
"type": "number"
},
"width_km": {
"label": "Width in kilometers",
"description": "Raw number entered in kilometers. Will automatically convert to display width in miles if 'length_mi' is empty.",
"type": "number"
},
"width_mi": {
"label": "Width in miles",
"description": "Raw number entered in miles. Will automatically convert to display width in kilometers if 'length_km' is empty.",
"type": "number"
},
"elevation_m": {
"label": "Elevation in meters",
"description": "Raw number entered in meters. Will automatically convert to display elevation in feet if 'elevation_ft' is empty. However, if a range in elevation (i.e. 5–50 m) is desired, use the 'max' and 'min' fields below.",
"type": "number"
},
"elevation_ft": {
"label": "Elevation in feet",
"description": "Raw number, entered in feet. Will automatically convert to display the average elevation in meters if 'elevation_m' field is empty. However, if a range in elevation (i.e. 50–500 ft) is desired, use the 'max' and 'min' fields below.",
"type": "number"
},
"elevation_footnotes": {
"label": "Elevation footnotes",
"description": "Reference(s) for elevation. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"elevation_min_point": {
"type": "line",
"label": "Point of min elevation",
"description": "The name of the point of lowest elevation in the place.",
"example": "[[Death Valley]]"
},
"elevation_min_m": {
"label": "Minimum elevation (m)",
"type": "number",
"description": "The minimum elevation in meters."
},
"elevation_min_ft": {
"label": "Minimum elevation (ft)",
"type": "number",
"description": "The minimum elevation in feet."
},
"elevation_min_rank": {
"type": "line",
"label": "Minimum elevation rank",
"description": "The point of minimum elevation's rank in the parent region.",
"example": "1st"
},
"elevation_min_footnotes": {
"label": "Min elevation footnotes",
"type": "content",
"description": "Footnotes or citations for the minimum elevation."
},
"elevation_max_point": {
"type": "line",
"label": "Point of max elevation",
"description": "The name of the point of highest elevation in the place.",
"example": "[[Mount Everest]]"
},
"elevation_max_m": {
"label": "Maximum elevation (m)",
"type": "number",
"description": "The maximum elevation in meters."
},
"elevation_max_ft": {
"label": "Maximum elevation (ft)",
"type": "number",
"description": "The maximum elevation in feet."
},
"elevation_max_rank": {
"type": "line",
"label": "Maximum elevation rank",
"description": "The point of maximum elevation's rank in the parent region.",
"example": "2nd"
},
"elevation_max_footnotes": {
"label": "Max elevation footnotes",
"type": "content",
"description": "Footnotes or citations for the maximum elevation."
},
"population_total": {
"label": "Population total",
"description": "Actual population (see below for estimates) preferably consisting of digits only (without any commas).",
"type": "number"
},
"population_as_of": {
"label": "Population total figure's year",
"description": "The year for the population total (usually a census year).",
"type": "number"
},
"population_footnotes": {
"label": "Population footnotes",
"description": "Reference(s) for population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_km2": {
"label": "Population density (per square km)",
"type": "string",
"description": "The place's population density per square kilometer.",
"example": "auto"
},
"population_density_sq_mi": {
"label": "Population density (per square mi)",
"type": "string",
"description": "The place's population density per square mile.",
"example": "auto"
},
"population_est": {
"label": "Population estimate",
"description": "Population estimate, e.g. for growth projections 4 years after a census.",
"type": "number",
"example": "331000000"
},
"pop_est_as_of": {
"label": "Population estimate figure as of",
"description": "The year, or the month and year, of the population estimate.",
"type": "date"
},
"pop_est_footnotes": {
"label": "Population estimate footnotes",
"description": "Reference(s) for population estimate; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content",
"example": "<ref name=\"USCensusEst2016\"/>"
},
"population_urban": {
"label": "Urban population",
"type": "number",
"description": "The place's urban population."
},
"population_urban_footnotes": {
"label": "Urban population footnotes",
"description": "Reference(s) for urban population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_urban_km2": {
"label": "Urban population density (per square km)",
"type": "string",
"description": "The place's urban population density per square kilometer.",
"example": "auto"
},
"population_density_urban_sq_mi": {
"label": "Urban population density (per square mi)",
"type": "string",
"description": "The place's urban population density per square mile.",
"example": "auto"
},
"population_rural": {
"label": "Rural population",
"type": "number",
"description": "The place's rural population."
},
"population_rural_footnotes": {
"label": "Rural population footnotes",
"description": "Reference(s) for rural population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_rural_km2": {
"label": "Rural population density per sq. km",
"type": "line",
"description": "The place's rural population density per square kilometer.",
"example": "auto"
},
"population_density_rural_sq_mi": {
"label": "Rural population density per sq. mi",
"type": "line",
"description": "The place's rural population density per square mile.",
"example": "auto"
},
"population_metro": {
"label": "Metropolitan area population",
"type": "number",
"description": "Population of the place's metropolitan area."
},
"population_metro_footnotes": {
"label": "Metropolitan area population footnotes",
"description": "Reference(s) for metro population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "string"
},
"population_density_metro_km2": {
"label": "Metropolitan population density per sq. km",
"type": "number",
"description": "The place's metropolitan area's population density per square kilometer.",
"example": "auto"
},
"population_density_metro_sq_mi": {
"label": "Metropolitan population density per sq. mi",
"type": "number",
"description": "The place's metropolitan area's population density per square mile.",
"example": "auto"
},
"population_rank": {
"label": "Population rank",
"description": "The settlement's population, as ranked within its parent sub-division.",
"type": "string"
},
"population_density_rank": {
"label": "Population density rank",
"description": "The settlement's population density, as ranked within its parent sub-division.",
"type": "string"
},
"population_blank1_title": {
"label": "Custom population type 1 title",
"description": "Can be used for estimates. For an example, see Windsor, Ontario.",
"type": "string",
"example": "See: [[Windsor, Ontario]]"
},
"population_blank1": {
"label": "Custom population type 1",
"description": "The population value for 'blank1_title'.",
"type": "string"
},
"population_density_blank1_km2": {
"label": "Custom population type 1 density per sq. km",
"type": "string",
"description": "Population density per square kilometer, according to the 1st custom population type."
},
"population_density_blank1_sq_mi": {
"label": "Custom population type 1 density per sq. mi",
"type": "string",
"description": "Population density per square mile, according to the 1st custom population type."
},
"population_blank2_title": {
"label": "Custom population type 2 title",
"description": "Can be used for estimates. For an example, see Windsor, Ontario.",
"type": "string",
"example": "See: [[Windsor, Ontario]]"
},
"population_blank2": {
"label": "Custom population type 2",
"description": "The population value for 'blank2_title'.",
"type": "string"
},
"population_density_blank2_km2": {
"label": "Custom population type 2 density per sq. km",
"type": "string",
"description": "Population density per square kilometer, according to the 2nd custom population type."
},
"population_density_blank2_sq_mi": {
"label": "Custom population type 2 density per sq. mi",
"type": "string",
"description": "Population density per square mile, according to the 2nd custom population type."
},
"population_demonym": {
"label": "Demonym",
"description": "A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example, a citizen in Liverpool is known as a Liverpudlian.",
"type": "line",
"example": "Liverpudlian"
},
"population_note": {
"label": "Population note",
"description": "A place for additional information such as the name of the source. See Windsor, Ontario, for an example.",
"type": "content"
},
"demographics_type1": {
"label": "Demographics type 1",
"description": "A sub-section header.",
"type": "string",
"example": "Ethnicities"
},
"demographics1_footnotes": {
"label": "Demographics section 1 footnotes",
"description": "Reference(s) for demographics section 1. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"demographics1_title1": {
"label": "Demographics section 1 title 1",
"description": "Titles related to demographics_type1. For example: 'White', 'Black', 'Hispanic'... Additional rows 'demographics1_title1' to 'demographics1_title5' are also available.",
"type": "string"
},
"demographics_type2": {
"label": "Demographics type 2",
"description": "A second sub-section header.",
"type": "line",
"example": "Languages"
},
"demographics2_footnotes": {
"label": "Demographics section 2 footnotes",
"description": "Reference(s) for demographics section 2. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"demographics2_title1": {
"label": "Demographics section 2 title 1",
"description": "Titles related to 'demographics_type1'. For example: 'English', 'French', 'Arabic'... Additional rows 'demographics2_title2' to 'demographics1_title5' are also available.",
"type": "string"
},
"demographics2_info1": {
"label": "Demographics section 2 info 1",
"description": "Information related to the titles. For example: '50%', '25%', '10%'... Additional rows 'demographics2_info2' to 'demographics2_info5' are also available.",
"type": "content"
},
"timezone1": {
"label": "Timezone 1",
"type": "string",
"description": "The place's primary time-zone.",
"example": "[[Eastern Standard Time]]"
},
"utc_offset": {
"label": "UTC offset",
"type": "string",
"description": "The place's time-zone's offset from UTC.",
"example": "+8"
},
"timezone_DST": {
"label": "Timezone during DST",
"type": "string",
"description": "The place's time-zone during daylight savings time, if applicable.",
"example": "[[Eastern Daylight Time]]"
},
"utc_offset_DST": {
"label": "UTC offset during DST",
"type": "string",
"description": "The place's time-zone's UTC offset during daylight savings time, if applicable.",
"example": "+9"
},
"utc_offset1": {
"label": "UTC offset 1",
"type": "string",
"description": "The place's primary time-zone's offset from UTC.",
"example": "-5"
},
"timezone1_DST": {
"label": "Timezone 1 (during DST)",
"type": "string",
"description": "The place's primary time-zone during daylight savings time, if applicable.",
"example": "[[Eastern Daylight Time]]"
},
"utc_offset1_DST": {
"label": "UTC offset 1 (during DST)",
"type": "string",
"description": "The place's primary time-zone's UTC offset during daylight savings time, if applicable.",
"example": "-6"
},
"timezone2": {
"label": "Timezone 2",
"description": "A second timezone field for larger areas such as a province.",
"type": "string",
"example": "[[Central Standard Time]]"
},
"utc_offset2": {
"label": "UTC offset 2",
"type": "string",
"description": "The place's secondary time-zone's offset from UTC.",
"example": "-6"
},
"timezone2_DST": {
"label": "Timezone 2 during DST",
"type": "string",
"description": "The place's secondary time-zone during daylight savings time, if applicable.",
"example": "[[Central Daylight Time]]"
},
"utc_offset2_DST": {
"label": "UTC offset 2 during DST",
"type": "string",
"description": "The place's secondary time-zone's offset from UTC during daylight savings time, if applicable.",
"example": "-7"
},
"postal_code_type": {
"label": "Postal code type",
"description": "Label used for postal code info, e.g. 'ZIP Code'. Defaults to 'Postal code'.",
"example": "[[Postal code of China|Postal code]]",
"type": "string"
},
"postal_code": {
"label": "Postal code",
"description": "The place's postal code/zip code.",
"type": "string",
"example": "90210"
},
"postal2_code_type": {
"label": "Postal code 2 type",
"type": "string",
"description": "If applicable, the place's second postal code type."
},
"postal2_code": {
"label": "Postal code 2",
"type": "string",
"description": "A second postal code of the place, if applicable.",
"example": "90007"
},
"area_code": {
"label": "Area code",
"description": "The regions' telephone area code.",
"type": "string"
},
"area_code_type": {
"label": "Area code type",
"description": "If left blank/not used, template will default to 'Area code(s)'.",
"type": "string"
},
"geocode": {
"label": "Geocode",
"description": "See [[Geocode]].",
"type": "string"
},
"iso_code": {
"label": "ISO 3166 code",
"description": "See ISO 3166.",
"type": "string"
},
"registration_plate": {
"label": "Registration/license plate info",
"description": "See Vehicle registration plate.",
"type": "string"
},
"blank_name_sec1": {
"label": "Blank name section 1",
"description": "Fields used to display other information. The name is displayed in bold on the left side of the infobox.",
"type": "string"
},
"blank_info_sec1": {
"label": "Blank info section 1",
"description": "The information associated with the 'blank_name_sec1' heading. The info is displayed on the right side of the infobox in the same row as the name. For an example, see [[Warsaw]].",
"type": "content"
},
"blank1_name_sec1": {
"label": "Blank 1 name section 1",
"description": "Up to 7 additional fields 'blank1_name_sec1' ... 'blank7_name_sec1' can be specified.",
"type": "string"
},
"blank1_info_sec1": {
"label": "Blank 1 info section 1",
"description": "Up to 7 additional fields 'blank1_info_sec1' ... 'blank7_info_sec1' can be specified.",
"type": "content"
},
"blank_name_sec2": {
"label": "Blank name section 2",
"description": "For a second section of blank fields.",
"type": "string"
},
"blank_info_sec2": {
"label": "Blank info section 2",
"example": "Beijing",
"type": "content",
"description": "The information associated with the 'blank_name_sec2' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see [[Warsaw]]."
},
"blank1_name_sec2": {
"label": "Blank 1 name section 2",
"description": "Up to 7 additional fields 'blank1_name_sec2' ... 'blank7_name_sec2' can be specified.",
"type": "string"
},
"blank1_info_sec2": {
"label": "Blank 1 info section 2",
"description": "Up to 7 additional fields 'blank1_info_sec2' ... 'blank7_info_sec2' can be specified.",
"type": "content"
},
"website": {
"label": "Official website in English",
"description": "External link to official website. Use the {{URL}} template, thus: {{URL|example.com}}.",
"type": "string"
},
"footnotes": {
"label": "Footnotes",
"description": "Text to be displayed at the bottom of the infobox.",
"type": "content"
},
"translit_lang1_info1": {
"label": "Language 1 first transcription ",
"description": "Transcription of type 1 in the first other language.",
"example": "{{lang|zh|森美兰}}",
"type": "line"
},
"translit_lang1_type1": {
"label": "Language 1 first transcription type",
"description": "Type of transcription used in the first language's first transcription.",
"example": "[[Chinese Language|Chinese]]",
"type": "line"
},
"translit_lang1_info2": {
"label": "Language 1 second transcription ",
"description": "Transcription of type 1 in the first other language.",
"example": "{{lang|ta|நெகிரி செம்பிலான்}}",
"type": "line"
},
"translit_lang1_type2": {
"label": "Language 1 second transcription type",
"description": "Type of transcription used in the first language's first transcription.",
"example": "[[Tamil Language|Tamil]]",
"type": "line"
},
"demographics1_info1": {
"label": "Demographics section 1 info 1",
"description": "Information related to the titles. For example: '50%', '25%', '10%'... Additional rows 'demographics1_info1' to 'demographics1_info5' are also available.",
"type": "content"
}
}
}
</templatedata>
{{collapse bottom}}
==Calls and redirects ==
At least {{PAGESINCATEGORY:Templates calling Infobox settlement}} other [[:Category:Templates calling Infobox settlement|templates call this one]].
[{{fullurl:Special:WhatLinksHere/Template:Infobox_settlement|namespace=10&hidetrans=1&hidelinks=1}} Several templates redirect here].
== Tracking categories ==
# {{clc|Pages using infobox settlement with a dot map}}
# {{clc|Pages using infobox settlement with bad settlement type}}
# {{clc|Pages using infobox settlement with image map1 but not image map}}
# {{clc|Pages using infobox settlement with imprecise region codes}}
# {{clc|Pages using infobox settlement with missing country}}
# {{clc|Pages using infobox settlement with no map}}
# {{clc|Pages using infobox settlement with no coordinates}}
# {{clc|Pages using infobox settlement with possible area code list}}
# {{clc|Pages using infobox settlement with possible demonym list}}
# {{clc|Pages using infobox settlement with possible motto list}}
# {{clc|Pages using infobox settlement with possible nickname list}}
# {{clc|Pages using infobox settlement with the wikidata parameter}}
# {{clc|Pages using infobox settlement with unknown parameters}}
# {{clc|Pages using infobox settlement with conflicting parameters}}
# {{clc|Pages using infobox settlement with ignored type}}
# {{clc|Templates calling Infobox settlement}}
<includeonly>{{Sandbox other||
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Place infobox templates|Settlement]]
[[Category:Embeddable templates]]
[[Category:Infobox templates using Wikidata]]
[[Category:Templates that add a tracking category]]
}}</includeonly>
d26ab36ad94fd5e58039aee02d998fb73bb508e8
580
571
2023-10-17T20:45:25Z
LamayII
2
wikitext
text/x-wiki
{{Documentation subpage}}
<!--Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[Wikipedia:Wikidata]])-->
{{Auto short description}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Coordinates|Module:Check for unknown parameters|Module:Settlement short description}}
{{Uses TemplateStyles|Template:Infobox settlement/styles.css}}
{{Uses Wikidata|P41|P94|P158|P625|P856}}
This template should be used to produce an [[WP:Infobox|Infobox]] for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, et cetera—in fact, any subdivision below the level of a country, for which {{tl|Infobox country}} should be used. Parameters are described in the table below. For questions, see the [[Template talk:Infobox settlement|talk page]]. For a US city guideline, see [[WP:USCITIES]].
The template is aliased or used as a sub-template for several infobox front-end templates.
==Usage==
* '''Important''': Please enter all numeric values in a raw, unformatted fashion. References and {{tl|citation needed}} tags are to be included in their respective section footnotes field. Numeric values that are not "raw" may create an "Expression error". Raw values will be automatically formatted by the template. If you find a raw value is not formatted in your usage of the template, please post a notice on the discussion page for this template.
* An expression error may also occur when any coordinate parameter has a value, but one or more coordinate parameters are blank or invalid.
Basic blank template, ready to cut and paste. See the next section for a copy of the template with all parameters and comments. See the table below that for a full description of each parameter.
===Using metric units===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name = <!-- Settlement name in local language(s), if different from the English name -->
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|image_flag =
|flag_alt =
|image_seal =
|seal_alt =
|image_shield =
|shield_alt =
|etymology =
|nickname =
|motto =
|image_map =
|map_alt =
|map_caption =
|pushpin_map =
|pushpin_map_alt =
|pushpin_map_caption =
|pushpin_mapsize =
|pushpin_label_position =
|coordinates = <!-- {{coord|latitude|longitude|type:city|display=inline,title}} -->
|coor_pinpoint =
|coordinates_footnotes =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|subdivision_type3 =
|subdivision_name3 =
|established_title =
|established_date =
|founder =
|seat_type =
|seat =
|government_footnotes =
|government_type =
|governing_body =
|leader_party =
|leader_title =
|leader_name =
|leader_title1 =
|leader_name1 =
|leader_title2 =
|leader_name2 =
|leader_title3 =
|leader_name3 =
|leader_title4 =
|leader_name4 =
|unit_pref = Metric
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
|area_footnotes =
|area_urban_footnotes = <!-- <ref> </ref> -->
|area_rural_footnotes = <!-- <ref> </ref> -->
|area_metro_footnotes = <!-- <ref> </ref> -->
|area_note =
|area_water_percent =
|area_rank =
|area_blank1_title =
|area_blank2_title =
<!-- square kilometers -->
|area_total_km2 =
|area_land_km2 =
|area_water_km2 =
|area_urban_km2 =
|area_rural_km2 =
|area_metro_km2 =
|area_blank1_km2 =
|area_blank2_km2 =
<!-- hectares -->
|area_total_ha =
|area_land_ha =
|area_water_ha =
|area_urban_ha =
|area_rural_ha =
|area_metro_ha =
|area_blank1_ha =
|area_blank2_ha =
|length_km =
|width_km =
|dimensions_footnotes =
|elevation_footnotes =
|elevation_m =
|population_footnotes =
|population_as_of =
|population_total =
|population_density_km2 = auto
|population_note =
|population_demonym =
|timezone1 =
|utc_offset1 =
|timezone1_DST =
|utc_offset1_DST =
|postal_code_type =
|postal_code =
|area_code_type =
|area_code =
|area_codes = <!-- for multiple area codes -->
|iso_code =
|website = <!-- {{URL|example.com}} -->
|module =
|footnotes =
}}
</syntaxhighlight>
===Using non-metric units===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name =
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|image_flag =
|flag_alt =
|image_seal =
|seal_alt =
|image_shield =
|shield_alt =
|etymology =
|nickname =
|motto =
|image_map =
|map_alt =
|map_caption =
|pushpin_map =
|pushpin_map_alt =
|pushpin_map_caption =
|pushpin_label_position =
|coordinates = <!-- {{coord|latitude|longitude|type:city|display=inline,title}} -->
|coor_pinpoint =
|coordinates_footnotes =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|subdivision_type3 =
|subdivision_name3 =
|established_title =
|established_date =
|founder =
|seat_type =
|seat =
|government_footnotes =
|leader_party =
|leader_title =
|leader_name =
|unit_pref = US<!-- or UK -->
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
|area_footnotes =
|area_urban_footnotes = <!-- <ref> </ref> -->
|area_rural_footnotes = <!-- <ref> </ref> -->
|area_metro_footnotes = <!-- <ref> </ref> -->
|area_note =
|area_water_percent =
|area_rank =
|area_blank1_title =
|area_blank2_title =
<!-- square miles -->
|area_total_sq_mi =
|area_land_sq_mi =
|area_water_sq_mi =
|area_urban_sq_mi =
|area_rural_sq_mi =
|area_metro_sq_mi =
|area_blank1_sq_mi =
|area_blank2_sq_mi =
<!-- acres -->
|area_total_acre =
|area_land_acre =
|area_water_acre =
|area_urban_acre =
|area_rural_acre =
|area_metro_acre =
|area_blank1_acre =
|area_blank2_acre =
|length_mi =
|width_mi =
|dimensions_footnotes =
|elevation_footnotes =
|elevation_ft =
|population_footnotes =
|population_as_of =
|population_total =
|population_density_sq_mi = auto
|population_note =
|population_demonym =
|timezone1 =
|utc_offset1 =
|timezone1_DST =
|utc_offset1_DST =
|postal_code_type =
|postal_code =
|area_code_type =
|area_code =
|iso_code =
|website = <!-- {{URL|example.com}} -->
|module =
|footnotes =
}}
</syntaxhighlight>
===Short version===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name =
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|etymology =
|nickname =
|coordinates = <!-- {{Coord}} -->
|population_total =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|website = <!-- {{URL|example.com}} -->
}}
</syntaxhighlight>
===Complete empty syntax, with comments===
This copy of the template lists all parameters except for some of the repeating numbered parameters which are noted in the comments. Comments here should be brief; see the table below for full descriptions of each parameter.
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Infobox settlement
| name = <!-- at least one of the first two fields must be filled in -->
| official_name =
| native_name = <!-- if different from the English name -->
| native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| other_name =
| settlement_type = <!-- such as Town, Village, City, Borough etc. -->
<!-- transliteration(s) -->
| translit_lang1 =
| translit_lang1_type =
| translit_lang1_info =
| translit_lang1_type1 =
| translit_lang1_info1 =
| translit_lang1_type2 =
| translit_lang1_info2 = <!-- etc., up to translit_lang1_type6 / translit_lang1_info6 -->
| translit_lang2 =
| translit_lang2_type =
| translit_lang2_info =
| translit_lang2_type1 =
| translit_lang2_info1 =
| translit_lang2_type2 =
| translit_lang2_info2 = <!-- etc., up to translit_lang2_type6 / translit_lang2_info6 -->
<!-- images, nickname, motto -->
| image_skyline =
| imagesize =
| image_alt =
| image_caption =
| image_flag =
| flag_size =
| flag_alt =
| flag_border =
| flag_link =
| image_seal =
| seal_size =
| seal_alt =
| seal_link =
| seal_type =
| image_shield =
| shield_size =
| shield_alt =
| shield_link =
| image_blank_emblem =
| blank_emblem_type =
| blank_emblem_size =
| blank_emblem_alt =
| blank_emblem_link =
| etymology =
| nickname =
| nicknames =
| motto =
| mottoes =
| anthem =
<!-- maps and coordinates -->
| image_map =
| mapsize =
| map_alt =
| map_caption =
| image_map1 =
| mapsize1 =
| map_alt1 =
| map_caption1 =
| pushpin_map = <!-- name of a location map as per Template:Location_map -->
| pushpin_mapsize =
| pushpin_map_alt =
| pushpin_map_caption =
| pushpin_map_caption_notsmall =
| pushpin_label = <!-- only necessary if "name" or "official_name" are too long -->
| pushpin_label_position = <!-- position of the pushpin label: left, right, top, bottom, none -->
| pushpin_outside =
| pushpin_relief =
| pushpin_image =
| pushpin_overlay =
| coordinates = <!-- {{Coord}} -->
| coor_pinpoint = <!-- to specify exact location of coordinates (was coor_type) -->
| coordinates_footnotes = <!-- for references: use <ref> tags -->
| grid_name = <!-- name of a regional grid system -->
| grid_position = <!-- position on the regional grid system -->
<!-- location -->
| subdivision_type = Country
| subdivision_name = <!-- the name of the country -->
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 = <!-- etc., subdivision_type6 / subdivision_name6 -->
<!-- established -->
| established_title = <!-- Founded -->
| established_date = <!-- requires established_title= -->
| established_title1 = <!-- Incorporated (town) -->
| established_date1 = <!-- requires established_title1= -->
| established_title2 = <!-- Incorporated (city) -->
| established_date2 = <!-- requires established_title2= -->
| established_title3 =
| established_date3 = <!-- requires established_title3= -->
| established_title4 =
| established_date4 = <!-- requires established_title4= -->
| established_title5 =
| established_date5 = <!-- requires established_title5= -->
| established_title6 =
| established_date6 = <!-- requires established_title6= -->
| established_title7 =
| established_date7 = <!-- requires established_title7= -->
| extinct_title =
| extinct_date =
| founder =
| named_for =
<!-- seat, smaller parts -->
| seat_type = <!-- defaults to: Seat -->
| seat =
| seat1_type = <!-- defaults to: Former seat -->
| seat1 =
| parts_type = <!-- defaults to: Boroughs -->
| parts_style = <!-- list, coll (collapsed list), para (paragraph format) -->
| parts = <!-- parts text, or header for parts list -->
| p1 =
| p2 = <!-- etc., up to p50: for separate parts to be listed-->
<!-- government type, leaders -->
| government_footnotes = <!-- for references: use <ref> tags -->
| government_type =
| governing_body =
| leader_party =
| leader_title =
| leader_name = <!-- add &nbsp; (no-break space) to disable automatic links -->
| leader_title1 =
| leader_name1 = <!-- etc., up to leader_title4 / leader_name4 -->
<!-- display settings -->
| total_type = <!-- to set a non-standard label for total area and population rows -->
| unit_pref = <!-- enter: Imperial, to display imperial before metric -->
<!-- area -->
| area_footnotes = <!-- for references: use <ref> tags -->
| dunam_link = <!-- If dunams are used, this specifies which dunam to link. -->
| area_total_km2 = <!-- ALL fields with measurements have automatic unit conversion -->
| area_total_sq_mi = <!-- see table @ Template:Infobox settlement for details -->
| area_total_ha =
| area_total_acre =
| area_total_dunam = <!-- used in Middle East articles only -->
| area_land_km2 =
| area_land_sq_mi =
| area_land_ha =
| area_land_acre =
| area_land_dunam = <!-- used in Middle East articles only -->
| area_water_km2 =
| area_water_sq_mi =
| area_water_ha =
| area_water_acre =
| area_water_dunam = <!-- used in Middle East articles only -->
| area_water_percent =
| area_urban_footnotes = <!-- for references: use <ref> tags -->
| area_urban_km2 =
| area_urban_sq_mi =
| area_urban_ha =
| area_urban_acre =
| area_urban_dunam = <!-- used in Middle East articles only -->
| area_rural_footnotes = <!-- for references: use <ref> tags -->
| area_rural_km2 =
| area_rural_sq_mi =
| area_rural_ha =
| area_rural_acre =
| area_rural_dunam = <!-- used in Middle East articles only -->
| area_metro_footnotes = <!-- for references: use <ref> tags -->
| area_metro_km2 =
| area_metro_sq_mi =
| area_metro_ha =
| area_metro_acre =
| area_metro_dunam = <!-- used in Middle East articles only -->
| area_rank =
| area_blank1_title =
| area_blank1_km2 =
| area_blank1_sq_mi =
| area_blank1_ha =
| area_blank1_acre =
| area_blank1_dunam = <!-- used in Middle East articles only -->
| area_blank2_title =
| area_blank2_km2 =
| area_blank2_sq_mi =
| area_blank2_ha =
| area_blank2_acre =
| area_blank2_dunam = <!-- used in Middle East articles only -->
| area_note =
<!-- dimensions -->
| dimensions_footnotes = <!-- for references: use <ref> tags -->
| length_km =
| length_mi =
| width_km =
| width_mi =
<!-- elevation -->
| elevation_footnotes = <!-- for references: use <ref> tags -->
| elevation_m =
| elevation_ft =
| elevation_point = <!-- for denoting the measurement point -->
| elevation_max_footnotes = <!-- for references: use <ref> tags -->
| elevation_max_m =
| elevation_max_ft =
| elevation_max_point = <!-- for denoting the measurement point -->
| elevation_max_rank =
| elevation_min_footnotes = <!-- for references: use <ref> tags -->
| elevation_min_m =
| elevation_min_ft =
| elevation_min_point = <!-- for denoting the measurement point -->
| elevation_min_rank =
<!-- population -->
| population_footnotes = <!-- for references: use <ref> tags -->
| population_as_of =
| population_total =
| pop_est_footnotes =
| pop_est_as_of =
| population_est =
| population_rank =
| population_density_km2 = <!-- for automatic calculation of any density field, use: auto -->
| population_density_sq_mi =
| population_urban_footnotes =
| population_urban =
| population_density_urban_km2 =
| population_density_urban_sq_mi =
| population_rural_footnotes =
| population_rural =
| population_density_rural_km2 =
| population_density_rural_sq_mi =
| population_metro_footnotes =
| population_metro =
| population_density_metro_km2 =
| population_density_metro_sq_mi =
| population_density_rank =
| population_blank1_title =
| population_blank1 =
| population_density_blank1_km2 =
| population_density_blank1_sq_mi =
| population_blank2_title =
| population_blank2 =
| population_density_blank2_km2 =
| population_density_blank2_sq_mi =
| population_demonym = <!-- demonym, e.g. Liverpudlian for someone from Liverpool -->
| population_demonyms =
| population_note =
<!-- demographics (section 1) -->
| demographics_type1 =
| demographics1_footnotes = <!-- for references: use <ref> tags -->
| demographics1_title1 =
| demographics1_info1 = <!-- etc., up to demographics1_title7 / demographics1_info7 -->
<!-- demographics (section 2) -->
| demographics_type2 =
| demographics2_footnotes = <!-- for references: use <ref> tags -->
| demographics2_title1 =
| demographics2_info1 = <!-- etc., up to demographics2_title10 / demographics2_info10 -->
<!-- time zone(s) -->
| timezone_link =
| timezone1_location =
| timezone1 =
| utc_offset1 =
| timezone1_DST =
| utc_offset1_DST =
| timezone2_location =
| timezone2 =
| utc_offset2 =
| timezone2_DST =
| utc_offset2_DST =
| timezone3_location =
| timezone3 =
| utc_offset3 =
| timezone3_DST =
| utc_offset3_DST =
| timezone4_location =
| timezone4 =
| utc_offset4 =
| timezone4_DST =
| utc_offset4_DST =
| timezone5_location =
| timezone5 =
| utc_offset5 =
| timezone5_DST =
| utc_offset5_DST =
<!-- postal codes, area code -->
| postal_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal_code =
| postal2_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal2_code =
| area_code_type = <!-- defaults to: Area code(s) -->
| area_code =
| area_codes =
| geocode =
| iso_code =
| registration_plate_type =
| registration_plate =
| code1_name =
| code1_info =
| code2_name =
| code2_info =
<!-- blank fields (section 1) -->
| blank_name_sec1 =
| blank_info_sec1 =
| blank1_name_sec1 =
| blank1_info_sec1 =
| blank2_name_sec1 =
| blank2_info_sec1 = <!-- etc., up to blank7_name_sec1 / blank7_info_sec1 -->
<!-- blank fields (section 2) -->
| blank_name_sec2 =
| blank_info_sec2 =
| blank1_name_sec2 =
| blank1_info_sec2 =
| blank2_name_sec2 =
| blank2_info_sec2 = <!-- etc., up to blank7_name_sec2 / blank7_info_sec2 -->
<!-- website, footnotes -->
| website = <!-- {{URL|example.com}} -->
| module =
| footnotes =
}}
</syntaxhighlight>
==Parameter names and descriptions==
{| class="wikitable" style="background: white"
| colspan=3 style="background: orange; text-align: center;" |
===Name and transliteration===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
| '''name''' || optional || This is the usual name in English. If it's not specified, the infobox will use the '''official_name''' as a title unless this too is missing, in which case the page name will be used.
|- style="vertical-align:top;"
| '''official_name''' || optional || The official name in English. Avoid using '''official_name''' if it leads to redundancy with '''name''' and '''settlement_type'''. Use '''official_name''' if the official name is unusual or cannot be simply deduced from the name and settlement type.
|- style="vertical-align:top;"
| '''native_name''' || optional || Name in the local language, if different from '''name''', and if not English. In this case "native" does not mean indigenous but is related to de facto language that is not English. This will display below the name/official name.
|- style="vertical-align:top;"
| '''native_name_lang''' || optional || Use [[List of ISO 639-1 codes|ISO 639-1 code]], e.g. "fr" for French. If there is more than one native name, in different languages, enter those names using {{tl|lang}}, instead.
|- style="vertical-align:top;"
| '''other_name''' || optional || For places with a former or more common name like Bombay or Saigon
|- style="vertical-align:top;"
| '''settlement_type''' || optional || Any type can be entered, such as City, Town, Village, Hamlet, Municipality, Reservation, etc. If set, will be displayed under the names. Might also be used as a label for total population/area (defaulting to ''City''), if needed to distinguish from ''Urban'', ''Rural'' or ''Metro'' (if urban, rural or metro figures are not present, the label is ''Total'' unless '''total_type''' is set).
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Transliteration(s)
|- style="vertical-align:top;"
| '''translit_lang1''' || optional || Will place the "entry" before the word "transliteration(s)". Can be used to specify a particular language like in [[Dêlêg]] or one may just enter "Other", like in [[Gaza City|Gaza]]'s article.
|- style="vertical-align:top;"
| '''translit_lang1_type'''<br />'''translit_lang1_type1'''<br />to<br />'''translit_lang1_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang1_info'''<br />'''translit_lang1_info1'''<br />to<br />'''translit_lang1_info6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2''' || optional || Will place a second transliteration. See [[Dêlêg]]
|- style="vertical-align:top;"
| '''translit_lang2_type'''<br />'''translit_lang2_type1'''<br />to<br />'''translit_lang2_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2_info'''<br />'''translit_lang2_info1'''<br />to<br />'''translit_lang2_info6''' || optional ||
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Images, nickname, motto===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Image
|- style="vertical-align:top;"
| '''image_skyline''' || optional || Primary image representing the settlement. Commonly a photo of the settlement’s skyline.
|- style="vertical-align:top;"
| '''imagesize''' || optional || Can be used to tweak the size of the image_skyline up or down. This can be helpful if an editor wants to make the infobox wider. If used, '''px''' must be specified; default size is 250px.
|- style="vertical-align:top;"
| '''image_alt''' || optional || [[Alt text]] for the image, used by visually impaired readers who cannot see the image. See [[WP:ALT]].
|- style="vertical-align:top;"
| '''image_caption''' || optional || Will place a caption under the image_skyline (if present)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Flag image
|- style="vertical-align:top;"
| '''image_flag''' || optional || Used for a flag.
|- style="vertical-align:top;"
| '''flag_size''' || optional || Can be used to tweak the size of the image_flag up or down from 100px as desired. If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''flag_alt''' || optional || Alt text for the flag.
|- style="vertical-align:top;"
| '''flag_border''' || optional || Set to 'no' to remove the border from the flag
|- style="vertical-align:top;"
| '''flag_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seal image
|- style="vertical-align:top;"
| '''image_seal''' || optional || If the place has an official seal.
|- style="vertical-align:top;"
| '''seal_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''seal_alt''' || optional || Alt text for the seal.
|- style="vertical-align:top;"
| '''seal_link'''<br />'''seal_type''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Coat of arms image
|- style="vertical-align:top;"
| '''image_shield''' || optional || Can be used for a place with a coat of arms.
|- style="vertical-align:top;"
| '''shield_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''shield_alt''' || optional || Alt text for the shield.
|- style="vertical-align:top;"
| '''shield_link''' || optional || Can be used if a wiki article if known but is not automatically linked by the template. See [[Coquitlam, British Columbia]]'s infobox for an example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Logo or emblem image
|- style="vertical-align:top;"
| '''image_blank_emblem''' || optional || Can be used if a place has an official logo, crest, emblem, etc.
|- style="vertical-align:top;"
| '''blank_emblem_type''' || optional || Caption beneath "image_blank_emblem" to specify what type of emblem it is.
|- style="vertical-align:top;"
| '''blank_emblem_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''blank_emblem_alt''' || optional || Alt text for blank emblem.
|- style="vertical-align:top;"
| '''blank_emblem_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Nickname, motto
|- style="vertical-align:top;"
| '''etymology''' || optional || origin of name
|- style="vertical-align:top;"
| '''nickname''' || optional || well-known nickname
|- style="vertical-align:top;"
| '''nicknames''' || optional || if more than one well-known nickname, use this
|- style="vertical-align:top;"
| '''motto''' || optional || Will place the motto under the nicknames
|- style="vertical-align:top;"
| '''mottoes''' || optional || if more than one motto, use this
|- style="vertical-align:top;"
| '''anthem''' || optional || Will place the anthem (song) under the nicknames
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Maps, coordinates===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Map images
|- style="vertical-align:top;"
| '''image_map''' || optional ||
|- style="vertical-align:top;"
| '''mapsize''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt''' || optional || Alt text for map.
|- style="vertical-align:top;"
| '''map_caption''' || optional ||
|- style="vertical-align:top;"
| '''image_map1''' || optional || A secondary map image. The field '''image_map''' must be filled in first. Example see: [[Bloomsburg, Pennsylvania]].
|- style="vertical-align:top;"
| '''mapsize1''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt1''' || optional || Alt text for secondary map.
|- style="vertical-align:top;"
| '''map_caption1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Pushpin map(s), coordinates
|- style="vertical-align:top;"
| '''pushpin_map''' || optional || The name of a location map as per [[Template:Location map]] (e.g. ''Indonesia'' or ''Russia''). The coordinate fields (from {{para|coordinates}}) position a pushpin coordinate marker and label on the map '''automatically'''. Example: [[Padang, Indonesia]]. To show multiple pushpin maps, provide a list of maps separated by #, e.g., ''California#USA''
|- style="vertical-align:top;"
| '''pushpin_mapsize''' || optional || Must be entered as only a number—'''do not use px'''. The default value is 250.<br/>''Equivalent to <code>width</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_alt''' || optional || Alt text for pushpin map; used by [[screen reader]]s, see [[WP:ALT]].<br/>''Equivalent to <code>alt</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_caption''' || optional || Fill out if a different caption from ''map_caption'' is desired.<br/>''Equivalent to <code>caption</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_caption_notsmall''' || optional || <!-- add documentation here -->
|- style="vertical-align:top;"
| '''pushpin_label''' || optional || The text of the label to display next to the identifying mark; a [[Wiki markup|wikilink]] can be used. If not specified, the label will be the text assigned to the ''name'' or ''official_name'' parameters (if {{para|pushpin_label_position|none}}, no label is displayed).<br/>''Equivalent to <code>label</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_label_position''' || optional || The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are {left, right, top, bottom, none}. If this field is not specified, the default value is ''right''.<br/>''Equivalent to <code>position</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_outside''' || optional || ''Equivalent to <code>outside</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_relief''' || optional || Set this to <code>y</code> or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available). <br/>''Equivalent to <code>relief</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_image''' || optional || Allows the use of an alternative map; the image must have the same edge coordinates as the location map template.<br/>''Equivalent to <code>AlternativeMap</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_overlay''' || optional || Can be used to specify an image to be superimposed on the regular pushpin map.<br/>''Equivalent to <code>overlay_image</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''coordinates''' || optional || Latitude and longitude. Use {{tl|Coord}}. See the documentation for {{tl|Coord}} for more details on usage.
|- style="vertical-align:top;"
| '''coor_pinpoint''' || optional || If needed, to specify more exactly where (or what) coordinates are given (e.g. ''Town Hall'') or a specific place in a larger area (e.g. a city in a county). Example: In the article [[Masovian Voivodeship]], <code>coor_pinpoint=Warsaw</code> specifies [[Warsaw]].
|- style="vertical-align:top;"
| '''coordinates_footnotes''' || optional || Reference(s) for coordinates, placed within <code><nowiki><ref> </ref></nowiki></code> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''grid_name'''<br />'''grid_position''' || optional || Name of a regional grid system and position on the regional grid
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Location, established, seat, subdivisions, government, leaders===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Location
|- style="vertical-align:top;"
| {{anchor|subdivision_type}}'''subdivision_type''' || optional || almost always <code><nowiki>Country</nowiki></code>
|- style="vertical-align:top;"
| '''subdivision_name''' || optional || Depends on the subdivision_type — use the name in text form, sample: <code>United States</code>. Per [[MOS:INFOBOXFLAG]], flag icons or flag templates may be used in this field
|- style="vertical-align:top;"
| '''subdivision_type1'''<br />to<br />'''subdivision_type6''' || optional || Can be State/Province, region, county. These labels are for subdivisions ''above'' the level of the settlement described in the article. For subdivisions ''below'' or ''within'' the place described in the article, use {{para|parts_type}}.
|- style="vertical-align:top;"
| '''subdivision_name1'''<br />to<br />'''subdivision_name6''' || optional || Use the name in text form, sample: <code>Florida</code> or <code><nowiki>[[Florida]]</nowiki></code>. Per [[MOS:INFOBOXFLAG]], flag icons or flag templates should '''not''' be used in these fields
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Established
|- style="vertical-align:top;"
| '''established_title''' || optional || Example: Founded
|- style="vertical-align:top;"
| '''established_date''' || optional || Requires established_title=
|- style="vertical-align:top;"
| '''established_title1''' || optional || Example: Incorporated (town) <br/>[Note that "established_title1" is distinct from "established_title"; you can think of "established_title" as behaving like "established_title0".]
|- style="vertical-align:top;"
| '''established_date1''' || optional || [See note for "established_title1".] Requires established_title1=
|- style="vertical-align:top;"
| '''established_title2''' || optional || Example: Incorporated (city)
|- style="vertical-align:top;"
| '''established_date2''' || optional || Requires established_title2=
|- style="vertical-align:top;"
| '''established_title3''' || optional ||
|- style="vertical-align:top;"
| '''established_date3''' || optional || Requires established_title3=
|- style="vertical-align:top;"
| '''established_title4''' || optional ||
|- style="vertical-align:top;"
| '''established_date4''' || optional || Requires established_title4=
|- style="vertical-align:top;"
| '''established_title5''' || optional ||
|- style="vertical-align:top;"
| '''established_date5''' || optional || Requires established_title5=
|- style="vertical-align:top;"
| '''established_title6''' || optional ||
|- style="vertical-align:top;"
| '''established_date6''' || optional || Requires established_title6=
|- style="vertical-align:top;"
| '''established_title7''' || optional ||
|- style="vertical-align:top;"
| '''established_date7''' || optional || Requires established_title7=
|- style="vertical-align:top;"
| '''extinct_title''' || optional || For when a settlement ceases to exist
|- style="vertical-align:top;"
| '''extinct_date''' || optional || Requires extinct_title=
|- style="vertical-align:top;"
| '''founder''' || optional || Who the settlement was founded by
|- style="vertical-align:top;"
| '''named_for''' || optional || The source of the name of the settlement (a person, a place, et cetera)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seat of government
|- style="vertical-align:top;"
| '''seat_type''' || optional || The label for the seat of government (defaults to ''Seat'').
|- style="vertical-align:top;"
| '''seat''' || optional || The seat of government.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Smaller parts (e.g. boroughs of a city)
|- style="vertical-align:top;"
| '''parts_type''' || optional || The label for the smaller subdivisions (defaults to ''Boroughs'').
|- style="vertical-align:top;"
| '''parts_style''' || optional || Set to ''list'' to display as a collapsible list, ''coll'' as a collapsed list, or ''para'' to use paragraph style. Default is ''list'' for up to 5 items, otherwise ''coll''.
|- style="vertical-align:top;"
| '''parts''' || optional || Text or header of the list of smaller subdivisions.
|- style="vertical-align:top;"
| '''p1'''<br />'''p2'''<br />to<br />'''p50''' || optional || The smaller subdivisions to be listed. Example: [[Warsaw]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Government type, leaders
|- style="vertical-align:top;"
| '''government_footnotes''' || optional || Reference(s) for government, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''government_type''' || optional || Examples: [[Mayor–council government]], [[Council–manager government]], [[City commission government]], ...
|- style="vertical-align:top;"
| '''governing_body''' || optional || Name of the place's governing body
|- style="vertical-align:top;"
| '''leader_party''' || optional || Political party of the place's leader
|- style="vertical-align:top;"
| '''leader_title''' || optional || First title of the place's leader, e.g. Mayor
|- style="vertical-align:top;"
| '''leader_name''' || optional || Name of the place's leader
|- style="vertical-align:top;"
| '''leader_title1'''<br />to<br />'''leader_title4''' || optional ||
|- style="vertical-align:top;"
| '''leader_name1'''<br />to<br />'''leader_name4''' || optional || For long lists use {{tl|Collapsible list}}. See [[Halifax Regional Municipality|Halifax]] for an example.
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Geographic information===
|- style="vertical-align:top;"
| colspan=3 | These fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they should enter both values in their respective fields.
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Display settings
|- style="vertical-align:top;"
| '''total_type''' || optional || Specifies what "total" area and population figure refer to, e.g. ''Greater London''. This overrides other labels for total population/area. To make the total area and population display on the same line as the words "Area" and "Population", with no "Total" or similar label, set the value of this parameter to '''&nbsp;'''.
|- style="vertical-align:top;"
| '''unit_pref''' || optional || To change the unit order to ''imperial (metric)'', enter '''imperial'''. The default display style is ''metric (imperial)''. However, the template will swap the order automatically if the '''subdivision_name''' equals some variation of the US or the UK.<br />For the middle east, a unit preference of [[dunam]] can be entered (only affects total area). <br /> All values must be entered in a '''raw format: no commas, spaces, or unit symbols'''. The template will format them automatically.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Area
|- style="vertical-align:top;"
| '''area_footnotes''' || optional || Reference(s) for area, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''dunam_link''' || optional || If dunams are used, the default is to link the word ''dunams'' in the total area section. This can be changed by setting <code>dunam_link</code> to another measure (e.g. <code>dunam_link=water</code>). Linking can also be turned off by setting the parameter to something else (e.g. <code>dunam_link=none</code> or <code>dunam_link=off</code>).
|- style="vertical-align:top;"
| '''area_total_km2''' || optional || Total area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_total_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_total_ha''' || optional || Total area in hectares—symbol: ha. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display acres if area_total_acre is empty.
|- style="vertical-align:top;"
| '''area_total_sq_mi''' || optional || Total area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_total_km2 is empty.
|- style="vertical-align:top;"
| '''area_total_acre''' || optional || Total area in acres. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display hectares if area_total_ha is empty.
|- style="vertical-align:top;"
| '''area_total_dunam''' || optional || Total area in dunams, which is wiki-linked. Used in middle eastern places like Israel, Gaza, and the West Bank. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers or hectares and square miles or acreds if area_total_km2, area_total_ha, area_total_sq_mi, and area_total_acre are empty. Examples: [[Gaza City|Gaza]] and [[Ramallah]]
|- style="vertical-align:top;"
| '''area_land_km2''' || optional || Land area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_land_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_land_sq_mi''' || optional || Land area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_land_km2 is empty.
|- style="vertical-align:top;"
| '''area_land_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_land_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_land_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_km2''' || optional || Water area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_water_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_water_sq_mi''' || optional || Water area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_water_km2 is empty.
|- style="vertical-align:top;"
| '''area_water_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_water_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_water_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_percent''' || optional || percent of water without the "%"
|- style="vertical-align:top;"
| '''area_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_urban_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_urban_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
|- style="vertical-align:top;"
| '''area_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_rural_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_rural_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_metro_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_metro_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_rank''' || optional || The settlement's area, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''area_blank1_title''' || optional || Example see London
|- style="vertical-align:top;"
| '''area_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank1_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank1_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank2_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank2_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_note''' || optional || A place for additional information such as the name of the source.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Dimensions
|- style="vertical-align:top;"
| '''dimensions_footnotes''' || optional || Reference(s) for dimensions, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''length_km''' || optional || Raw number entered in kilometers. Will automatically convert to display length in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''length_mi''' || optional || Raw number entered in miles. Will automatically convert to display length in kilometers if length_km is empty.
|- style="vertical-align:top;"
| '''width_km''' || optional || Raw number entered in kilometers. Will automatically convert to display width in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''width_mi''' || optional || Raw number entered in miles. Will automatically convert to display width in kilometers if length_km is empty.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Elevation
|- style="vertical-align:top;"
| '''elevation_footnotes''' || optional || Reference(s) for elevation, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''elevation_m''' || optional || Raw number entered in meters. Will automatically convert to display elevation in feet if elevation_ft is empty. However, if a range in elevation (i.e. 5–50 m ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_ft''' || optional || Raw number, entered in feet. Will automatically convert to display the average elevation in meters if '''elevation_m''' field is empty. However, if a range in elevation (e.g. 50–500 ft ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_max_footnotes'''<br />'''elevation_min_footnotes''' || optional || Same as above, but for the "max" and "min" elevations. See [[City of Leeds]].
|- style="vertical-align:top;"
| '''elevation_max_m'''<br />'''elevation_max_ft'''<br />'''elevation_max_rank'''<br />'''elevation_min_m'''<br />'''elevation_min_ft'''<br />'''elevation_min_rank''' || optional || Used to give highest & lowest elevations and rank, instead of just a single value. Example: [[Halifax Regional Municipality]].
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Population, demographics===
|- style="vertical-align:top;"
| colspan=3 | The density fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they can enter both values in their respective fields. '''To calculate density with respect to the total area automatically, type ''auto'' in place of any density value.'''
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Population
|- style="vertical-align:top;"
| '''population_total''' || optional || Actual population (see below for estimates) preferably consisting of digits only (without any commas)
|- style="vertical-align:top;"
| '''population_as_of''' || optional || The year for the population total (usually a census year)
|- style="vertical-align:top;"
| '''population_footnotes''' || optional || Reference(s) for population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_est''' || optional || Population estimate.
|- style="vertical-align:top;"
| '''pop_est_as_of''' || optional || The year or month & year of the population estimate
|- style="vertical-align:top;"
| '''pop_est_footnotes''' || optional || Reference(s) for population estimate, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_urban''' || optional ||
|- style="vertical-align:top;"
| '''population_urban_footnotes''' || optional || Reference(s) for urban population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rural''' || optional ||
|- style="vertical-align:top;"
| '''population_rural_footnotes''' || optional || Reference(s) for rural population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_metro''' || optional ||
|- style="vertical-align:top;"
| '''population_metro_footnotes''' || optional || Reference(s) for metro population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rank''' || optional || The settlement's population, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_density_rank''' || optional || The settlement's population density, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_blank1_title''' || optional || Can be used for estimates. Example: [[Windsor, Ontario]]
|- style="vertical-align:top;"
| '''population_blank1''' || optional || The population value for blank1_title
|- style="vertical-align:top;"
| '''population_density_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_demonym''' || optional || A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example, a citizen in [[Liverpool]] is known as a [[Liverpudlian]].
|- style="vertical-align:top;"
| '''population_demonyms''' || optional || If more than one demonym, use this
|- style="vertical-align:top;"
| '''population_note''' || optional || A place for additional information such as the name of the source. See [[Windsor, Ontario]] for example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 1)
|- style="vertical-align:top;"
| '''demographics_type1''' || optional || Section Header. For example: Ethnicity
|- style="vertical-align:top;"
| '''demographics1_footnotes''' || optional || Reference(s) for demographics section 1, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics1_title1'''<br />to<br />'''demographics1_title7''' || optional || Titles related to demographics_type1. For example: White, Black, Hispanic...
|- style="vertical-align:top;"
| '''demographics1_info1'''<br />to<br />'''demographics1_info7''' || optional || Information related to the "titles". For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 2)
|- style="vertical-align:top;"
| '''demographics_type2''' || optional || A second section header. For example: Languages
|- style="vertical-align:top;"
| '''demographics2_footnotes''' || optional || Reference(s) for demographics section 2, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics2_title1'''<br />to<br />'''demographics2_title10''' || optional || Titles related to '''demographics_type2'''. For example: English, French, Arabic...
|- style="vertical-align:top;"
| '''demographics2_info1'''<br />to<br />'''demographics2_info10''' || optional || Information related to the "titles" for type2. For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Other information===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Time zone(s)
|- style="vertical-align:top;"
| '''timezone1''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1''' || optional || Plain text, e.g. "+05:00" or "-08:00". Auto-linked, so do not include references or additional text.
|- style="vertical-align:top;"
| '''timezone1_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1_DST''' || optional ||
|- style="vertical-align:top;"
| '''timezone2''' || optional || A second timezone field for larger areas such as a Province.
|- style="vertical-align:top;"
| '''utc_offset2''' || optional ||
|- style="vertical-align:top;"
| '''timezone2_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset2_DST''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Postal code(s) & area code
|- style="vertical-align:top;"
| '''postal_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal_code''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code''' || optional ||
|- style="vertical-align:top;"
| '''area_code_type''' || optional || If left blank/not used template will default to "[[Telephone numbering plan|Area code(s)]]"
|- style="vertical-align:top;"
| '''area_code''' || optional || Refers to the telephone dialing code for the settlement, ''not'' a geographic area code.
|- style="vertical-align:top;"
| '''area_codes''' || optional || If more than one area code, use this
|- style="vertical-align:top;"
| '''geocode''' || optional || See [[Geocode]]
|- style="vertical-align:top;"
| '''iso_code''' || optional || See [[ISO 3166]]
|- style="vertical-align:top;"
| '''registration_plate_type''' || optional || If left blank/not used template will default to "[[Vehicle registration plate|Vehicle registration]]"
|- style="vertical-align:top;"
| '''registration_plate''' || optional || See [[Vehicle registration plate]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 1)
|- style="vertical-align:top;"
| '''blank_name_sec1''' || optional || Fields used to display other information. The name is displayed in bold on the left side of the infobox.
|- style="vertical-align:top;"
| '''blank_info_sec1''' || optional || The information associated with the ''blank_name'' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see: [[Warsaw]]
|- style="vertical-align:top;"
| '''blank1_name_sec1'''<br />to<br />'''blank7_name_sec1''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec1'''<br />to<br />'''blank7_info_sec1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 2)
|- style="vertical-align:top;"
| '''blank_name_sec2''' || optional || For a second section of blank fields
|- style="vertical-align:top;"
| '''blank_info_sec2''' || optional || Example: [[Beijing]]
|- style="vertical-align:top;"
| '''blank1_name_sec2'''<br />to<br />'''blank7_name_sec2''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec2'''<br />to<br />'''blank7_info_sec2''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Website, footnotes
|- style="vertical-align:top;"
| '''website''' || optional || External link to official website, Use {{Tl|URL}}, thus: <nowiki>{{URL|example.com}}</nowiki>
|- style="vertical-align:top;"
| '''module''' || optional || To embed infoboxes at the bottom of the infobox
|- style="vertical-align:top;"
| '''footnotes''' || optional || Text to be displayed at the bottom of the infobox
|- style="vertical-align:top;"
| '''short_description''' || optional || [[WP:SHORTDESC|specify custom short description]]; if not specified, one will be automatically generated, e.g. "Place in Israel".
|}
<!-- End of parameter name/description table -->
# {{tl|Infobox settlement/densdisp}}
# {{tl|Infobox settlement/dunam}}
# {{tl|Infobox settlement/dunam/mag}}
# {{tl|Infobox settlement/impus}}
# {{tl|Infobox settlement/impus/mag}}
# {{tl|Infobox settlement/lengthdisp}}
# {{tl|Infobox settlement/link}}
# {{tl|Infobox settlement/metric}}
# {{tl|Infobox settlement/metric/mag}}
# {{tl|Infobox settlement/pref}}
==Microformat==
{{UF-hcard-geo}}
== TemplateData ==
{{TemplateData header}}
{{collapse top|title=TemplateData}}
<templatedata>
{
"description": "Infobox for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, etc.",
"format": "{{_\n| __________________ = _\n}}\n",
"params": {
"name": {
"label": "Common name",
"description": "This is the usual name in English. If it's not specified, the infobox will use the 'official_name' as a title unless this too is missing, in which case the page name will be used.",
"type": "string",
"suggested": true
},
"official_name": {
"label": "Official name",
"description": "The official name in English, if different from 'name'.",
"type": "string",
"suggested": true
},
"native_name": {
"label": "Native name",
"description": "This will display under the name/official name.",
"type": "string",
"example": "Distrito Federal de México"
},
"native_name_lang": {
"label": "Native name language",
"description": "Use ISO 639-1 code, e.g. 'fr' for French. If there is more than one native name in different languages, enter those names using {{lang}} instead.",
"type": "string",
"example": "zh"
},
"other_name": {
"label": "Other name",
"description": "For places with a former or more common name like Bombay or Saigon.",
"type": "string"
},
"settlement_type": {
"label": "Type of settlement",
"description": "Any type can be entered, such as 'City', 'Town', 'Village', 'Hamlet', 'Municipality', 'Reservation', etc. If set, will be displayed under the names, provided either 'name' or 'official_name' is filled in. Might also be used as a label for total population/area (defaulting to 'City'), if needed to distinguish from 'Urban', 'Rural' or 'Metro' (if urban, rural or metro figures are not present, the label is 'Total' unless 'total_type' is set).",
"type": "string",
"aliases": [
"type"
]
},
"translit_lang1": {
"label": "Transliteration from language 1",
"description": "Will place the entry before the word 'transliteration(s)'. Can be used to specify a particular language, like in Dêlêg, or one may just enter 'Other', like in Gaza's article.",
"type": "string"
},
"translit_lang1_type": {
"label": "Transliteration type for language 1",
"type": "line",
"example": "[[Hanyu pinyin]]",
"description": "The type of transliteration used for the first language."
},
"translit_lang1_info": {
"label": "Transliteration language 1 info",
"description": "Parameters 'translit_lang2_info1' ... 'translit_lang2_info6' are also available, but not documented here.",
"type": "string"
},
"translit_lang2": {
"label": "Transliteration language 2",
"description": "Will place a second transliteration. See Dêlêg.",
"type": "string"
},
"image_skyline": {
"label": "Image",
"description": "Primary image representing the settlement. Commonly a photo of the settlement’s skyline.",
"type": "wiki-file-name"
},
"imagesize": {
"label": "Image size",
"description": "Can be used to tweak the size of 'image_skyline' up or down. This can be helpful if an editor wants to make the infobox wider. If used, 'px' must be specified; default size is 250px.",
"type": "string"
},
"image_alt": {
"label": "Image alt text",
"description": "Alt (hover) text for the image, used by visually impaired readers who cannot see the image.",
"type": "string"
},
"image_caption": {
"label": "Image caption",
"description": "Will place a caption under 'image_skyline' (if present).",
"type": "content"
},
"image_flag": {
"label": "Flag image",
"description": "Used for a flag.",
"type": "wiki-file-name"
},
"flag_size": {
"label": "Flag size",
"description": "Can be used to tweak the size of 'image_flag' up or down from 100px as desired. If used, 'px' must be specified; default size is 100px.",
"type": "string"
},
"flag_alt": {
"label": "Flag alt text",
"description": "Alt text for the flag.",
"type": "string"
},
"flag_border": {
"label": "Flag border?",
"description": "Set to 'no' to remove the border from the flag.",
"type": "boolean",
"example": "no"
},
"flag_link": {
"label": "Flag link",
"type": "string",
"description": "Link to the flag."
},
"image_seal": {
"label": "Official seal image",
"description": "An image of an official seal, if the place has one.",
"type": "wiki-file-name"
},
"seal_size": {
"label": "Seal size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string"
},
"seal_alt": {
"label": "Seal alt text",
"description": "Alt (hover) text for the seal.",
"type": "string"
},
"seal_link": {
"label": "Seal link",
"type": "string",
"description": "Link to the seal."
},
"image_shield": {
"label": "Coat of arms/shield image",
"description": "Can be used for a place with a coat of arms.",
"type": "wiki-file-name"
},
"shield_size": {
"label": "Shield size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"example": "200px"
},
"shield_alt": {
"label": "Shield alt text",
"description": "Alternate text for the shield.",
"type": "string"
},
"shield_link": {
"label": "Shield link",
"description": "Can be used if a wiki article if known but is not automatically linked by the template. See Coquitlam, British Columbia's infobox for an example.",
"type": "string"
},
"image_blank_emblem": {
"label": "Blank emblem image",
"description": "Can be used if a place has an official logo, crest, emblem, etc.",
"type": "wiki-file-name"
},
"blank_emblem_type": {
"label": "Blank emblem type",
"description": "Caption beneath 'image_blank_emblem' to specify what type of emblem it is.",
"type": "string",
"example": "Logo"
},
"blank_emblem_size": {
"label": "Blank emblem size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"example": "200px"
},
"blank_emblem_alt": {
"label": "Blank emblem alt text",
"description": "Alt text for blank emblem.",
"type": "string"
},
"blank_emblem_link": {
"label": "Blank emblem link",
"type": "string",
"description": "A link to the emblem of custom type."
},
"nickname": {
"label": "Nickname",
"description": "Well-known nickname(s).",
"type": "string",
"example": "Sin City"
},
"motto": {
"label": "Motto",
"description": "Will place the motto under the nicknames.",
"type": "string"
},
"anthem": {
"label": "Anthem",
"description": "Will place the anthem (song) under the nicknames.",
"type": "string",
"example": "[[Hatikvah]]"
},
"image_map": {
"label": "Map image",
"description": "A map of the region, or a map with the region highlighted within a parent region.",
"type": "wiki-file-name"
},
"mapsize": {
"label": "Map size",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string"
},
"map_alt": {
"label": "Map alt text",
"description": "Alternate (hover) text for the map.",
"type": "string"
},
"map_caption": {
"label": "Map caption",
"type": "content",
"description": "Caption for the map displayed."
},
"image_map1": {
"label": "Map 2 image",
"description": "A secondary map image. The field 'image_map' must be filled in first. For an example, see [[Bloomsburg, Pennsylvania]].",
"example": "File:Columbia County Pennsylvania Incorporated and Unincorporated areas Bloomsburg Highlighted.svg",
"type": "wiki-file-name"
},
"mapsize1": {
"label": "Map 2 size",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string",
"example": "300px"
},
"map_alt1": {
"label": "Map 2 alt text",
"description": "Alt (hover) text for the second map.",
"type": "string"
},
"map_caption1": {
"label": "Map 2 caption",
"type": "content",
"description": "Caption of the second map."
},
"pushpin_map": {
"label": "Pushpin map",
"description": "The name of a location map (e.g. 'Indonesia' or 'Russia'). The coordinates information (from the coordinates parameter) positions a pushpin coordinate marker and label on the map automatically. For an example, see Padang, Indonesia.",
"type": "string",
"example": "Indonesia"
},
"pushpin_mapsize": {
"label": "Pushpin map size",
"description": "Must be entered as only a number—do not use 'px'. The default value is 250.",
"type": "number",
"example": "200"
},
"pushpin_map_alt": {
"label": "Pushpin map alt text",
"description": "Alt (hover) text for the pushpin map.",
"type": "string"
},
"pushpin_map_caption": {
"label": "Pushpin map caption",
"description": "Fill out if a different caption from 'map_caption' is desired.",
"type": "string",
"example": "Map showing Bloomsburg in Pennsylvania"
},
"pushpin_label": {
"label": "Pushpin label",
"type": "line",
"example": "Bloomsburg",
"description": "Label of the pushpin."
},
"pushpin_label_position": {
"label": "Pushpin label position",
"description": "The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are 'left', 'right', 'top', 'bottom', and 'none'. If this field is not specified, the default value is 'right'.",
"type": "string",
"example": "left",
"default": "right"
},
"pushpin_outside": {
"label": "Pushpin outside?",
"type": "line"
},
"pushpin_relief": {
"label": "Pushpin relief",
"description": "Set this to 'y' or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available).",
"type": "string",
"example": "y"
},
"pushpin_image": {
"label": "Pushpin image",
"type": "wiki-file-name",
"description": "Image to use for the pushpin."
},
"pushpin_overlay": {
"label": "Pushpin overlay",
"description": "Can be used to specify an image to be superimposed on the regular pushpin map.",
"type": "wiki-file-name"
},
"coordinates": {
"label": "Coordinates",
"description": "Latitude and longitude. Use {{Coord}}. See the documentation for {{Coord}} for more details on usage.",
"type": "wiki-template-name",
"example": "{{coord|41|50|15|N|87|40|55|W}}"
},
"coor_pinpoint": {
"label": "Coordinate pinpoint",
"description": "If needed, to specify more exactly where (or what) coordinates are given (e.g. 'Town Hall') or a specific place in a larger area (e.g. a city in a county). Example: Masovian Voivodeship.",
"type": "string"
},
"coordinates_footnotes": {
"label": "Coordinates footnotes",
"description": "Reference(s) for coordinates. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"subdivision_type": {
"label": "Subdivision type 1",
"description": "Almost always 'Country'.",
"type": "string",
"example": "[[List of sovereign states|Country]]"
},
"subdivision_name": {
"label": "Subdivision name 1",
"description": "Depends on 'subdivision_type'. Use the name in text form, e.g., 'United States'. Per MOS:INFOBOXFLAG, flag icons or flag templates may be used in this field.",
"type": "string"
},
"subdivision_type1": {
"label": "Subdivision type 2",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type2": {
"label": "Subdivision type 3",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type3": {
"label": "Subdivision type 4",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type4": {
"label": "Subdivision type 5",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type5": {
"label": "Subdivision type 6",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type6": {
"label": "Subdivision type 7",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_name1": {
"label": "Subdivision name 2",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Connecticut]]"
},
"subdivision_name2": {
"label": "Subdivision name 3",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Florida]]"
},
"subdivision_name3": {
"label": "Subdivision name 4",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Utah]]"
},
"subdivision_name4": {
"label": "Subdivision name 5",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[California]]"
},
"subdivision_name5": {
"label": "Subdivision name 6",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Vermont]]"
},
"subdivision_name6": {
"label": "Subdivision name 7",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Wyoming]]"
},
"established_title": {
"label": "First establishment event",
"description": "Title of the first establishment event.",
"type": "string",
"example": "First settled"
},
"established_date": {
"label": "First establishment date",
"type": "date",
"description": "Date of the first establishment event."
},
"established_title1": {
"label": "Second establishment event",
"description": "Title of the second establishment event.",
"type": "string",
"example": "Incorporated as a town"
},
"established_date1": {
"label": "Second establishment date",
"type": "date",
"description": "Date of the second establishment event."
},
"established_title2": {
"label": "Third establishment event",
"description": "Title of the third establishment event.",
"type": "string",
"example": "Incorporated as a city"
},
"established_date2": {
"label": "Third establishment date",
"type": "date",
"description": "Date of the third establishment event."
},
"established_title3": {
"label": "Fourth establishment event",
"type": "string",
"description": "Title of the fourth establishment event.",
"example": "Incorporated as a county"
},
"established_date3": {
"label": "Fourth establishment date",
"type": "date",
"description": "Date of the fourth establishment event."
},
"extinct_title": {
"label": "Extinction event title",
"description": "For when a settlement ceases to exist.",
"type": "string",
"example": "[[Sack of Rome]]"
},
"extinct_date": {
"label": "Extinction date",
"type": "string",
"description": "Date the settlement ceased to exist."
},
"founder": {
"label": "Founder",
"description": "Who the settlement was founded by.",
"type": "string"
},
"named_for": {
"label": "Named for",
"description": "The source of the name of the settlement (a person, a place, et cetera).",
"type": "string",
"example": "[[Ho Chi Minh]]"
},
"seat_type": {
"label": "Seat of government type",
"description": "The label for the seat of government (defaults to 'Seat').",
"type": "string",
"default": "Seat"
},
"seat": {
"label": "Seat of government",
"description": "The seat of government.",
"type": "string",
"example": "[[White House]]"
},
"parts_type": {
"label": "Type of smaller subdivisions",
"description": "The label for the smaller subdivisions (defaults to 'Boroughs').",
"type": "string",
"default": "Boroughs"
},
"parts_style": {
"label": "Parts style",
"description": "Set to 'list' to display as a collapsible list, 'coll' as a collapsed list, or 'para' to use paragraph style. Default is 'list' for up to 5 items, otherwise 'coll'.",
"type": "string",
"example": "list"
},
"parts": {
"label": "Smaller subdivisions",
"description": "Text or header of the list of smaller subdivisions.",
"type": "string"
},
"p1": {
"label": "Smaller subdivision 1",
"description": "The smaller subdivisions to be listed. Parameters 'p1' to 'p50' can also be used.",
"type": "string"
},
"government_footnotes": {
"label": "Government footnotes",
"description": "Reference(s) for government. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"government_type": {
"label": "Government type",
"description": "The place's type of government.",
"type": "string",
"example": "[[Mayor–council government]]"
},
"governing_body": {
"label": "Governing body",
"description": "Name of the place's governing body.",
"type": "wiki-page-name",
"example": "Legislative Council of Hong Kong"
},
"leader_party": {
"label": "Leader political party",
"description": "Political party of the place's leader.",
"type": "string"
},
"leader_title": {
"label": "Leader title",
"description": "First title of the place's leader, e.g. 'Mayor'.",
"type": "string",
"example": "[[Governor (United States)|Governor]]"
},
"leader_name": {
"label": "Leader's name",
"description": "Name of the place's leader.",
"type": "string",
"example": "[[Jay Inslee]]"
},
"leader_title1": {
"label": "Leader title 1",
"description": "First title of the place's leader, e.g. 'Mayor'.",
"type": "string",
"example": "Mayor"
},
"leader_name1": {
"label": "Leader name 1",
"description": "Additional names for leaders. Parameters 'leader_name1' .. 'leader_name4' are available. For long lists, use {{Collapsible list}}.",
"type": "string"
},
"total_type": {
"label": "Total type",
"description": "Specifies what total area and population figure refer to, e.g. 'Greater London'. This overrides other labels for total population/area. To make the total area and population display on the same line as the words ''Area'' and ''Population'', with no ''Total'' or similar label, set the value of this parameter to ' '.",
"type": "string"
},
"unit_pref": {
"label": "Unit preference",
"description": "To change the unit order to 'imperial (metric)', enter 'imperial'. The default display style is 'metric (imperial)'. However, the template will swap the order automatically if the 'subdivision_name' equals some variation of the US or the UK. For the Middle East, a unit preference of dunam can be entered (only affects total area). All values must be entered in a raw format (no commas, spaces, or unit symbols). The template will format them automatically.",
"type": "string",
"example": "imperial"
},
"area_footnotes": {
"label": "Area footnotes",
"description": "Reference(s) for area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"dunam_link": {
"label": "Link dunams?",
"description": "If dunams are used, the default is to link the word ''dunams'' in the total area section. This can be changed by setting 'dunam_link' to another measure (e.g. 'dunam_link=water'). Linking can also be turned off by setting the parameter to something else (e.g., 'dunam_link=none' or 'dunam_link=off').",
"type": "boolean",
"example": "none"
},
"area_total_km2": {
"label": "Total area (km2)",
"description": "Total area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_total_sq_mi' is empty.",
"type": "number"
},
"area_total_sq_mi": {
"label": "Total area (sq. mi)",
"description": "Total area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_total_km2' is empty.",
"type": "number"
},
"area_total_ha": {
"label": "Total area (hectares)",
"description": "Total area in hectares (symbol: ha). Value must be entered in raw format (no commas or spaces). Auto-converted to display acres if 'area_total_acre' is empty.",
"type": "number"
},
"area_total_acre": {
"label": "Total area (acres)",
"description": "Total area in acres. Value must be entered in raw format (no commas or spaces). Auto-converted to display hectares if 'area_total_ha' is empty.",
"type": "number"
},
"area_total_dunam": {
"label": "Total area (dunams)",
"description": "Total area in dunams, which is wikilinked. Used in Middle Eastern places like Israel, Gaza, and the West Bank. Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers or hectares and square miles or acres if 'area_total_km2', 'area_total_ha', 'area_total_sq_mi', and 'area_total_acre' are empty. Examples: Gaza and Ramallah.",
"type": "number"
},
"area_land_km2": {
"label": "Land area (sq. km)",
"description": "Land area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_land_sq_mi' is empty.",
"type": "number"
},
"area_land_sq_mi": {
"label": "Land area (sq. mi)",
"description": "Land area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_land_km2' is empty.",
"type": "number"
},
"area_land_ha": {
"label": "Land area (hectares)",
"description": "The place's land area in hectares.",
"type": "number"
},
"area_land_dunam": {
"label": "Land area (dunams)",
"description": "The place's land area in dunams.",
"type": "number"
},
"area_land_acre": {
"label": "Land area (acres)",
"description": "The place's land area in acres.",
"type": "number"
},
"area_water_km2": {
"label": "Water area (sq. km)",
"description": "Water area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_water_sq_mi' is empty.",
"type": "number"
},
"area_water_sq_mi": {
"label": "Water area (sq. mi)",
"description": "Water area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_water_km2' is empty.",
"type": "number"
},
"area_water_ha": {
"label": "Water area (hectares)",
"description": "The place's water area in hectares.",
"type": "number"
},
"area_water_dunam": {
"label": "Water area (dunams)",
"description": "The place's water area in dunams.",
"type": "number"
},
"area_water_acre": {
"label": "Water area (acres)",
"description": "The place's water area in acres.",
"type": "number"
},
"area_water_percent": {
"label": "Percent water area",
"description": "Percent of water without the %.",
"type": "number",
"example": "21"
},
"area_urban_km2": {
"label": "Urban area (sq. km)",
"type": "number",
"description": "Area of the place's urban area in square kilometers."
},
"area_urban_sq_mi": {
"label": "Urban area (sq. mi)",
"type": "number",
"description": "Area of the place's urban area in square miles."
},
"area_urban_ha": {
"label": "Urban area (hectares)",
"description": "Area of the place's urban area in hectares.",
"type": "number"
},
"area_urban_dunam": {
"label": "Urban area (dunams)",
"description": "Area of the place's urban area in dunams.",
"type": "number"
},
"area_urban_acre": {
"label": "Urban area (acres)",
"description": "Area of the place's urban area in acres.",
"type": "number"
},
"area_urban_footnotes": {
"label": "Urban area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_rural_km2": {
"label": "Rural area (sq. km)",
"type": "number",
"description": "Area of the place's rural area in square kilometers."
},
"area_rural_sq_mi": {
"label": "Rural area (sq. mi)",
"type": "number",
"description": "Area of the place's rural area in square miles."
},
"area_rural_ha": {
"label": "Rural area (hectares)",
"description": "Area of the place's rural area in hectares.",
"type": "number"
},
"area_rural_dunam": {
"label": "Rural area (dunams)",
"description": "Area of the place's rural area in dunams.",
"type": "number"
},
"area_rural_acre": {
"label": "Rural area (acres)",
"description": "Area of the place's rural area in acres.",
"type": "number"
},
"area_rural_footnotes": {
"label": "Rural area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_metro_km2": {
"label": "Metropolitan area (sq. km)",
"type": "number",
"description": "Area of the place's metropolitan area in square kilometers."
},
"area_metro_sq_mi": {
"label": "Metropolitan area (sq. mi)",
"type": "number",
"description": "Area of the place's metropolitan area in square miles."
},
"area_metro_ha": {
"label": "Metropolitan area (hectares)",
"description": "Area of the place's metropolitan area in hectares.",
"type": "number"
},
"area_metro_dunam": {
"label": "Metropolitan area (dunams)",
"description": "Area of the place's metropolitan area in dunams.",
"type": "number"
},
"area_metro_acre": {
"label": "Metropolitan area (acres)",
"description": "Area of the place's metropolitan area in acres.",
"type": "number"
},
"area_metro_footnotes": {
"label": "Metropolitan area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_rank": {
"label": "Area rank",
"description": "The settlement's area, as ranked within its parent sub-division.",
"type": "string"
},
"area_blank1_title": {
"label": "First blank area section title",
"description": "Title of the place's first custom area section.",
"type": "string",
"example": "see [[London]]"
},
"area_blank1_km2": {
"label": "Area blank 1 (sq. km)",
"type": "number",
"description": "Area of the place's first blank area section in square kilometers."
},
"area_blank1_sq_mi": {
"label": "Area blank 1 (sq. mi)",
"type": "number",
"description": "Area of the place's first blank area section in square miles."
},
"area_blank1_ha": {
"label": "Area blank 1 (hectares)",
"description": "Area of the place's first blank area section in hectares.",
"type": "number"
},
"area_blank1_dunam": {
"label": "Area blank 1 (dunams)",
"description": "Area of the place's first blank area section in dunams.",
"type": "number"
},
"area_blank1_acre": {
"label": "Area blank 1 (acres)",
"description": "Area of the place's first blank area section in acres.",
"type": "number"
},
"area_blank2_title": {
"label": "Second blank area section title",
"type": "string",
"description": "Title of the place's second custom area section."
},
"area_blank2_km2": {
"label": "Area blank 2 (sq. km)",
"type": "number",
"description": "Area of the place's second blank area section in square kilometers."
},
"area_blank2_sq_mi": {
"label": "Area blank 2 (sq. mi)",
"type": "number",
"description": "Area of the place's second blank area section in square miles."
},
"area_blank2_ha": {
"label": "Area blank 2 (hectares)",
"description": "Area of the place's third blank area section in hectares.",
"type": "number"
},
"area_blank2_dunam": {
"label": "Area blank 2 (dunams)",
"description": "Area of the place's third blank area section in dunams.",
"type": "number"
},
"area_blank2_acre": {
"label": "Area blank 2 (acres)",
"description": "Area of the place's third blank area section in acres.",
"type": "number"
},
"area_note": {
"label": "Area footnotes",
"description": "A place for additional information such as the name of the source.",
"type": "content",
"example": "<ref name=\"CenPopGazetteer2016\">{{cite web|title=2016 U.S. Gazetteer Files|url=https://www2.census.gov/geo/docs/maps-data/data/gazetteer/2016_Gazetteer/2016_gaz_place_42.txt|publisher=United States Census Bureau|access-date=August 13, 2017}}</ref>"
},
"dimensions_footnotes": {
"label": "Dimensions footnotes",
"description": "Reference(s) for dimensions. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"length_km": {
"label": "Length in km",
"description": "Raw number entered in kilometers. Will automatically convert to display length in miles if 'length_mi' is empty.",
"type": "number"
},
"length_mi": {
"label": "Length in miles",
"description": "Raw number entered in miles. Will automatically convert to display length in kilometers if 'length_km' is empty.",
"type": "number"
},
"width_km": {
"label": "Width in kilometers",
"description": "Raw number entered in kilometers. Will automatically convert to display width in miles if 'length_mi' is empty.",
"type": "number"
},
"width_mi": {
"label": "Width in miles",
"description": "Raw number entered in miles. Will automatically convert to display width in kilometers if 'length_km' is empty.",
"type": "number"
},
"elevation_m": {
"label": "Elevation in meters",
"description": "Raw number entered in meters. Will automatically convert to display elevation in feet if 'elevation_ft' is empty. However, if a range in elevation (i.e. 5–50 m) is desired, use the 'max' and 'min' fields below.",
"type": "number"
},
"elevation_ft": {
"label": "Elevation in feet",
"description": "Raw number, entered in feet. Will automatically convert to display the average elevation in meters if 'elevation_m' field is empty. However, if a range in elevation (i.e. 50–500 ft) is desired, use the 'max' and 'min' fields below.",
"type": "number"
},
"elevation_footnotes": {
"label": "Elevation footnotes",
"description": "Reference(s) for elevation. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"elevation_min_point": {
"type": "line",
"label": "Point of min elevation",
"description": "The name of the point of lowest elevation in the place.",
"example": "[[Death Valley]]"
},
"elevation_min_m": {
"label": "Minimum elevation (m)",
"type": "number",
"description": "The minimum elevation in meters."
},
"elevation_min_ft": {
"label": "Minimum elevation (ft)",
"type": "number",
"description": "The minimum elevation in feet."
},
"elevation_min_rank": {
"type": "line",
"label": "Minimum elevation rank",
"description": "The point of minimum elevation's rank in the parent region.",
"example": "1st"
},
"elevation_min_footnotes": {
"label": "Min elevation footnotes",
"type": "content",
"description": "Footnotes or citations for the minimum elevation."
},
"elevation_max_point": {
"type": "line",
"label": "Point of max elevation",
"description": "The name of the point of highest elevation in the place.",
"example": "[[Mount Everest]]"
},
"elevation_max_m": {
"label": "Maximum elevation (m)",
"type": "number",
"description": "The maximum elevation in meters."
},
"elevation_max_ft": {
"label": "Maximum elevation (ft)",
"type": "number",
"description": "The maximum elevation in feet."
},
"elevation_max_rank": {
"type": "line",
"label": "Maximum elevation rank",
"description": "The point of maximum elevation's rank in the parent region.",
"example": "2nd"
},
"elevation_max_footnotes": {
"label": "Max elevation footnotes",
"type": "content",
"description": "Footnotes or citations for the maximum elevation."
},
"population_total": {
"label": "Population total",
"description": "Actual population (see below for estimates) preferably consisting of digits only (without any commas).",
"type": "number"
},
"population_as_of": {
"label": "Population total figure's year",
"description": "The year for the population total (usually a census year).",
"type": "number"
},
"population_footnotes": {
"label": "Population footnotes",
"description": "Reference(s) for population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_km2": {
"label": "Population density (per square km)",
"type": "string",
"description": "The place's population density per square kilometer.",
"example": "auto"
},
"population_density_sq_mi": {
"label": "Population density (per square mi)",
"type": "string",
"description": "The place's population density per square mile.",
"example": "auto"
},
"population_est": {
"label": "Population estimate",
"description": "Population estimate, e.g. for growth projections 4 years after a census.",
"type": "number",
"example": "331000000"
},
"pop_est_as_of": {
"label": "Population estimate figure as of",
"description": "The year, or the month and year, of the population estimate.",
"type": "date"
},
"pop_est_footnotes": {
"label": "Population estimate footnotes",
"description": "Reference(s) for population estimate; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content",
"example": "<ref name=\"USCensusEst2016\"/>"
},
"population_urban": {
"label": "Urban population",
"type": "number",
"description": "The place's urban population."
},
"population_urban_footnotes": {
"label": "Urban population footnotes",
"description": "Reference(s) for urban population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_urban_km2": {
"label": "Urban population density (per square km)",
"type": "string",
"description": "The place's urban population density per square kilometer.",
"example": "auto"
},
"population_density_urban_sq_mi": {
"label": "Urban population density (per square mi)",
"type": "string",
"description": "The place's urban population density per square mile.",
"example": "auto"
},
"population_rural": {
"label": "Rural population",
"type": "number",
"description": "The place's rural population."
},
"population_rural_footnotes": {
"label": "Rural population footnotes",
"description": "Reference(s) for rural population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_rural_km2": {
"label": "Rural population density per sq. km",
"type": "line",
"description": "The place's rural population density per square kilometer.",
"example": "auto"
},
"population_density_rural_sq_mi": {
"label": "Rural population density per sq. mi",
"type": "line",
"description": "The place's rural population density per square mile.",
"example": "auto"
},
"population_metro": {
"label": "Metropolitan area population",
"type": "number",
"description": "Population of the place's metropolitan area."
},
"population_metro_footnotes": {
"label": "Metropolitan area population footnotes",
"description": "Reference(s) for metro population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "string"
},
"population_density_metro_km2": {
"label": "Metropolitan population density per sq. km",
"type": "number",
"description": "The place's metropolitan area's population density per square kilometer.",
"example": "auto"
},
"population_density_metro_sq_mi": {
"label": "Metropolitan population density per sq. mi",
"type": "number",
"description": "The place's metropolitan area's population density per square mile.",
"example": "auto"
},
"population_rank": {
"label": "Population rank",
"description": "The settlement's population, as ranked within its parent sub-division.",
"type": "string"
},
"population_density_rank": {
"label": "Population density rank",
"description": "The settlement's population density, as ranked within its parent sub-division.",
"type": "string"
},
"population_blank1_title": {
"label": "Custom population type 1 title",
"description": "Can be used for estimates. For an example, see Windsor, Ontario.",
"type": "string",
"example": "See: [[Windsor, Ontario]]"
},
"population_blank1": {
"label": "Custom population type 1",
"description": "The population value for 'blank1_title'.",
"type": "string"
},
"population_density_blank1_km2": {
"label": "Custom population type 1 density per sq. km",
"type": "string",
"description": "Population density per square kilometer, according to the 1st custom population type."
},
"population_density_blank1_sq_mi": {
"label": "Custom population type 1 density per sq. mi",
"type": "string",
"description": "Population density per square mile, according to the 1st custom population type."
},
"population_blank2_title": {
"label": "Custom population type 2 title",
"description": "Can be used for estimates. For an example, see Windsor, Ontario.",
"type": "string",
"example": "See: [[Windsor, Ontario]]"
},
"population_blank2": {
"label": "Custom population type 2",
"description": "The population value for 'blank2_title'.",
"type": "string"
},
"population_density_blank2_km2": {
"label": "Custom population type 2 density per sq. km",
"type": "string",
"description": "Population density per square kilometer, according to the 2nd custom population type."
},
"population_density_blank2_sq_mi": {
"label": "Custom population type 2 density per sq. mi",
"type": "string",
"description": "Population density per square mile, according to the 2nd custom population type."
},
"population_demonym": {
"label": "Demonym",
"description": "A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example, a citizen in Liverpool is known as a Liverpudlian.",
"type": "line",
"example": "Liverpudlian"
},
"population_note": {
"label": "Population note",
"description": "A place for additional information such as the name of the source. See Windsor, Ontario, for an example.",
"type": "content"
},
"demographics_type1": {
"label": "Demographics type 1",
"description": "A sub-section header.",
"type": "string",
"example": "Ethnicities"
},
"demographics1_footnotes": {
"label": "Demographics section 1 footnotes",
"description": "Reference(s) for demographics section 1. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"demographics1_title1": {
"label": "Demographics section 1 title 1",
"description": "Titles related to demographics_type1. For example: 'White', 'Black', 'Hispanic'... Additional rows 'demographics1_title1' to 'demographics1_title5' are also available.",
"type": "string"
},
"demographics_type2": {
"label": "Demographics type 2",
"description": "A second sub-section header.",
"type": "line",
"example": "Languages"
},
"demographics2_footnotes": {
"label": "Demographics section 2 footnotes",
"description": "Reference(s) for demographics section 2. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"demographics2_title1": {
"label": "Demographics section 2 title 1",
"description": "Titles related to 'demographics_type1'. For example: 'English', 'French', 'Arabic'... Additional rows 'demographics2_title2' to 'demographics1_title5' are also available.",
"type": "string"
},
"demographics2_info1": {
"label": "Demographics section 2 info 1",
"description": "Information related to the titles. For example: '50%', '25%', '10%'... Additional rows 'demographics2_info2' to 'demographics2_info5' are also available.",
"type": "content"
},
"timezone1": {
"label": "Timezone 1",
"type": "string",
"description": "The place's primary time-zone.",
"example": "[[Eastern Standard Time]]"
},
"utc_offset": {
"label": "UTC offset",
"type": "string",
"description": "The place's time-zone's offset from UTC.",
"example": "+8"
},
"timezone_DST": {
"label": "Timezone during DST",
"type": "string",
"description": "The place's time-zone during daylight savings time, if applicable.",
"example": "[[Eastern Daylight Time]]"
},
"utc_offset_DST": {
"label": "UTC offset during DST",
"type": "string",
"description": "The place's time-zone's UTC offset during daylight savings time, if applicable.",
"example": "+9"
},
"utc_offset1": {
"label": "UTC offset 1",
"type": "string",
"description": "The place's primary time-zone's offset from UTC.",
"example": "-5"
},
"timezone1_DST": {
"label": "Timezone 1 (during DST)",
"type": "string",
"description": "The place's primary time-zone during daylight savings time, if applicable.",
"example": "[[Eastern Daylight Time]]"
},
"utc_offset1_DST": {
"label": "UTC offset 1 (during DST)",
"type": "string",
"description": "The place's primary time-zone's UTC offset during daylight savings time, if applicable.",
"example": "-6"
},
"timezone2": {
"label": "Timezone 2",
"description": "A second timezone field for larger areas such as a province.",
"type": "string",
"example": "[[Central Standard Time]]"
},
"utc_offset2": {
"label": "UTC offset 2",
"type": "string",
"description": "The place's secondary time-zone's offset from UTC.",
"example": "-6"
},
"timezone2_DST": {
"label": "Timezone 2 during DST",
"type": "string",
"description": "The place's secondary time-zone during daylight savings time, if applicable.",
"example": "[[Central Daylight Time]]"
},
"utc_offset2_DST": {
"label": "UTC offset 2 during DST",
"type": "string",
"description": "The place's secondary time-zone's offset from UTC during daylight savings time, if applicable.",
"example": "-7"
},
"postal_code_type": {
"label": "Postal code type",
"description": "Label used for postal code info, e.g. 'ZIP Code'. Defaults to 'Postal code'.",
"example": "[[Postal code of China|Postal code]]",
"type": "string"
},
"postal_code": {
"label": "Postal code",
"description": "The place's postal code/zip code.",
"type": "string",
"example": "90210"
},
"postal2_code_type": {
"label": "Postal code 2 type",
"type": "string",
"description": "If applicable, the place's second postal code type."
},
"postal2_code": {
"label": "Postal code 2",
"type": "string",
"description": "A second postal code of the place, if applicable.",
"example": "90007"
},
"area_code": {
"label": "Area code",
"description": "The regions' telephone area code.",
"type": "string"
},
"area_code_type": {
"label": "Area code type",
"description": "If left blank/not used, template will default to 'Area code(s)'.",
"type": "string"
},
"geocode": {
"label": "Geocode",
"description": "See [[Geocode]].",
"type": "string"
},
"iso_code": {
"label": "ISO 3166 code",
"description": "See ISO 3166.",
"type": "string"
},
"registration_plate": {
"label": "Registration/license plate info",
"description": "See Vehicle registration plate.",
"type": "string"
},
"blank_name_sec1": {
"label": "Blank name section 1",
"description": "Fields used to display other information. The name is displayed in bold on the left side of the infobox.",
"type": "string"
},
"blank_info_sec1": {
"label": "Blank info section 1",
"description": "The information associated with the 'blank_name_sec1' heading. The info is displayed on the right side of the infobox in the same row as the name. For an example, see [[Warsaw]].",
"type": "content"
},
"blank1_name_sec1": {
"label": "Blank 1 name section 1",
"description": "Up to 7 additional fields 'blank1_name_sec1' ... 'blank7_name_sec1' can be specified.",
"type": "string"
},
"blank1_info_sec1": {
"label": "Blank 1 info section 1",
"description": "Up to 7 additional fields 'blank1_info_sec1' ... 'blank7_info_sec1' can be specified.",
"type": "content"
},
"blank_name_sec2": {
"label": "Blank name section 2",
"description": "For a second section of blank fields.",
"type": "string"
},
"blank_info_sec2": {
"label": "Blank info section 2",
"example": "Beijing",
"type": "content",
"description": "The information associated with the 'blank_name_sec2' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see [[Warsaw]]."
},
"blank1_name_sec2": {
"label": "Blank 1 name section 2",
"description": "Up to 7 additional fields 'blank1_name_sec2' ... 'blank7_name_sec2' can be specified.",
"type": "string"
},
"blank1_info_sec2": {
"label": "Blank 1 info section 2",
"description": "Up to 7 additional fields 'blank1_info_sec2' ... 'blank7_info_sec2' can be specified.",
"type": "content"
},
"website": {
"label": "Official website in English",
"description": "External link to official website. Use the {{URL}} template, thus: {{URL|example.com}}.",
"type": "string"
},
"footnotes": {
"label": "Footnotes",
"description": "Text to be displayed at the bottom of the infobox.",
"type": "content"
},
"translit_lang1_info1": {
"label": "Language 1 first transcription ",
"description": "Transcription of type 1 in the first other language.",
"example": "{{lang|zh|森美兰}}",
"type": "line"
},
"translit_lang1_type1": {
"label": "Language 1 first transcription type",
"description": "Type of transcription used in the first language's first transcription.",
"example": "[[Chinese Language|Chinese]]",
"type": "line"
},
"translit_lang1_info2": {
"label": "Language 1 second transcription ",
"description": "Transcription of type 1 in the first other language.",
"example": "{{lang|ta|நெகிரி செம்பிலான்}}",
"type": "line"
},
"translit_lang1_type2": {
"label": "Language 1 second transcription type",
"description": "Type of transcription used in the first language's first transcription.",
"example": "[[Tamil Language|Tamil]]",
"type": "line"
},
"demographics1_info1": {
"label": "Demographics section 1 info 1",
"description": "Information related to the titles. For example: '50%', '25%', '10%'... Additional rows 'demographics1_info1' to 'demographics1_info5' are also available.",
"type": "content"
}
}
}
</templatedata>
{{collapse bottom}}
==Calls and redirects ==
At least {{PAGESINCATEGORY:Templates calling Infobox settlement}} other [[:Category:Templates calling Infobox settlement|templates call this one]].
[{{fullurl:Special:WhatLinksHere/Template:Infobox_settlement|namespace=10&hidetrans=1&hidelinks=1}} Several templates redirect here].
== Tracking categories ==
# {{clc|Pages using infobox settlement with a dot map}}
# {{clc|Pages using infobox settlement with bad settlement type}}
# {{clc|Pages using infobox settlement with image map1 but not image map}}
# {{clc|Pages using infobox settlement with imprecise region codes}}
# {{clc|Pages using infobox settlement with missing country}}
# {{clc|Pages using infobox settlement with no map}}
# {{clc|Pages using infobox settlement with no coordinates}}
# {{clc|Pages using infobox settlement with possible area code list}}
# {{clc|Pages using infobox settlement with possible demonym list}}
# {{clc|Pages using infobox settlement with possible motto list}}
# {{clc|Pages using infobox settlement with possible nickname list}}
# {{clc|Pages using infobox settlement with the wikidata parameter}}
# {{clc|Pages using infobox settlement with unknown parameters}}
# {{clc|Pages using infobox settlement with conflicting parameters}}
# {{clc|Pages using infobox settlement with ignored type}}
# {{clc|Templates calling Infobox settlement}}
<includeonly>{{Sandbox other||
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Place infobox templates|Settlement]]
[[Category:Embeddable templates]]
[[Category:Infobox templates using Wikidata]]
[[Category:Templates that add a tracking category]]
}}</includeonly>
849c25d77a356188a5d47594a9dd63af005e6b1c
605
580
2023-10-17T21:25:40Z
LamayII
2
Removed uneeded docs
wikitext
text/x-wiki
{{Documentation subpage}}
<!--Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[Wikipedia:Wikidata]])-->
{{Auto short description}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Coordinates|Module:Check for unknown parameters|Module:Settlement short description}}
{{Uses TemplateStyles|Template:Infobox settlement/styles.css}}
This template should be used to produce an [[WP:Infobox|Infobox]] for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, et cetera—in fact, any subdivision below the level of a country, for which {{tl|Infobox country}} should be used. Parameters are described in the table below. For questions, see the [[Template talk:Infobox settlement|talk page]]. For a US city guideline, see [[WP:USCITIES]].
The template is aliased or used as a sub-template for several infobox front-end templates.
==Usage==
* '''Important''': Please enter all numeric values in a raw, unformatted fashion. References and {{tl|citation needed}} tags are to be included in their respective section footnotes field. Numeric values that are not "raw" may create an "Expression error". Raw values will be automatically formatted by the template. If you find a raw value is not formatted in your usage of the template, please post a notice on the discussion page for this template.
* An expression error may also occur when any coordinate parameter has a value, but one or more coordinate parameters are blank or invalid.
Basic blank template, ready to cut and paste. See the next section for a copy of the template with all parameters and comments. See the table below that for a full description of each parameter.
===Using metric units===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name = <!-- Settlement name in local language(s), if different from the English name -->
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|image_flag =
|flag_alt =
|image_seal =
|seal_alt =
|image_shield =
|shield_alt =
|etymology =
|nickname =
|motto =
|image_map =
|map_alt =
|map_caption =
|pushpin_map =
|pushpin_map_alt =
|pushpin_map_caption =
|pushpin_mapsize =
|pushpin_label_position =
|coordinates = <!-- {{coord|latitude|longitude|type:city|display=inline,title}} -->
|coor_pinpoint =
|coordinates_footnotes =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|subdivision_type3 =
|subdivision_name3 =
|established_title =
|established_date =
|founder =
|seat_type =
|seat =
|government_footnotes =
|government_type =
|governing_body =
|leader_party =
|leader_title =
|leader_name =
|leader_title1 =
|leader_name1 =
|leader_title2 =
|leader_name2 =
|leader_title3 =
|leader_name3 =
|leader_title4 =
|leader_name4 =
|unit_pref = Metric
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
|area_footnotes =
|area_urban_footnotes = <!-- <ref> </ref> -->
|area_rural_footnotes = <!-- <ref> </ref> -->
|area_metro_footnotes = <!-- <ref> </ref> -->
|area_note =
|area_water_percent =
|area_rank =
|area_blank1_title =
|area_blank2_title =
<!-- square kilometers -->
|area_total_km2 =
|area_land_km2 =
|area_water_km2 =
|area_urban_km2 =
|area_rural_km2 =
|area_metro_km2 =
|area_blank1_km2 =
|area_blank2_km2 =
<!-- hectares -->
|area_total_ha =
|area_land_ha =
|area_water_ha =
|area_urban_ha =
|area_rural_ha =
|area_metro_ha =
|area_blank1_ha =
|area_blank2_ha =
|length_km =
|width_km =
|dimensions_footnotes =
|elevation_footnotes =
|elevation_m =
|population_footnotes =
|population_as_of =
|population_total =
|population_density_km2 = auto
|population_note =
|population_demonym =
|timezone1 =
|utc_offset1 =
|timezone1_DST =
|utc_offset1_DST =
|postal_code_type =
|postal_code =
|area_code_type =
|area_code =
|area_codes = <!-- for multiple area codes -->
|iso_code =
|website = <!-- {{URL|example.com}} -->
|module =
|footnotes =
}}
</syntaxhighlight>
===Using non-metric units===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name =
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|image_flag =
|flag_alt =
|image_seal =
|seal_alt =
|image_shield =
|shield_alt =
|etymology =
|nickname =
|motto =
|image_map =
|map_alt =
|map_caption =
|pushpin_map =
|pushpin_map_alt =
|pushpin_map_caption =
|pushpin_label_position =
|coordinates = <!-- {{coord|latitude|longitude|type:city|display=inline,title}} -->
|coor_pinpoint =
|coordinates_footnotes =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|subdivision_type3 =
|subdivision_name3 =
|established_title =
|established_date =
|founder =
|seat_type =
|seat =
|government_footnotes =
|leader_party =
|leader_title =
|leader_name =
|unit_pref = US<!-- or UK -->
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
|area_footnotes =
|area_urban_footnotes = <!-- <ref> </ref> -->
|area_rural_footnotes = <!-- <ref> </ref> -->
|area_metro_footnotes = <!-- <ref> </ref> -->
|area_note =
|area_water_percent =
|area_rank =
|area_blank1_title =
|area_blank2_title =
<!-- square miles -->
|area_total_sq_mi =
|area_land_sq_mi =
|area_water_sq_mi =
|area_urban_sq_mi =
|area_rural_sq_mi =
|area_metro_sq_mi =
|area_blank1_sq_mi =
|area_blank2_sq_mi =
<!-- acres -->
|area_total_acre =
|area_land_acre =
|area_water_acre =
|area_urban_acre =
|area_rural_acre =
|area_metro_acre =
|area_blank1_acre =
|area_blank2_acre =
|length_mi =
|width_mi =
|dimensions_footnotes =
|elevation_footnotes =
|elevation_ft =
|population_footnotes =
|population_as_of =
|population_total =
|population_density_sq_mi = auto
|population_note =
|population_demonym =
|timezone1 =
|utc_offset1 =
|timezone1_DST =
|utc_offset1_DST =
|postal_code_type =
|postal_code =
|area_code_type =
|area_code =
|iso_code =
|website = <!-- {{URL|example.com}} -->
|module =
|footnotes =
}}
</syntaxhighlight>
===Short version===
<syntaxhighlight lang="wikitext" style="overflow:auto">
{{Infobox settlement
|name =
|native_name =
|native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
|settlement_type =
|image_skyline =
|imagesize =
|image_alt =
|image_caption =
|etymology =
|nickname =
|coordinates = <!-- {{Coord}} -->
|population_total =
|subdivision_type = Country
|subdivision_name =
|subdivision_type1 =
|subdivision_name1 =
|subdivision_type2 =
|subdivision_name2 =
|website = <!-- {{URL|example.com}} -->
}}
</syntaxhighlight>
===Complete empty syntax, with comments===
This copy of the template lists all parameters except for some of the repeating numbered parameters which are noted in the comments. Comments here should be brief; see the table below for full descriptions of each parameter.
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Infobox settlement
| name = <!-- at least one of the first two fields must be filled in -->
| official_name =
| native_name = <!-- if different from the English name -->
| native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| other_name =
| settlement_type = <!-- such as Town, Village, City, Borough etc. -->
<!-- transliteration(s) -->
| translit_lang1 =
| translit_lang1_type =
| translit_lang1_info =
| translit_lang1_type1 =
| translit_lang1_info1 =
| translit_lang1_type2 =
| translit_lang1_info2 = <!-- etc., up to translit_lang1_type6 / translit_lang1_info6 -->
| translit_lang2 =
| translit_lang2_type =
| translit_lang2_info =
| translit_lang2_type1 =
| translit_lang2_info1 =
| translit_lang2_type2 =
| translit_lang2_info2 = <!-- etc., up to translit_lang2_type6 / translit_lang2_info6 -->
<!-- images, nickname, motto -->
| image_skyline =
| imagesize =
| image_alt =
| image_caption =
| image_flag =
| flag_size =
| flag_alt =
| flag_border =
| flag_link =
| image_seal =
| seal_size =
| seal_alt =
| seal_link =
| seal_type =
| image_shield =
| shield_size =
| shield_alt =
| shield_link =
| image_blank_emblem =
| blank_emblem_type =
| blank_emblem_size =
| blank_emblem_alt =
| blank_emblem_link =
| etymology =
| nickname =
| nicknames =
| motto =
| mottoes =
| anthem =
<!-- maps and coordinates -->
| image_map =
| mapsize =
| map_alt =
| map_caption =
| image_map1 =
| mapsize1 =
| map_alt1 =
| map_caption1 =
| pushpin_map = <!-- name of a location map as per Template:Location_map -->
| pushpin_mapsize =
| pushpin_map_alt =
| pushpin_map_caption =
| pushpin_map_caption_notsmall =
| pushpin_label = <!-- only necessary if "name" or "official_name" are too long -->
| pushpin_label_position = <!-- position of the pushpin label: left, right, top, bottom, none -->
| pushpin_outside =
| pushpin_relief =
| pushpin_image =
| pushpin_overlay =
| coordinates = <!-- {{Coord}} -->
| coor_pinpoint = <!-- to specify exact location of coordinates (was coor_type) -->
| coordinates_footnotes = <!-- for references: use <ref> tags -->
| grid_name = <!-- name of a regional grid system -->
| grid_position = <!-- position on the regional grid system -->
<!-- location -->
| subdivision_type = Country
| subdivision_name = <!-- the name of the country -->
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 = <!-- etc., subdivision_type6 / subdivision_name6 -->
<!-- established -->
| established_title = <!-- Founded -->
| established_date = <!-- requires established_title= -->
| established_title1 = <!-- Incorporated (town) -->
| established_date1 = <!-- requires established_title1= -->
| established_title2 = <!-- Incorporated (city) -->
| established_date2 = <!-- requires established_title2= -->
| established_title3 =
| established_date3 = <!-- requires established_title3= -->
| established_title4 =
| established_date4 = <!-- requires established_title4= -->
| established_title5 =
| established_date5 = <!-- requires established_title5= -->
| established_title6 =
| established_date6 = <!-- requires established_title6= -->
| established_title7 =
| established_date7 = <!-- requires established_title7= -->
| extinct_title =
| extinct_date =
| founder =
| named_for =
<!-- seat, smaller parts -->
| seat_type = <!-- defaults to: Seat -->
| seat =
| seat1_type = <!-- defaults to: Former seat -->
| seat1 =
| parts_type = <!-- defaults to: Boroughs -->
| parts_style = <!-- list, coll (collapsed list), para (paragraph format) -->
| parts = <!-- parts text, or header for parts list -->
| p1 =
| p2 = <!-- etc., up to p50: for separate parts to be listed-->
<!-- government type, leaders -->
| government_footnotes = <!-- for references: use <ref> tags -->
| government_type =
| governing_body =
| leader_party =
| leader_title =
| leader_name = <!-- add &nbsp; (no-break space) to disable automatic links -->
| leader_title1 =
| leader_name1 = <!-- etc., up to leader_title4 / leader_name4 -->
<!-- display settings -->
| total_type = <!-- to set a non-standard label for total area and population rows -->
| unit_pref = <!-- enter: Imperial, to display imperial before metric -->
<!-- area -->
| area_footnotes = <!-- for references: use <ref> tags -->
| dunam_link = <!-- If dunams are used, this specifies which dunam to link. -->
| area_total_km2 = <!-- ALL fields with measurements have automatic unit conversion -->
| area_total_sq_mi = <!-- see table @ Template:Infobox settlement for details -->
| area_total_ha =
| area_total_acre =
| area_total_dunam = <!-- used in Middle East articles only -->
| area_land_km2 =
| area_land_sq_mi =
| area_land_ha =
| area_land_acre =
| area_land_dunam = <!-- used in Middle East articles only -->
| area_water_km2 =
| area_water_sq_mi =
| area_water_ha =
| area_water_acre =
| area_water_dunam = <!-- used in Middle East articles only -->
| area_water_percent =
| area_urban_footnotes = <!-- for references: use <ref> tags -->
| area_urban_km2 =
| area_urban_sq_mi =
| area_urban_ha =
| area_urban_acre =
| area_urban_dunam = <!-- used in Middle East articles only -->
| area_rural_footnotes = <!-- for references: use <ref> tags -->
| area_rural_km2 =
| area_rural_sq_mi =
| area_rural_ha =
| area_rural_acre =
| area_rural_dunam = <!-- used in Middle East articles only -->
| area_metro_footnotes = <!-- for references: use <ref> tags -->
| area_metro_km2 =
| area_metro_sq_mi =
| area_metro_ha =
| area_metro_acre =
| area_metro_dunam = <!-- used in Middle East articles only -->
| area_rank =
| area_blank1_title =
| area_blank1_km2 =
| area_blank1_sq_mi =
| area_blank1_ha =
| area_blank1_acre =
| area_blank1_dunam = <!-- used in Middle East articles only -->
| area_blank2_title =
| area_blank2_km2 =
| area_blank2_sq_mi =
| area_blank2_ha =
| area_blank2_acre =
| area_blank2_dunam = <!-- used in Middle East articles only -->
| area_note =
<!-- dimensions -->
| dimensions_footnotes = <!-- for references: use <ref> tags -->
| length_km =
| length_mi =
| width_km =
| width_mi =
<!-- elevation -->
| elevation_footnotes = <!-- for references: use <ref> tags -->
| elevation_m =
| elevation_ft =
| elevation_point = <!-- for denoting the measurement point -->
| elevation_max_footnotes = <!-- for references: use <ref> tags -->
| elevation_max_m =
| elevation_max_ft =
| elevation_max_point = <!-- for denoting the measurement point -->
| elevation_max_rank =
| elevation_min_footnotes = <!-- for references: use <ref> tags -->
| elevation_min_m =
| elevation_min_ft =
| elevation_min_point = <!-- for denoting the measurement point -->
| elevation_min_rank =
<!-- population -->
| population_footnotes = <!-- for references: use <ref> tags -->
| population_as_of =
| population_total =
| pop_est_footnotes =
| pop_est_as_of =
| population_est =
| population_rank =
| population_density_km2 = <!-- for automatic calculation of any density field, use: auto -->
| population_density_sq_mi =
| population_urban_footnotes =
| population_urban =
| population_density_urban_km2 =
| population_density_urban_sq_mi =
| population_rural_footnotes =
| population_rural =
| population_density_rural_km2 =
| population_density_rural_sq_mi =
| population_metro_footnotes =
| population_metro =
| population_density_metro_km2 =
| population_density_metro_sq_mi =
| population_density_rank =
| population_blank1_title =
| population_blank1 =
| population_density_blank1_km2 =
| population_density_blank1_sq_mi =
| population_blank2_title =
| population_blank2 =
| population_density_blank2_km2 =
| population_density_blank2_sq_mi =
| population_demonym = <!-- demonym, e.g. Liverpudlian for someone from Liverpool -->
| population_demonyms =
| population_note =
<!-- demographics (section 1) -->
| demographics_type1 =
| demographics1_footnotes = <!-- for references: use <ref> tags -->
| demographics1_title1 =
| demographics1_info1 = <!-- etc., up to demographics1_title7 / demographics1_info7 -->
<!-- demographics (section 2) -->
| demographics_type2 =
| demographics2_footnotes = <!-- for references: use <ref> tags -->
| demographics2_title1 =
| demographics2_info1 = <!-- etc., up to demographics2_title10 / demographics2_info10 -->
<!-- time zone(s) -->
| timezone_link =
| timezone1_location =
| timezone1 =
| utc_offset1 =
| timezone1_DST =
| utc_offset1_DST =
| timezone2_location =
| timezone2 =
| utc_offset2 =
| timezone2_DST =
| utc_offset2_DST =
| timezone3_location =
| timezone3 =
| utc_offset3 =
| timezone3_DST =
| utc_offset3_DST =
| timezone4_location =
| timezone4 =
| utc_offset4 =
| timezone4_DST =
| utc_offset4_DST =
| timezone5_location =
| timezone5 =
| utc_offset5 =
| timezone5_DST =
| utc_offset5_DST =
<!-- postal codes, area code -->
| postal_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal_code =
| postal2_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal2_code =
| area_code_type = <!-- defaults to: Area code(s) -->
| area_code =
| area_codes =
| geocode =
| iso_code =
| registration_plate_type =
| registration_plate =
| code1_name =
| code1_info =
| code2_name =
| code2_info =
<!-- blank fields (section 1) -->
| blank_name_sec1 =
| blank_info_sec1 =
| blank1_name_sec1 =
| blank1_info_sec1 =
| blank2_name_sec1 =
| blank2_info_sec1 = <!-- etc., up to blank7_name_sec1 / blank7_info_sec1 -->
<!-- blank fields (section 2) -->
| blank_name_sec2 =
| blank_info_sec2 =
| blank1_name_sec2 =
| blank1_info_sec2 =
| blank2_name_sec2 =
| blank2_info_sec2 = <!-- etc., up to blank7_name_sec2 / blank7_info_sec2 -->
<!-- website, footnotes -->
| website = <!-- {{URL|example.com}} -->
| module =
| footnotes =
}}
</syntaxhighlight>
==Parameter names and descriptions==
{| class="wikitable" style="background: white"
| colspan=3 style="background: orange; text-align: center;" |
===Name and transliteration===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
| '''name''' || optional || This is the usual name in English. If it's not specified, the infobox will use the '''official_name''' as a title unless this too is missing, in which case the page name will be used.
|- style="vertical-align:top;"
| '''official_name''' || optional || The official name in English. Avoid using '''official_name''' if it leads to redundancy with '''name''' and '''settlement_type'''. Use '''official_name''' if the official name is unusual or cannot be simply deduced from the name and settlement type.
|- style="vertical-align:top;"
| '''native_name''' || optional || Name in the local language, if different from '''name''', and if not English. In this case "native" does not mean indigenous but is related to de facto language that is not English. This will display below the name/official name.
|- style="vertical-align:top;"
| '''native_name_lang''' || optional || Use [[List of ISO 639-1 codes|ISO 639-1 code]], e.g. "fr" for French. If there is more than one native name, in different languages, enter those names using {{tl|lang}}, instead.
|- style="vertical-align:top;"
| '''other_name''' || optional || For places with a former or more common name like Bombay or Saigon
|- style="vertical-align:top;"
| '''settlement_type''' || optional || Any type can be entered, such as City, Town, Village, Hamlet, Municipality, Reservation, etc. If set, will be displayed under the names. Might also be used as a label for total population/area (defaulting to ''City''), if needed to distinguish from ''Urban'', ''Rural'' or ''Metro'' (if urban, rural or metro figures are not present, the label is ''Total'' unless '''total_type''' is set).
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Transliteration(s)
|- style="vertical-align:top;"
| '''translit_lang1''' || optional || Will place the "entry" before the word "transliteration(s)". Can be used to specify a particular language like in [[Dêlêg]] or one may just enter "Other", like in [[Gaza City|Gaza]]'s article.
|- style="vertical-align:top;"
| '''translit_lang1_type'''<br />'''translit_lang1_type1'''<br />to<br />'''translit_lang1_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang1_info'''<br />'''translit_lang1_info1'''<br />to<br />'''translit_lang1_info6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2''' || optional || Will place a second transliteration. See [[Dêlêg]]
|- style="vertical-align:top;"
| '''translit_lang2_type'''<br />'''translit_lang2_type1'''<br />to<br />'''translit_lang2_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2_info'''<br />'''translit_lang2_info1'''<br />to<br />'''translit_lang2_info6''' || optional ||
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Images, nickname, motto===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Image
|- style="vertical-align:top;"
| '''image_skyline''' || optional || Primary image representing the settlement. Commonly a photo of the settlement’s skyline.
|- style="vertical-align:top;"
| '''imagesize''' || optional || Can be used to tweak the size of the image_skyline up or down. This can be helpful if an editor wants to make the infobox wider. If used, '''px''' must be specified; default size is 250px.
|- style="vertical-align:top;"
| '''image_alt''' || optional || [[Alt text]] for the image, used by visually impaired readers who cannot see the image. See [[WP:ALT]].
|- style="vertical-align:top;"
| '''image_caption''' || optional || Will place a caption under the image_skyline (if present)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Flag image
|- style="vertical-align:top;"
| '''image_flag''' || optional || Used for a flag.
|- style="vertical-align:top;"
| '''flag_size''' || optional || Can be used to tweak the size of the image_flag up or down from 100px as desired. If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''flag_alt''' || optional || Alt text for the flag.
|- style="vertical-align:top;"
| '''flag_border''' || optional || Set to 'no' to remove the border from the flag
|- style="vertical-align:top;"
| '''flag_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seal image
|- style="vertical-align:top;"
| '''image_seal''' || optional || If the place has an official seal.
|- style="vertical-align:top;"
| '''seal_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''seal_alt''' || optional || Alt text for the seal.
|- style="vertical-align:top;"
| '''seal_link'''<br />'''seal_type''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Coat of arms image
|- style="vertical-align:top;"
| '''image_shield''' || optional || Can be used for a place with a coat of arms.
|- style="vertical-align:top;"
| '''shield_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''shield_alt''' || optional || Alt text for the shield.
|- style="vertical-align:top;"
| '''shield_link''' || optional || Can be used if a wiki article if known but is not automatically linked by the template. See [[Coquitlam, British Columbia]]'s infobox for an example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Logo or emblem image
|- style="vertical-align:top;"
| '''image_blank_emblem''' || optional || Can be used if a place has an official logo, crest, emblem, etc.
|- style="vertical-align:top;"
| '''blank_emblem_type''' || optional || Caption beneath "image_blank_emblem" to specify what type of emblem it is.
|- style="vertical-align:top;"
| '''blank_emblem_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''blank_emblem_alt''' || optional || Alt text for blank emblem.
|- style="vertical-align:top;"
| '''blank_emblem_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Nickname, motto
|- style="vertical-align:top;"
| '''etymology''' || optional || origin of name
|- style="vertical-align:top;"
| '''nickname''' || optional || well-known nickname
|- style="vertical-align:top;"
| '''nicknames''' || optional || if more than one well-known nickname, use this
|- style="vertical-align:top;"
| '''motto''' || optional || Will place the motto under the nicknames
|- style="vertical-align:top;"
| '''mottoes''' || optional || if more than one motto, use this
|- style="vertical-align:top;"
| '''anthem''' || optional || Will place the anthem (song) under the nicknames
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Maps, coordinates===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Map images
|- style="vertical-align:top;"
| '''image_map''' || optional ||
|- style="vertical-align:top;"
| '''mapsize''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt''' || optional || Alt text for map.
|- style="vertical-align:top;"
| '''map_caption''' || optional ||
|- style="vertical-align:top;"
| '''image_map1''' || optional || A secondary map image. The field '''image_map''' must be filled in first. Example see: [[Bloomsburg, Pennsylvania]].
|- style="vertical-align:top;"
| '''mapsize1''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt1''' || optional || Alt text for secondary map.
|- style="vertical-align:top;"
| '''map_caption1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Pushpin map(s), coordinates
|- style="vertical-align:top;"
| '''pushpin_map''' || optional || The name of a location map as per [[Template:Location map]] (e.g. ''Indonesia'' or ''Russia''). The coordinate fields (from {{para|coordinates}}) position a pushpin coordinate marker and label on the map '''automatically'''. Example: [[Padang, Indonesia]]. To show multiple pushpin maps, provide a list of maps separated by #, e.g., ''California#USA''
|- style="vertical-align:top;"
| '''pushpin_mapsize''' || optional || Must be entered as only a number—'''do not use px'''. The default value is 250.<br/>''Equivalent to <code>width</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_alt''' || optional || Alt text for pushpin map; used by [[screen reader]]s, see [[WP:ALT]].<br/>''Equivalent to <code>alt</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_caption''' || optional || Fill out if a different caption from ''map_caption'' is desired.<br/>''Equivalent to <code>caption</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_map_caption_notsmall''' || optional || <!-- add documentation here -->
|- style="vertical-align:top;"
| '''pushpin_label''' || optional || The text of the label to display next to the identifying mark; a [[Wiki markup|wikilink]] can be used. If not specified, the label will be the text assigned to the ''name'' or ''official_name'' parameters (if {{para|pushpin_label_position|none}}, no label is displayed).<br/>''Equivalent to <code>label</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_label_position''' || optional || The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are {left, right, top, bottom, none}. If this field is not specified, the default value is ''right''.<br/>''Equivalent to <code>position</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_outside''' || optional || ''Equivalent to <code>outside</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_relief''' || optional || Set this to <code>y</code> or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available). <br/>''Equivalent to <code>relief</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_image''' || optional || Allows the use of an alternative map; the image must have the same edge coordinates as the location map template.<br/>''Equivalent to <code>AlternativeMap</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''pushpin_overlay''' || optional || Can be used to specify an image to be superimposed on the regular pushpin map.<br/>''Equivalent to <code>overlay_image</code> parameter in [[Template:Location map]].''
|- style="vertical-align:top;"
| '''coordinates''' || optional || Latitude and longitude. Use {{tl|Coord}}. See the documentation for {{tl|Coord}} for more details on usage.
|- style="vertical-align:top;"
| '''coor_pinpoint''' || optional || If needed, to specify more exactly where (or what) coordinates are given (e.g. ''Town Hall'') or a specific place in a larger area (e.g. a city in a county). Example: In the article [[Masovian Voivodeship]], <code>coor_pinpoint=Warsaw</code> specifies [[Warsaw]].
|- style="vertical-align:top;"
| '''coordinates_footnotes''' || optional || Reference(s) for coordinates, placed within <code><nowiki><ref> </ref></nowiki></code> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''grid_name'''<br />'''grid_position''' || optional || Name of a regional grid system and position on the regional grid
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Location, established, seat, subdivisions, government, leaders===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Location
|- style="vertical-align:top;"
| {{anchor|subdivision_type}}'''subdivision_type''' || optional || almost always <code><nowiki>Country</nowiki></code>
|- style="vertical-align:top;"
| '''subdivision_name''' || optional || Depends on the subdivision_type — use the name in text form, sample: <code>United States</code>. Per [[MOS:INFOBOXFLAG]], flag icons or flag templates may be used in this field
|- style="vertical-align:top;"
| '''subdivision_type1'''<br />to<br />'''subdivision_type6''' || optional || Can be State/Province, region, county. These labels are for subdivisions ''above'' the level of the settlement described in the article. For subdivisions ''below'' or ''within'' the place described in the article, use {{para|parts_type}}.
|- style="vertical-align:top;"
| '''subdivision_name1'''<br />to<br />'''subdivision_name6''' || optional || Use the name in text form, sample: <code>Florida</code> or <code><nowiki>[[Florida]]</nowiki></code>. Per [[MOS:INFOBOXFLAG]], flag icons or flag templates should '''not''' be used in these fields
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Established
|- style="vertical-align:top;"
| '''established_title''' || optional || Example: Founded
|- style="vertical-align:top;"
| '''established_date''' || optional || Requires established_title=
|- style="vertical-align:top;"
| '''established_title1''' || optional || Example: Incorporated (town) <br/>[Note that "established_title1" is distinct from "established_title"; you can think of "established_title" as behaving like "established_title0".]
|- style="vertical-align:top;"
| '''established_date1''' || optional || [See note for "established_title1".] Requires established_title1=
|- style="vertical-align:top;"
| '''established_title2''' || optional || Example: Incorporated (city)
|- style="vertical-align:top;"
| '''established_date2''' || optional || Requires established_title2=
|- style="vertical-align:top;"
| '''established_title3''' || optional ||
|- style="vertical-align:top;"
| '''established_date3''' || optional || Requires established_title3=
|- style="vertical-align:top;"
| '''established_title4''' || optional ||
|- style="vertical-align:top;"
| '''established_date4''' || optional || Requires established_title4=
|- style="vertical-align:top;"
| '''established_title5''' || optional ||
|- style="vertical-align:top;"
| '''established_date5''' || optional || Requires established_title5=
|- style="vertical-align:top;"
| '''established_title6''' || optional ||
|- style="vertical-align:top;"
| '''established_date6''' || optional || Requires established_title6=
|- style="vertical-align:top;"
| '''established_title7''' || optional ||
|- style="vertical-align:top;"
| '''established_date7''' || optional || Requires established_title7=
|- style="vertical-align:top;"
| '''extinct_title''' || optional || For when a settlement ceases to exist
|- style="vertical-align:top;"
| '''extinct_date''' || optional || Requires extinct_title=
|- style="vertical-align:top;"
| '''founder''' || optional || Who the settlement was founded by
|- style="vertical-align:top;"
| '''named_for''' || optional || The source of the name of the settlement (a person, a place, et cetera)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seat of government
|- style="vertical-align:top;"
| '''seat_type''' || optional || The label for the seat of government (defaults to ''Seat'').
|- style="vertical-align:top;"
| '''seat''' || optional || The seat of government.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Smaller parts (e.g. boroughs of a city)
|- style="vertical-align:top;"
| '''parts_type''' || optional || The label for the smaller subdivisions (defaults to ''Boroughs'').
|- style="vertical-align:top;"
| '''parts_style''' || optional || Set to ''list'' to display as a collapsible list, ''coll'' as a collapsed list, or ''para'' to use paragraph style. Default is ''list'' for up to 5 items, otherwise ''coll''.
|- style="vertical-align:top;"
| '''parts''' || optional || Text or header of the list of smaller subdivisions.
|- style="vertical-align:top;"
| '''p1'''<br />'''p2'''<br />to<br />'''p50''' || optional || The smaller subdivisions to be listed. Example: [[Warsaw]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Government type, leaders
|- style="vertical-align:top;"
| '''government_footnotes''' || optional || Reference(s) for government, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''government_type''' || optional || Examples: [[Mayor–council government]], [[Council–manager government]], [[City commission government]], ...
|- style="vertical-align:top;"
| '''governing_body''' || optional || Name of the place's governing body
|- style="vertical-align:top;"
| '''leader_party''' || optional || Political party of the place's leader
|- style="vertical-align:top;"
| '''leader_title''' || optional || First title of the place's leader, e.g. Mayor
|- style="vertical-align:top;"
| '''leader_name''' || optional || Name of the place's leader
|- style="vertical-align:top;"
| '''leader_title1'''<br />to<br />'''leader_title4''' || optional ||
|- style="vertical-align:top;"
| '''leader_name1'''<br />to<br />'''leader_name4''' || optional || For long lists use {{tl|Collapsible list}}. See [[Halifax Regional Municipality|Halifax]] for an example.
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Geographic information===
|- style="vertical-align:top;"
| colspan=3 | These fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they should enter both values in their respective fields.
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Display settings
|- style="vertical-align:top;"
| '''total_type''' || optional || Specifies what "total" area and population figure refer to, e.g. ''Greater London''. This overrides other labels for total population/area. To make the total area and population display on the same line as the words "Area" and "Population", with no "Total" or similar label, set the value of this parameter to '''&nbsp;'''.
|- style="vertical-align:top;"
| '''unit_pref''' || optional || To change the unit order to ''imperial (metric)'', enter '''imperial'''. The default display style is ''metric (imperial)''. However, the template will swap the order automatically if the '''subdivision_name''' equals some variation of the US or the UK.<br />For the middle east, a unit preference of [[dunam]] can be entered (only affects total area). <br /> All values must be entered in a '''raw format: no commas, spaces, or unit symbols'''. The template will format them automatically.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Area
|- style="vertical-align:top;"
| '''area_footnotes''' || optional || Reference(s) for area, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''dunam_link''' || optional || If dunams are used, the default is to link the word ''dunams'' in the total area section. This can be changed by setting <code>dunam_link</code> to another measure (e.g. <code>dunam_link=water</code>). Linking can also be turned off by setting the parameter to something else (e.g. <code>dunam_link=none</code> or <code>dunam_link=off</code>).
|- style="vertical-align:top;"
| '''area_total_km2''' || optional || Total area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_total_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_total_ha''' || optional || Total area in hectares—symbol: ha. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display acres if area_total_acre is empty.
|- style="vertical-align:top;"
| '''area_total_sq_mi''' || optional || Total area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_total_km2 is empty.
|- style="vertical-align:top;"
| '''area_total_acre''' || optional || Total area in acres. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display hectares if area_total_ha is empty.
|- style="vertical-align:top;"
| '''area_total_dunam''' || optional || Total area in dunams, which is wiki-linked. Used in middle eastern places like Israel, Gaza, and the West Bank. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers or hectares and square miles or acreds if area_total_km2, area_total_ha, area_total_sq_mi, and area_total_acre are empty. Examples: [[Gaza City|Gaza]] and [[Ramallah]]
|- style="vertical-align:top;"
| '''area_land_km2''' || optional || Land area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_land_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_land_sq_mi''' || optional || Land area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_land_km2 is empty.
|- style="vertical-align:top;"
| '''area_land_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_land_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_land_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_km2''' || optional || Water area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_water_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_water_sq_mi''' || optional || Water area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_water_km2 is empty.
|- style="vertical-align:top;"
| '''area_water_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_water_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_water_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_percent''' || optional || percent of water without the "%"
|- style="vertical-align:top;"
| '''area_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_urban_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_urban_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
|- style="vertical-align:top;"
| '''area_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_rural_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_rural_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_metro_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_metro_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_rank''' || optional || The settlement's area, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''area_blank1_title''' || optional || Example see London
|- style="vertical-align:top;"
| '''area_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank1_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank1_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank2_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank2_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_note''' || optional || A place for additional information such as the name of the source.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Dimensions
|- style="vertical-align:top;"
| '''dimensions_footnotes''' || optional || Reference(s) for dimensions, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''length_km''' || optional || Raw number entered in kilometers. Will automatically convert to display length in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''length_mi''' || optional || Raw number entered in miles. Will automatically convert to display length in kilometers if length_km is empty.
|- style="vertical-align:top;"
| '''width_km''' || optional || Raw number entered in kilometers. Will automatically convert to display width in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''width_mi''' || optional || Raw number entered in miles. Will automatically convert to display width in kilometers if length_km is empty.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Elevation
|- style="vertical-align:top;"
| '''elevation_footnotes''' || optional || Reference(s) for elevation, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''elevation_m''' || optional || Raw number entered in meters. Will automatically convert to display elevation in feet if elevation_ft is empty. However, if a range in elevation (i.e. 5–50 m ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_ft''' || optional || Raw number, entered in feet. Will automatically convert to display the average elevation in meters if '''elevation_m''' field is empty. However, if a range in elevation (e.g. 50–500 ft ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_max_footnotes'''<br />'''elevation_min_footnotes''' || optional || Same as above, but for the "max" and "min" elevations. See [[City of Leeds]].
|- style="vertical-align:top;"
| '''elevation_max_m'''<br />'''elevation_max_ft'''<br />'''elevation_max_rank'''<br />'''elevation_min_m'''<br />'''elevation_min_ft'''<br />'''elevation_min_rank''' || optional || Used to give highest & lowest elevations and rank, instead of just a single value. Example: [[Halifax Regional Municipality]].
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Population, demographics===
|- style="vertical-align:top;"
| colspan=3 | The density fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they can enter both values in their respective fields. '''To calculate density with respect to the total area automatically, type ''auto'' in place of any density value.'''
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Population
|- style="vertical-align:top;"
| '''population_total''' || optional || Actual population (see below for estimates) preferably consisting of digits only (without any commas)
|- style="vertical-align:top;"
| '''population_as_of''' || optional || The year for the population total (usually a census year)
|- style="vertical-align:top;"
| '''population_footnotes''' || optional || Reference(s) for population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_est''' || optional || Population estimate.
|- style="vertical-align:top;"
| '''pop_est_as_of''' || optional || The year or month & year of the population estimate
|- style="vertical-align:top;"
| '''pop_est_footnotes''' || optional || Reference(s) for population estimate, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_urban''' || optional ||
|- style="vertical-align:top;"
| '''population_urban_footnotes''' || optional || Reference(s) for urban population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rural''' || optional ||
|- style="vertical-align:top;"
| '''population_rural_footnotes''' || optional || Reference(s) for rural population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_metro''' || optional ||
|- style="vertical-align:top;"
| '''population_metro_footnotes''' || optional || Reference(s) for metro population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rank''' || optional || The settlement's population, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_density_rank''' || optional || The settlement's population density, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_blank1_title''' || optional || Can be used for estimates. Example: [[Windsor, Ontario]]
|- style="vertical-align:top;"
| '''population_blank1''' || optional || The population value for blank1_title
|- style="vertical-align:top;"
| '''population_density_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_demonym''' || optional || A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example, a citizen in [[Liverpool]] is known as a [[Liverpudlian]].
|- style="vertical-align:top;"
| '''population_demonyms''' || optional || If more than one demonym, use this
|- style="vertical-align:top;"
| '''population_note''' || optional || A place for additional information such as the name of the source. See [[Windsor, Ontario]] for example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 1)
|- style="vertical-align:top;"
| '''demographics_type1''' || optional || Section Header. For example: Ethnicity
|- style="vertical-align:top;"
| '''demographics1_footnotes''' || optional || Reference(s) for demographics section 1, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics1_title1'''<br />to<br />'''demographics1_title7''' || optional || Titles related to demographics_type1. For example: White, Black, Hispanic...
|- style="vertical-align:top;"
| '''demographics1_info1'''<br />to<br />'''demographics1_info7''' || optional || Information related to the "titles". For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 2)
|- style="vertical-align:top;"
| '''demographics_type2''' || optional || A second section header. For example: Languages
|- style="vertical-align:top;"
| '''demographics2_footnotes''' || optional || Reference(s) for demographics section 2, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics2_title1'''<br />to<br />'''demographics2_title10''' || optional || Titles related to '''demographics_type2'''. For example: English, French, Arabic...
|- style="vertical-align:top;"
| '''demographics2_info1'''<br />to<br />'''demographics2_info10''' || optional || Information related to the "titles" for type2. For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Other information===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Time zone(s)
|- style="vertical-align:top;"
| '''timezone1''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1''' || optional || Plain text, e.g. "+05:00" or "-08:00". Auto-linked, so do not include references or additional text.
|- style="vertical-align:top;"
| '''timezone1_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1_DST''' || optional ||
|- style="vertical-align:top;"
| '''timezone2''' || optional || A second timezone field for larger areas such as a Province.
|- style="vertical-align:top;"
| '''utc_offset2''' || optional ||
|- style="vertical-align:top;"
| '''timezone2_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset2_DST''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Postal code(s) & area code
|- style="vertical-align:top;"
| '''postal_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal_code''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code''' || optional ||
|- style="vertical-align:top;"
| '''area_code_type''' || optional || If left blank/not used template will default to "[[Telephone numbering plan|Area code(s)]]"
|- style="vertical-align:top;"
| '''area_code''' || optional || Refers to the telephone dialing code for the settlement, ''not'' a geographic area code.
|- style="vertical-align:top;"
| '''area_codes''' || optional || If more than one area code, use this
|- style="vertical-align:top;"
| '''geocode''' || optional || See [[Geocode]]
|- style="vertical-align:top;"
| '''iso_code''' || optional || See [[ISO 3166]]
|- style="vertical-align:top;"
| '''registration_plate_type''' || optional || If left blank/not used template will default to "[[Vehicle registration plate|Vehicle registration]]"
|- style="vertical-align:top;"
| '''registration_plate''' || optional || See [[Vehicle registration plate]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 1)
|- style="vertical-align:top;"
| '''blank_name_sec1''' || optional || Fields used to display other information. The name is displayed in bold on the left side of the infobox.
|- style="vertical-align:top;"
| '''blank_info_sec1''' || optional || The information associated with the ''blank_name'' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see: [[Warsaw]]
|- style="vertical-align:top;"
| '''blank1_name_sec1'''<br />to<br />'''blank7_name_sec1''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec1'''<br />to<br />'''blank7_info_sec1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 2)
|- style="vertical-align:top;"
| '''blank_name_sec2''' || optional || For a second section of blank fields
|- style="vertical-align:top;"
| '''blank_info_sec2''' || optional || Example: [[Beijing]]
|- style="vertical-align:top;"
| '''blank1_name_sec2'''<br />to<br />'''blank7_name_sec2''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec2'''<br />to<br />'''blank7_info_sec2''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Website, footnotes
|- style="vertical-align:top;"
| '''website''' || optional || External link to official website, Use {{Tl|URL}}, thus: <nowiki>{{URL|example.com}}</nowiki>
|- style="vertical-align:top;"
| '''module''' || optional || To embed infoboxes at the bottom of the infobox
|- style="vertical-align:top;"
| '''footnotes''' || optional || Text to be displayed at the bottom of the infobox
|- style="vertical-align:top;"
| '''short_description''' || optional || [[WP:SHORTDESC|specify custom short description]]; if not specified, one will be automatically generated, e.g. "Place in Israel".
|}
<!-- End of parameter name/description table -->
# {{tl|Infobox settlement/densdisp}}
# {{tl|Infobox settlement/dunam}}
# {{tl|Infobox settlement/dunam/mag}}
# {{tl|Infobox settlement/impus}}
# {{tl|Infobox settlement/impus/mag}}
# {{tl|Infobox settlement/lengthdisp}}
# {{tl|Infobox settlement/link}}
# {{tl|Infobox settlement/metric}}
# {{tl|Infobox settlement/metric/mag}}
# {{tl|Infobox settlement/pref}}
==Microformat==
{{UF-hcard-geo}}
== TemplateData ==
{{TemplateData header}}
{{collapse top|title=TemplateData}}
<templatedata>
{
"description": "Infobox for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, etc.",
"format": "{{_\n| __________________ = _\n}}\n",
"params": {
"name": {
"label": "Common name",
"description": "This is the usual name in English. If it's not specified, the infobox will use the 'official_name' as a title unless this too is missing, in which case the page name will be used.",
"type": "string",
"suggested": true
},
"official_name": {
"label": "Official name",
"description": "The official name in English, if different from 'name'.",
"type": "string",
"suggested": true
},
"native_name": {
"label": "Native name",
"description": "This will display under the name/official name.",
"type": "string",
"example": "Distrito Federal de México"
},
"native_name_lang": {
"label": "Native name language",
"description": "Use ISO 639-1 code, e.g. 'fr' for French. If there is more than one native name in different languages, enter those names using {{lang}} instead.",
"type": "string",
"example": "zh"
},
"other_name": {
"label": "Other name",
"description": "For places with a former or more common name like Bombay or Saigon.",
"type": "string"
},
"settlement_type": {
"label": "Type of settlement",
"description": "Any type can be entered, such as 'City', 'Town', 'Village', 'Hamlet', 'Municipality', 'Reservation', etc. If set, will be displayed under the names, provided either 'name' or 'official_name' is filled in. Might also be used as a label for total population/area (defaulting to 'City'), if needed to distinguish from 'Urban', 'Rural' or 'Metro' (if urban, rural or metro figures are not present, the label is 'Total' unless 'total_type' is set).",
"type": "string",
"aliases": [
"type"
]
},
"translit_lang1": {
"label": "Transliteration from language 1",
"description": "Will place the entry before the word 'transliteration(s)'. Can be used to specify a particular language, like in Dêlêg, or one may just enter 'Other', like in Gaza's article.",
"type": "string"
},
"translit_lang1_type": {
"label": "Transliteration type for language 1",
"type": "line",
"example": "[[Hanyu pinyin]]",
"description": "The type of transliteration used for the first language."
},
"translit_lang1_info": {
"label": "Transliteration language 1 info",
"description": "Parameters 'translit_lang2_info1' ... 'translit_lang2_info6' are also available, but not documented here.",
"type": "string"
},
"translit_lang2": {
"label": "Transliteration language 2",
"description": "Will place a second transliteration. See Dêlêg.",
"type": "string"
},
"image_skyline": {
"label": "Image",
"description": "Primary image representing the settlement. Commonly a photo of the settlement’s skyline.",
"type": "wiki-file-name"
},
"imagesize": {
"label": "Image size",
"description": "Can be used to tweak the size of 'image_skyline' up or down. This can be helpful if an editor wants to make the infobox wider. If used, 'px' must be specified; default size is 250px.",
"type": "string"
},
"image_alt": {
"label": "Image alt text",
"description": "Alt (hover) text for the image, used by visually impaired readers who cannot see the image.",
"type": "string"
},
"image_caption": {
"label": "Image caption",
"description": "Will place a caption under 'image_skyline' (if present).",
"type": "content"
},
"image_flag": {
"label": "Flag image",
"description": "Used for a flag.",
"type": "wiki-file-name"
},
"flag_size": {
"label": "Flag size",
"description": "Can be used to tweak the size of 'image_flag' up or down from 100px as desired. If used, 'px' must be specified; default size is 100px.",
"type": "string"
},
"flag_alt": {
"label": "Flag alt text",
"description": "Alt text for the flag.",
"type": "string"
},
"flag_border": {
"label": "Flag border?",
"description": "Set to 'no' to remove the border from the flag.",
"type": "boolean",
"example": "no"
},
"flag_link": {
"label": "Flag link",
"type": "string",
"description": "Link to the flag."
},
"image_seal": {
"label": "Official seal image",
"description": "An image of an official seal, if the place has one.",
"type": "wiki-file-name"
},
"seal_size": {
"label": "Seal size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string"
},
"seal_alt": {
"label": "Seal alt text",
"description": "Alt (hover) text for the seal.",
"type": "string"
},
"seal_link": {
"label": "Seal link",
"type": "string",
"description": "Link to the seal."
},
"image_shield": {
"label": "Coat of arms/shield image",
"description": "Can be used for a place with a coat of arms.",
"type": "wiki-file-name"
},
"shield_size": {
"label": "Shield size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"example": "200px"
},
"shield_alt": {
"label": "Shield alt text",
"description": "Alternate text for the shield.",
"type": "string"
},
"shield_link": {
"label": "Shield link",
"description": "Can be used if a wiki article if known but is not automatically linked by the template. See Coquitlam, British Columbia's infobox for an example.",
"type": "string"
},
"image_blank_emblem": {
"label": "Blank emblem image",
"description": "Can be used if a place has an official logo, crest, emblem, etc.",
"type": "wiki-file-name"
},
"blank_emblem_type": {
"label": "Blank emblem type",
"description": "Caption beneath 'image_blank_emblem' to specify what type of emblem it is.",
"type": "string",
"example": "Logo"
},
"blank_emblem_size": {
"label": "Blank emblem size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"example": "200px"
},
"blank_emblem_alt": {
"label": "Blank emblem alt text",
"description": "Alt text for blank emblem.",
"type": "string"
},
"blank_emblem_link": {
"label": "Blank emblem link",
"type": "string",
"description": "A link to the emblem of custom type."
},
"nickname": {
"label": "Nickname",
"description": "Well-known nickname(s).",
"type": "string",
"example": "Sin City"
},
"motto": {
"label": "Motto",
"description": "Will place the motto under the nicknames.",
"type": "string"
},
"anthem": {
"label": "Anthem",
"description": "Will place the anthem (song) under the nicknames.",
"type": "string",
"example": "[[Hatikvah]]"
},
"image_map": {
"label": "Map image",
"description": "A map of the region, or a map with the region highlighted within a parent region.",
"type": "wiki-file-name"
},
"mapsize": {
"label": "Map size",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string"
},
"map_alt": {
"label": "Map alt text",
"description": "Alternate (hover) text for the map.",
"type": "string"
},
"map_caption": {
"label": "Map caption",
"type": "content",
"description": "Caption for the map displayed."
},
"image_map1": {
"label": "Map 2 image",
"description": "A secondary map image. The field 'image_map' must be filled in first. For an example, see [[Bloomsburg, Pennsylvania]].",
"example": "File:Columbia County Pennsylvania Incorporated and Unincorporated areas Bloomsburg Highlighted.svg",
"type": "wiki-file-name"
},
"mapsize1": {
"label": "Map 2 size",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string",
"example": "300px"
},
"map_alt1": {
"label": "Map 2 alt text",
"description": "Alt (hover) text for the second map.",
"type": "string"
},
"map_caption1": {
"label": "Map 2 caption",
"type": "content",
"description": "Caption of the second map."
},
"pushpin_map": {
"label": "Pushpin map",
"description": "The name of a location map (e.g. 'Indonesia' or 'Russia'). The coordinates information (from the coordinates parameter) positions a pushpin coordinate marker and label on the map automatically. For an example, see Padang, Indonesia.",
"type": "string",
"example": "Indonesia"
},
"pushpin_mapsize": {
"label": "Pushpin map size",
"description": "Must be entered as only a number—do not use 'px'. The default value is 250.",
"type": "number",
"example": "200"
},
"pushpin_map_alt": {
"label": "Pushpin map alt text",
"description": "Alt (hover) text for the pushpin map.",
"type": "string"
},
"pushpin_map_caption": {
"label": "Pushpin map caption",
"description": "Fill out if a different caption from 'map_caption' is desired.",
"type": "string",
"example": "Map showing Bloomsburg in Pennsylvania"
},
"pushpin_label": {
"label": "Pushpin label",
"type": "line",
"example": "Bloomsburg",
"description": "Label of the pushpin."
},
"pushpin_label_position": {
"label": "Pushpin label position",
"description": "The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are 'left', 'right', 'top', 'bottom', and 'none'. If this field is not specified, the default value is 'right'.",
"type": "string",
"example": "left",
"default": "right"
},
"pushpin_outside": {
"label": "Pushpin outside?",
"type": "line"
},
"pushpin_relief": {
"label": "Pushpin relief",
"description": "Set this to 'y' or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available).",
"type": "string",
"example": "y"
},
"pushpin_image": {
"label": "Pushpin image",
"type": "wiki-file-name",
"description": "Image to use for the pushpin."
},
"pushpin_overlay": {
"label": "Pushpin overlay",
"description": "Can be used to specify an image to be superimposed on the regular pushpin map.",
"type": "wiki-file-name"
},
"coordinates": {
"label": "Coordinates",
"description": "Latitude and longitude. Use {{Coord}}. See the documentation for {{Coord}} for more details on usage.",
"type": "wiki-template-name",
"example": "{{coord|41|50|15|N|87|40|55|W}}"
},
"coor_pinpoint": {
"label": "Coordinate pinpoint",
"description": "If needed, to specify more exactly where (or what) coordinates are given (e.g. 'Town Hall') or a specific place in a larger area (e.g. a city in a county). Example: Masovian Voivodeship.",
"type": "string"
},
"coordinates_footnotes": {
"label": "Coordinates footnotes",
"description": "Reference(s) for coordinates. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"subdivision_type": {
"label": "Subdivision type 1",
"description": "Almost always 'Country'.",
"type": "string",
"example": "[[List of sovereign states|Country]]"
},
"subdivision_name": {
"label": "Subdivision name 1",
"description": "Depends on 'subdivision_type'. Use the name in text form, e.g., 'United States'. Per MOS:INFOBOXFLAG, flag icons or flag templates may be used in this field.",
"type": "string"
},
"subdivision_type1": {
"label": "Subdivision type 2",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type2": {
"label": "Subdivision type 3",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type3": {
"label": "Subdivision type 4",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type4": {
"label": "Subdivision type 5",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type5": {
"label": "Subdivision type 6",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_type6": {
"label": "Subdivision type 7",
"description": "Additional subdivisions; can be state/province, region, or county.",
"type": "string"
},
"subdivision_name1": {
"label": "Subdivision name 2",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Connecticut]]"
},
"subdivision_name2": {
"label": "Subdivision name 3",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Florida]]"
},
"subdivision_name3": {
"label": "Subdivision name 4",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Utah]]"
},
"subdivision_name4": {
"label": "Subdivision name 5",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[California]]"
},
"subdivision_name5": {
"label": "Subdivision name 6",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Vermont]]"
},
"subdivision_name6": {
"label": "Subdivision name 7",
"description": "Use the name in text form, e.g., 'Florida' or '[[Florida]]'. Per MOS:INFOBOXFLAG, flag icons or flag templates should not be used in this field.",
"type": "string",
"example": "[[Wyoming]]"
},
"established_title": {
"label": "First establishment event",
"description": "Title of the first establishment event.",
"type": "string",
"example": "First settled"
},
"established_date": {
"label": "First establishment date",
"type": "date",
"description": "Date of the first establishment event."
},
"established_title1": {
"label": "Second establishment event",
"description": "Title of the second establishment event.",
"type": "string",
"example": "Incorporated as a town"
},
"established_date1": {
"label": "Second establishment date",
"type": "date",
"description": "Date of the second establishment event."
},
"established_title2": {
"label": "Third establishment event",
"description": "Title of the third establishment event.",
"type": "string",
"example": "Incorporated as a city"
},
"established_date2": {
"label": "Third establishment date",
"type": "date",
"description": "Date of the third establishment event."
},
"established_title3": {
"label": "Fourth establishment event",
"type": "string",
"description": "Title of the fourth establishment event.",
"example": "Incorporated as a county"
},
"established_date3": {
"label": "Fourth establishment date",
"type": "date",
"description": "Date of the fourth establishment event."
},
"extinct_title": {
"label": "Extinction event title",
"description": "For when a settlement ceases to exist.",
"type": "string",
"example": "[[Sack of Rome]]"
},
"extinct_date": {
"label": "Extinction date",
"type": "string",
"description": "Date the settlement ceased to exist."
},
"founder": {
"label": "Founder",
"description": "Who the settlement was founded by.",
"type": "string"
},
"named_for": {
"label": "Named for",
"description": "The source of the name of the settlement (a person, a place, et cetera).",
"type": "string",
"example": "[[Ho Chi Minh]]"
},
"seat_type": {
"label": "Seat of government type",
"description": "The label for the seat of government (defaults to 'Seat').",
"type": "string",
"default": "Seat"
},
"seat": {
"label": "Seat of government",
"description": "The seat of government.",
"type": "string",
"example": "[[White House]]"
},
"parts_type": {
"label": "Type of smaller subdivisions",
"description": "The label for the smaller subdivisions (defaults to 'Boroughs').",
"type": "string",
"default": "Boroughs"
},
"parts_style": {
"label": "Parts style",
"description": "Set to 'list' to display as a collapsible list, 'coll' as a collapsed list, or 'para' to use paragraph style. Default is 'list' for up to 5 items, otherwise 'coll'.",
"type": "string",
"example": "list"
},
"parts": {
"label": "Smaller subdivisions",
"description": "Text or header of the list of smaller subdivisions.",
"type": "string"
},
"p1": {
"label": "Smaller subdivision 1",
"description": "The smaller subdivisions to be listed. Parameters 'p1' to 'p50' can also be used.",
"type": "string"
},
"government_footnotes": {
"label": "Government footnotes",
"description": "Reference(s) for government. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"government_type": {
"label": "Government type",
"description": "The place's type of government.",
"type": "string",
"example": "[[Mayor–council government]]"
},
"governing_body": {
"label": "Governing body",
"description": "Name of the place's governing body.",
"type": "wiki-page-name",
"example": "Legislative Council of Hong Kong"
},
"leader_party": {
"label": "Leader political party",
"description": "Political party of the place's leader.",
"type": "string"
},
"leader_title": {
"label": "Leader title",
"description": "First title of the place's leader, e.g. 'Mayor'.",
"type": "string",
"example": "[[Governor (United States)|Governor]]"
},
"leader_name": {
"label": "Leader's name",
"description": "Name of the place's leader.",
"type": "string",
"example": "[[Jay Inslee]]"
},
"leader_title1": {
"label": "Leader title 1",
"description": "First title of the place's leader, e.g. 'Mayor'.",
"type": "string",
"example": "Mayor"
},
"leader_name1": {
"label": "Leader name 1",
"description": "Additional names for leaders. Parameters 'leader_name1' .. 'leader_name4' are available. For long lists, use {{Collapsible list}}.",
"type": "string"
},
"total_type": {
"label": "Total type",
"description": "Specifies what total area and population figure refer to, e.g. 'Greater London'. This overrides other labels for total population/area. To make the total area and population display on the same line as the words ''Area'' and ''Population'', with no ''Total'' or similar label, set the value of this parameter to ' '.",
"type": "string"
},
"unit_pref": {
"label": "Unit preference",
"description": "To change the unit order to 'imperial (metric)', enter 'imperial'. The default display style is 'metric (imperial)'. However, the template will swap the order automatically if the 'subdivision_name' equals some variation of the US or the UK. For the Middle East, a unit preference of dunam can be entered (only affects total area). All values must be entered in a raw format (no commas, spaces, or unit symbols). The template will format them automatically.",
"type": "string",
"example": "imperial"
},
"area_footnotes": {
"label": "Area footnotes",
"description": "Reference(s) for area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"dunam_link": {
"label": "Link dunams?",
"description": "If dunams are used, the default is to link the word ''dunams'' in the total area section. This can be changed by setting 'dunam_link' to another measure (e.g. 'dunam_link=water'). Linking can also be turned off by setting the parameter to something else (e.g., 'dunam_link=none' or 'dunam_link=off').",
"type": "boolean",
"example": "none"
},
"area_total_km2": {
"label": "Total area (km2)",
"description": "Total area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_total_sq_mi' is empty.",
"type": "number"
},
"area_total_sq_mi": {
"label": "Total area (sq. mi)",
"description": "Total area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_total_km2' is empty.",
"type": "number"
},
"area_total_ha": {
"label": "Total area (hectares)",
"description": "Total area in hectares (symbol: ha). Value must be entered in raw format (no commas or spaces). Auto-converted to display acres if 'area_total_acre' is empty.",
"type": "number"
},
"area_total_acre": {
"label": "Total area (acres)",
"description": "Total area in acres. Value must be entered in raw format (no commas or spaces). Auto-converted to display hectares if 'area_total_ha' is empty.",
"type": "number"
},
"area_total_dunam": {
"label": "Total area (dunams)",
"description": "Total area in dunams, which is wikilinked. Used in Middle Eastern places like Israel, Gaza, and the West Bank. Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers or hectares and square miles or acres if 'area_total_km2', 'area_total_ha', 'area_total_sq_mi', and 'area_total_acre' are empty. Examples: Gaza and Ramallah.",
"type": "number"
},
"area_land_km2": {
"label": "Land area (sq. km)",
"description": "Land area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_land_sq_mi' is empty.",
"type": "number"
},
"area_land_sq_mi": {
"label": "Land area (sq. mi)",
"description": "Land area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_land_km2' is empty.",
"type": "number"
},
"area_land_ha": {
"label": "Land area (hectares)",
"description": "The place's land area in hectares.",
"type": "number"
},
"area_land_dunam": {
"label": "Land area (dunams)",
"description": "The place's land area in dunams.",
"type": "number"
},
"area_land_acre": {
"label": "Land area (acres)",
"description": "The place's land area in acres.",
"type": "number"
},
"area_water_km2": {
"label": "Water area (sq. km)",
"description": "Water area in square kilometers (symbol: km²). Value must be entered in raw format (no commas or spaces). Auto-converted to display square miles if 'area_water_sq_mi' is empty.",
"type": "number"
},
"area_water_sq_mi": {
"label": "Water area (sq. mi)",
"description": "Water area in square miles (symbol: sq mi). Value must be entered in raw format (no commas or spaces). Auto-converted to display square kilometers if 'area_water_km2' is empty.",
"type": "number"
},
"area_water_ha": {
"label": "Water area (hectares)",
"description": "The place's water area in hectares.",
"type": "number"
},
"area_water_dunam": {
"label": "Water area (dunams)",
"description": "The place's water area in dunams.",
"type": "number"
},
"area_water_acre": {
"label": "Water area (acres)",
"description": "The place's water area in acres.",
"type": "number"
},
"area_water_percent": {
"label": "Percent water area",
"description": "Percent of water without the %.",
"type": "number",
"example": "21"
},
"area_urban_km2": {
"label": "Urban area (sq. km)",
"type": "number",
"description": "Area of the place's urban area in square kilometers."
},
"area_urban_sq_mi": {
"label": "Urban area (sq. mi)",
"type": "number",
"description": "Area of the place's urban area in square miles."
},
"area_urban_ha": {
"label": "Urban area (hectares)",
"description": "Area of the place's urban area in hectares.",
"type": "number"
},
"area_urban_dunam": {
"label": "Urban area (dunams)",
"description": "Area of the place's urban area in dunams.",
"type": "number"
},
"area_urban_acre": {
"label": "Urban area (acres)",
"description": "Area of the place's urban area in acres.",
"type": "number"
},
"area_urban_footnotes": {
"label": "Urban area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_rural_km2": {
"label": "Rural area (sq. km)",
"type": "number",
"description": "Area of the place's rural area in square kilometers."
},
"area_rural_sq_mi": {
"label": "Rural area (sq. mi)",
"type": "number",
"description": "Area of the place's rural area in square miles."
},
"area_rural_ha": {
"label": "Rural area (hectares)",
"description": "Area of the place's rural area in hectares.",
"type": "number"
},
"area_rural_dunam": {
"label": "Rural area (dunams)",
"description": "Area of the place's rural area in dunams.",
"type": "number"
},
"area_rural_acre": {
"label": "Rural area (acres)",
"description": "Area of the place's rural area in acres.",
"type": "number"
},
"area_rural_footnotes": {
"label": "Rural area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_metro_km2": {
"label": "Metropolitan area (sq. km)",
"type": "number",
"description": "Area of the place's metropolitan area in square kilometers."
},
"area_metro_sq_mi": {
"label": "Metropolitan area (sq. mi)",
"type": "number",
"description": "Area of the place's metropolitan area in square miles."
},
"area_metro_ha": {
"label": "Metropolitan area (hectares)",
"description": "Area of the place's metropolitan area in hectares.",
"type": "number"
},
"area_metro_dunam": {
"label": "Metropolitan area (dunams)",
"description": "Area of the place's metropolitan area in dunams.",
"type": "number"
},
"area_metro_acre": {
"label": "Metropolitan area (acres)",
"description": "Area of the place's metropolitan area in acres.",
"type": "number"
},
"area_metro_footnotes": {
"label": "Metropolitan area footnotes",
"description": "Reference(s) for the urban area. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"area_rank": {
"label": "Area rank",
"description": "The settlement's area, as ranked within its parent sub-division.",
"type": "string"
},
"area_blank1_title": {
"label": "First blank area section title",
"description": "Title of the place's first custom area section.",
"type": "string",
"example": "see [[London]]"
},
"area_blank1_km2": {
"label": "Area blank 1 (sq. km)",
"type": "number",
"description": "Area of the place's first blank area section in square kilometers."
},
"area_blank1_sq_mi": {
"label": "Area blank 1 (sq. mi)",
"type": "number",
"description": "Area of the place's first blank area section in square miles."
},
"area_blank1_ha": {
"label": "Area blank 1 (hectares)",
"description": "Area of the place's first blank area section in hectares.",
"type": "number"
},
"area_blank1_dunam": {
"label": "Area blank 1 (dunams)",
"description": "Area of the place's first blank area section in dunams.",
"type": "number"
},
"area_blank1_acre": {
"label": "Area blank 1 (acres)",
"description": "Area of the place's first blank area section in acres.",
"type": "number"
},
"area_blank2_title": {
"label": "Second blank area section title",
"type": "string",
"description": "Title of the place's second custom area section."
},
"area_blank2_km2": {
"label": "Area blank 2 (sq. km)",
"type": "number",
"description": "Area of the place's second blank area section in square kilometers."
},
"area_blank2_sq_mi": {
"label": "Area blank 2 (sq. mi)",
"type": "number",
"description": "Area of the place's second blank area section in square miles."
},
"area_blank2_ha": {
"label": "Area blank 2 (hectares)",
"description": "Area of the place's third blank area section in hectares.",
"type": "number"
},
"area_blank2_dunam": {
"label": "Area blank 2 (dunams)",
"description": "Area of the place's third blank area section in dunams.",
"type": "number"
},
"area_blank2_acre": {
"label": "Area blank 2 (acres)",
"description": "Area of the place's third blank area section in acres.",
"type": "number"
},
"area_note": {
"label": "Area footnotes",
"description": "A place for additional information such as the name of the source.",
"type": "content",
"example": "<ref name=\"CenPopGazetteer2016\">{{cite web|title=2016 U.S. Gazetteer Files|url=https://www2.census.gov/geo/docs/maps-data/data/gazetteer/2016_Gazetteer/2016_gaz_place_42.txt|publisher=United States Census Bureau|access-date=August 13, 2017}}</ref>"
},
"dimensions_footnotes": {
"label": "Dimensions footnotes",
"description": "Reference(s) for dimensions. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"length_km": {
"label": "Length in km",
"description": "Raw number entered in kilometers. Will automatically convert to display length in miles if 'length_mi' is empty.",
"type": "number"
},
"length_mi": {
"label": "Length in miles",
"description": "Raw number entered in miles. Will automatically convert to display length in kilometers if 'length_km' is empty.",
"type": "number"
},
"width_km": {
"label": "Width in kilometers",
"description": "Raw number entered in kilometers. Will automatically convert to display width in miles if 'length_mi' is empty.",
"type": "number"
},
"width_mi": {
"label": "Width in miles",
"description": "Raw number entered in miles. Will automatically convert to display width in kilometers if 'length_km' is empty.",
"type": "number"
},
"elevation_m": {
"label": "Elevation in meters",
"description": "Raw number entered in meters. Will automatically convert to display elevation in feet if 'elevation_ft' is empty. However, if a range in elevation (i.e. 5–50 m) is desired, use the 'max' and 'min' fields below.",
"type": "number"
},
"elevation_ft": {
"label": "Elevation in feet",
"description": "Raw number, entered in feet. Will automatically convert to display the average elevation in meters if 'elevation_m' field is empty. However, if a range in elevation (i.e. 50–500 ft) is desired, use the 'max' and 'min' fields below.",
"type": "number"
},
"elevation_footnotes": {
"label": "Elevation footnotes",
"description": "Reference(s) for elevation. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"elevation_min_point": {
"type": "line",
"label": "Point of min elevation",
"description": "The name of the point of lowest elevation in the place.",
"example": "[[Death Valley]]"
},
"elevation_min_m": {
"label": "Minimum elevation (m)",
"type": "number",
"description": "The minimum elevation in meters."
},
"elevation_min_ft": {
"label": "Minimum elevation (ft)",
"type": "number",
"description": "The minimum elevation in feet."
},
"elevation_min_rank": {
"type": "line",
"label": "Minimum elevation rank",
"description": "The point of minimum elevation's rank in the parent region.",
"example": "1st"
},
"elevation_min_footnotes": {
"label": "Min elevation footnotes",
"type": "content",
"description": "Footnotes or citations for the minimum elevation."
},
"elevation_max_point": {
"type": "line",
"label": "Point of max elevation",
"description": "The name of the point of highest elevation in the place.",
"example": "[[Mount Everest]]"
},
"elevation_max_m": {
"label": "Maximum elevation (m)",
"type": "number",
"description": "The maximum elevation in meters."
},
"elevation_max_ft": {
"label": "Maximum elevation (ft)",
"type": "number",
"description": "The maximum elevation in feet."
},
"elevation_max_rank": {
"type": "line",
"label": "Maximum elevation rank",
"description": "The point of maximum elevation's rank in the parent region.",
"example": "2nd"
},
"elevation_max_footnotes": {
"label": "Max elevation footnotes",
"type": "content",
"description": "Footnotes or citations for the maximum elevation."
},
"population_total": {
"label": "Population total",
"description": "Actual population (see below for estimates) preferably consisting of digits only (without any commas).",
"type": "number"
},
"population_as_of": {
"label": "Population total figure's year",
"description": "The year for the population total (usually a census year).",
"type": "number"
},
"population_footnotes": {
"label": "Population footnotes",
"description": "Reference(s) for population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_km2": {
"label": "Population density (per square km)",
"type": "string",
"description": "The place's population density per square kilometer.",
"example": "auto"
},
"population_density_sq_mi": {
"label": "Population density (per square mi)",
"type": "string",
"description": "The place's population density per square mile.",
"example": "auto"
},
"population_est": {
"label": "Population estimate",
"description": "Population estimate, e.g. for growth projections 4 years after a census.",
"type": "number",
"example": "331000000"
},
"pop_est_as_of": {
"label": "Population estimate figure as of",
"description": "The year, or the month and year, of the population estimate.",
"type": "date"
},
"pop_est_footnotes": {
"label": "Population estimate footnotes",
"description": "Reference(s) for population estimate; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content",
"example": "<ref name=\"USCensusEst2016\"/>"
},
"population_urban": {
"label": "Urban population",
"type": "number",
"description": "The place's urban population."
},
"population_urban_footnotes": {
"label": "Urban population footnotes",
"description": "Reference(s) for urban population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_urban_km2": {
"label": "Urban population density (per square km)",
"type": "string",
"description": "The place's urban population density per square kilometer.",
"example": "auto"
},
"population_density_urban_sq_mi": {
"label": "Urban population density (per square mi)",
"type": "string",
"description": "The place's urban population density per square mile.",
"example": "auto"
},
"population_rural": {
"label": "Rural population",
"type": "number",
"description": "The place's rural population."
},
"population_rural_footnotes": {
"label": "Rural population footnotes",
"description": "Reference(s) for rural population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "content"
},
"population_density_rural_km2": {
"label": "Rural population density per sq. km",
"type": "line",
"description": "The place's rural population density per square kilometer.",
"example": "auto"
},
"population_density_rural_sq_mi": {
"label": "Rural population density per sq. mi",
"type": "line",
"description": "The place's rural population density per square mile.",
"example": "auto"
},
"population_metro": {
"label": "Metropolitan area population",
"type": "number",
"description": "Population of the place's metropolitan area."
},
"population_metro_footnotes": {
"label": "Metropolitan area population footnotes",
"description": "Reference(s) for metro population; placed within <nowiki><ref> </ref></nowiki> tags.",
"type": "string"
},
"population_density_metro_km2": {
"label": "Metropolitan population density per sq. km",
"type": "number",
"description": "The place's metropolitan area's population density per square kilometer.",
"example": "auto"
},
"population_density_metro_sq_mi": {
"label": "Metropolitan population density per sq. mi",
"type": "number",
"description": "The place's metropolitan area's population density per square mile.",
"example": "auto"
},
"population_rank": {
"label": "Population rank",
"description": "The settlement's population, as ranked within its parent sub-division.",
"type": "string"
},
"population_density_rank": {
"label": "Population density rank",
"description": "The settlement's population density, as ranked within its parent sub-division.",
"type": "string"
},
"population_blank1_title": {
"label": "Custom population type 1 title",
"description": "Can be used for estimates. For an example, see Windsor, Ontario.",
"type": "string",
"example": "See: [[Windsor, Ontario]]"
},
"population_blank1": {
"label": "Custom population type 1",
"description": "The population value for 'blank1_title'.",
"type": "string"
},
"population_density_blank1_km2": {
"label": "Custom population type 1 density per sq. km",
"type": "string",
"description": "Population density per square kilometer, according to the 1st custom population type."
},
"population_density_blank1_sq_mi": {
"label": "Custom population type 1 density per sq. mi",
"type": "string",
"description": "Population density per square mile, according to the 1st custom population type."
},
"population_blank2_title": {
"label": "Custom population type 2 title",
"description": "Can be used for estimates. For an example, see Windsor, Ontario.",
"type": "string",
"example": "See: [[Windsor, Ontario]]"
},
"population_blank2": {
"label": "Custom population type 2",
"description": "The population value for 'blank2_title'.",
"type": "string"
},
"population_density_blank2_km2": {
"label": "Custom population type 2 density per sq. km",
"type": "string",
"description": "Population density per square kilometer, according to the 2nd custom population type."
},
"population_density_blank2_sq_mi": {
"label": "Custom population type 2 density per sq. mi",
"type": "string",
"description": "Population density per square mile, according to the 2nd custom population type."
},
"population_demonym": {
"label": "Demonym",
"description": "A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example, a citizen in Liverpool is known as a Liverpudlian.",
"type": "line",
"example": "Liverpudlian"
},
"population_note": {
"label": "Population note",
"description": "A place for additional information such as the name of the source. See Windsor, Ontario, for an example.",
"type": "content"
},
"demographics_type1": {
"label": "Demographics type 1",
"description": "A sub-section header.",
"type": "string",
"example": "Ethnicities"
},
"demographics1_footnotes": {
"label": "Demographics section 1 footnotes",
"description": "Reference(s) for demographics section 1. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "content"
},
"demographics1_title1": {
"label": "Demographics section 1 title 1",
"description": "Titles related to demographics_type1. For example: 'White', 'Black', 'Hispanic'... Additional rows 'demographics1_title1' to 'demographics1_title5' are also available.",
"type": "string"
},
"demographics_type2": {
"label": "Demographics type 2",
"description": "A second sub-section header.",
"type": "line",
"example": "Languages"
},
"demographics2_footnotes": {
"label": "Demographics section 2 footnotes",
"description": "Reference(s) for demographics section 2. Placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{Cite web}}.",
"type": "string"
},
"demographics2_title1": {
"label": "Demographics section 2 title 1",
"description": "Titles related to 'demographics_type1'. For example: 'English', 'French', 'Arabic'... Additional rows 'demographics2_title2' to 'demographics1_title5' are also available.",
"type": "string"
},
"demographics2_info1": {
"label": "Demographics section 2 info 1",
"description": "Information related to the titles. For example: '50%', '25%', '10%'... Additional rows 'demographics2_info2' to 'demographics2_info5' are also available.",
"type": "content"
},
"timezone1": {
"label": "Timezone 1",
"type": "string",
"description": "The place's primary time-zone.",
"example": "[[Eastern Standard Time]]"
},
"utc_offset": {
"label": "UTC offset",
"type": "string",
"description": "The place's time-zone's offset from UTC.",
"example": "+8"
},
"timezone_DST": {
"label": "Timezone during DST",
"type": "string",
"description": "The place's time-zone during daylight savings time, if applicable.",
"example": "[[Eastern Daylight Time]]"
},
"utc_offset_DST": {
"label": "UTC offset during DST",
"type": "string",
"description": "The place's time-zone's UTC offset during daylight savings time, if applicable.",
"example": "+9"
},
"utc_offset1": {
"label": "UTC offset 1",
"type": "string",
"description": "The place's primary time-zone's offset from UTC.",
"example": "-5"
},
"timezone1_DST": {
"label": "Timezone 1 (during DST)",
"type": "string",
"description": "The place's primary time-zone during daylight savings time, if applicable.",
"example": "[[Eastern Daylight Time]]"
},
"utc_offset1_DST": {
"label": "UTC offset 1 (during DST)",
"type": "string",
"description": "The place's primary time-zone's UTC offset during daylight savings time, if applicable.",
"example": "-6"
},
"timezone2": {
"label": "Timezone 2",
"description": "A second timezone field for larger areas such as a province.",
"type": "string",
"example": "[[Central Standard Time]]"
},
"utc_offset2": {
"label": "UTC offset 2",
"type": "string",
"description": "The place's secondary time-zone's offset from UTC.",
"example": "-6"
},
"timezone2_DST": {
"label": "Timezone 2 during DST",
"type": "string",
"description": "The place's secondary time-zone during daylight savings time, if applicable.",
"example": "[[Central Daylight Time]]"
},
"utc_offset2_DST": {
"label": "UTC offset 2 during DST",
"type": "string",
"description": "The place's secondary time-zone's offset from UTC during daylight savings time, if applicable.",
"example": "-7"
},
"postal_code_type": {
"label": "Postal code type",
"description": "Label used for postal code info, e.g. 'ZIP Code'. Defaults to 'Postal code'.",
"example": "[[Postal code of China|Postal code]]",
"type": "string"
},
"postal_code": {
"label": "Postal code",
"description": "The place's postal code/zip code.",
"type": "string",
"example": "90210"
},
"postal2_code_type": {
"label": "Postal code 2 type",
"type": "string",
"description": "If applicable, the place's second postal code type."
},
"postal2_code": {
"label": "Postal code 2",
"type": "string",
"description": "A second postal code of the place, if applicable.",
"example": "90007"
},
"area_code": {
"label": "Area code",
"description": "The regions' telephone area code.",
"type": "string"
},
"area_code_type": {
"label": "Area code type",
"description": "If left blank/not used, template will default to 'Area code(s)'.",
"type": "string"
},
"geocode": {
"label": "Geocode",
"description": "See [[Geocode]].",
"type": "string"
},
"iso_code": {
"label": "ISO 3166 code",
"description": "See ISO 3166.",
"type": "string"
},
"registration_plate": {
"label": "Registration/license plate info",
"description": "See Vehicle registration plate.",
"type": "string"
},
"blank_name_sec1": {
"label": "Blank name section 1",
"description": "Fields used to display other information. The name is displayed in bold on the left side of the infobox.",
"type": "string"
},
"blank_info_sec1": {
"label": "Blank info section 1",
"description": "The information associated with the 'blank_name_sec1' heading. The info is displayed on the right side of the infobox in the same row as the name. For an example, see [[Warsaw]].",
"type": "content"
},
"blank1_name_sec1": {
"label": "Blank 1 name section 1",
"description": "Up to 7 additional fields 'blank1_name_sec1' ... 'blank7_name_sec1' can be specified.",
"type": "string"
},
"blank1_info_sec1": {
"label": "Blank 1 info section 1",
"description": "Up to 7 additional fields 'blank1_info_sec1' ... 'blank7_info_sec1' can be specified.",
"type": "content"
},
"blank_name_sec2": {
"label": "Blank name section 2",
"description": "For a second section of blank fields.",
"type": "string"
},
"blank_info_sec2": {
"label": "Blank info section 2",
"example": "Beijing",
"type": "content",
"description": "The information associated with the 'blank_name_sec2' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see [[Warsaw]]."
},
"blank1_name_sec2": {
"label": "Blank 1 name section 2",
"description": "Up to 7 additional fields 'blank1_name_sec2' ... 'blank7_name_sec2' can be specified.",
"type": "string"
},
"blank1_info_sec2": {
"label": "Blank 1 info section 2",
"description": "Up to 7 additional fields 'blank1_info_sec2' ... 'blank7_info_sec2' can be specified.",
"type": "content"
},
"website": {
"label": "Official website in English",
"description": "External link to official website. Use the {{URL}} template, thus: {{URL|example.com}}.",
"type": "string"
},
"footnotes": {
"label": "Footnotes",
"description": "Text to be displayed at the bottom of the infobox.",
"type": "content"
},
"translit_lang1_info1": {
"label": "Language 1 first transcription ",
"description": "Transcription of type 1 in the first other language.",
"example": "{{lang|zh|森美兰}}",
"type": "line"
},
"translit_lang1_type1": {
"label": "Language 1 first transcription type",
"description": "Type of transcription used in the first language's first transcription.",
"example": "[[Chinese Language|Chinese]]",
"type": "line"
},
"translit_lang1_info2": {
"label": "Language 1 second transcription ",
"description": "Transcription of type 1 in the first other language.",
"example": "{{lang|ta|நெகிரி செம்பிலான்}}",
"type": "line"
},
"translit_lang1_type2": {
"label": "Language 1 second transcription type",
"description": "Type of transcription used in the first language's first transcription.",
"example": "[[Tamil Language|Tamil]]",
"type": "line"
},
"demographics1_info1": {
"label": "Demographics section 1 info 1",
"description": "Information related to the titles. For example: '50%', '25%', '10%'... Additional rows 'demographics1_info1' to 'demographics1_info5' are also available.",
"type": "content"
}
}
}
</templatedata>
{{collapse bottom}}
==Calls and redirects ==
At least {{PAGESINCATEGORY:Templates calling Infobox settlement}} other [[:Category:Templates calling Infobox settlement|templates call this one]].
[{{fullurl:Special:WhatLinksHere/Template:Infobox_settlement|namespace=10&hidetrans=1&hidelinks=1}} Several templates redirect here].
<includeonly>{{Sandbox other||
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Place infobox templates|Settlement]]
[[Category:Embeddable templates]]
[[Category:Infobox templates using Wikidata]]
[[Category:Templates that add a tracking category]]
}}</includeonly>
df19dd180c2154162f8aac885a1595522b15e5b4
Template:Fix comma category
10
234
573
572
2023-10-17T20:37:08Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Fix_comma_category]]
wikitext
text/x-wiki
{{#invoke:String|replace|{{{1}}}|%[%[Category:(.-)from (.-) 2,(.-)%]%]|[[Category:%1 from %2 2%3]]|plain=false}}<noinclude>{{documentation}}</noinclude>
beac35ea2acb0b21dc3e27cb7807f3a10bbb7948
Module:Settlement short description
828
235
575
574
2023-10-17T20:42:47Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Settlement_short_description]]
Scribunto
text/plain
--generates auto short description for use in infobox settlement
local p = {}
p.categories = ""
local plain = require('Module:Plain text')._main
local getArgs = require('Module:Arguments').getArgs
local tableTools = require ('Module:TableTools')
function p.reverseTable (init)
init[1], init[3] = init[3], init[1]
return init
end
function p.assign (args, argname, num)
local val
local var = {}
for i = 0,num do
--handle initial "subdivision_foo" without number
if i == 0 then
val = ""
else
val = tostring(i)
end
var[i+1] = p.validate(plain(args[argname..val]))
end
return var
end
--Display short description using {{short description}}
function p.shortdesc(text, frame)
return frame:expandTemplate{title = 'Short description', args = {text, 'noreplace'}}
end
function p.category (cattype)
local category = string.format('[[Category:Pages using infobox settlement with bad %s]]', cattype)
if category then p.categories = p.categories..category end --categorize
end
--sanity and other checks
function p.validate (parameter, cat)
if not parameter then return nil end
parameter = parameter:gsub('%b()', '') --remove things in brackets as extraneous information
:gsub('%s+', ' ') --fix possible extra spaces from previous cleanup
:gsub('^%s+', '') --trim spaces from beginning
:gsub('%s+$', '') --trim spaces from end
if parameter:match("[,;]") or not parameter:match("%a") then --must have some letters, ignore if multiple types/subdivisions
if cat then p.category (cat) end
return nil
end
if (parameter == "") then return nil end
return parameter
end
--removes redundancy like "England, United Kingdom" and fixes issues like "Foo in United States" (to "Foo in the United States")
--also used in Module:Type in location
function p.cleanupLoc (location)
if location == "" then return nil end
local replacements = {
["England, United Kingdom"] = "England",
["Scotland, United Kingdom"] = "Scotland",
["Wales, United Kingdom"] = "Wales",
["New York City, New York, United States"] = "New York City",
["^United States$"] = "the United States",
["London, United Kingdom"] = "London, England"
}
for i, v in pairs(replacements) do
location = location:gsub(i, v) --series of replacements
end
return location
end
function p.main(frame)
local categories = ""
local subdivision_types = {}
local subdivision_names = {}
local args = getArgs (frame, {parentOnly = true})
local settlement_type = p.validate(plain(args.settlement_type or args.type), "settlement type") or "Place"
local short_description = plain(args.short_description)
subdivision_types = p.assign(args, "subdivision_type", 2)
subdivision_names = p.assign(args, "subdivision_name", 2)
if short_description then
if (short_description == 'no') then
return
else
local language = mw.language.getContentLanguage()
return p.shortdesc(language:ucfirst(short_description), frame)
end
end
if not(subdivision_names[3] and
(string.find(settlement_type, '[nN]eighbo[u]?rhood') or string.find(settlement_type, '[sS]uburb'))) then
subdivision_names[3] = nil --display the third subdivision_type only if suburb or neighborhood
end
--if say "Voivodeship" is found within the subdivision_type, then specially handle
--by adding Voivodeship to the end if not already present
for x, y in ipairs (subdivision_types) do
local special_types = {
"Voivodeship"
}
for i, j in ipairs(special_types) do
if subdivision_names[x] and string.find(y, j, 1, true)
and not string.find(subdivision_names[x], j, 1, true) then
subdivision_names[x] = subdivision_names[x].." "..j
end
end
end
for x, y in ipairs (subdivision_names) do
if y then
if string.find(settlement_type, y, 1, true) then --if the subdivision is found within the settlement type
subdivision_names[x] = nil --don't display redundancy
p.category ("settlement type")
end
if y == mw.title.getCurrentTitle().text then --if the title is the same as one of the subdivision_names
subdivision_names[x] = nil --don't display redundancy
end
end
end
local location = table.concat(tableTools.compressSparseArray(p.reverseTable(subdivision_names)), ', ')
location = p.cleanupLoc (location)
if location then location = " in " .. location else location = "" end
local language = mw.language.getContentLanguage()
return p.shortdesc(language:ucfirst(settlement_type..location), frame)..p.categories
end
return p
f2f1adada5fd2b30e158e56b9f05102571b2a17f
Module:Plain text
828
236
577
576
2023-10-17T20:43:13Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Plain_text]]
Scribunto
text/plain
--converts text with wikilinks to plain text, e.g "[[foo|gah]] is [[bar]]" to "gah is bar"
--removes anything enclosed in tags that isn't nested, mediawiki strip markers (references etc), files, italic and bold markup
require[[strict]]
local p = {}
function p.main(frame)
local text = frame.args[1]
local encode = require('Module:yesno')(frame.args.encode)
return p._main(text, encode)
end
function p._main(text, encode)
if not text then return end
text = mw.text.killMarkers(text)
:gsub(' ', ' ') --replace nbsp spaces with regular spaces
:gsub('<br ?/?>', ', ') --replace br with commas
:gsub('<span.->(.-)</span>', '%1') --remove spans while keeping text inside
:gsub('<i.->(.-)</i>', '%1') --remove italics while keeping text inside
:gsub('<b.->(.-)</b>', '%1') --remove bold while keeping text inside
:gsub('<em.->(.-)</em>', '%1') --remove emphasis while keeping text inside
:gsub('<strong.->(.-)</strong>', '%1') --remove strong while keeping text inside
:gsub('<sub.->(.-)</sub>', '%1') --remove subscript markup; retain contents
:gsub('<sup.->(.-)</sup>', '%1') --remove superscript markup; retain contents
:gsub('<u.->(.-)</u>', '%1') --remove underline markup; retain contents
:gsub('<.->.-<.->', '') --strip out remaining tags and the text inside
:gsub('<.->', '') --remove any other tag markup
:gsub('%[%[%s*[Ff][Ii][Ll][Ee]%s*:.-%]%]', '') --strip out files
:gsub('%[%[%s*[Ii][Mm][Aa][Gg][Ee]%s*:.-%]%]', '') --strip out use of image:
:gsub('%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:.-%]%]', '') --strip out categories
:gsub('%[%[[^%]]-|', '') --strip out piped link text
:gsub('([^%[])%[[^%[%]][^%]]-%s', '%1') --strip out external link text
:gsub('^%[[^%[%]][^%]]-%s', '') --strip out external link text
:gsub('[%[%]]', '') --then strip out remaining [ and ]
:gsub("'''''", "") --strip out bold italic markup
:gsub("'''?", "") --not stripping out '''' gives correct output for bolded text in quotes
:gsub('----+', '') --remove ---- lines
:gsub("^%s+", "") --strip leading
:gsub("%s+$", "") --and trailing spaces
:gsub("%s+", " ") --strip redundant spaces
if encode then
return mw.text.encode(text)
else
return text
end
end
return p
8d406c43e8cf1dadf34be7d3b395f44ba4c48b75
Template:Short description
10
237
579
578
2023-10-17T20:44:51Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Short_description]]
wikitext
text/x-wiki
{{#ifeq:{{lc:{{{1|}}}}}|none|<nowiki /><!--Prevents whitespace issues when used with adjacent newlines-->|<div class="shortdescription nomobile noexcerpt noprint searchaux" style="display:none">{{{1|}}}{{SHORTDESC:{{{1|}}}|{{{2|}}}}}</div>}}<includeonly>{{#ifeq:{{{pagetype}}}|Disambiguation pages||{{#ifeq:{{pagetype |defaultns = all |user=exclude}}|exclude||{{#ifeq:{{#switch: {{NAMESPACENUMBER}} | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 100 | 101 | 118 | 119 | 828 | 829 | = exclude|#default=}}|exclude||[[Category:{{{pagetype|{{pagetype |defaultns = extended |plural=y}}}}} with short description]]}}}}}}</includeonly><!-- Start tracking
-->{{#invoke:Check for unknown parameters|check|unknown={{Main other|[[Category:Pages using short description with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Short description]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | pagetype | bot |plural }}<!--
-->{{#ifexpr: {{#invoke:String|len|{{{1|}}}}}>100 | [[Category:{{{pagetype|{{pagetype |defaultns = extended |plural=y}}}}} with long short description]]}}<!--
--><includeonly>{{#if:{{{1|}}}||[[Category:Pages with empty short description]]}}</includeonly><!--
-->{{Short description/lowercasecheck|{{{1|}}}}}<!--
-->{{Main other |{{SDcat |sd={{{1|}}} }} }}<noinclude>
{{Documentation}}
</noinclude>
f175a6d61b40a87adb43e2dd4f73c7979759b34c
Template:Infobox state
10
147
581
395
2023-10-17T20:52:57Z
LamayII
2
wikitext
text/x-wiki
<includeonly>{{Infobox settlement
| name = {{{name|}}}
| official_name = {{{official_name|}}}
| native_name = {{{native_name|}}}
| settlement_type = {{#if: {{{type|}}}|{{{type}}}|[[U.S. state|State]]}}
<!-- images, nickname, motto -->
| image_flag = {{{image_flag|}}}
| flag_border = {{{flag_border|}}}
| flag_size = {{{flag_size|125}}}
| flag_alt = {{{flag_alt|}}}
| flag_link = {{{flag_link|Flag of {{{name|}}}}}}
| image_seal = {{{image_seal|}}}
| seal_size = {{{seal_size|}}}
| seal_alt = {{{seal_alt|}}}
| seal_link = {{{seal_link|Seal of {{{name|}}}}}}
| etymology = {{{etymology|}}}
| nickname_link = List of U.S. state and territory nicknames
| nickname = {{{nickname|}}}
| nicknames = {{{nicknames|}}}
| motto = {{{motto|}}}
| mottoes =
| anthem = {{{anthem|}}}
<!-- maps and coordinates -->
| image_map = {{{image_map|}}}
| mapsize = 300
| map_alt = {{{map_alt|}}}
| map_caption = Map of the United States with {{{name|}}} highlighted
<!-- location -->
| subdivision_type = Country
| subdivision_name = United States<!-- the name of the country -->
<!-- established -->
| established_title1 = Before statehood
| established_date1 = {{#ifexist:{{{Former|}}}|[[{{{Former|}}}]]|{{{Former|}}}}}
| established_title2 = State Established<!-- Founded -->
| established_date2 = {{{AdmittanceDate|}}} ({{{AdmittanceOrder|}}})<!-- requires established_title= -->
<!-- seat, smaller parts -->
| seat_type = {{#ifeq:{{{LargestCity}}}|capital|[[List of capitals in the United States|Capital]]<br/>{{nobold|([[List of largest cities of U.S. states and territories by population|and largest city]])}}|[[List of capitals in the United States|Capital]]}}
| seat = {{{seat|{{{Capital|}}}}}}
| seat1_type = [[List of largest cities of U.S. states and territories by population|Largest city]]
| seat2_type = [[List of the most populous counties by U.S. state|Largest county or equivalent]]
| seat2 = {{{LargestCounty|}}}
| seat1 = {{#ifeq:{{{LargestCity}}}|capital||{{{LargestCity}}}}}
| parts_type = [[statistical area (United States)|Largest metro]] and [[List of United States urban areas|urban]] areas
| parts_style = <!-- list, coll (collapsed list), para (paragraph format) -->
| parts = {{{LargestMetro|}}}
<!-- government type, leaders -->
| government_footnotes = {{{government_footnotes|}}}
| government_type =
| governing_body =
| leader_party =
| leader_title = [[Governor of {{{name|}}}|Governor]]
| leader_name = {{{Governor|}}}<!-- add (no-break space) to disable automatic links -->
| leader_title1 = [[Lieutenant Governor of {{{name|}}}|{{{Lieutenant Governor_alt|Lieutenant Governor}}}]]
| leader_name1 = {{{Lieutenant Governor|}}}<!-- etc., up to leader_title4 / leader_name4 -->
| government_blank1_title = [[Legislature]]
| government_blank1 = {{{Legislature|}}}
| government_blank2_title = • [[Upper house]]
| government_blank2 = {{{Upperhouse}}}
| government_blank3_title = • [[Lower house]]
| government_blank3 = {{{Lowerhouse}}}
| government_blank4_title = [[Judiciary]]
| government_blank4 = {{{Judiciary|}}}
| government_blank5 = {{{Senators}}}
| {{{Representative}}} ([[United States congressional delegations from {{{name|}}}|list]])
}}
| government_blank7_title =
| government_blank7 =
<!-- display settings -->
| unit_pref = Imperial<!-- enter: Imperial, to display imperial before metric -->
<!-- area -->
| area_footnotes = {{{area_footnotes|}}}
| area_magnitude = <!-- use only to set a special wikilink -->
| area_total_km2 = {{{area_total_km2|}}}
| area_total_sq_mi = {{{area_total_sq_mi|}}}<!-- see table @ Template:Infobox settlement for details -->
| area_land_km2 = {{{area_land_km2|}}}
| area_land_sq_mi = {{{area_land_sq_mi|}}}
| area_water_km2 = {{{area_water_km2|}}}
| area_water_sq_mi = {{{area_water_sq_mi|}}}
| area_water_percent = {{{area_water_percent|}}}
| area_rank = {{#if:{{{area_rank|}}}|[[List of U.S. states and territories by area|{{{area_rank|}}}]]}}
<!-- dimensions -->
| dimensions_footnotes = {{{dimensions_footnotes|}}}
| length_km = {{{length_km|}}}
| length_mi = {{{length_mi|}}}
| width_km = {{{width_km|}}}
| width_mi = {{{width_mi|}}}
<!-- elevation -->
| elevation_footnotes = {{{elevation_footnotes|}}}
| elevation_m = {{{elevation_m|}}}
| elevation_ft = {{{elevation_ft|}}}
| elevation_point = <!-- for denoting the measurement point -->
| elevation_max_footnotes = {{{elevation_max_footnotes|}}}
| elevation_max_m = {{{elevation_max_m|}}}
| elevation_max_ft = {{{elevation_max_ft|}}}
| elevation_max_point = {{{elevation_max_point|}}}<!-- for denoting the measurement point -->
| elevation_max_rank =
| elevation_min_m = {{{elevation_min_m|}}}
| elevation_min_ft = {{{elevation_min_ft|}}}
| elevation_min_point = {{{elevation_min_point|}}}<!-- for denoting the measurement point -->
| elevation_min_rank =
<!-- demographics (section 1) -->
| demographics_type1 = Language
| demographics1_title1 = [[Languages of the United States|Official language]]{{#if:{{{OfficialLangs|}}}|s}}
| demographics1_info1 = {{{OfficialLang|{{{OfficialLangs|}}}}}}
| demographics1_title2 = [[Languages of the United States|Spoken language]]
| demographics1_info2 = {{{Languages|}}}
<!-- time zone(s) -->
| timezone1 = {{{timezone1|}}}
| utc_offset1 = {{{utc_offset1|}}}
| timezone1_DST = {{{timezone1_DST|}}}
| utc_offset1_DST = {{{utc_offset1_DST|}}}
| timezone1_location = {{{timezone1_location|}}}
| timezone2 = {{{timezone2|}}}
| utc_offset2 = {{{utc_offset2|}}}
| timezone2_DST = {{{timezone2_DST|}}}
| utc_offset2_DST = {{{utc_offset2_DST|}}}
| timezone2_location = {{{timezone2_location|}}}
<!-- postal codes, area code -->
| postal_code_type = [[List of U.S. state and territory abbreviations|USPS abbreviation]]<!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal_code = {{{postal_code|}}}
| iso_code = {{#if:{{{iso_code|}}}| [[ISO 3166-2:US|{{{iso_code|}}}]]}}
| code1_name = [[List of U.S. state and territory abbreviations|Traditional abbreviation]]
| code1_info = {{{TradAbbreviation|}}}
<!-- blank fields (section 1) -->
| blank_name_sec1 = Latitude
| blank_info_sec1 = {{{Latitude|}}}
| blank1_name_sec1 = Longitude
| blank1_info_sec1 = {{{Longitude|}}}
<!-- website, footnotes -->
| website = {{#if:{{{website|}}}|{{URL|1={{{website|}}}}}}}
| footnotes = {{{footnotes|}}}
| module = {{{module|}}}
}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox state with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox state]] with unknown parameter "_VALUE_"|ignoreblank=y| 2000Density | 2000DensityUS | 2000Pop | 2010Density | 2010DensityUS | 2010Pop | 2020Density | 2020DensityUS | 2020Pop | AdmittanceDate | AdmittanceOrder | anthem | area_footnotes | area_land_km2 | area_land_sq_mi | area_rank | area_total_km2 | area_total_sq_mi | area_water_km2 | area_water_percent | area_water_sq_mi | Capital | dimensions_footnotes | elevation_footnotes | elevation_ft | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_min_ft | elevation_min_m | elevation_min_point | etymology | flag_alt | flag_border | flag_link | flag_size | footnotes | Former | government_footnotes | Governor | image_flag | image_map | image_seal | IncomeRank | iso_code | Judiciary | Languages | LargestCity | LargestCounty | LargestMetro | Latitude | Legislature | length_km | length_mi | Lieutenant Governor | Lieutenant Governor_alt | Longitude | Lowerhouse | map_alt | MedianHouseholdIncome | module | motto | name | native_name | nickname | nicknames | official_name | OfficialLang | OfficialLangs | population_as_of | population_demonym | population_density_rank | population_rank | postal_code | Representative | seal_alt | seal_link | seal_size | seat | Senators | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | TradAbbreviation | type | Upperhouse | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | website | width_km | width_mi }}<noinclude>{{documentation}}</noinclude>
4ca047909f189ad3100b904911d3cc4c23c4ce61
582
581
2023-10-17T21:00:27Z
LamayII
2
test
wikitext
text/x-wiki
<includeonly>{{Infobox settlement
| name = {{{name|}}}
| native_name = {{{native_name|}}}
<!-- images, nickname, motto -->
| image_flag = {{{image_flag|}}}
| flag_border = {{{flag_border|}}}
| flag_size = {{{flag_size|125}}}
| flag_alt = {{{flag_alt|}}}
| image_seal = {{{image_seal|}}}
| seal_size = {{{seal_size|}}}
| seal_alt = {{{seal_alt|}}}
| motto = {{{motto|}}}
| anthem = {{{anthem|}}}
}}</includeonly>
3c5294f71ca2bbce8299472957027c160ac96a73
607
582
2023-10-17T21:32:01Z
LamayII
2
Added other params
wikitext
text/x-wiki
<includeonly>{{Infobox settlement
| name = {{{name|}}}
| native_name = {{{native_name|}}}
<!-- images, nickname, motto -->
| image_flag = {{{image_flag|}}}
| flag_border = {{{flag_border|}}}
| flag_size = {{{flag_size|125}}}
| flag_alt = {{{flag_alt|}}}
| image_seal = {{{image_seal|}}}
| seal_size = {{{seal_size|}}}
| seal_alt = {{{seal_alt|}}}
| motto = {{{motto|}}}
| anthem = {{{anthem|}}}
<!-- maps and coordinates -->
| image_map = {{{image_map|}}}
| mapsize = 300
| map_alt = {{{map_alt|}}}
<!-- established -->
| established_title1 = State Established
| established_date1 = {{{AdmittanceDate|}}}
<!-- government type, leaders -->
| government_type = {{government_type}}
| leader_title = [[Governor of {{{name|}}}|Governor]]
| leader_name = {{{Governor|}}}
| leader_title1 = [[Lieutenant Governor of {{{name|}}}|{{{Lieutenant Governor_alt|Lieutenant Governor}}}]]
| leader_name1 = {{{Lieutenant Governor|}}}<!-- etc., up to leader_title4 / leader_name4 -->
| government_blank1_title = Legislature
| government_blank1 = {{{Legislature|}}}
}}</includeonly>
41d7552c85ea060b6df694684221d37bebe5f484
609
607
2023-10-17T21:36:20Z
LamayII
2
Removed gov_type
wikitext
text/x-wiki
<includeonly>{{Infobox settlement
| name = {{{name|}}}
| native_name = {{{native_name|}}}
<!-- images, nickname, motto -->
| image_flag = {{{image_flag|}}}
| flag_border = {{{flag_border|}}}
| flag_size = {{{flag_size|125}}}
| flag_alt = {{{flag_alt|}}}
| image_seal = {{{image_seal|}}}
| seal_size = {{{seal_size|}}}
| seal_alt = {{{seal_alt|}}}
| motto = {{{motto|}}}
| anthem = {{{anthem|}}}
<!-- maps and coordinates -->
| image_map = {{{image_map|}}}
| mapsize = 300
| map_alt = {{{map_alt|}}}
<!-- established -->
| established_title1 = State Established
| established_date1 = {{{AdmittanceDate|}}}
<!-- government type, leaders -->
| leader_title = [[Governor of {{{name|}}}|Governor]]
| leader_name = {{{Governor|}}}
| leader_title1 = [[Lieutenant Governor of {{{name|}}}|{{{Lieutenant Governor_alt|Lieutenant Governor}}}]]
| leader_name1 = {{{Lieutenant Governor|}}}<!-- etc., up to leader_title4 / leader_name4 -->
| government_blank1_title = Legislature
| government_blank1 = {{{Legislature|}}}
}}</includeonly>
0c97cd8f3cf478c79aea117a08b4c9655cd67625
Template:Pagetype
10
238
584
583
2023-10-17T21:03:27Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Pagetype]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:pagetype|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
b8e6aa66678cd57877ea2c607372a45070f030a7
Template:SDcat
10
239
586
585
2023-10-17T21:03:48Z
LamayII
2
1 revision imported from [[:wikipedia:Template:SDcat]]
wikitext
text/x-wiki
<includeonly>{{#invoke:SDcat |setCat}}</includeonly><noinclude>
{{documentation}}
</noinclude>
8c6e8783ddb0dc699d6fb60370db97b73725b9a6
Module:SDcat
828
240
588
587
2023-10-17T21:06:02Z
LamayII
2
1 revision imported from [[:wikipedia:Module:SDcat]]
Scribunto
text/plain
--[[
SDcat
Module to check whether local short description matches that on Wikidata
--]]
local p = {}
-------------------------------------------------------------------------------
--[[
setCat has the qid of a Wikidata entity passed as |qid=
(it defaults to the associated qid of the current article if omitted)
and the local short description passed as |sd=
It returns a category if there is an associated Wikidata entity.
It returns one of the following tracking categories, as appropriate:
* Category:Short description matches Wikidata (case-insensitive)
* Category:Short description is different from Wikidata
* Category:Short description with empty Wikidata description
For testing purposes, a link prefix |lp= may be set to ":" to make the categories visible.
--]]
-- function exported for use in other modules
-- (local short description, Wikidata entity-ID, link prefix)
p._setCat = function(sdesc, itemID, lp)
if not mw.wikibase then return nil end
if itemID == "" then itemID = nil end
-- Wikidata description field
local wdesc = (mw.wikibase.getDescription(itemID) or ""):lower()
if wdesc == "" then
return "[[" .. lp .. "Category:Short description with empty Wikidata description]]"
elseif wdesc == sdesc then
return "[[" .. lp .. "Category:Short description matches Wikidata]]"
else
return "[[" .. lp .. "Category:Short description is different from Wikidata]]"
end
end
-- function exported for call from #invoke
p.setCat = function(frame)
local args
if frame.args.sd then
args = frame.args
else
args = frame:getParent().args
end
-- local short description
local sdesc = mw.text.trim(args.sd or ""):lower()
-- Wikidata entity-ID
local itemID = mw.text.trim(args.qid or "")
-- link prefix, strip quotes
local lp = mw.text.trim(args.lp or ""):gsub('"', '')
return p._setCat(sdesc, itemID, lp)
end
return p
6c19ac0f72c79a618eb105808f74701376bb2b38
Module:Pagetype
828
241
590
589
2023-10-17T21:06:29Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Pagetype]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- --
-- PAGETYPE --
-- --
-- This is a meta-module intended to replace {{pagetype}} and similar --
-- templates. It automatically detects namespaces, and allows for a --
-- great deal of customisation. It can easily be ported to other --
-- wikis by changing the values in the [[Module:Pagetype/config]]. --
-- --
--------------------------------------------------------------------------------
-- Load config.
local cfg = mw.loadData('Module:Pagetype/config')
-- Load required modules.
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local mDisambiguation = require('Module:Disambiguation')
local p = {}
-- Look up a namespace argument in the args table.
local function lookUpNamespaceArg(args, key)
local arg = args[key]
-- Convert "yes", "1" etc. to true, "no", "0" etc. to false, and leave
-- other values the same.
return yesno(arg, arg)
end
-- Append multiple values to an array
local function appendMultiple(target, source)
for _, value in ipairs(source) do
table.insert(target, value)
end
end
-- Get argument keys for a title's namespace
local function getNamespaceArgKeys(title, cfg)
local nsInfo = mw.site.namespaces[title.namespace]
local customAliases = cfg.customNamespaceAliases[title.namespace] or {}
local keys = {}
if nsInfo.name ~= '' then
table.insert(keys, nsInfo.name)
end
if nsInfo.canonicalName ~= nsInfo.name and nsInfo.canonicalName ~= '' then
table.insert(keys, nsInfo.canonicalName)
end
appendMultiple(keys, nsInfo.aliases)
appendMultiple(keys, customAliases)
return keys
end
-- Get the argument for a title's namespace, if it was specified in the args
-- table.
local function getNamespaceArg(title, args, cfg)
if title.isTalkPage then
return lookUpNamespaceArg(args, cfg.talk)
end
for _, key in ipairs(getNamespaceArgKeys(title, cfg)) do
local arg = lookUpNamespaceArg(args, mw.ustring.lower(key))
if arg ~= nil then
return arg
end
end
return nil
end
-- Look up a page type specific to the title's namespace
local function getExplicitPageType(title, cfg)
if title.isTalkPage then
return cfg.talkDefault
else
return cfg.pagetypes[title.namespace]
end
end
-- Get a default page type that is not specific to the title's namespace
local function getDefaultPageType(args, cfg)
local other = lookUpNamespaceArg(args, cfg.other)
if type(other) == 'string' then
return other
else
return cfg.otherDefault
end
end
local function detectRedirects(title, args)
local redirect = lookUpNamespaceArg(args, cfg.redirect)
if redirect == false then
-- Don't detect redirects if they have been specifically disallowed.
return nil
end
-- Allow custom values for redirects.
if not title.isRedirect then
return nil
elseif type(redirect) == 'string' then
return redirect
else
return cfg.redirectDefault
end
end
local function detectDisambiguationPages(title, args, cfg)
if title.namespace ~= 0 then
-- Only detect disambiguation pages in mainspace
return nil
end
local dab = lookUpNamespaceArg(args, cfg.dab)
if dab == false then
-- Don't detect disambiguation pages if explicitly disallowed
return nil
end
if not mDisambiguation.isDisambiguation(title:getContent()) then
return nil
elseif type(dab) == 'string' then
return dab
else
return cfg.dabDefault
end
end
-- Gets the pagetype from a class specified from the first positional
-- parameter.
local function getPageTypeFromClass(args, class, key, aliasTable, default)
local arg = lookUpNamespaceArg(args, key)
if arg == false then
-- Don't check for this class if it is specifically disallowed.
return nil
end
if aliasTable[class] then
if type(arg) == 'string' then
return arg
else
return default
end
end
return nil
end
-- Get page types for mainspaces pages with an explicit class specified
local function getMainNamespaceClassPageType(title, args, cfg)
if title.namespace ~= 0 then
return nil
end
local class = args[1]
if type(class) == 'string' then
-- Put in lower case so e.g. "na" and "NA" will both match.
class = mw.ustring.lower(class)
end
return getPageTypeFromClass(
args,
class,
cfg.na,
cfg.naAliases,
cfg.naDefault
)
end
-- Get page type specified by an explicit namespace argument.
local function getNamespaceArgPageType(title, args, cfg)
local namespaceArg = getNamespaceArg(title, args, cfg)
if namespaceArg == true then
-- Namespace has been explicitly enabled, so return the default for
-- this namespace
return getExplicitPageType(title, cfg)
elseif namespaceArg == false then
-- Namespace has been explicitly disabled
return getDefaultPageType(args, cfg)
elseif namespaceArg then
-- This namespaces uses custom text
return namespaceArg
else
return nil
end
end
-- Whether the title is in the set of default active namespaces which are
-- looked up in cfg.pagetypes.
local function isInDefaultActiveNamespace(title, args, cfg)
local defaultNamespacesKey = args[cfg.defaultns]
if defaultNamespacesKey == cfg.defaultnsAll then
return true
end
local defaultNamespaces
if defaultNamespacesKey == cfg.defaultnsExtended then
defaultNamespaces = cfg.extendedNamespaces
elseif defaultNamespacesKey == cfg.defaultnsNone then
defaultNamespaces = {}
else
defaultNamespaces = cfg.defaultNamespaces
end
return defaultNamespaces[title.namespace] or false
end
-- Get page type not specified or detected by other means
local function getOtherPageType(title, args, cfg)
if isInDefaultActiveNamespace(title, args, cfg) then
return getExplicitPageType(title, cfg)
else
return getDefaultPageType(args, cfg)
end
end
local function getPageType(title, args, cfg)
return (
detectRedirects(title, args, cfg)
or detectDisambiguationPages(title, args, cfg)
or getMainNamespaceClassPageType(title, args, cfg)
or getNamespaceArgPageType(title, args, cfg)
or getOtherPageType(title, args, cfg)
)
end
local function shouldUseSubjectTitle(args, cfg)
return not yesno(args.talk, true) and args[cfg.defaultns] ~= cfg.defaultnsAll
end
-- Get the Scribunto title object to fetch the page type of
local function getTitle(args, cfg)
local title
if args.page then
title = mw.title.new(args.page)
if not title then
return nil
end
else
title = mw.title.getCurrentTitle()
end
if shouldUseSubjectTitle(args, cfg) then
return title.subjectPageTitle
else
return title
end
end
local function pluralize(pageType, cfg)
if cfg.irregularPlurals[pageType] then
return cfg.irregularPlurals[pageType]
else
return pageType .. cfg.plural -- often 's'
end
end
local function capitalize(pageType)
local first = mw.ustring.sub(pageType, 1, 1)
local rest = mw.ustring.sub(pageType, 2)
return mw.ustring.upper(first) .. rest
end
function p._main(args)
local title = getTitle(args, cfg)
local pageType = getPageType(title, args, cfg)
if yesno(args.plural, false) then
pageType = pluralize(pageType, cfg)
end
if yesno(args.caps, false) then
pageType = capitalize(pageType)
end
return pageType
end
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
return p
ab72b17cbd3e423817484aedfd33b480e9ba3611
Module:Pagetype/config
828
242
592
591
2023-10-17T21:06:44Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Pagetype/config]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Pagetype configuration data --
-- This page holds localisation and configuration data for Module:Pagetype. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
-- This table holds the default page types for each namespace. Keys to this
-- table should be integers that can be used as keys to mw.site.namespaces.
cfg.pagetypes = {
[0] = 'article', -- Main namespace
[2] = 'user page',
[4] = 'project page',
[6] = 'file',
[8] = 'interface page', -- MediaWiki namespace
[10] = 'template',
[12] = 'help page',
[14] = 'category',
[100] = 'portal',
[118] = 'draft',
[710] = 'Timed Text page',
[828] = 'module',
[2300] = 'gadget',
[2302] = 'gadget definition',
[-1] = 'special page',
[-2] = 'file', -- Media namespace
}
-- This table holds the namespaces to be looked up from cfg.pagetypes by
-- default.
cfg.defaultNamespaces = {
[0] = true, -- main
[6] = true, -- file
[10] = true, -- template
[14] = true, -- category
[828] = true, -- module
}
-- This table holds the namespaces to be looked up from cfg.pagetypes if
-- cfg.defaultnsExtended is set.
cfg.extendedNamespaces = {
[0] = true, -- main
[2] = true, -- user
[4] = true, -- project
[6] = true, -- file
[8] = true, -- mediawiki
[10] = true, -- template
[12] = true, -- help
[14] = true, -- category
[100] = true, -- portal
[118] = true, -- draft
[828] = true, -- module
}
-- This table holds custom aliases for each namespace.
cfg.customNamespaceAliases = {
[0] = {'main'},
}
-- The parameter name to set which default namespace values to be looked up from
-- cfg.pagetypes.
cfg.defaultns = 'defaultns'
-- The value of cfg.defaultns to set all namespaces, including talk.
cfg.defaultnsAll = 'all'
-- The value of cfg.defaultns to set the namespaces listed in
-- cfg.extendedNamespaces
cfg.defaultnsExtended = 'extended'
-- The value of cfg.defaultns to set no default namespaces.
cfg.defaultnsNone = 'none'
-- The parameter name to use for talk pages.
cfg.talk = 'talk'
-- The default value for talk pages.
cfg.talkDefault = 'talk page'
-- The parameter name to use for disambiguation pages page.
cfg.dab = 'dab'
-- This table holds the different possible aliases for disambiguation-class
-- pages. These should be lower-case.
cfg.dabAliases = {
['disambiguation'] = true,
['disambig'] = true,
['disamb'] = true,
['dab'] = true,
}
-- The default value for disambiguation pages.
cfg.dabDefault = 'page'
-- The parameter name to use for N/A-class page.
cfg.na = 'na'
-- This table holds the different possible aliases for N/A-class pages. These
-- should be lower-case.
cfg.naAliases = {
['na'] = true,
['n/a'] = true,
}
-- The default value for N/A-class pages.
cfg.naDefault = 'page'
-- The parameter name to use for redirects.
cfg.redirect = 'redirect'
-- The default value to use for redirects.
cfg.redirectDefault = 'redirect'
-- The parameter name for undefined namespaces.
cfg.other = 'other'
-- The value used if the module detects an undefined namespace.
cfg.otherDefault = 'page'
-- The usual suffix denoting a plural.
cfg.plural = 's'
-- This table holds plurals not formed by a simple suffix.
cfg.irregularPlurals = {
["category"] = "categories"
}
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line
5360b93ef5fd7551e38026f1b8df00bed8b34b2d
Module:Disambiguation
828
243
594
593
2023-10-17T21:07:15Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Disambiguation]]
Scribunto
text/plain
local p = {}
local mRedirect = require('Module:Redirect')
local disambiguationTemplates = mw.loadData('Module:Disambiguation/templates')
local function capitalize(s)
-- This function only works on ASCII strings. If your wiki has
-- disambiguation templates that use Unicode strings, use the commented-out
-- line instead. Enwiki uses ASCII string manipulation only here to improve
-- performance.
return s:sub(1, 1):upper() .. s:sub(2, -1)
-- return mw.ustring.upper(mw.ustring.sub(1, 1)) .. mw.ustring.sub(2, -1)
end
local function isDisambiguationTemplate(template)
return disambiguationTemplates[capitalize(template)] or false
end
p.isDisambiguation = function(content)
-- false if there is no content
if content == nil then
return false
end
-- redirects are not disambiguation pages
if mRedirect.getTargetFromText(content) ~= nil then
return false
end
-- check for disambiguation templates in the content
local templateNames = {}
for template in string.gmatch(content, "{{%s*([^|}]-)%s*[|}]") do
if isDisambiguationTemplate(template) then
return true
end
end
-- check for magic word
if string.find(content, "__DISAMBIG__", 1, true) ~= nil then
return true
end
return false
end
p._isDisambiguationPage = function(page)
-- Look "(disambiguation)" in the title
if string.find(page, "(disambiguation)",0,true) ~= nil then
return true;
end
-- Look for disamiguation template in page content
local title = mw.title.new(page)
if not title then return false end
local content = title:getContent()
return p.isDisambiguation(content)
end
-- Entry points for templates
p.isDisambiguationPage = function(frame)
local title = frame.args[1]
return p._isDisambiguationPage(title) and "yes" or ""
end
return p
fedda4d3046080cab39fcd65ab9a9318912a8d57
Module:Disambiguation/templates
828
244
596
595
2023-10-17T21:07:31Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Disambiguation/templates]]
Scribunto
text/plain
-- This page contains a table of all disambiguation templates and their
-- redirects. Templates names are capitalized, and the Template: prefix is
-- removed. Templates are grouped with the main template first, followed by
-- its redirects.
return {
["Disambiguation"] = true,
["Begriffsklärung"] = true,
["DAB"] = true,
["Dab"] = true,
["Dabpage"] = true,
["Dbig"] = true,
["Dis"] = true,
["Disam"] = true,
["Disamb"] = true,
["Disambig"] = true,
["Disambig misspelling"] = true,
["Disambig-plants"] = true,
["Disambiguation page"] = true,
["Meta disambig"] = true,
["Project disambiguation"] = true,
["Shortcut disambig"] = true,
["WP disambig"] = true,
["WP-disambig"] = true,
["Wikipedia disambiguation"] = true,
["Airport disambiguation"] = true,
["Airport disambig"] = true,
["Biology disambiguation"] = true,
["Call sign disambiguation"] = true,
["Callsigndis"] = true,
["Caselaw disambiguation"] = true,
["Case law disambiguation"] = true,
["Chinese title disambiguation"] = true,
["CJKVdab"] = true,
["Chinese title disambig"] = true,
["Disambig-Chinese-char-title"] = true,
["Disambiguation cleanup"] = true,
["Cleanup disambig"] = true,
["Cleanup disambiguation"] = true,
["CleanupDisambig"] = true,
["Dab cleanup"] = true,
["Dab-cleanup"] = true,
["Dabclean"] = true,
["Disamb-cleanup"] = true,
["Disambcleanup"] = true,
["Disambig cleanup"] = true,
["Disambig-CU"] = true,
["Disambig-cleanup"] = true,
["Disambig-cu"] = true,
["Disambigcleanup"] = true,
["Disambiguate-cleanup"] = true,
["Disambiguation-cleanup"] = true,
["Geodis-cleanup"] = true,
["Genus disambiguation"] = true,
["Genus disambig"] = true,
["Hangul title disambiguation"] = true,
["Hospital disambiguation"] = true,
["Hospitaldis"] = true,
["Human name disambiguation"] = true,
["Bio-dab"] = true,
["HNDIS"] = true,
["HnDis"] = true,
["Hndab"] = true,
["Hndis"] = true,
["Hndisambig"] = true,
["Human name dab"] = true,
["Personal name"] = true,
["Personal name disambiguation"] = true,
["Human name disambiguation cleanup"] = true,
["Hndis-cleanup"] = true,
["Personal name disambiguation cleanup"] = true,
["Letter–number combination disambiguation"] = true,
["LNCD"] = true,
["Letter-Number Combination Disambiguation"] = true,
["Letter-Number combination disambiguation"] = true,
["Letter-NumberCombDisambig"] = true,
["Letter-NumberCombdisambig"] = true,
["Letter-NumberCombinationDisambiguation"] = true,
["Letter-number combination disambiguation"] = true,
["Mathematical disambiguation"] = true,
["Math dab"] = true,
["Math disambiguation"] = true,
["Mathdab"] = true,
["Mathematics disambiguation"] = true,
["Maths disambiguation"] = true,
["Military unit disambiguation"] = true,
["Mil-unit-dis"] = true,
["Mil-unit-disambig"] = true,
["Music disambiguation"] = true,
["Music disambig"] = true,
["Number disambiguation"] = true,
["Numberdis"] = true,
["Numdab"] = true,
["Numdisambig"] = true,
["Opus number disambiguation"] = true,
["Phonetics disambiguation"] = true,
["Place name disambiguation"] = true,
["DisambigG"] = true,
["DisambigGeo"] = true,
["Disambiggeo"] = true,
["Geo-dis"] = true,
["Geodab"] = true,
["Geodis"] = true,
["Geodisambig"] = true,
["Geographic disambiguation"] = true,
["Portal disambiguation"] = true,
["Portal disambig"] = true,
["Road disambiguation"] = true,
["Roaddis"] = true,
["School disambiguation"] = true,
["School disambig"] = true,
["Schooldab"] = true,
["Schooldis"] = true,
["Species Latin name abbreviation disambiguation"] = true,
["Species Latin name disambiguation"] = true,
["LatinNameDisambig"] = true,
["SpeciesLatinNameDisambig"] = true,
["Station disambiguation"] = true,
["Station dab"] = true,
["Synagogue disambiguation"] = true,
["Taxonomic authority disambiguation"] = true,
["Taxonomic authorities disambiguation"] = true,
["Taxonomy disambiguation"] = true,
["Species disambiguation"] = true,
["Template disambiguation"] = true,
["Template ambiguous"] = true,
["Template dab"] = true,
["Template disambig"] = true,
["WoO number disambiguation"] = true,
}
98d5e2735cd3ddcadf551a10294cfd2c6a550be8
Template:Short description/lowercasecheck
10
245
598
597
2023-10-17T21:07:57Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Short_description/lowercasecheck]]
wikitext
text/x-wiki
{{#ifeq:<!--test first character for lower-case letter-->{{#invoke:string|find|1={{{1|}}}|2=^%l|plain=false}}|1
|<!-- first character is a lower case letter; test against whitelist
-->{{#switch: {{First word|{{{1|}}}}}<!--begin whitelist-->
|c. <!--for circa-->
|gTLD
|iMac
|iOS
|iOS,
|iPad
|iPhone
|iTunes
|macOS
|none
|pH
|pH-dependent=<!-- end whitelist; short description starts with an allowed lower-case string; whitelist matched; do nothing -->
|#default=<!-- apply category to track lower-case short descriptions -->{{main other|[[Category:Pages with lower-case short description|{{trim|{{{1|}}}}}]]}}{{Testcases other|{{red|CATEGORY APPLIED}}}}<!-- end whitelist test -->}}
|<!-- short description does not start with lower-case letter; do nothing; end lower-case test -->
}}<noinclude>
{{documentation}}
</noinclude>
9a6d4db14b74614625fd234b4f8ee3c8e1a235c0
File:LASD Badge.png
6
246
599
2023-10-17T21:11:56Z
LamayII
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Los Alameda County Sheriff's Department
0
8
600
390
2023-10-17T21:12:53Z
LamayII
2
Added badge logo
wikitext
text/x-wiki
{{Infobox law enforcement agency
|agencyname=Los Alameda County Sheriff's Department
|motto="A tradition of service."
|formedyear=1850
|budget=>~ 100 Employees
|legaljuris=County law enforcement
|headquarters=Carrington
|chief1name=Canada_Enforcer|chief1position=Sheriff
|badge=LASD Badge.png|badgecaption=''Badge of an LASD Sheriff's Deputy''}}
The '''Los Alameda County Sheriff's Department (LASD)''', officially the '''County of Los Alameda Sheriff's Department''' is a law enforcement agency within the State of Santa Modesta serving Los Alameda County. LASD is the largest law enforcement agency in the state. Since the department’s formation in 1850, the County of Los Alameda Sheriff’s Department has taken the responsibilities of providing contracted municipal police services within unincorporated communities of Los Alameda County, provide courthouse security for the Superior Court of Los Alameda County, and regulate the housing and transportation services of inmates within the county jail system.
== History ==
fd6f5ef6a59220bbfc4225dfbcb441b9e8b2dd64
603
600
2023-10-17T21:19:26Z
LamayII
2
Added patch
wikitext
text/x-wiki
{{Infobox law enforcement agency
|agencyname=Los Alameda County Sheriff's Department
|motto="A tradition of service."
|formedyear=1850
|budget=>~ 100 Employees
|legaljuris=County law enforcement
|headquarters=Carrington
|chief1name=Canada_Enforcer|chief1position=Sheriff
|badge=LASD Badge.png|badgecaption=''Badge of an LASD Sheriff's Deputy''|patch=LASD_Patch.png|patchcaption=Patch}}
The '''Los Alameda County Sheriff's Department (LASD)''', officially the '''County of Los Alameda Sheriff's Department''' is a law enforcement agency within the State of Santa Modesta serving Los Alameda County. LASD is the largest law enforcement agency in the state. Since the department’s formation in 1850, the County of Los Alameda Sheriff’s Department has taken the responsibilities of providing contracted municipal police services within unincorporated communities of Los Alameda County, provide courthouse security for the Superior Court of Los Alameda County, and regulate the housing and transportation services of inmates within the county jail system.
== History ==
9ff0efe0f2ef363731ae6c1d31d248b8159b7e62
File:SM State Flag.png
6
247
601
2023-10-17T21:14:40Z
LamayII
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:LASD Patch.png
6
248
602
2023-10-17T21:18:32Z
LamayII
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Template:Infobox settlement
10
148
604
397
2023-10-17T21:24:13Z
LamayII
2
wikitext
text/x-wiki
<includeonly>{{main other|{{#invoke:Settlement short description|main}}|}}{{Infobox
| child = {{yesno|{{{embed|}}}}}
| templatestyles = Infobox settlement/styles.css
| bodyclass = ib-settlement vcard
<!--** names, type, and transliterations ** -->
| above = <div class="fn org">{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}</div>
{{#if:{{{native_name|}}}|<div class="nickname ib-settlement-native" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</div>}}{{#if:{{{other_name|}}}|<div class="nickname ib-settlement-other-name">{{{other_name}}}</div>}}
| subheader = {{#if:{{{settlement_type|{{{type|}}}}}}|<div class="category">{{{settlement_type|{{{type}}}}}}</div>}}
| rowclass1 = mergedtoprow ib-settlement-official
| data1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
<!-- ***Transliteration language 1*** -->
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|{{{translit_lang1}}} transcription(s)}}
| rowclass3 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
| label3 = • {{{translit_lang1_type}}}
| data3 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}}}
| rowclass4 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
| label4 = • {{{translit_lang1_type1}}}
| data4 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}}}
| rowclass5 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
| label5 = • {{{translit_lang1_type2}}}
| data5 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}}}
| rowclass6 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
| label6 = • {{{translit_lang1_type3}}}
| data6 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}}}
| rowclass7 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
| label7 = • {{{translit_lang1_type4}}}
| data7 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}}}
| rowclass8 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
| label8 = • {{{translit_lang1_type5}}}
| data8 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}}}
| rowclass9 = mergedbottomrow
| label9 = • {{{translit_lang1_type6}}}
| data9 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}}}}}}
<!-- ***Transliteration language 2*** -->
| rowclass10 = mergedtoprow
| header10 = {{#if:{{{translit_lang2|}}}|{{{translit_lang2}}} transcription(s)}}
| rowclass11 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
| label11 = • {{{translit_lang2_type}}}
| data11 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}}}
| rowclass12 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
| label12 = • {{{translit_lang2_type1}}}
| data12 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}}}
| rowclass13 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
| label13 = • {{{translit_lang2_type2}}}
| data13 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}}}
| rowclass14 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
| label14 = • {{{translit_lang2_type3}}}
| data14 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}}}
| rowclass15 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
| label15 = • {{{translit_lang2_type4}}}
| data15 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}}}
| rowclass16 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
| label16 = • {{{translit_lang2_type5}}}
| data16 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}}}
| rowclass17 = mergedbottomrow
| label17 = • {{{translit_lang2_type6}}}
| data17 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}}}}}}
<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| rowclass18 = mergedtoprow
| data18 = {{#if:{{{image_skyline|}}}|<!--
-->{{#invoke:InfoboxImage|InfoboxImage<!--
-->|image={{{image_skyline|}}}<!--
-->|size={{if empty|{{{image_size|}}}|{{{imagesize|}}}}}|sizedefault=250px<!--
-->|alt={{if empty|{{{image_alt|}}}|{{{alt|}}}}}<!--
-->|title={{if empty|{{{image_caption|}}}|{{{caption|}}}|{{{image_alt|}}}|{{{alt|}}}}}}}<!--
-->{{#if:{{{image_caption|}}}{{{caption|}}}|<div class="ib-settlement-caption">{{if empty|{{{image_caption|}}}|{{{caption|}}}}}</div>}} }}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass19 = mergedtoprow
| class19 = maptable
| data19 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|125px|100x100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Flag of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Flag|link={{{flag_link|}}}|name={{{official_name}}}}}</div>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{seal_alt|}}}|title=Official seal of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Seal}}|link={{{seal_link|}}}|name={{{official_name}}}}}</div>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{shield_alt|}}}|title=Coat of arms of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Coat of arms|link={{{shield_link|}}}|name={{{official_name}}}}}</div>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}</div>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100x100px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption-link">{{{map_caption}}}</div>}}}}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{{map_caption}}}}}}}}}
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
}} }}
<!-- ***Etymology*** -->
| rowclass20 = mergedtoprow
| data20 = {{#if:{{{etymology|}}}|Etymology: {{{etymology}}} }}
<!-- ***Nickname*** -->
| rowclass21 = {{#if:{{{etymology|}}}|mergedrow|mergedtoprow}}
| data21 = {{#if:{{{nickname|}}}{{{nicknames|}}}|<!--
-->{{Pluralize from text|parse_links=1|{{if empty|{{{nickname|}}}|{{{nicknames|}}}{{force plural}}}}|<!--
-->link={{{nickname_link|}}}|singular=Nickname|likely=Nickname(s)|plural=Nicknames}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{nickname|}}}|{{{nicknames|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|parse_links=1|{{{nickname|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible nickname list]]}}}}}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}{{{mottoes|}}}|<!--
-->{{Pluralize from text|{{if empty|{{{motto|}}}|{{{mottoes|}}}{{force plural}}}}|<!--
-->link={{{motto_link|}}}|singular=Motto|likely=Motto(s)|plural=Mottoes}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{motto|}}}|{{{mottoes|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|{{{motto|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible motto list]]}}}}}}
<!-- ***Anthem*** -->
| rowclass23 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}{{{motto|}}}{{{mottoes|}}}|mergedrow|mergedtoprow}}
| data23 = {{#if:{{{anthem|}}}|{{#if:{{{anthem_link|}}}|[[{{{anthem_link|}}}|Anthem:]]|Anthem:}} {{{anthem}}}}}
<!-- ***Map*** -->
| rowclass24 = mergedtoprow
| data24 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption">{{{map_caption}}}</div>}}
}}}}
| rowclass25 = mergedrow
| data25 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<div class="ib-settlement-caption">{{{map_caption1}}}</div>}} }}
<!-- ***Pushpin Map*** -->
| rowclass26 = mergedtoprow
| data26 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{#if:{{{image_map|}}}||{{{map_caption}}}}}}}}}}}
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| rowclass27 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|{{#if:{{{grid_position|}}}|mergedrow|mergedbottomrow}}}}
| data27 = {{#if:{{{coordinates|}}}
|Coordinates{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})}}: {{#invoke:ISO 3166|geocoordinsert|nocat=true|1={{{coordinates|}}}|country={{{subdivision_name|}}}|subdivision1={{{subdivision_name1|}}}|subdivision2={{{subdivision_name2|}}}|subdivision3={{{subdivision_name3|}}}|type=city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{replace|{{{population_total}}}|,|}}|R}})}}}} }}{{{coordinates_footnotes|}}} }}
| rowclass28 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label28 = {{if empty|{{{grid_name|}}}|Grid position}}
| data28 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass29 = mergedtoprow
| label29 = {{{subdivision_type}}}
| data29 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass30 = mergedrow
| label30 = {{{subdivision_type1}}}
| data30 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass31 = mergedrow
| label31 = {{{subdivision_type2}}}
| data31 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type3}}}
| data32 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type4}}}
| data33 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type5}}}
| data34 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type6}}}
| data35 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass36 = mergedtoprow
| label36 = {{{established_title}}}
| data36 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass37 = mergedrow
| label37 = {{{established_title1}}}
| data37 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass38 = mergedrow
| label38 = {{{established_title2}}}
| data38 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass39 = mergedrow
| label39 = {{{established_title3}}}
| data39 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title4}}}
| data40 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title5}}}
| data41 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title6}}}
| data42 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title7}}}
| data43 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass44 = mergedrow
| label44 = {{{extinct_title}}}
| data44 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass45 = mergedrow
| label45 = Founded by
| data45 = {{{founder|}}}
| rowclass46 = mergedrow
| label46 = [[Namesake|Named for]]
| data46 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass47 = mergedtoprow
| label47 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Seat}}
| data47 = {{{seat|}}}
| rowclass48 = mergedrow
| label48 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Former seat}}
| data48 = {{{seat1|}}}
| rowclass49 = mergedrow
| label49 = {{#if:{{{seat2_type|}}}|{{{seat2_type}}}|Former seat}}
| data49 = {{{seat2|}}}
| rowclass51 = {{#if:{{{seat|}}}{{{seat1|}}}{{{seat2|}}}|mergedrow|mergedtoprow}}
| label51 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|Boroughs}}
| data51 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass52 = mergedtoprow
| header52 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Government<div class="ib-settlement-fn">{{{government_footnotes|}}}</div>}}
<!-- ***Government*** -->
| rowclass53 = mergedrow
| label53 = • Type
| data53 = {{{government_type|}}}
| rowclass54 = mergedrow
| label54 = • Body
| class54 = agent
| data54 = {{{governing_body|}}}
| rowclass55 = mergedrow
| label55 = • {{{leader_title}}}
| data55 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title1}}}
| data56 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title2}}}
| data57 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass58 = mergedrow
| label58 = • {{{leader_title3}}}
| data58 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass59 = mergedrow
| label59 = • {{{leader_title4}}}
| data59 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
| rowclass60 = mergedrow
| label60 = {{{government_blank1_title}}}
| data60 = {{#if:{{{government_blank1|}}}|{{{government_blank1|}}}}}
| rowclass61 = mergedrow
| label61 = {{{government_blank2_title}}}
| data61 = {{#if:{{{government_blank2|}}}|{{{government_blank2|}}}}}
| rowclass62 = mergedrow
| label62 = {{{government_blank3_title}}}
| data62 = {{#if:{{{government_blank3|}}}|{{{government_blank3|}}}}}
| rowclass63 = mergedrow
| label63 = {{{government_blank4_title}}}
| data63 = {{#if:{{{government_blank4|}}}|{{{government_blank4|}}}}}
| rowclass64 = mergedrow
| label64 = {{{government_blank5_title}}}
| data64 = {{#if:{{{government_blank5|}}}|{{{government_blank5|}}}}}
| rowclass65 = mergedrow
| label65 = {{{government_blank6_title}}}
| data65 = {{#if:{{{government_blank6|}}}|{{{government_blank6|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass66 = mergedtoprow
| header66 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
}}
}}
| rowclass67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
}}
| data67 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass68 = mergedrow
| label68 = • Land
| data68 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass69 = mergedrow
| label69 = • Water
| data69 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}{{#ifeq:%|{{#invoke:string|sub|{{{area_water_percent|}}}|-1}}||%}}}}}}
| rowclass70 = mergedrow
| label70 = • Urban<div class="ib-settlement-fn">{{{area_urban_footnotes|}}}</div>
| data70 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass71 = mergedrow
| label71 = • Rural<div class="ib-settlement-fn">{{{area_rural_footnotes|}}}</div>
| data71 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass72 = mergedrow
| label72 = • Metro<div class="ib-settlement-fn">{{{area_metro_footnotes|}}}</div>
| data72 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass73 = mergedrow
| label73 = • Rank
| data73 = {{{area_rank|}}}
| rowclass74 = mergedrow
| label74 = • {{{area_blank1_title}}}
| data74 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass75 = mergedrow
| label75 = • {{{area_blank2_title}}}
| data75 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass76 = mergedrow
| label76 =
| data76 = {{{area_note|}}}
<!-- ***Dimensions*** -->
| rowclass77 = mergedtoprow
| header77 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<div class="ib-settlement-fn">{{{dimensions_footnotes|}}}</div>}}
| rowclass78 = mergedrow
| label78 = • Length
| data78 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass79 = mergedrow
| label79 = • Width
| data79 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass80 = mergedtoprow
| label80 = {{#if:{{{elevation_link|}}}|[[{{{elevation_link|}}}|Elevation]]|Elevation}}<div class="ib-settlement-fn">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</div>
| data80 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass81 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}|mergedrow|mergedtoprow}}
| label81 = Highest elevation<div class="ib-settlement-fn">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</div>
| data81 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass82 = mergedrow
| label82 = • Rank
| data82 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass83 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label83 = Lowest elevation<div class="ib-settlement-fn">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</div>
| data83 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass84 = mergedrow
| label84 = • Rank
| data84 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass85 = mergedtoprow
| label85 = Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
| data85 = {{fix comma category|{{#if:{{{population|}}}
| {{formatnum:{{replace|{{{population}}}|,|}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{replace|{{{population_total}}}|,|}}}}
}}
}}
}}}}
| rowclass86 = mergedtoprow
| header86 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
}}
}}
}}
| rowclass87 = mergedrow
| label87 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
| data87 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{fix comma category|{{formatnum:{{replace|{{{population_total}}}|,|}}}}}}
}}
}}
}}
| rowclass88 = mergedrow
| label88 = • Estimate <div class="ib-settlement-fn">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</div>
| data88 = {{#if:{{{population_est|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_est}}}|,|}}}}}} }}
<!-- ***Population rank*** -->
| rowclass89 = mergedrow
| label89 = • Rank
| data89 = {{{population_rank|}}}
| rowclass90 = mergedrow
| label90 = • Density
| data90 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass91 = mergedrow
| label91 = • Rank
| data91 = {{{population_density_rank|}}}
| rowclass92 = mergedrow
| label92 = • [[Urban area|Urban]]<div class="ib-settlement-fn">{{{population_urban_footnotes|}}}</div>
| data92 = {{#if:{{{population_urban|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_urban}}}|,|}}}}}} }}
| rowclass93 = mergedrow
| label93 = • Urban density
| data93 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass94 = mergedrow
| label94 = • [[Rural area|Rural]]<div class="ib-settlement-fn">{{{population_rural_footnotes|}}}</div>
| data94 = {{#if:{{{population_rural|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_rural}}}|,|}}}}}}}}
| rowclass95 = mergedrow
| label95 = • Rural density
| data95 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass96 = mergedrow
| label96 = • [[Metropolitan area|Metro]]<div class="ib-settlement-fn">{{{population_metro_footnotes|}}}</div>
| data96 = {{#if:{{{population_metro|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_metro}}}|,|}}}}}} }}
| rowclass97 = mergedrow
| label97 = • Metro density
| data97 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass98 = mergedrow
| label98 = • {{{population_blank1_title|}}}<div class="ib-settlement-fn">{{{population_blank1_footnotes|}}}</div>
| data98 = {{#if:{{{population_blank1|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank1}}}|,|}}}}}}}}
| rowclass99 = mergedrow
| label99 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data99 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass100 = mergedrow
| label100 = • {{{population_blank2_title|}}}<div class="ib-settlement-fn">{{{population_blank2_footnotes|}}}</div>
| data100 = {{#if:{{{population_blank2|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank2}}}|,|}}}}}}}}
| rowclass101 = mergedrow
| label101 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data101 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass102 = mergedrow
| label102 =
| data102 = {{{population_note|}}}
| rowclass103 = mergedtoprow
| label103 = {{Pluralize from text|{{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}{{force plural}}}}|<!--
-->link=Demonym|singular=Demonym|likely=Demonym(s)|plural=Demonyms}}
| data103 = {{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}}}{{Main other|{{Pluralize from text|{{{population_demonym|}}}|likely=[[Category:Pages using infobox settlement with possible demonym list]]}}}}
<!-- ***Demographics 1*** -->
| rowclass104 = mergedtoprow
| header104 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<div class="ib-settlement-fn">{{{demographics1_footnotes|}}}</div>}}
| rowclass105 = mergedrow
| label105 = • {{{demographics1_title1}}}
| data105 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass106 = mergedrow
| label106 = • {{{demographics1_title2}}}
| data106 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass107 = mergedrow
| label107 = • {{{demographics1_title3}}}
| data107 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics1_title4}}}
| data108 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics1_title5}}}
| data109 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics1_title6}}}
| data110 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics1_title7}}}
| data111 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
| rowclass112 = mergedrow
| label112 = • {{{demographics1_title8}}}
| data112 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title8|}}}|{{{demographics1_info8|}}}}}}}
| rowclass113 = mergedrow
| label113 = • {{{demographics1_title9}}}
| data113 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title9|}}}|{{{demographics1_info9|}}}}}}}
| rowclass114 = mergedrow
| label114 = • {{{demographics1_title10}}}
| data114 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title10|}}}|{{{demographics1_info10|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass115 = mergedtoprow
| header115 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<div class="ib-settlement-fn">{{{demographics2_footnotes|}}}</div>}}
| rowclass116 = mergedrow
| label116 = • {{{demographics2_title1}}}
| data116 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass117 = mergedrow
| label117 = • {{{demographics2_title2}}}
| data117 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass118 = mergedrow
| label118 = • {{{demographics2_title3}}}
| data118 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass119 = mergedrow
| label119 = • {{{demographics2_title4}}}
| data119 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass120 = mergedrow
| label120 = • {{{demographics2_title5}}}
| data120 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass121 = mergedrow
| label121 = • {{{demographics2_title6}}}
| data121 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass122 = mergedrow
| label122 = • {{{demographics2_title7}}}
| data122 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
| rowclass123 = mergedrow
| label123 = • {{{demographics2_title8}}}
| data123 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title8|}}}|{{{demographics2_info8|}}}}}}}
| rowclass124 = mergedrow
| label124 = • {{{demographics2_title9}}}
| data124 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title9|}}}|{{{demographics2_info9|}}}}}}}
| rowclass125 = mergedrow
| label125 = • {{{demographics2_title10}}}
| data125 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title10|}}}|{{{demographics2_info10|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass126 = mergedtoprow
| header126 = {{#if:{{{timezone1_location|}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}|}}
| rowclass127 = {{#if:{{{timezone1_location|}}}|mergedrow|mergedtoprow}}
| label127 = {{#if:{{{timezone1_location|}}}|{{{timezone1_location}}}|{{#if:{{{timezone2_location|}}}|{{{timezone2_location}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}}}}}
| data127 = {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}
|[[UTC{{{utc_offset1|{{{utc_offset}}}}}}]] {{#if:{{{timezone1|{{{timezone|}}}}}}|({{{timezone1|{{{timezone}}}}}})}}
|{{{timezone1|{{{timezone|}}}}}}
}}
| rowclass128 = mergedrow
| label128 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data128 = {{#if:{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}
|[[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]] {{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|({{{timezone1_DST|{{{timezone_DST}}}}}})}}
|{{{timezone1_DST|{{{timezone_DST|}}}}}}
}}
| rowclass129 = mergedrow
| label129 = {{#if:{{{timezone2_location|}}}| {{{timezone2_location|}}}|<nowiki />}}
| data129 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}
|[[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]] {{#if:{{{timezone2|}}}|({{{timezone2}}})}}
|{{{timezone2|}}}
}}
}}
| rowclass130 = mergedrow
| label130 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data130 = {{#if:{{{utc_offset2_DST|}}}|[[UTC{{{utc_offset2_DST|}}}]] {{#if:{{{timezone2_DST|}}}|({{{timezone2_DST|}}})}}
|{{{timezone2_DST|}}}
}}
| rowclass131 = mergedrow
| label131 = {{#if:{{{timezone3_location|}}}| {{{timezone3_location|}}}|<nowiki />}}
| data131 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset3|{{{utc_offset3|}}} }}}
|[[UTC{{{utc_offset3|{{{utc_offset3}}}}}}]] {{#if:{{{timezone3|}}}|({{{timezone3}}})}}
|{{{timezone3|}}}
}}
}}
| rowclass132 = mergedrow
| label132 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data132 = {{#if:{{{utc_offset3_DST|}}}|[[UTC{{{utc_offset3_DST|}}}]] {{#if:{{{timezone3_DST|}}}|({{{timezone3_DST|}}})}}
|{{{timezone3_DST|}}}
}}
| rowclass133 = mergedrow
| label133 = {{#if:{{{timezone4_location|}}}| {{{timezone4_location|}}}|<nowiki />}}
| data133 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset4|{{{utc_offset4|}}} }}}
|[[UTC{{{utc_offset4|{{{utc_offset4}}}}}}]] {{#if:{{{timezone4|}}}|({{{timezone4}}})}}
|{{{timezone4|}}}
}}
}}
| rowclass134 = mergedrow
| label134 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data134 = {{#if:{{{utc_offset4_DST|}}}|[[UTC{{{utc_offset4_DST|}}}]] {{#if:{{{timezone4_DST|}}}|({{{timezone4_DST|}}})}}
|{{{timezone4_DST|}}}
}}
| rowclass135 = mergedrow
| label135 = {{#if:{{{timezone5_location|}}}| {{{timezone5_location|}}}|<nowiki />}}
| data135 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset5|{{{utc_offset5|}}} }}}
|[[UTC{{{utc_offset5|{{{utc_offset5}}}}}}]] {{#if:{{{timezone5|}}}|({{{timezone5}}})}}
|{{{timezone5|}}}
}}
}}
| rowclass136 = mergedrow
| label136 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data136 = {{#if:{{{utc_offset5_DST|}}}|[[UTC{{{utc_offset5_DST|}}}]] {{#if:{{{timezone5_DST|}}}|({{{timezone5_DST|}}})}}
|{{{timezone5_DST|}}}
}}
<!-- ***Postal Code(s)*** -->
| rowclass137 = mergedtoprow
| label137 = {{{postal_code_type}}}
| class137 = adr
| data137 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<div class="postal-code">{{{postal_code}}}</div>}}}}
| rowclass138 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}|mergedbottomrow|mergedtoprow}}
| label138 = {{{postal2_code_type}}}
| class138 = adr
| data138 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<div class="postal-code">{{{postal2_code}}}</div>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass139 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}|mergedrow|mergedtoprow}}
| label139 = {{if empty|{{{area_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{if empty|{{{area_code|}}}|{{{area_codes|}}}{{force plural}}}}|<!--
-->link=Telephone numbering plan|singular=Area code|likely=Area code(s)|plural=Area codes}}}}
| data139 = {{if empty|{{{area_code|}}}|{{{area_codes|}}}}}{{#if:{{{area_code_type|}}}||{{Main other|{{Pluralize from text|any_comma=1|parse_links=1|{{{area_code|}}}|||[[Category:Pages using infobox settlement with possible area code list]]}}}}}}
<!-- Geocode-->
| rowclass140 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label140 = [[Geocode]]
| class140 = nickname
| data140 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass141 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label141 = [[ISO 3166|ISO 3166 code]]
| class141 = nickname
| data141 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass142 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label142 = {{#if:{{{registration_plate_type|}}}|{{{registration_plate_type}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data142 = {{{registration_plate|}}}
<!-- Other codes -->
| rowclass143 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label143 = {{{code1_name|}}}
| class143 = nickname
| data143 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass144 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label144 = {{{code2_name|}}}
| class144 = nickname
| data144 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass145 = mergedtoprow
| label145 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data145 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass146 = mergedrow
| label146 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data146 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass147 = mergedrow
| label147 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data147 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass148 = mergedrow
| label148 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data148 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass149 = mergedrow
| label149 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data149 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass150 = mergedrow
| label150 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data150 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass151 = mergedrow
| label151 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data151 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass152 = mergedrow
| label152 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data152 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass153 = mergedtoprow
| label153 = {{{blank_name_sec2}}}
| data153 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass154 = mergedrow
| label154 = {{{blank1_name_sec2}}}
| data154 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass155 = mergedrow
| label155 = {{{blank2_name_sec2}}}
| data155 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass156 = mergedrow
| label156 = {{{blank3_name_sec2}}}
| data156 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass157 = mergedrow
| label157 = {{{blank4_name_sec2}}}
| data157 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass158 = mergedrow
| label158 = {{{blank5_name_sec2}}}
| data158 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass159 = mergedrow
| label159 = {{{blank6_name_sec2}}}
| data159 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass160 = mergedrow
| label160 = {{{blank7_name_sec2}}}
| data160 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass161 = mergedtoprow
| label161 = Website
| data161 = {{#if:{{{website|}}}|{{{website}}}}}
| class162 = maptable
| data162 = {{#if:{{{module|}}}|{{{module}}}}}
<!-- ***Footnotes*** -->
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!-- Check for unknowns
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox settlement with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox settlement]] with unknown parameter "_VALUE_"|ignoreblank=y
| alt | anthem | anthem_link | area_blank1_acre | area_blank1_dunam | area_blank1_ha | area_blank1_km2 | area_blank1_sq_mi | area_blank1_title | area_blank2_acre | area_blank2_dunam | area_blank2_ha | area_blank2_km2 | area_blank2_sq_mi | area_blank2_title | area_code | area_code_type | area_codes | area_footnotes | area_land_acre | area_land_dunam | area_land_ha | area_land_km2 | area_land_sq_mi | area_metro_acre | area_metro_dunam | area_metro_footnotes | area_metro_ha | area_metro_km2 | area_metro_sq_mi | area_note | area_rank | area_rural_acre | area_rural_dunam | area_rural_footnotes | area_rural_ha | area_rural_km2 | area_rural_sq_mi | area_total_acre | area_total_dunam | area_total_ha | area_total_km2 | area_total_sq_mi | area_urban_acre | area_urban_dunam | area_urban_footnotes | area_urban_ha | area_urban_km2 | area_urban_sq_mi | area_water_acre | area_water_dunam | area_water_ha | area_water_km2 | area_water_percent | area_water_sq_mi | blank_emblem_alt | blank_emblem_link | blank_emblem_size | blank_emblem_type | blank_info | blank_info_sec1 | blank_info_sec2 | blank_name | blank_name_sec1 | blank_name_sec2 | blank1_info | blank1_info_sec1 | blank1_info_sec2 | blank1_name | blank1_name_sec1 | blank1_name_sec2 | blank2_info | blank2_info_sec1 | blank2_info_sec2 | blank2_name | blank2_name_sec1 | blank2_name_sec2 | blank3_info | blank3_info_sec1 | blank3_info_sec2 | blank3_name | blank3_name_sec1 | blank3_name_sec2 | blank4_info | blank4_info_sec1 | blank4_info_sec2 | blank4_name | blank4_name_sec1 | blank4_name_sec2 | blank5_info | blank5_info_sec1 | blank5_info_sec2 | blank5_name | blank5_name_sec1 | blank5_name_sec2 | blank6_info | blank6_info_sec1 | blank6_info_sec2 | blank6_name | blank6_name_sec1 | blank6_name_sec2 | blank7_info | blank7_info_sec1 | blank7_info_sec2 | blank7_name | blank7_name_sec1 | blank7_name_sec2 | caption | code1_info | code1_name | code2_info | code2_name | coor_pinpoint | coor_type | coordinates | coordinates_footnotes | demographics_type1 | demographics_type2 | demographics1_footnotes | demographics1_info1 | demographics1_info10 | demographics1_info2 | demographics1_info3 | demographics1_info4 | demographics1_info5 | demographics1_info6 | demographics1_info7 | demographics1_info8 | demographics1_info9 | demographics1_title1 | demographics1_title10 | demographics1_title2 | demographics1_title3 | demographics1_title4 | demographics1_title5 | demographics1_title6 | demographics1_title7 | demographics1_title8 | demographics1_title9 | demographics2_footnotes | demographics2_info1 | demographics2_info10 | demographics2_info2 | demographics2_info3 | demographics2_info4 | demographics2_info5 | demographics2_info6 | demographics2_info7 | demographics2_info8 | demographics2_info9 | demographics2_title1 | demographics2_title10 | demographics2_title2 | demographics2_title3 | demographics2_title4 | demographics2_title5 | demographics2_title6 | demographics2_title7 | demographics2_title8 | demographics2_title9 | dimensions_footnotes | dunam_link | elevation_footnotes | elevation_ft | elevation_link | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_max_rank | elevation_min_footnotes | elevation_min_ft | elevation_min_m | elevation_min_point | elevation_min_rank | elevation_point | embed | established_date | established_date1 | established_date2 | established_date3 | established_date4 | established_date5 | established_date6 | established_date7 | established_title | established_title1 | established_title2 | established_title3 | established_title4 | established_title5 | established_title6 | established_title7 | etymology | extinct_date | extinct_title | flag_alt | flag_border | flag_link | flag_size | footnotes | founder | geocode | governing_body | government_footnotes | government_type | government_blank1_title | government_blank1 | government_blank2_title | government_blank2 | government_blank2_title | government_blank3 | government_blank3_title | government_blank3 | government_blank4_title | government_blank4 | government_blank5_title | government_blank5 | government_blank6_title | government_blank6 | grid_name | grid_position | image_alt | image_blank_emblem | image_caption | image_flag | image_map | image_map1 | image_seal | image_shield | image_size | image_skyline | imagesize | iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | length_km | length_mi | map_alt | map_alt1 | map_caption | map_caption1 | mapsize | mapsize1 | module | motto | motto_link | mottoes | name | named_for | native_name | native_name_lang | nickname | nickname_link | nicknames | official_name | other_name | p1 | p10 | p11 | p12 | p13 | p14 | p15 | p16 | p17 | p18 | p19 | p2 | p20 | p21 | p22 | p23 | p24 | p25 | p26 | p27 | p28 | p29 | p3 | p30 | p31 | p32 | p33 | p34 | p35 | p36 | p37 | p38 | p39 | p4 | p40 | p41 | p42 | p43 | p44 | p45 | p46 | p47 | p48 | p49 | p5 | p50 | p6 | p7 | p8 | p9 | parts | parts_style | parts_type | pop_est_as_of | pop_est_footnotes | population | population_as_of | population_blank1 | population_blank1_footnotes | population_blank1_title | population_blank2 | population_blank2_footnotes | population_blank2_title | population_demonym | population_demonyms | population_density_blank1_km2 | population_density_blank1_sq_mi | population_density_blank2_km2 | population_density_blank2_sq_mi | population_density_km2 | population_density_metro_km2 | population_density_metro_sq_mi | population_density_rank | population_density_rural_km2 | population_density_rural_sq_mi | population_density_sq_mi | population_density_urban_km2 | population_density_urban_sq_mi | population_est | population_footnotes | population_metro | population_metro_footnotes | population_note | population_rank | population_rural | population_rural_footnotes | population_total | population_urban | population_urban_footnotes | postal_code | postal_code_type | postal2_code | postal2_code_type | pushpin_image | pushpin_label | pushpin_label_position | pushpin_map | pushpin_map_alt | pushpin_map_caption | pushpin_map_caption_notsmall | pushpin_map_narrow | pushpin_mapsize | pushpin_outside | pushpin_overlay | pushpin_relief | registration_plate | registration_plate_type | seal_alt | seal_link | seal_size | seal_type | seat | seat_type | seat1 | seat1_type | seat2 | seat2_type | settlement_type | shield_alt | shield_link | shield_size | short_description | subdivision_name | subdivision_name1 | subdivision_name2 | subdivision_name3 | subdivision_name4 | subdivision_name5 | subdivision_name6 | subdivision_type | subdivision_type1 | subdivision_type2 | subdivision_type3 | subdivision_type4 | subdivision_type5 | subdivision_type6 | timezone | timezone_DST | timezone_link | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | timezone3 | timezone3_DST | timezone3_location | timezone4 | timezone4_DST | timezone4_location | timezone5 | timezone5_DST | timezone5_location | total_type | translit_lang1 | translit_lang1_info | translit_lang1_info1 | translit_lang1_info2 | translit_lang1_info3 | translit_lang1_info4 | translit_lang1_info5 | translit_lang1_info6 | translit_lang1_type | translit_lang1_type1 | translit_lang1_type2 | translit_lang1_type3 | translit_lang1_type4 | translit_lang1_type5 | translit_lang1_type6 | translit_lang2 | translit_lang2_info | translit_lang2_info1 | translit_lang2_info2 | translit_lang2_info3 | translit_lang2_info4 | translit_lang2_info5 | translit_lang2_info6 | translit_lang2_type | translit_lang2_type1 | translit_lang2_type2 | translit_lang2_type3 | translit_lang2_type4 | translit_lang2_type5 | translit_lang2_type6 | type | unit_pref | utc_offset | utc_offset_DST | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | utc_offset3 | utc_offset3_DST | utc_offset4 | utc_offset4_DST | utc_offset5 | utc_offset5_DST | website | width_km | width_mi
}}<!--
-->{{#invoke:Check for clobbered parameters|check
| template = Infobox settlement
| cat = {{main other|Category:Pages using infobox settlement with conflicting parameters}}
| population; population_total
| image_size; imagesize
| image_alt; alt
| image_caption; caption
}}<!-- Wikidata-->{{main other|<!-- Missing country
-->{{#if:{{{subdivision_name|}}}||[[Category:Pages using infobox settlement with missing country]]}}<!-- No map
-->{{#if:{{{pushpin_map|}}}{{{image_map|}}}{{{image_map1|}}}||[[Category:Pages using infobox settlement with no map]]}}<!-- Image_map1 without image_map
-->{{#if:{{{image_map1|}}}|{{#if:{{{image_map|}}}||[[Category:Pages using infobox settlement with image_map1 but not image_map]]}}}}<!-- No coordinates
-->{{#if:{{{coordinates|}}}||[[Category:Pages using infobox settlement with no coordinates]]}}<!--
-->{{#if:{{{type|}}}|{{#ifeq:{{{settlement_type|a}}}|{{{settlement_type|b}}}|[[Category:Pages using infobox settlement with ignored type]]|}}|}}<!-- Ignored type parameter
-->{{#if:{{{embed|}}}|[[Category:Pages using infobox settlement with embed]]}}
}}</includeonly><noinclude>
{{documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
a2e7d0d2163e16346fd8498058748c63276409f0
611
604
2023-10-17T21:40:18Z
LamayII
2
Removed Category sets
wikitext
text/x-wiki
<includeonly>{{main other|{{#invoke:Settlement short description|main}}|}}{{Infobox
| child = {{yesno|{{{embed|}}}}}
| templatestyles = Infobox settlement/styles.css
| bodyclass = ib-settlement vcard
<!--** names, type, and transliterations ** -->
| above = <div class="fn org">{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}</div>
{{#if:{{{native_name|}}}|<div class="nickname ib-settlement-native" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</div>}}{{#if:{{{other_name|}}}|<div class="nickname ib-settlement-other-name">{{{other_name}}}</div>}}
| subheader = {{#if:{{{settlement_type|{{{type|}}}}}}|<div class="category">{{{settlement_type|{{{type}}}}}}</div>}}
| rowclass1 = mergedtoprow ib-settlement-official
| data1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
<!-- ***Transliteration language 1*** -->
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|{{{translit_lang1}}} transcription(s)}}
| rowclass3 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
| label3 = • {{{translit_lang1_type}}}
| data3 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}}}
| rowclass4 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
| label4 = • {{{translit_lang1_type1}}}
| data4 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}}}
| rowclass5 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
| label5 = • {{{translit_lang1_type2}}}
| data5 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}}}
| rowclass6 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
| label6 = • {{{translit_lang1_type3}}}
| data6 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}}}
| rowclass7 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
| label7 = • {{{translit_lang1_type4}}}
| data7 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}}}
| rowclass8 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
| label8 = • {{{translit_lang1_type5}}}
| data8 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}}}
| rowclass9 = mergedbottomrow
| label9 = • {{{translit_lang1_type6}}}
| data9 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}}}}}}
<!-- ***Transliteration language 2*** -->
| rowclass10 = mergedtoprow
| header10 = {{#if:{{{translit_lang2|}}}|{{{translit_lang2}}} transcription(s)}}
| rowclass11 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
| label11 = • {{{translit_lang2_type}}}
| data11 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}}}
| rowclass12 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
| label12 = • {{{translit_lang2_type1}}}
| data12 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}}}
| rowclass13 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
| label13 = • {{{translit_lang2_type2}}}
| data13 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}}}
| rowclass14 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
| label14 = • {{{translit_lang2_type3}}}
| data14 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}}}
| rowclass15 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
| label15 = • {{{translit_lang2_type4}}}
| data15 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}}}
| rowclass16 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
| label16 = • {{{translit_lang2_type5}}}
| data16 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}}}
| rowclass17 = mergedbottomrow
| label17 = • {{{translit_lang2_type6}}}
| data17 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}}}}}}
<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| rowclass18 = mergedtoprow
| data18 = {{#if:{{{image_skyline|}}}|<!--
-->{{#invoke:InfoboxImage|InfoboxImage<!--
-->|image={{{image_skyline|}}}<!--
-->|size={{if empty|{{{image_size|}}}|{{{imagesize|}}}}}|sizedefault=250px<!--
-->|alt={{if empty|{{{image_alt|}}}|{{{alt|}}}}}<!--
-->|title={{if empty|{{{image_caption|}}}|{{{caption|}}}|{{{image_alt|}}}|{{{alt|}}}}}}}<!--
-->{{#if:{{{image_caption|}}}{{{caption|}}}|<div class="ib-settlement-caption">{{if empty|{{{image_caption|}}}|{{{caption|}}}}}</div>}} }}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass19 = mergedtoprow
| class19 = maptable
| data19 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|125px|100x100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Flag of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Flag|link={{{flag_link|}}}|name={{{official_name}}}}}</div>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{seal_alt|}}}|title=Official seal of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Seal}}|link={{{seal_link|}}}|name={{{official_name}}}}}</div>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{shield_alt|}}}|title=Coat of arms of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Coat of arms|link={{{shield_link|}}}|name={{{official_name}}}}}</div>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}</div>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100x100px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption-link">{{{map_caption}}}</div>}}}}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{{map_caption}}}}}}}}}
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
}} }}
<!-- ***Etymology*** -->
| rowclass20 = mergedtoprow
| data20 = {{#if:{{{etymology|}}}|Etymology: {{{etymology}}} }}
<!-- ***Nickname*** -->
| rowclass21 = {{#if:{{{etymology|}}}|mergedrow|mergedtoprow}}
| data21 = {{#if:{{{nickname|}}}{{{nicknames|}}}|<!--
-->{{Pluralize from text|parse_links=1|{{if empty|{{{nickname|}}}|{{{nicknames|}}}{{force plural}}}}|<!--
-->link={{{nickname_link|}}}|singular=Nickname|likely=Nickname(s)|plural=Nicknames}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{nickname|}}}|{{{nicknames|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|parse_links=1|{{{nickname|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible nickname list]]}}}}}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}{{{mottoes|}}}|<!--
-->{{Pluralize from text|{{if empty|{{{motto|}}}|{{{mottoes|}}}{{force plural}}}}|<!--
-->link={{{motto_link|}}}|singular=Motto|likely=Motto(s)|plural=Mottoes}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{motto|}}}|{{{mottoes|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|{{{motto|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible motto list]]}}}}}}
<!-- ***Anthem*** -->
| rowclass23 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}{{{motto|}}}{{{mottoes|}}}|mergedrow|mergedtoprow}}
| data23 = {{#if:{{{anthem|}}}|{{#if:{{{anthem_link|}}}|[[{{{anthem_link|}}}|Anthem:]]|Anthem:}} {{{anthem}}}}}
<!-- ***Map*** -->
| rowclass24 = mergedtoprow
| data24 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption">{{{map_caption}}}</div>}}
}}}}
| rowclass25 = mergedrow
| data25 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<div class="ib-settlement-caption">{{{map_caption1}}}</div>}} }}
<!-- ***Pushpin Map*** -->
| rowclass26 = mergedtoprow
| data26 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{#if:{{{image_map|}}}||{{{map_caption}}}}}}}}}}}
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| rowclass27 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|{{#if:{{{grid_position|}}}|mergedrow|mergedbottomrow}}}}
| data27 = {{#if:{{{coordinates|}}}
|Coordinates{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})}}: {{#invoke:ISO 3166|geocoordinsert|nocat=true|1={{{coordinates|}}}|country={{{subdivision_name|}}}|subdivision1={{{subdivision_name1|}}}|subdivision2={{{subdivision_name2|}}}|subdivision3={{{subdivision_name3|}}}|type=city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{replace|{{{population_total}}}|,|}}|R}})}}}} }}{{{coordinates_footnotes|}}} }}
| rowclass28 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label28 = {{if empty|{{{grid_name|}}}|Grid position}}
| data28 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass29 = mergedtoprow
| label29 = {{{subdivision_type}}}
| data29 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass30 = mergedrow
| label30 = {{{subdivision_type1}}}
| data30 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass31 = mergedrow
| label31 = {{{subdivision_type2}}}
| data31 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type3}}}
| data32 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type4}}}
| data33 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type5}}}
| data34 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type6}}}
| data35 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass36 = mergedtoprow
| label36 = {{{established_title}}}
| data36 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass37 = mergedrow
| label37 = {{{established_title1}}}
| data37 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass38 = mergedrow
| label38 = {{{established_title2}}}
| data38 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass39 = mergedrow
| label39 = {{{established_title3}}}
| data39 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title4}}}
| data40 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title5}}}
| data41 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title6}}}
| data42 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title7}}}
| data43 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass44 = mergedrow
| label44 = {{{extinct_title}}}
| data44 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass45 = mergedrow
| label45 = Founded by
| data45 = {{{founder|}}}
| rowclass46 = mergedrow
| label46 = [[Namesake|Named for]]
| data46 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass47 = mergedtoprow
| label47 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Seat}}
| data47 = {{{seat|}}}
| rowclass48 = mergedrow
| label48 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Former seat}}
| data48 = {{{seat1|}}}
| rowclass49 = mergedrow
| label49 = {{#if:{{{seat2_type|}}}|{{{seat2_type}}}|Former seat}}
| data49 = {{{seat2|}}}
| rowclass51 = {{#if:{{{seat|}}}{{{seat1|}}}{{{seat2|}}}|mergedrow|mergedtoprow}}
| label51 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|Boroughs}}
| data51 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass52 = mergedtoprow
| header52 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Government<div class="ib-settlement-fn">{{{government_footnotes|}}}</div>}}
<!-- ***Government*** -->
| rowclass53 = mergedrow
| label53 = • Type
| data53 = {{{government_type|}}}
| rowclass54 = mergedrow
| label54 = • Body
| class54 = agent
| data54 = {{{governing_body|}}}
| rowclass55 = mergedrow
| label55 = • {{{leader_title}}}
| data55 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title1}}}
| data56 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title2}}}
| data57 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass58 = mergedrow
| label58 = • {{{leader_title3}}}
| data58 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass59 = mergedrow
| label59 = • {{{leader_title4}}}
| data59 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
| rowclass60 = mergedrow
| label60 = {{{government_blank1_title}}}
| data60 = {{#if:{{{government_blank1|}}}|{{{government_blank1|}}}}}
| rowclass61 = mergedrow
| label61 = {{{government_blank2_title}}}
| data61 = {{#if:{{{government_blank2|}}}|{{{government_blank2|}}}}}
| rowclass62 = mergedrow
| label62 = {{{government_blank3_title}}}
| data62 = {{#if:{{{government_blank3|}}}|{{{government_blank3|}}}}}
| rowclass63 = mergedrow
| label63 = {{{government_blank4_title}}}
| data63 = {{#if:{{{government_blank4|}}}|{{{government_blank4|}}}}}
| rowclass64 = mergedrow
| label64 = {{{government_blank5_title}}}
| data64 = {{#if:{{{government_blank5|}}}|{{{government_blank5|}}}}}
| rowclass65 = mergedrow
| label65 = {{{government_blank6_title}}}
| data65 = {{#if:{{{government_blank6|}}}|{{{government_blank6|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass66 = mergedtoprow
| header66 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
}}
}}
| rowclass67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
}}
| data67 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass68 = mergedrow
| label68 = • Land
| data68 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass69 = mergedrow
| label69 = • Water
| data69 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}{{#ifeq:%|{{#invoke:string|sub|{{{area_water_percent|}}}|-1}}||%}}}}}}
| rowclass70 = mergedrow
| label70 = • Urban<div class="ib-settlement-fn">{{{area_urban_footnotes|}}}</div>
| data70 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass71 = mergedrow
| label71 = • Rural<div class="ib-settlement-fn">{{{area_rural_footnotes|}}}</div>
| data71 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass72 = mergedrow
| label72 = • Metro<div class="ib-settlement-fn">{{{area_metro_footnotes|}}}</div>
| data72 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass73 = mergedrow
| label73 = • Rank
| data73 = {{{area_rank|}}}
| rowclass74 = mergedrow
| label74 = • {{{area_blank1_title}}}
| data74 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass75 = mergedrow
| label75 = • {{{area_blank2_title}}}
| data75 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass76 = mergedrow
| label76 =
| data76 = {{{area_note|}}}
<!-- ***Dimensions*** -->
| rowclass77 = mergedtoprow
| header77 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<div class="ib-settlement-fn">{{{dimensions_footnotes|}}}</div>}}
| rowclass78 = mergedrow
| label78 = • Length
| data78 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass79 = mergedrow
| label79 = • Width
| data79 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass80 = mergedtoprow
| label80 = {{#if:{{{elevation_link|}}}|[[{{{elevation_link|}}}|Elevation]]|Elevation}}<div class="ib-settlement-fn">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</div>
| data80 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass81 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}|mergedrow|mergedtoprow}}
| label81 = Highest elevation<div class="ib-settlement-fn">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</div>
| data81 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass82 = mergedrow
| label82 = • Rank
| data82 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass83 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label83 = Lowest elevation<div class="ib-settlement-fn">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</div>
| data83 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass84 = mergedrow
| label84 = • Rank
| data84 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass85 = mergedtoprow
| label85 = Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
| data85 = {{fix comma category|{{#if:{{{population|}}}
| {{formatnum:{{replace|{{{population}}}|,|}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{replace|{{{population_total}}}|,|}}}}
}}
}}
}}}}
| rowclass86 = mergedtoprow
| header86 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
}}
}}
}}
| rowclass87 = mergedrow
| label87 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
| data87 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{fix comma category|{{formatnum:{{replace|{{{population_total}}}|,|}}}}}}
}}
}}
}}
| rowclass88 = mergedrow
| label88 = • Estimate <div class="ib-settlement-fn">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</div>
| data88 = {{#if:{{{population_est|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_est}}}|,|}}}}}} }}
<!-- ***Population rank*** -->
| rowclass89 = mergedrow
| label89 = • Rank
| data89 = {{{population_rank|}}}
| rowclass90 = mergedrow
| label90 = • Density
| data90 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass91 = mergedrow
| label91 = • Rank
| data91 = {{{population_density_rank|}}}
| rowclass92 = mergedrow
| label92 = • [[Urban area|Urban]]<div class="ib-settlement-fn">{{{population_urban_footnotes|}}}</div>
| data92 = {{#if:{{{population_urban|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_urban}}}|,|}}}}}} }}
| rowclass93 = mergedrow
| label93 = • Urban density
| data93 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass94 = mergedrow
| label94 = • [[Rural area|Rural]]<div class="ib-settlement-fn">{{{population_rural_footnotes|}}}</div>
| data94 = {{#if:{{{population_rural|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_rural}}}|,|}}}}}}}}
| rowclass95 = mergedrow
| label95 = • Rural density
| data95 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass96 = mergedrow
| label96 = • [[Metropolitan area|Metro]]<div class="ib-settlement-fn">{{{population_metro_footnotes|}}}</div>
| data96 = {{#if:{{{population_metro|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_metro}}}|,|}}}}}} }}
| rowclass97 = mergedrow
| label97 = • Metro density
| data97 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass98 = mergedrow
| label98 = • {{{population_blank1_title|}}}<div class="ib-settlement-fn">{{{population_blank1_footnotes|}}}</div>
| data98 = {{#if:{{{population_blank1|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank1}}}|,|}}}}}}}}
| rowclass99 = mergedrow
| label99 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data99 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass100 = mergedrow
| label100 = • {{{population_blank2_title|}}}<div class="ib-settlement-fn">{{{population_blank2_footnotes|}}}</div>
| data100 = {{#if:{{{population_blank2|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank2}}}|,|}}}}}}}}
| rowclass101 = mergedrow
| label101 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data101 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass102 = mergedrow
| label102 =
| data102 = {{{population_note|}}}
| rowclass103 = mergedtoprow
| label103 = {{Pluralize from text|{{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}{{force plural}}}}|<!--
-->link=Demonym|singular=Demonym|likely=Demonym(s)|plural=Demonyms}}
| data103 = {{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}}}{{Main other|{{Pluralize from text|{{{population_demonym|}}}|likely=[[Category:Pages using infobox settlement with possible demonym list]]}}}}
<!-- ***Demographics 1*** -->
| rowclass104 = mergedtoprow
| header104 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<div class="ib-settlement-fn">{{{demographics1_footnotes|}}}</div>}}
| rowclass105 = mergedrow
| label105 = • {{{demographics1_title1}}}
| data105 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass106 = mergedrow
| label106 = • {{{demographics1_title2}}}
| data106 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass107 = mergedrow
| label107 = • {{{demographics1_title3}}}
| data107 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics1_title4}}}
| data108 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics1_title5}}}
| data109 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics1_title6}}}
| data110 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics1_title7}}}
| data111 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
| rowclass112 = mergedrow
| label112 = • {{{demographics1_title8}}}
| data112 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title8|}}}|{{{demographics1_info8|}}}}}}}
| rowclass113 = mergedrow
| label113 = • {{{demographics1_title9}}}
| data113 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title9|}}}|{{{demographics1_info9|}}}}}}}
| rowclass114 = mergedrow
| label114 = • {{{demographics1_title10}}}
| data114 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title10|}}}|{{{demographics1_info10|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass115 = mergedtoprow
| header115 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<div class="ib-settlement-fn">{{{demographics2_footnotes|}}}</div>}}
| rowclass116 = mergedrow
| label116 = • {{{demographics2_title1}}}
| data116 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass117 = mergedrow
| label117 = • {{{demographics2_title2}}}
| data117 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass118 = mergedrow
| label118 = • {{{demographics2_title3}}}
| data118 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass119 = mergedrow
| label119 = • {{{demographics2_title4}}}
| data119 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass120 = mergedrow
| label120 = • {{{demographics2_title5}}}
| data120 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass121 = mergedrow
| label121 = • {{{demographics2_title6}}}
| data121 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass122 = mergedrow
| label122 = • {{{demographics2_title7}}}
| data122 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
| rowclass123 = mergedrow
| label123 = • {{{demographics2_title8}}}
| data123 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title8|}}}|{{{demographics2_info8|}}}}}}}
| rowclass124 = mergedrow
| label124 = • {{{demographics2_title9}}}
| data124 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title9|}}}|{{{demographics2_info9|}}}}}}}
| rowclass125 = mergedrow
| label125 = • {{{demographics2_title10}}}
| data125 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title10|}}}|{{{demographics2_info10|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass126 = mergedtoprow
| header126 = {{#if:{{{timezone1_location|}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}|}}
| rowclass127 = {{#if:{{{timezone1_location|}}}|mergedrow|mergedtoprow}}
| label127 = {{#if:{{{timezone1_location|}}}|{{{timezone1_location}}}|{{#if:{{{timezone2_location|}}}|{{{timezone2_location}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}}}}}
| data127 = {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}
|[[UTC{{{utc_offset1|{{{utc_offset}}}}}}]] {{#if:{{{timezone1|{{{timezone|}}}}}}|({{{timezone1|{{{timezone}}}}}})}}
|{{{timezone1|{{{timezone|}}}}}}
}}
| rowclass128 = mergedrow
| label128 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data128 = {{#if:{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}
|[[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]] {{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|({{{timezone1_DST|{{{timezone_DST}}}}}})}}
|{{{timezone1_DST|{{{timezone_DST|}}}}}}
}}
| rowclass129 = mergedrow
| label129 = {{#if:{{{timezone2_location|}}}| {{{timezone2_location|}}}|<nowiki />}}
| data129 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}
|[[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]] {{#if:{{{timezone2|}}}|({{{timezone2}}})}}
|{{{timezone2|}}}
}}
}}
| rowclass130 = mergedrow
| label130 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data130 = {{#if:{{{utc_offset2_DST|}}}|[[UTC{{{utc_offset2_DST|}}}]] {{#if:{{{timezone2_DST|}}}|({{{timezone2_DST|}}})}}
|{{{timezone2_DST|}}}
}}
| rowclass131 = mergedrow
| label131 = {{#if:{{{timezone3_location|}}}| {{{timezone3_location|}}}|<nowiki />}}
| data131 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset3|{{{utc_offset3|}}} }}}
|[[UTC{{{utc_offset3|{{{utc_offset3}}}}}}]] {{#if:{{{timezone3|}}}|({{{timezone3}}})}}
|{{{timezone3|}}}
}}
}}
| rowclass132 = mergedrow
| label132 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data132 = {{#if:{{{utc_offset3_DST|}}}|[[UTC{{{utc_offset3_DST|}}}]] {{#if:{{{timezone3_DST|}}}|({{{timezone3_DST|}}})}}
|{{{timezone3_DST|}}}
}}
| rowclass133 = mergedrow
| label133 = {{#if:{{{timezone4_location|}}}| {{{timezone4_location|}}}|<nowiki />}}
| data133 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset4|{{{utc_offset4|}}} }}}
|[[UTC{{{utc_offset4|{{{utc_offset4}}}}}}]] {{#if:{{{timezone4|}}}|({{{timezone4}}})}}
|{{{timezone4|}}}
}}
}}
| rowclass134 = mergedrow
| label134 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data134 = {{#if:{{{utc_offset4_DST|}}}|[[UTC{{{utc_offset4_DST|}}}]] {{#if:{{{timezone4_DST|}}}|({{{timezone4_DST|}}})}}
|{{{timezone4_DST|}}}
}}
| rowclass135 = mergedrow
| label135 = {{#if:{{{timezone5_location|}}}| {{{timezone5_location|}}}|<nowiki />}}
| data135 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset5|{{{utc_offset5|}}} }}}
|[[UTC{{{utc_offset5|{{{utc_offset5}}}}}}]] {{#if:{{{timezone5|}}}|({{{timezone5}}})}}
|{{{timezone5|}}}
}}
}}
| rowclass136 = mergedrow
| label136 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data136 = {{#if:{{{utc_offset5_DST|}}}|[[UTC{{{utc_offset5_DST|}}}]] {{#if:{{{timezone5_DST|}}}|({{{timezone5_DST|}}})}}
|{{{timezone5_DST|}}}
}}
<!-- ***Postal Code(s)*** -->
| rowclass137 = mergedtoprow
| label137 = {{{postal_code_type}}}
| class137 = adr
| data137 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<div class="postal-code">{{{postal_code}}}</div>}}}}
| rowclass138 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}|mergedbottomrow|mergedtoprow}}
| label138 = {{{postal2_code_type}}}
| class138 = adr
| data138 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<div class="postal-code">{{{postal2_code}}}</div>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass139 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}|mergedrow|mergedtoprow}}
| label139 = {{if empty|{{{area_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{if empty|{{{area_code|}}}|{{{area_codes|}}}{{force plural}}}}|<!--
-->link=Telephone numbering plan|singular=Area code|likely=Area code(s)|plural=Area codes}}}}
| data139 = {{if empty|{{{area_code|}}}|{{{area_codes|}}}}}{{#if:{{{area_code_type|}}}||{{Main other|{{Pluralize from text|any_comma=1|parse_links=1|{{{area_code|}}}|||[[Category:Pages using infobox settlement with possible area code list]]}}}}}}
<!-- Geocode-->
| rowclass140 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label140 = [[Geocode]]
| class140 = nickname
| data140 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass141 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label141 = [[ISO 3166|ISO 3166 code]]
| class141 = nickname
| data141 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass142 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label142 = {{#if:{{{registration_plate_type|}}}|{{{registration_plate_type}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data142 = {{{registration_plate|}}}
<!-- Other codes -->
| rowclass143 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label143 = {{{code1_name|}}}
| class143 = nickname
| data143 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass144 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label144 = {{{code2_name|}}}
| class144 = nickname
| data144 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass145 = mergedtoprow
| label145 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data145 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass146 = mergedrow
| label146 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data146 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass147 = mergedrow
| label147 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data147 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass148 = mergedrow
| label148 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data148 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass149 = mergedrow
| label149 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data149 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass150 = mergedrow
| label150 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data150 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass151 = mergedrow
| label151 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data151 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass152 = mergedrow
| label152 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data152 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass153 = mergedtoprow
| label153 = {{{blank_name_sec2}}}
| data153 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass154 = mergedrow
| label154 = {{{blank1_name_sec2}}}
| data154 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass155 = mergedrow
| label155 = {{{blank2_name_sec2}}}
| data155 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass156 = mergedrow
| label156 = {{{blank3_name_sec2}}}
| data156 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass157 = mergedrow
| label157 = {{{blank4_name_sec2}}}
| data157 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass158 = mergedrow
| label158 = {{{blank5_name_sec2}}}
| data158 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass159 = mergedrow
| label159 = {{{blank6_name_sec2}}}
| data159 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass160 = mergedrow
| label160 = {{{blank7_name_sec2}}}
| data160 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass161 = mergedtoprow
| label161 = Website
| data161 = {{#if:{{{website|}}}|{{{website}}}}}
| class162 = maptable
| data162 = {{#if:{{{module|}}}|{{{module}}}}}
<!-- ***Footnotes*** -->
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!-- Check for unknowns
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox settlement with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox settlement]] with unknown parameter "_VALUE_"|ignoreblank=y
| alt | anthem | anthem_link | area_blank1_acre | area_blank1_dunam | area_blank1_ha | area_blank1_km2 | area_blank1_sq_mi | area_blank1_title | area_blank2_acre | area_blank2_dunam | area_blank2_ha | area_blank2_km2 | area_blank2_sq_mi | area_blank2_title | area_code | area_code_type | area_codes | area_footnotes | area_land_acre | area_land_dunam | area_land_ha | area_land_km2 | area_land_sq_mi | area_metro_acre | area_metro_dunam | area_metro_footnotes | area_metro_ha | area_metro_km2 | area_metro_sq_mi | area_note | area_rank | area_rural_acre | area_rural_dunam | area_rural_footnotes | area_rural_ha | area_rural_km2 | area_rural_sq_mi | area_total_acre | area_total_dunam | area_total_ha | area_total_km2 | area_total_sq_mi | area_urban_acre | area_urban_dunam | area_urban_footnotes | area_urban_ha | area_urban_km2 | area_urban_sq_mi | area_water_acre | area_water_dunam | area_water_ha | area_water_km2 | area_water_percent | area_water_sq_mi | blank_emblem_alt | blank_emblem_link | blank_emblem_size | blank_emblem_type | blank_info | blank_info_sec1 | blank_info_sec2 | blank_name | blank_name_sec1 | blank_name_sec2 | blank1_info | blank1_info_sec1 | blank1_info_sec2 | blank1_name | blank1_name_sec1 | blank1_name_sec2 | blank2_info | blank2_info_sec1 | blank2_info_sec2 | blank2_name | blank2_name_sec1 | blank2_name_sec2 | blank3_info | blank3_info_sec1 | blank3_info_sec2 | blank3_name | blank3_name_sec1 | blank3_name_sec2 | blank4_info | blank4_info_sec1 | blank4_info_sec2 | blank4_name | blank4_name_sec1 | blank4_name_sec2 | blank5_info | blank5_info_sec1 | blank5_info_sec2 | blank5_name | blank5_name_sec1 | blank5_name_sec2 | blank6_info | blank6_info_sec1 | blank6_info_sec2 | blank6_name | blank6_name_sec1 | blank6_name_sec2 | blank7_info | blank7_info_sec1 | blank7_info_sec2 | blank7_name | blank7_name_sec1 | blank7_name_sec2 | caption | code1_info | code1_name | code2_info | code2_name | coor_pinpoint | coor_type | coordinates | coordinates_footnotes | demographics_type1 | demographics_type2 | demographics1_footnotes | demographics1_info1 | demographics1_info10 | demographics1_info2 | demographics1_info3 | demographics1_info4 | demographics1_info5 | demographics1_info6 | demographics1_info7 | demographics1_info8 | demographics1_info9 | demographics1_title1 | demographics1_title10 | demographics1_title2 | demographics1_title3 | demographics1_title4 | demographics1_title5 | demographics1_title6 | demographics1_title7 | demographics1_title8 | demographics1_title9 | demographics2_footnotes | demographics2_info1 | demographics2_info10 | demographics2_info2 | demographics2_info3 | demographics2_info4 | demographics2_info5 | demographics2_info6 | demographics2_info7 | demographics2_info8 | demographics2_info9 | demographics2_title1 | demographics2_title10 | demographics2_title2 | demographics2_title3 | demographics2_title4 | demographics2_title5 | demographics2_title6 | demographics2_title7 | demographics2_title8 | demographics2_title9 | dimensions_footnotes | dunam_link | elevation_footnotes | elevation_ft | elevation_link | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_max_rank | elevation_min_footnotes | elevation_min_ft | elevation_min_m | elevation_min_point | elevation_min_rank | elevation_point | embed | established_date | established_date1 | established_date2 | established_date3 | established_date4 | established_date5 | established_date6 | established_date7 | established_title | established_title1 | established_title2 | established_title3 | established_title4 | established_title5 | established_title6 | established_title7 | etymology | extinct_date | extinct_title | flag_alt | flag_border | flag_link | flag_size | footnotes | founder | geocode | governing_body | government_footnotes | government_type | government_blank1_title | government_blank1 | government_blank2_title | government_blank2 | government_blank2_title | government_blank3 | government_blank3_title | government_blank3 | government_blank4_title | government_blank4 | government_blank5_title | government_blank5 | government_blank6_title | government_blank6 | grid_name | grid_position | image_alt | image_blank_emblem | image_caption | image_flag | image_map | image_map1 | image_seal | image_shield | image_size | image_skyline | imagesize | iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | length_km | length_mi | map_alt | map_alt1 | map_caption | map_caption1 | mapsize | mapsize1 | module | motto | motto_link | mottoes | name | named_for | native_name | native_name_lang | nickname | nickname_link | nicknames | official_name | other_name | p1 | p10 | p11 | p12 | p13 | p14 | p15 | p16 | p17 | p18 | p19 | p2 | p20 | p21 | p22 | p23 | p24 | p25 | p26 | p27 | p28 | p29 | p3 | p30 | p31 | p32 | p33 | p34 | p35 | p36 | p37 | p38 | p39 | p4 | p40 | p41 | p42 | p43 | p44 | p45 | p46 | p47 | p48 | p49 | p5 | p50 | p6 | p7 | p8 | p9 | parts | parts_style | parts_type | pop_est_as_of | pop_est_footnotes | population | population_as_of | population_blank1 | population_blank1_footnotes | population_blank1_title | population_blank2 | population_blank2_footnotes | population_blank2_title | population_demonym | population_demonyms | population_density_blank1_km2 | population_density_blank1_sq_mi | population_density_blank2_km2 | population_density_blank2_sq_mi | population_density_km2 | population_density_metro_km2 | population_density_metro_sq_mi | population_density_rank | population_density_rural_km2 | population_density_rural_sq_mi | population_density_sq_mi | population_density_urban_km2 | population_density_urban_sq_mi | population_est | population_footnotes | population_metro | population_metro_footnotes | population_note | population_rank | population_rural | population_rural_footnotes | population_total | population_urban | population_urban_footnotes | postal_code | postal_code_type | postal2_code | postal2_code_type | pushpin_image | pushpin_label | pushpin_label_position | pushpin_map | pushpin_map_alt | pushpin_map_caption | pushpin_map_caption_notsmall | pushpin_map_narrow | pushpin_mapsize | pushpin_outside | pushpin_overlay | pushpin_relief | registration_plate | registration_plate_type | seal_alt | seal_link | seal_size | seal_type | seat | seat_type | seat1 | seat1_type | seat2 | seat2_type | settlement_type | shield_alt | shield_link | shield_size | short_description | subdivision_name | subdivision_name1 | subdivision_name2 | subdivision_name3 | subdivision_name4 | subdivision_name5 | subdivision_name6 | subdivision_type | subdivision_type1 | subdivision_type2 | subdivision_type3 | subdivision_type4 | subdivision_type5 | subdivision_type6 | timezone | timezone_DST | timezone_link | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | timezone3 | timezone3_DST | timezone3_location | timezone4 | timezone4_DST | timezone4_location | timezone5 | timezone5_DST | timezone5_location | total_type | translit_lang1 | translit_lang1_info | translit_lang1_info1 | translit_lang1_info2 | translit_lang1_info3 | translit_lang1_info4 | translit_lang1_info5 | translit_lang1_info6 | translit_lang1_type | translit_lang1_type1 | translit_lang1_type2 | translit_lang1_type3 | translit_lang1_type4 | translit_lang1_type5 | translit_lang1_type6 | translit_lang2 | translit_lang2_info | translit_lang2_info1 | translit_lang2_info2 | translit_lang2_info3 | translit_lang2_info4 | translit_lang2_info5 | translit_lang2_info6 | translit_lang2_type | translit_lang2_type1 | translit_lang2_type2 | translit_lang2_type3 | translit_lang2_type4 | translit_lang2_type5 | translit_lang2_type6 | type | unit_pref | utc_offset | utc_offset_DST | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | utc_offset3 | utc_offset3_DST | utc_offset4 | utc_offset4_DST | utc_offset5 | utc_offset5_DST | website | width_km | width_mi
}}<!--
-->{{#invoke:Check for clobbered parameters|check
| template = Infobox settlement
| cat = {{main other|Category:Pages using infobox settlement with conflicting parameters}}
| population; population_total
| image_size; imagesize
| image_alt; alt
| image_caption; caption
}}
-->{{#if:{{{embed|}}}|[[Category:Pages using infobox settlement with embed]]}}
}}</includeonly><noinclude>
{{documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
2c5d5fd2648c7b5490ca7abe85eb0741300903c0
612
611
2023-10-17T21:41:55Z
LamayII
2
fixed comment error
wikitext
text/x-wiki
<includeonly>{{main other|{{#invoke:Settlement short description|main}}|}}{{Infobox
| child = {{yesno|{{{embed|}}}}}
| templatestyles = Infobox settlement/styles.css
| bodyclass = ib-settlement vcard
<!--** names, type, and transliterations ** -->
| above = <div class="fn org">{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}</div>
{{#if:{{{native_name|}}}|<div class="nickname ib-settlement-native" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</div>}}{{#if:{{{other_name|}}}|<div class="nickname ib-settlement-other-name">{{{other_name}}}</div>}}
| subheader = {{#if:{{{settlement_type|{{{type|}}}}}}|<div class="category">{{{settlement_type|{{{type}}}}}}</div>}}
| rowclass1 = mergedtoprow ib-settlement-official
| data1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
<!-- ***Transliteration language 1*** -->
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|{{{translit_lang1}}} transcription(s)}}
| rowclass3 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
| label3 = • {{{translit_lang1_type}}}
| data3 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}}}
| rowclass4 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
| label4 = • {{{translit_lang1_type1}}}
| data4 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}}}
| rowclass5 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
| label5 = • {{{translit_lang1_type2}}}
| data5 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}}}
| rowclass6 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
| label6 = • {{{translit_lang1_type3}}}
| data6 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}}}
| rowclass7 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
| label7 = • {{{translit_lang1_type4}}}
| data7 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}}}
| rowclass8 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
| label8 = • {{{translit_lang1_type5}}}
| data8 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}}}
| rowclass9 = mergedbottomrow
| label9 = • {{{translit_lang1_type6}}}
| data9 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}}}}}}
<!-- ***Transliteration language 2*** -->
| rowclass10 = mergedtoprow
| header10 = {{#if:{{{translit_lang2|}}}|{{{translit_lang2}}} transcription(s)}}
| rowclass11 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
| label11 = • {{{translit_lang2_type}}}
| data11 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}}}
| rowclass12 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
| label12 = • {{{translit_lang2_type1}}}
| data12 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}}}
| rowclass13 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
| label13 = • {{{translit_lang2_type2}}}
| data13 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}}}
| rowclass14 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
| label14 = • {{{translit_lang2_type3}}}
| data14 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}}}
| rowclass15 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
| label15 = • {{{translit_lang2_type4}}}
| data15 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}}}
| rowclass16 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
| label16 = • {{{translit_lang2_type5}}}
| data16 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}}}
| rowclass17 = mergedbottomrow
| label17 = • {{{translit_lang2_type6}}}
| data17 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}}}}}}
<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| rowclass18 = mergedtoprow
| data18 = {{#if:{{{image_skyline|}}}|<!--
-->{{#invoke:InfoboxImage|InfoboxImage<!--
-->|image={{{image_skyline|}}}<!--
-->|size={{if empty|{{{image_size|}}}|{{{imagesize|}}}}}|sizedefault=250px<!--
-->|alt={{if empty|{{{image_alt|}}}|{{{alt|}}}}}<!--
-->|title={{if empty|{{{image_caption|}}}|{{{caption|}}}|{{{image_alt|}}}|{{{alt|}}}}}}}<!--
-->{{#if:{{{image_caption|}}}{{{caption|}}}|<div class="ib-settlement-caption">{{if empty|{{{image_caption|}}}|{{{caption|}}}}}</div>}} }}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass19 = mergedtoprow
| class19 = maptable
| data19 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|125px|100x100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Flag of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Flag|link={{{flag_link|}}}|name={{{official_name}}}}}</div>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{seal_alt|}}}|title=Official seal of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Seal}}|link={{{seal_link|}}}|name={{{official_name}}}}}</div>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{shield_alt|}}}|title=Coat of arms of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Coat of arms|link={{{shield_link|}}}|name={{{official_name}}}}}</div>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}</div>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100x100px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption-link">{{{map_caption}}}</div>}}}}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{{map_caption}}}}}}}}}
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
}} }}
<!-- ***Etymology*** -->
| rowclass20 = mergedtoprow
| data20 = {{#if:{{{etymology|}}}|Etymology: {{{etymology}}} }}
<!-- ***Nickname*** -->
| rowclass21 = {{#if:{{{etymology|}}}|mergedrow|mergedtoprow}}
| data21 = {{#if:{{{nickname|}}}{{{nicknames|}}}|<!--
-->{{Pluralize from text|parse_links=1|{{if empty|{{{nickname|}}}|{{{nicknames|}}}{{force plural}}}}|<!--
-->link={{{nickname_link|}}}|singular=Nickname|likely=Nickname(s)|plural=Nicknames}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{nickname|}}}|{{{nicknames|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|parse_links=1|{{{nickname|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible nickname list]]}}}}}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}{{{mottoes|}}}|<!--
-->{{Pluralize from text|{{if empty|{{{motto|}}}|{{{mottoes|}}}{{force plural}}}}|<!--
-->link={{{motto_link|}}}|singular=Motto|likely=Motto(s)|plural=Mottoes}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{motto|}}}|{{{mottoes|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|{{{motto|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible motto list]]}}}}}}
<!-- ***Anthem*** -->
| rowclass23 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}{{{motto|}}}{{{mottoes|}}}|mergedrow|mergedtoprow}}
| data23 = {{#if:{{{anthem|}}}|{{#if:{{{anthem_link|}}}|[[{{{anthem_link|}}}|Anthem:]]|Anthem:}} {{{anthem}}}}}
<!-- ***Map*** -->
| rowclass24 = mergedtoprow
| data24 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption">{{{map_caption}}}</div>}}
}}}}
| rowclass25 = mergedrow
| data25 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<div class="ib-settlement-caption">{{{map_caption1}}}</div>}} }}
<!-- ***Pushpin Map*** -->
| rowclass26 = mergedtoprow
| data26 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{#if:{{{image_map|}}}||{{{map_caption}}}}}}}}}}}
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| rowclass27 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|{{#if:{{{grid_position|}}}|mergedrow|mergedbottomrow}}}}
| data27 = {{#if:{{{coordinates|}}}
|Coordinates{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})}}: {{#invoke:ISO 3166|geocoordinsert|nocat=true|1={{{coordinates|}}}|country={{{subdivision_name|}}}|subdivision1={{{subdivision_name1|}}}|subdivision2={{{subdivision_name2|}}}|subdivision3={{{subdivision_name3|}}}|type=city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{replace|{{{population_total}}}|,|}}|R}})}}}} }}{{{coordinates_footnotes|}}} }}
| rowclass28 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label28 = {{if empty|{{{grid_name|}}}|Grid position}}
| data28 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass29 = mergedtoprow
| label29 = {{{subdivision_type}}}
| data29 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass30 = mergedrow
| label30 = {{{subdivision_type1}}}
| data30 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass31 = mergedrow
| label31 = {{{subdivision_type2}}}
| data31 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type3}}}
| data32 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type4}}}
| data33 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type5}}}
| data34 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type6}}}
| data35 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass36 = mergedtoprow
| label36 = {{{established_title}}}
| data36 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass37 = mergedrow
| label37 = {{{established_title1}}}
| data37 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass38 = mergedrow
| label38 = {{{established_title2}}}
| data38 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass39 = mergedrow
| label39 = {{{established_title3}}}
| data39 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title4}}}
| data40 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title5}}}
| data41 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title6}}}
| data42 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title7}}}
| data43 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass44 = mergedrow
| label44 = {{{extinct_title}}}
| data44 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass45 = mergedrow
| label45 = Founded by
| data45 = {{{founder|}}}
| rowclass46 = mergedrow
| label46 = [[Namesake|Named for]]
| data46 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass47 = mergedtoprow
| label47 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Seat}}
| data47 = {{{seat|}}}
| rowclass48 = mergedrow
| label48 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Former seat}}
| data48 = {{{seat1|}}}
| rowclass49 = mergedrow
| label49 = {{#if:{{{seat2_type|}}}|{{{seat2_type}}}|Former seat}}
| data49 = {{{seat2|}}}
| rowclass51 = {{#if:{{{seat|}}}{{{seat1|}}}{{{seat2|}}}|mergedrow|mergedtoprow}}
| label51 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|Boroughs}}
| data51 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass52 = mergedtoprow
| header52 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Government<div class="ib-settlement-fn">{{{government_footnotes|}}}</div>}}
<!-- ***Government*** -->
| rowclass53 = mergedrow
| label53 = • Type
| data53 = {{{government_type|}}}
| rowclass54 = mergedrow
| label54 = • Body
| class54 = agent
| data54 = {{{governing_body|}}}
| rowclass55 = mergedrow
| label55 = • {{{leader_title}}}
| data55 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title1}}}
| data56 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title2}}}
| data57 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass58 = mergedrow
| label58 = • {{{leader_title3}}}
| data58 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass59 = mergedrow
| label59 = • {{{leader_title4}}}
| data59 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
| rowclass60 = mergedrow
| label60 = {{{government_blank1_title}}}
| data60 = {{#if:{{{government_blank1|}}}|{{{government_blank1|}}}}}
| rowclass61 = mergedrow
| label61 = {{{government_blank2_title}}}
| data61 = {{#if:{{{government_blank2|}}}|{{{government_blank2|}}}}}
| rowclass62 = mergedrow
| label62 = {{{government_blank3_title}}}
| data62 = {{#if:{{{government_blank3|}}}|{{{government_blank3|}}}}}
| rowclass63 = mergedrow
| label63 = {{{government_blank4_title}}}
| data63 = {{#if:{{{government_blank4|}}}|{{{government_blank4|}}}}}
| rowclass64 = mergedrow
| label64 = {{{government_blank5_title}}}
| data64 = {{#if:{{{government_blank5|}}}|{{{government_blank5|}}}}}
| rowclass65 = mergedrow
| label65 = {{{government_blank6_title}}}
| data65 = {{#if:{{{government_blank6|}}}|{{{government_blank6|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass66 = mergedtoprow
| header66 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
}}
}}
| rowclass67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
}}
| data67 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass68 = mergedrow
| label68 = • Land
| data68 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass69 = mergedrow
| label69 = • Water
| data69 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}{{#ifeq:%|{{#invoke:string|sub|{{{area_water_percent|}}}|-1}}||%}}}}}}
| rowclass70 = mergedrow
| label70 = • Urban<div class="ib-settlement-fn">{{{area_urban_footnotes|}}}</div>
| data70 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass71 = mergedrow
| label71 = • Rural<div class="ib-settlement-fn">{{{area_rural_footnotes|}}}</div>
| data71 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass72 = mergedrow
| label72 = • Metro<div class="ib-settlement-fn">{{{area_metro_footnotes|}}}</div>
| data72 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass73 = mergedrow
| label73 = • Rank
| data73 = {{{area_rank|}}}
| rowclass74 = mergedrow
| label74 = • {{{area_blank1_title}}}
| data74 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass75 = mergedrow
| label75 = • {{{area_blank2_title}}}
| data75 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass76 = mergedrow
| label76 =
| data76 = {{{area_note|}}}
<!-- ***Dimensions*** -->
| rowclass77 = mergedtoprow
| header77 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<div class="ib-settlement-fn">{{{dimensions_footnotes|}}}</div>}}
| rowclass78 = mergedrow
| label78 = • Length
| data78 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass79 = mergedrow
| label79 = • Width
| data79 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass80 = mergedtoprow
| label80 = {{#if:{{{elevation_link|}}}|[[{{{elevation_link|}}}|Elevation]]|Elevation}}<div class="ib-settlement-fn">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</div>
| data80 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass81 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}|mergedrow|mergedtoprow}}
| label81 = Highest elevation<div class="ib-settlement-fn">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</div>
| data81 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass82 = mergedrow
| label82 = • Rank
| data82 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass83 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label83 = Lowest elevation<div class="ib-settlement-fn">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</div>
| data83 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass84 = mergedrow
| label84 = • Rank
| data84 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass85 = mergedtoprow
| label85 = Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
| data85 = {{fix comma category|{{#if:{{{population|}}}
| {{formatnum:{{replace|{{{population}}}|,|}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{replace|{{{population_total}}}|,|}}}}
}}
}}
}}}}
| rowclass86 = mergedtoprow
| header86 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
}}
}}
}}
| rowclass87 = mergedrow
| label87 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
| data87 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{fix comma category|{{formatnum:{{replace|{{{population_total}}}|,|}}}}}}
}}
}}
}}
| rowclass88 = mergedrow
| label88 = • Estimate <div class="ib-settlement-fn">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</div>
| data88 = {{#if:{{{population_est|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_est}}}|,|}}}}}} }}
<!-- ***Population rank*** -->
| rowclass89 = mergedrow
| label89 = • Rank
| data89 = {{{population_rank|}}}
| rowclass90 = mergedrow
| label90 = • Density
| data90 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass91 = mergedrow
| label91 = • Rank
| data91 = {{{population_density_rank|}}}
| rowclass92 = mergedrow
| label92 = • [[Urban area|Urban]]<div class="ib-settlement-fn">{{{population_urban_footnotes|}}}</div>
| data92 = {{#if:{{{population_urban|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_urban}}}|,|}}}}}} }}
| rowclass93 = mergedrow
| label93 = • Urban density
| data93 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass94 = mergedrow
| label94 = • [[Rural area|Rural]]<div class="ib-settlement-fn">{{{population_rural_footnotes|}}}</div>
| data94 = {{#if:{{{population_rural|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_rural}}}|,|}}}}}}}}
| rowclass95 = mergedrow
| label95 = • Rural density
| data95 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass96 = mergedrow
| label96 = • [[Metropolitan area|Metro]]<div class="ib-settlement-fn">{{{population_metro_footnotes|}}}</div>
| data96 = {{#if:{{{population_metro|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_metro}}}|,|}}}}}} }}
| rowclass97 = mergedrow
| label97 = • Metro density
| data97 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass98 = mergedrow
| label98 = • {{{population_blank1_title|}}}<div class="ib-settlement-fn">{{{population_blank1_footnotes|}}}</div>
| data98 = {{#if:{{{population_blank1|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank1}}}|,|}}}}}}}}
| rowclass99 = mergedrow
| label99 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data99 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass100 = mergedrow
| label100 = • {{{population_blank2_title|}}}<div class="ib-settlement-fn">{{{population_blank2_footnotes|}}}</div>
| data100 = {{#if:{{{population_blank2|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank2}}}|,|}}}}}}}}
| rowclass101 = mergedrow
| label101 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data101 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass102 = mergedrow
| label102 =
| data102 = {{{population_note|}}}
| rowclass103 = mergedtoprow
| label103 = {{Pluralize from text|{{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}{{force plural}}}}|<!--
-->link=Demonym|singular=Demonym|likely=Demonym(s)|plural=Demonyms}}
| data103 = {{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}}}{{Main other|{{Pluralize from text|{{{population_demonym|}}}|likely=[[Category:Pages using infobox settlement with possible demonym list]]}}}}
<!-- ***Demographics 1*** -->
| rowclass104 = mergedtoprow
| header104 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<div class="ib-settlement-fn">{{{demographics1_footnotes|}}}</div>}}
| rowclass105 = mergedrow
| label105 = • {{{demographics1_title1}}}
| data105 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass106 = mergedrow
| label106 = • {{{demographics1_title2}}}
| data106 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass107 = mergedrow
| label107 = • {{{demographics1_title3}}}
| data107 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics1_title4}}}
| data108 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics1_title5}}}
| data109 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics1_title6}}}
| data110 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics1_title7}}}
| data111 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
| rowclass112 = mergedrow
| label112 = • {{{demographics1_title8}}}
| data112 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title8|}}}|{{{demographics1_info8|}}}}}}}
| rowclass113 = mergedrow
| label113 = • {{{demographics1_title9}}}
| data113 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title9|}}}|{{{demographics1_info9|}}}}}}}
| rowclass114 = mergedrow
| label114 = • {{{demographics1_title10}}}
| data114 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title10|}}}|{{{demographics1_info10|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass115 = mergedtoprow
| header115 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<div class="ib-settlement-fn">{{{demographics2_footnotes|}}}</div>}}
| rowclass116 = mergedrow
| label116 = • {{{demographics2_title1}}}
| data116 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass117 = mergedrow
| label117 = • {{{demographics2_title2}}}
| data117 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass118 = mergedrow
| label118 = • {{{demographics2_title3}}}
| data118 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass119 = mergedrow
| label119 = • {{{demographics2_title4}}}
| data119 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass120 = mergedrow
| label120 = • {{{demographics2_title5}}}
| data120 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass121 = mergedrow
| label121 = • {{{demographics2_title6}}}
| data121 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass122 = mergedrow
| label122 = • {{{demographics2_title7}}}
| data122 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
| rowclass123 = mergedrow
| label123 = • {{{demographics2_title8}}}
| data123 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title8|}}}|{{{demographics2_info8|}}}}}}}
| rowclass124 = mergedrow
| label124 = • {{{demographics2_title9}}}
| data124 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title9|}}}|{{{demographics2_info9|}}}}}}}
| rowclass125 = mergedrow
| label125 = • {{{demographics2_title10}}}
| data125 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title10|}}}|{{{demographics2_info10|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass126 = mergedtoprow
| header126 = {{#if:{{{timezone1_location|}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}|}}
| rowclass127 = {{#if:{{{timezone1_location|}}}|mergedrow|mergedtoprow}}
| label127 = {{#if:{{{timezone1_location|}}}|{{{timezone1_location}}}|{{#if:{{{timezone2_location|}}}|{{{timezone2_location}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}}}}}
| data127 = {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}
|[[UTC{{{utc_offset1|{{{utc_offset}}}}}}]] {{#if:{{{timezone1|{{{timezone|}}}}}}|({{{timezone1|{{{timezone}}}}}})}}
|{{{timezone1|{{{timezone|}}}}}}
}}
| rowclass128 = mergedrow
| label128 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data128 = {{#if:{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}
|[[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]] {{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|({{{timezone1_DST|{{{timezone_DST}}}}}})}}
|{{{timezone1_DST|{{{timezone_DST|}}}}}}
}}
| rowclass129 = mergedrow
| label129 = {{#if:{{{timezone2_location|}}}| {{{timezone2_location|}}}|<nowiki />}}
| data129 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}
|[[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]] {{#if:{{{timezone2|}}}|({{{timezone2}}})}}
|{{{timezone2|}}}
}}
}}
| rowclass130 = mergedrow
| label130 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data130 = {{#if:{{{utc_offset2_DST|}}}|[[UTC{{{utc_offset2_DST|}}}]] {{#if:{{{timezone2_DST|}}}|({{{timezone2_DST|}}})}}
|{{{timezone2_DST|}}}
}}
| rowclass131 = mergedrow
| label131 = {{#if:{{{timezone3_location|}}}| {{{timezone3_location|}}}|<nowiki />}}
| data131 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset3|{{{utc_offset3|}}} }}}
|[[UTC{{{utc_offset3|{{{utc_offset3}}}}}}]] {{#if:{{{timezone3|}}}|({{{timezone3}}})}}
|{{{timezone3|}}}
}}
}}
| rowclass132 = mergedrow
| label132 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data132 = {{#if:{{{utc_offset3_DST|}}}|[[UTC{{{utc_offset3_DST|}}}]] {{#if:{{{timezone3_DST|}}}|({{{timezone3_DST|}}})}}
|{{{timezone3_DST|}}}
}}
| rowclass133 = mergedrow
| label133 = {{#if:{{{timezone4_location|}}}| {{{timezone4_location|}}}|<nowiki />}}
| data133 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset4|{{{utc_offset4|}}} }}}
|[[UTC{{{utc_offset4|{{{utc_offset4}}}}}}]] {{#if:{{{timezone4|}}}|({{{timezone4}}})}}
|{{{timezone4|}}}
}}
}}
| rowclass134 = mergedrow
| label134 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data134 = {{#if:{{{utc_offset4_DST|}}}|[[UTC{{{utc_offset4_DST|}}}]] {{#if:{{{timezone4_DST|}}}|({{{timezone4_DST|}}})}}
|{{{timezone4_DST|}}}
}}
| rowclass135 = mergedrow
| label135 = {{#if:{{{timezone5_location|}}}| {{{timezone5_location|}}}|<nowiki />}}
| data135 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset5|{{{utc_offset5|}}} }}}
|[[UTC{{{utc_offset5|{{{utc_offset5}}}}}}]] {{#if:{{{timezone5|}}}|({{{timezone5}}})}}
|{{{timezone5|}}}
}}
}}
| rowclass136 = mergedrow
| label136 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data136 = {{#if:{{{utc_offset5_DST|}}}|[[UTC{{{utc_offset5_DST|}}}]] {{#if:{{{timezone5_DST|}}}|({{{timezone5_DST|}}})}}
|{{{timezone5_DST|}}}
}}
<!-- ***Postal Code(s)*** -->
| rowclass137 = mergedtoprow
| label137 = {{{postal_code_type}}}
| class137 = adr
| data137 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<div class="postal-code">{{{postal_code}}}</div>}}}}
| rowclass138 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}|mergedbottomrow|mergedtoprow}}
| label138 = {{{postal2_code_type}}}
| class138 = adr
| data138 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<div class="postal-code">{{{postal2_code}}}</div>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass139 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}|mergedrow|mergedtoprow}}
| label139 = {{if empty|{{{area_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{if empty|{{{area_code|}}}|{{{area_codes|}}}{{force plural}}}}|<!--
-->link=Telephone numbering plan|singular=Area code|likely=Area code(s)|plural=Area codes}}}}
| data139 = {{if empty|{{{area_code|}}}|{{{area_codes|}}}}}{{#if:{{{area_code_type|}}}||{{Main other|{{Pluralize from text|any_comma=1|parse_links=1|{{{area_code|}}}|||[[Category:Pages using infobox settlement with possible area code list]]}}}}}}
<!-- Geocode-->
| rowclass140 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label140 = [[Geocode]]
| class140 = nickname
| data140 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass141 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label141 = [[ISO 3166|ISO 3166 code]]
| class141 = nickname
| data141 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass142 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label142 = {{#if:{{{registration_plate_type|}}}|{{{registration_plate_type}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data142 = {{{registration_plate|}}}
<!-- Other codes -->
| rowclass143 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label143 = {{{code1_name|}}}
| class143 = nickname
| data143 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass144 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label144 = {{{code2_name|}}}
| class144 = nickname
| data144 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass145 = mergedtoprow
| label145 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data145 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass146 = mergedrow
| label146 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data146 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass147 = mergedrow
| label147 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data147 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass148 = mergedrow
| label148 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data148 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass149 = mergedrow
| label149 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data149 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass150 = mergedrow
| label150 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data150 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass151 = mergedrow
| label151 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data151 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass152 = mergedrow
| label152 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data152 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass153 = mergedtoprow
| label153 = {{{blank_name_sec2}}}
| data153 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass154 = mergedrow
| label154 = {{{blank1_name_sec2}}}
| data154 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass155 = mergedrow
| label155 = {{{blank2_name_sec2}}}
| data155 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass156 = mergedrow
| label156 = {{{blank3_name_sec2}}}
| data156 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass157 = mergedrow
| label157 = {{{blank4_name_sec2}}}
| data157 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass158 = mergedrow
| label158 = {{{blank5_name_sec2}}}
| data158 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass159 = mergedrow
| label159 = {{{blank6_name_sec2}}}
| data159 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass160 = mergedrow
| label160 = {{{blank7_name_sec2}}}
| data160 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass161 = mergedtoprow
| label161 = Website
| data161 = {{#if:{{{website|}}}|{{{website}}}}}
| class162 = maptable
| data162 = {{#if:{{{module|}}}|{{{module}}}}}
<!-- ***Footnotes*** -->
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!-- Check for unknowns
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox settlement with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox settlement]] with unknown parameter "_VALUE_"|ignoreblank=y
| alt | anthem | anthem_link | area_blank1_acre | area_blank1_dunam | area_blank1_ha | area_blank1_km2 | area_blank1_sq_mi | area_blank1_title | area_blank2_acre | area_blank2_dunam | area_blank2_ha | area_blank2_km2 | area_blank2_sq_mi | area_blank2_title | area_code | area_code_type | area_codes | area_footnotes | area_land_acre | area_land_dunam | area_land_ha | area_land_km2 | area_land_sq_mi | area_metro_acre | area_metro_dunam | area_metro_footnotes | area_metro_ha | area_metro_km2 | area_metro_sq_mi | area_note | area_rank | area_rural_acre | area_rural_dunam | area_rural_footnotes | area_rural_ha | area_rural_km2 | area_rural_sq_mi | area_total_acre | area_total_dunam | area_total_ha | area_total_km2 | area_total_sq_mi | area_urban_acre | area_urban_dunam | area_urban_footnotes | area_urban_ha | area_urban_km2 | area_urban_sq_mi | area_water_acre | area_water_dunam | area_water_ha | area_water_km2 | area_water_percent | area_water_sq_mi | blank_emblem_alt | blank_emblem_link | blank_emblem_size | blank_emblem_type | blank_info | blank_info_sec1 | blank_info_sec2 | blank_name | blank_name_sec1 | blank_name_sec2 | blank1_info | blank1_info_sec1 | blank1_info_sec2 | blank1_name | blank1_name_sec1 | blank1_name_sec2 | blank2_info | blank2_info_sec1 | blank2_info_sec2 | blank2_name | blank2_name_sec1 | blank2_name_sec2 | blank3_info | blank3_info_sec1 | blank3_info_sec2 | blank3_name | blank3_name_sec1 | blank3_name_sec2 | blank4_info | blank4_info_sec1 | blank4_info_sec2 | blank4_name | blank4_name_sec1 | blank4_name_sec2 | blank5_info | blank5_info_sec1 | blank5_info_sec2 | blank5_name | blank5_name_sec1 | blank5_name_sec2 | blank6_info | blank6_info_sec1 | blank6_info_sec2 | blank6_name | blank6_name_sec1 | blank6_name_sec2 | blank7_info | blank7_info_sec1 | blank7_info_sec2 | blank7_name | blank7_name_sec1 | blank7_name_sec2 | caption | code1_info | code1_name | code2_info | code2_name | coor_pinpoint | coor_type | coordinates | coordinates_footnotes | demographics_type1 | demographics_type2 | demographics1_footnotes | demographics1_info1 | demographics1_info10 | demographics1_info2 | demographics1_info3 | demographics1_info4 | demographics1_info5 | demographics1_info6 | demographics1_info7 | demographics1_info8 | demographics1_info9 | demographics1_title1 | demographics1_title10 | demographics1_title2 | demographics1_title3 | demographics1_title4 | demographics1_title5 | demographics1_title6 | demographics1_title7 | demographics1_title8 | demographics1_title9 | demographics2_footnotes | demographics2_info1 | demographics2_info10 | demographics2_info2 | demographics2_info3 | demographics2_info4 | demographics2_info5 | demographics2_info6 | demographics2_info7 | demographics2_info8 | demographics2_info9 | demographics2_title1 | demographics2_title10 | demographics2_title2 | demographics2_title3 | demographics2_title4 | demographics2_title5 | demographics2_title6 | demographics2_title7 | demographics2_title8 | demographics2_title9 | dimensions_footnotes | dunam_link | elevation_footnotes | elevation_ft | elevation_link | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_max_rank | elevation_min_footnotes | elevation_min_ft | elevation_min_m | elevation_min_point | elevation_min_rank | elevation_point | embed | established_date | established_date1 | established_date2 | established_date3 | established_date4 | established_date5 | established_date6 | established_date7 | established_title | established_title1 | established_title2 | established_title3 | established_title4 | established_title5 | established_title6 | established_title7 | etymology | extinct_date | extinct_title | flag_alt | flag_border | flag_link | flag_size | footnotes | founder | geocode | governing_body | government_footnotes | government_type | government_blank1_title | government_blank1 | government_blank2_title | government_blank2 | government_blank2_title | government_blank3 | government_blank3_title | government_blank3 | government_blank4_title | government_blank4 | government_blank5_title | government_blank5 | government_blank6_title | government_blank6 | grid_name | grid_position | image_alt | image_blank_emblem | image_caption | image_flag | image_map | image_map1 | image_seal | image_shield | image_size | image_skyline | imagesize | iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | length_km | length_mi | map_alt | map_alt1 | map_caption | map_caption1 | mapsize | mapsize1 | module | motto | motto_link | mottoes | name | named_for | native_name | native_name_lang | nickname | nickname_link | nicknames | official_name | other_name | p1 | p10 | p11 | p12 | p13 | p14 | p15 | p16 | p17 | p18 | p19 | p2 | p20 | p21 | p22 | p23 | p24 | p25 | p26 | p27 | p28 | p29 | p3 | p30 | p31 | p32 | p33 | p34 | p35 | p36 | p37 | p38 | p39 | p4 | p40 | p41 | p42 | p43 | p44 | p45 | p46 | p47 | p48 | p49 | p5 | p50 | p6 | p7 | p8 | p9 | parts | parts_style | parts_type | pop_est_as_of | pop_est_footnotes | population | population_as_of | population_blank1 | population_blank1_footnotes | population_blank1_title | population_blank2 | population_blank2_footnotes | population_blank2_title | population_demonym | population_demonyms | population_density_blank1_km2 | population_density_blank1_sq_mi | population_density_blank2_km2 | population_density_blank2_sq_mi | population_density_km2 | population_density_metro_km2 | population_density_metro_sq_mi | population_density_rank | population_density_rural_km2 | population_density_rural_sq_mi | population_density_sq_mi | population_density_urban_km2 | population_density_urban_sq_mi | population_est | population_footnotes | population_metro | population_metro_footnotes | population_note | population_rank | population_rural | population_rural_footnotes | population_total | population_urban | population_urban_footnotes | postal_code | postal_code_type | postal2_code | postal2_code_type | pushpin_image | pushpin_label | pushpin_label_position | pushpin_map | pushpin_map_alt | pushpin_map_caption | pushpin_map_caption_notsmall | pushpin_map_narrow | pushpin_mapsize | pushpin_outside | pushpin_overlay | pushpin_relief | registration_plate | registration_plate_type | seal_alt | seal_link | seal_size | seal_type | seat | seat_type | seat1 | seat1_type | seat2 | seat2_type | settlement_type | shield_alt | shield_link | shield_size | short_description | subdivision_name | subdivision_name1 | subdivision_name2 | subdivision_name3 | subdivision_name4 | subdivision_name5 | subdivision_name6 | subdivision_type | subdivision_type1 | subdivision_type2 | subdivision_type3 | subdivision_type4 | subdivision_type5 | subdivision_type6 | timezone | timezone_DST | timezone_link | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | timezone3 | timezone3_DST | timezone3_location | timezone4 | timezone4_DST | timezone4_location | timezone5 | timezone5_DST | timezone5_location | total_type | translit_lang1 | translit_lang1_info | translit_lang1_info1 | translit_lang1_info2 | translit_lang1_info3 | translit_lang1_info4 | translit_lang1_info5 | translit_lang1_info6 | translit_lang1_type | translit_lang1_type1 | translit_lang1_type2 | translit_lang1_type3 | translit_lang1_type4 | translit_lang1_type5 | translit_lang1_type6 | translit_lang2 | translit_lang2_info | translit_lang2_info1 | translit_lang2_info2 | translit_lang2_info3 | translit_lang2_info4 | translit_lang2_info5 | translit_lang2_info6 | translit_lang2_type | translit_lang2_type1 | translit_lang2_type2 | translit_lang2_type3 | translit_lang2_type4 | translit_lang2_type5 | translit_lang2_type6 | type | unit_pref | utc_offset | utc_offset_DST | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | utc_offset3 | utc_offset3_DST | utc_offset4 | utc_offset4_DST | utc_offset5 | utc_offset5_DST | website | width_km | width_mi
}}<!--
-->{{#invoke:Check for clobbered parameters|check
| template = Infobox settlement
| cat = {{main other|Category:Pages using infobox settlement with conflicting parameters}}
| population; population_total
| image_size; imagesize
| image_alt; alt
| image_caption; caption
}}
{{#if:{{{embed|}}}|[[Category:Pages using infobox settlement with embed]]}}
}}</includeonly><noinclude>
{{documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
5cf732b6c0a0fcf3e89e81ac2d7e6ff18b970ffe
613
612
2023-10-17T21:42:44Z
LamayII
2
fixed comment error
wikitext
text/x-wiki
<includeonly>{{main other|{{#invoke:Settlement short description|main}}|}}{{Infobox
| child = {{yesno|{{{embed|}}}}}
| templatestyles = Infobox settlement/styles.css
| bodyclass = ib-settlement vcard
<!--** names, type, and transliterations ** -->
| above = <div class="fn org">{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}</div>
{{#if:{{{native_name|}}}|<div class="nickname ib-settlement-native" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</div>}}{{#if:{{{other_name|}}}|<div class="nickname ib-settlement-other-name">{{{other_name}}}</div>}}
| subheader = {{#if:{{{settlement_type|{{{type|}}}}}}|<div class="category">{{{settlement_type|{{{type}}}}}}</div>}}
| rowclass1 = mergedtoprow ib-settlement-official
| data1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
<!-- ***Transliteration language 1*** -->
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|{{{translit_lang1}}} transcription(s)}}
| rowclass3 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
| label3 = • {{{translit_lang1_type}}}
| data3 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}}}
| rowclass4 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
| label4 = • {{{translit_lang1_type1}}}
| data4 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}}}
| rowclass5 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
| label5 = • {{{translit_lang1_type2}}}
| data5 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}}}
| rowclass6 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
| label6 = • {{{translit_lang1_type3}}}
| data6 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}}}
| rowclass7 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
| label7 = • {{{translit_lang1_type4}}}
| data7 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}}}
| rowclass8 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
| label8 = • {{{translit_lang1_type5}}}
| data8 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}}}
| rowclass9 = mergedbottomrow
| label9 = • {{{translit_lang1_type6}}}
| data9 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}}}}}}
<!-- ***Transliteration language 2*** -->
| rowclass10 = mergedtoprow
| header10 = {{#if:{{{translit_lang2|}}}|{{{translit_lang2}}} transcription(s)}}
| rowclass11 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
| label11 = • {{{translit_lang2_type}}}
| data11 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}}}
| rowclass12 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
| label12 = • {{{translit_lang2_type1}}}
| data12 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}}}
| rowclass13 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
| label13 = • {{{translit_lang2_type2}}}
| data13 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}}}
| rowclass14 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
| label14 = • {{{translit_lang2_type3}}}
| data14 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}}}
| rowclass15 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
| label15 = • {{{translit_lang2_type4}}}
| data15 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}}}
| rowclass16 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
| label16 = • {{{translit_lang2_type5}}}
| data16 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}}}
| rowclass17 = mergedbottomrow
| label17 = • {{{translit_lang2_type6}}}
| data17 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}}}}}}
<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| rowclass18 = mergedtoprow
| data18 = {{#if:{{{image_skyline|}}}|<!--
-->{{#invoke:InfoboxImage|InfoboxImage<!--
-->|image={{{image_skyline|}}}<!--
-->|size={{if empty|{{{image_size|}}}|{{{imagesize|}}}}}|sizedefault=250px<!--
-->|alt={{if empty|{{{image_alt|}}}|{{{alt|}}}}}<!--
-->|title={{if empty|{{{image_caption|}}}|{{{caption|}}}|{{{image_alt|}}}|{{{alt|}}}}}}}<!--
-->{{#if:{{{image_caption|}}}{{{caption|}}}|<div class="ib-settlement-caption">{{if empty|{{{image_caption|}}}|{{{caption|}}}}}</div>}} }}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass19 = mergedtoprow
| class19 = maptable
| data19 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|125px|100x100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Flag of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Flag|link={{{flag_link|}}}|name={{{official_name}}}}}</div>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{seal_alt|}}}|title=Official seal of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Seal}}|link={{{seal_link|}}}|name={{{official_name}}}}}</div>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{shield_alt|}}}|title=Coat of arms of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Coat of arms|link={{{shield_link|}}}|name={{{official_name}}}}}</div>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}</div>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100x100px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption-link">{{{map_caption}}}</div>}}}}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{{map_caption}}}}}}}}}
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
}} }}
<!-- ***Etymology*** -->
| rowclass20 = mergedtoprow
| data20 = {{#if:{{{etymology|}}}|Etymology: {{{etymology}}} }}
<!-- ***Nickname*** -->
| rowclass21 = {{#if:{{{etymology|}}}|mergedrow|mergedtoprow}}
| data21 = {{#if:{{{nickname|}}}{{{nicknames|}}}|<!--
-->{{Pluralize from text|parse_links=1|{{if empty|{{{nickname|}}}|{{{nicknames|}}}{{force plural}}}}|<!--
-->link={{{nickname_link|}}}|singular=Nickname|likely=Nickname(s)|plural=Nicknames}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{nickname|}}}|{{{nicknames|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|parse_links=1|{{{nickname|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible nickname list]]}}}}}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}{{{mottoes|}}}|<!--
-->{{Pluralize from text|{{if empty|{{{motto|}}}|{{{mottoes|}}}{{force plural}}}}|<!--
-->link={{{motto_link|}}}|singular=Motto|likely=Motto(s)|plural=Mottoes}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{motto|}}}|{{{mottoes|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|{{{motto|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible motto list]]}}}}}}
<!-- ***Anthem*** -->
| rowclass23 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}{{{motto|}}}{{{mottoes|}}}|mergedrow|mergedtoprow}}
| data23 = {{#if:{{{anthem|}}}|{{#if:{{{anthem_link|}}}|[[{{{anthem_link|}}}|Anthem:]]|Anthem:}} {{{anthem}}}}}
<!-- ***Map*** -->
| rowclass24 = mergedtoprow
| data24 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption">{{{map_caption}}}</div>}}
}}}}
| rowclass25 = mergedrow
| data25 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<div class="ib-settlement-caption">{{{map_caption1}}}</div>}} }}
<!-- ***Pushpin Map*** -->
| rowclass26 = mergedtoprow
| data26 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{#if:{{{image_map|}}}||{{{map_caption}}}}}}}}}}}
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| rowclass27 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|{{#if:{{{grid_position|}}}|mergedrow|mergedbottomrow}}}}
| data27 = {{#if:{{{coordinates|}}}
|Coordinates{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})}}: {{#invoke:ISO 3166|geocoordinsert|nocat=true|1={{{coordinates|}}}|country={{{subdivision_name|}}}|subdivision1={{{subdivision_name1|}}}|subdivision2={{{subdivision_name2|}}}|subdivision3={{{subdivision_name3|}}}|type=city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{replace|{{{population_total}}}|,|}}|R}})}}}} }}{{{coordinates_footnotes|}}} }}
| rowclass28 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label28 = {{if empty|{{{grid_name|}}}|Grid position}}
| data28 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass29 = mergedtoprow
| label29 = {{{subdivision_type}}}
| data29 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass30 = mergedrow
| label30 = {{{subdivision_type1}}}
| data30 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass31 = mergedrow
| label31 = {{{subdivision_type2}}}
| data31 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type3}}}
| data32 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type4}}}
| data33 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type5}}}
| data34 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type6}}}
| data35 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass36 = mergedtoprow
| label36 = {{{established_title}}}
| data36 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass37 = mergedrow
| label37 = {{{established_title1}}}
| data37 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass38 = mergedrow
| label38 = {{{established_title2}}}
| data38 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass39 = mergedrow
| label39 = {{{established_title3}}}
| data39 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title4}}}
| data40 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title5}}}
| data41 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title6}}}
| data42 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title7}}}
| data43 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass44 = mergedrow
| label44 = {{{extinct_title}}}
| data44 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass45 = mergedrow
| label45 = Founded by
| data45 = {{{founder|}}}
| rowclass46 = mergedrow
| label46 = [[Namesake|Named for]]
| data46 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass47 = mergedtoprow
| label47 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Seat}}
| data47 = {{{seat|}}}
| rowclass48 = mergedrow
| label48 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Former seat}}
| data48 = {{{seat1|}}}
| rowclass49 = mergedrow
| label49 = {{#if:{{{seat2_type|}}}|{{{seat2_type}}}|Former seat}}
| data49 = {{{seat2|}}}
| rowclass51 = {{#if:{{{seat|}}}{{{seat1|}}}{{{seat2|}}}|mergedrow|mergedtoprow}}
| label51 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|Boroughs}}
| data51 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass52 = mergedtoprow
| header52 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Government<div class="ib-settlement-fn">{{{government_footnotes|}}}</div>}}
<!-- ***Government*** -->
| rowclass53 = mergedrow
| label53 = • Type
| data53 = {{{government_type|}}}
| rowclass54 = mergedrow
| label54 = • Body
| class54 = agent
| data54 = {{{governing_body|}}}
| rowclass55 = mergedrow
| label55 = • {{{leader_title}}}
| data55 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title1}}}
| data56 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title2}}}
| data57 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass58 = mergedrow
| label58 = • {{{leader_title3}}}
| data58 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass59 = mergedrow
| label59 = • {{{leader_title4}}}
| data59 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
| rowclass60 = mergedrow
| label60 = {{{government_blank1_title}}}
| data60 = {{#if:{{{government_blank1|}}}|{{{government_blank1|}}}}}
| rowclass61 = mergedrow
| label61 = {{{government_blank2_title}}}
| data61 = {{#if:{{{government_blank2|}}}|{{{government_blank2|}}}}}
| rowclass62 = mergedrow
| label62 = {{{government_blank3_title}}}
| data62 = {{#if:{{{government_blank3|}}}|{{{government_blank3|}}}}}
| rowclass63 = mergedrow
| label63 = {{{government_blank4_title}}}
| data63 = {{#if:{{{government_blank4|}}}|{{{government_blank4|}}}}}
| rowclass64 = mergedrow
| label64 = {{{government_blank5_title}}}
| data64 = {{#if:{{{government_blank5|}}}|{{{government_blank5|}}}}}
| rowclass65 = mergedrow
| label65 = {{{government_blank6_title}}}
| data65 = {{#if:{{{government_blank6|}}}|{{{government_blank6|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass66 = mergedtoprow
| header66 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
}}
}}
| rowclass67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
}}
| data67 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass68 = mergedrow
| label68 = • Land
| data68 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass69 = mergedrow
| label69 = • Water
| data69 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}{{#ifeq:%|{{#invoke:string|sub|{{{area_water_percent|}}}|-1}}||%}}}}}}
| rowclass70 = mergedrow
| label70 = • Urban<div class="ib-settlement-fn">{{{area_urban_footnotes|}}}</div>
| data70 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass71 = mergedrow
| label71 = • Rural<div class="ib-settlement-fn">{{{area_rural_footnotes|}}}</div>
| data71 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass72 = mergedrow
| label72 = • Metro<div class="ib-settlement-fn">{{{area_metro_footnotes|}}}</div>
| data72 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass73 = mergedrow
| label73 = • Rank
| data73 = {{{area_rank|}}}
| rowclass74 = mergedrow
| label74 = • {{{area_blank1_title}}}
| data74 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass75 = mergedrow
| label75 = • {{{area_blank2_title}}}
| data75 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass76 = mergedrow
| label76 =
| data76 = {{{area_note|}}}
<!-- ***Dimensions*** -->
| rowclass77 = mergedtoprow
| header77 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<div class="ib-settlement-fn">{{{dimensions_footnotes|}}}</div>}}
| rowclass78 = mergedrow
| label78 = • Length
| data78 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass79 = mergedrow
| label79 = • Width
| data79 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass80 = mergedtoprow
| label80 = {{#if:{{{elevation_link|}}}|[[{{{elevation_link|}}}|Elevation]]|Elevation}}<div class="ib-settlement-fn">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</div>
| data80 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass81 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}|mergedrow|mergedtoprow}}
| label81 = Highest elevation<div class="ib-settlement-fn">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</div>
| data81 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass82 = mergedrow
| label82 = • Rank
| data82 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass83 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label83 = Lowest elevation<div class="ib-settlement-fn">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</div>
| data83 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass84 = mergedrow
| label84 = • Rank
| data84 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass85 = mergedtoprow
| label85 = Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
| data85 = {{fix comma category|{{#if:{{{population|}}}
| {{formatnum:{{replace|{{{population}}}|,|}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{replace|{{{population_total}}}|,|}}}}
}}
}}
}}}}
| rowclass86 = mergedtoprow
| header86 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
}}
}}
}}
| rowclass87 = mergedrow
| label87 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
| data87 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{fix comma category|{{formatnum:{{replace|{{{population_total}}}|,|}}}}}}
}}
}}
}}
| rowclass88 = mergedrow
| label88 = • Estimate <div class="ib-settlement-fn">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</div>
| data88 = {{#if:{{{population_est|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_est}}}|,|}}}}}} }}
<!-- ***Population rank*** -->
| rowclass89 = mergedrow
| label89 = • Rank
| data89 = {{{population_rank|}}}
| rowclass90 = mergedrow
| label90 = • Density
| data90 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass91 = mergedrow
| label91 = • Rank
| data91 = {{{population_density_rank|}}}
| rowclass92 = mergedrow
| label92 = • [[Urban area|Urban]]<div class="ib-settlement-fn">{{{population_urban_footnotes|}}}</div>
| data92 = {{#if:{{{population_urban|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_urban}}}|,|}}}}}} }}
| rowclass93 = mergedrow
| label93 = • Urban density
| data93 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass94 = mergedrow
| label94 = • [[Rural area|Rural]]<div class="ib-settlement-fn">{{{population_rural_footnotes|}}}</div>
| data94 = {{#if:{{{population_rural|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_rural}}}|,|}}}}}}}}
| rowclass95 = mergedrow
| label95 = • Rural density
| data95 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass96 = mergedrow
| label96 = • [[Metropolitan area|Metro]]<div class="ib-settlement-fn">{{{population_metro_footnotes|}}}</div>
| data96 = {{#if:{{{population_metro|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_metro}}}|,|}}}}}} }}
| rowclass97 = mergedrow
| label97 = • Metro density
| data97 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass98 = mergedrow
| label98 = • {{{population_blank1_title|}}}<div class="ib-settlement-fn">{{{population_blank1_footnotes|}}}</div>
| data98 = {{#if:{{{population_blank1|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank1}}}|,|}}}}}}}}
| rowclass99 = mergedrow
| label99 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data99 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass100 = mergedrow
| label100 = • {{{population_blank2_title|}}}<div class="ib-settlement-fn">{{{population_blank2_footnotes|}}}</div>
| data100 = {{#if:{{{population_blank2|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank2}}}|,|}}}}}}}}
| rowclass101 = mergedrow
| label101 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data101 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass102 = mergedrow
| label102 =
| data102 = {{{population_note|}}}
| rowclass103 = mergedtoprow
| label103 = {{Pluralize from text|{{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}{{force plural}}}}|<!--
-->link=Demonym|singular=Demonym|likely=Demonym(s)|plural=Demonyms}}
| data103 = {{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}}}{{Main other|{{Pluralize from text|{{{population_demonym|}}}|likely=[[Category:Pages using infobox settlement with possible demonym list]]}}}}
<!-- ***Demographics 1*** -->
| rowclass104 = mergedtoprow
| header104 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<div class="ib-settlement-fn">{{{demographics1_footnotes|}}}</div>}}
| rowclass105 = mergedrow
| label105 = • {{{demographics1_title1}}}
| data105 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass106 = mergedrow
| label106 = • {{{demographics1_title2}}}
| data106 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass107 = mergedrow
| label107 = • {{{demographics1_title3}}}
| data107 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics1_title4}}}
| data108 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics1_title5}}}
| data109 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics1_title6}}}
| data110 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics1_title7}}}
| data111 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
| rowclass112 = mergedrow
| label112 = • {{{demographics1_title8}}}
| data112 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title8|}}}|{{{demographics1_info8|}}}}}}}
| rowclass113 = mergedrow
| label113 = • {{{demographics1_title9}}}
| data113 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title9|}}}|{{{demographics1_info9|}}}}}}}
| rowclass114 = mergedrow
| label114 = • {{{demographics1_title10}}}
| data114 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title10|}}}|{{{demographics1_info10|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass115 = mergedtoprow
| header115 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<div class="ib-settlement-fn">{{{demographics2_footnotes|}}}</div>}}
| rowclass116 = mergedrow
| label116 = • {{{demographics2_title1}}}
| data116 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass117 = mergedrow
| label117 = • {{{demographics2_title2}}}
| data117 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass118 = mergedrow
| label118 = • {{{demographics2_title3}}}
| data118 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass119 = mergedrow
| label119 = • {{{demographics2_title4}}}
| data119 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass120 = mergedrow
| label120 = • {{{demographics2_title5}}}
| data120 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass121 = mergedrow
| label121 = • {{{demographics2_title6}}}
| data121 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass122 = mergedrow
| label122 = • {{{demographics2_title7}}}
| data122 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
| rowclass123 = mergedrow
| label123 = • {{{demographics2_title8}}}
| data123 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title8|}}}|{{{demographics2_info8|}}}}}}}
| rowclass124 = mergedrow
| label124 = • {{{demographics2_title9}}}
| data124 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title9|}}}|{{{demographics2_info9|}}}}}}}
| rowclass125 = mergedrow
| label125 = • {{{demographics2_title10}}}
| data125 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title10|}}}|{{{demographics2_info10|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass126 = mergedtoprow
| header126 = {{#if:{{{timezone1_location|}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}|}}
| rowclass127 = {{#if:{{{timezone1_location|}}}|mergedrow|mergedtoprow}}
| label127 = {{#if:{{{timezone1_location|}}}|{{{timezone1_location}}}|{{#if:{{{timezone2_location|}}}|{{{timezone2_location}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}}}}}
| data127 = {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}
|[[UTC{{{utc_offset1|{{{utc_offset}}}}}}]] {{#if:{{{timezone1|{{{timezone|}}}}}}|({{{timezone1|{{{timezone}}}}}})}}
|{{{timezone1|{{{timezone|}}}}}}
}}
| rowclass128 = mergedrow
| label128 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data128 = {{#if:{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}
|[[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]] {{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|({{{timezone1_DST|{{{timezone_DST}}}}}})}}
|{{{timezone1_DST|{{{timezone_DST|}}}}}}
}}
| rowclass129 = mergedrow
| label129 = {{#if:{{{timezone2_location|}}}| {{{timezone2_location|}}}|<nowiki />}}
| data129 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}
|[[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]] {{#if:{{{timezone2|}}}|({{{timezone2}}})}}
|{{{timezone2|}}}
}}
}}
| rowclass130 = mergedrow
| label130 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data130 = {{#if:{{{utc_offset2_DST|}}}|[[UTC{{{utc_offset2_DST|}}}]] {{#if:{{{timezone2_DST|}}}|({{{timezone2_DST|}}})}}
|{{{timezone2_DST|}}}
}}
| rowclass131 = mergedrow
| label131 = {{#if:{{{timezone3_location|}}}| {{{timezone3_location|}}}|<nowiki />}}
| data131 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset3|{{{utc_offset3|}}} }}}
|[[UTC{{{utc_offset3|{{{utc_offset3}}}}}}]] {{#if:{{{timezone3|}}}|({{{timezone3}}})}}
|{{{timezone3|}}}
}}
}}
| rowclass132 = mergedrow
| label132 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data132 = {{#if:{{{utc_offset3_DST|}}}|[[UTC{{{utc_offset3_DST|}}}]] {{#if:{{{timezone3_DST|}}}|({{{timezone3_DST|}}})}}
|{{{timezone3_DST|}}}
}}
| rowclass133 = mergedrow
| label133 = {{#if:{{{timezone4_location|}}}| {{{timezone4_location|}}}|<nowiki />}}
| data133 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset4|{{{utc_offset4|}}} }}}
|[[UTC{{{utc_offset4|{{{utc_offset4}}}}}}]] {{#if:{{{timezone4|}}}|({{{timezone4}}})}}
|{{{timezone4|}}}
}}
}}
| rowclass134 = mergedrow
| label134 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data134 = {{#if:{{{utc_offset4_DST|}}}|[[UTC{{{utc_offset4_DST|}}}]] {{#if:{{{timezone4_DST|}}}|({{{timezone4_DST|}}})}}
|{{{timezone4_DST|}}}
}}
| rowclass135 = mergedrow
| label135 = {{#if:{{{timezone5_location|}}}| {{{timezone5_location|}}}|<nowiki />}}
| data135 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset5|{{{utc_offset5|}}} }}}
|[[UTC{{{utc_offset5|{{{utc_offset5}}}}}}]] {{#if:{{{timezone5|}}}|({{{timezone5}}})}}
|{{{timezone5|}}}
}}
}}
| rowclass136 = mergedrow
| label136 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data136 = {{#if:{{{utc_offset5_DST|}}}|[[UTC{{{utc_offset5_DST|}}}]] {{#if:{{{timezone5_DST|}}}|({{{timezone5_DST|}}})}}
|{{{timezone5_DST|}}}
}}
<!-- ***Postal Code(s)*** -->
| rowclass137 = mergedtoprow
| label137 = {{{postal_code_type}}}
| class137 = adr
| data137 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<div class="postal-code">{{{postal_code}}}</div>}}}}
| rowclass138 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}|mergedbottomrow|mergedtoprow}}
| label138 = {{{postal2_code_type}}}
| class138 = adr
| data138 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<div class="postal-code">{{{postal2_code}}}</div>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass139 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}|mergedrow|mergedtoprow}}
| label139 = {{if empty|{{{area_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{if empty|{{{area_code|}}}|{{{area_codes|}}}{{force plural}}}}|<!--
-->link=Telephone numbering plan|singular=Area code|likely=Area code(s)|plural=Area codes}}}}
| data139 = {{if empty|{{{area_code|}}}|{{{area_codes|}}}}}{{#if:{{{area_code_type|}}}||{{Main other|{{Pluralize from text|any_comma=1|parse_links=1|{{{area_code|}}}|||[[Category:Pages using infobox settlement with possible area code list]]}}}}}}
<!-- Geocode-->
| rowclass140 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label140 = [[Geocode]]
| class140 = nickname
| data140 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass141 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label141 = [[ISO 3166|ISO 3166 code]]
| class141 = nickname
| data141 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass142 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label142 = {{#if:{{{registration_plate_type|}}}|{{{registration_plate_type}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data142 = {{{registration_plate|}}}
<!-- Other codes -->
| rowclass143 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label143 = {{{code1_name|}}}
| class143 = nickname
| data143 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass144 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label144 = {{{code2_name|}}}
| class144 = nickname
| data144 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass145 = mergedtoprow
| label145 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data145 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass146 = mergedrow
| label146 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data146 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass147 = mergedrow
| label147 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data147 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass148 = mergedrow
| label148 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data148 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass149 = mergedrow
| label149 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data149 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass150 = mergedrow
| label150 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data150 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass151 = mergedrow
| label151 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data151 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass152 = mergedrow
| label152 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data152 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass153 = mergedtoprow
| label153 = {{{blank_name_sec2}}}
| data153 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass154 = mergedrow
| label154 = {{{blank1_name_sec2}}}
| data154 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass155 = mergedrow
| label155 = {{{blank2_name_sec2}}}
| data155 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass156 = mergedrow
| label156 = {{{blank3_name_sec2}}}
| data156 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass157 = mergedrow
| label157 = {{{blank4_name_sec2}}}
| data157 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass158 = mergedrow
| label158 = {{{blank5_name_sec2}}}
| data158 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass159 = mergedrow
| label159 = {{{blank6_name_sec2}}}
| data159 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass160 = mergedrow
| label160 = {{{blank7_name_sec2}}}
| data160 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass161 = mergedtoprow
| label161 = Website
| data161 = {{#if:{{{website|}}}|{{{website}}}}}
| class162 = maptable
| data162 = {{#if:{{{module|}}}|{{{module}}}}}
<!-- ***Footnotes*** -->
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!-- Check for unknowns
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox settlement with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox settlement]] with unknown parameter "_VALUE_"|ignoreblank=y
| alt | anthem | anthem_link | area_blank1_acre | area_blank1_dunam | area_blank1_ha | area_blank1_km2 | area_blank1_sq_mi | area_blank1_title | area_blank2_acre | area_blank2_dunam | area_blank2_ha | area_blank2_km2 | area_blank2_sq_mi | area_blank2_title | area_code | area_code_type | area_codes | area_footnotes | area_land_acre | area_land_dunam | area_land_ha | area_land_km2 | area_land_sq_mi | area_metro_acre | area_metro_dunam | area_metro_footnotes | area_metro_ha | area_metro_km2 | area_metro_sq_mi | area_note | area_rank | area_rural_acre | area_rural_dunam | area_rural_footnotes | area_rural_ha | area_rural_km2 | area_rural_sq_mi | area_total_acre | area_total_dunam | area_total_ha | area_total_km2 | area_total_sq_mi | area_urban_acre | area_urban_dunam | area_urban_footnotes | area_urban_ha | area_urban_km2 | area_urban_sq_mi | area_water_acre | area_water_dunam | area_water_ha | area_water_km2 | area_water_percent | area_water_sq_mi | blank_emblem_alt | blank_emblem_link | blank_emblem_size | blank_emblem_type | blank_info | blank_info_sec1 | blank_info_sec2 | blank_name | blank_name_sec1 | blank_name_sec2 | blank1_info | blank1_info_sec1 | blank1_info_sec2 | blank1_name | blank1_name_sec1 | blank1_name_sec2 | blank2_info | blank2_info_sec1 | blank2_info_sec2 | blank2_name | blank2_name_sec1 | blank2_name_sec2 | blank3_info | blank3_info_sec1 | blank3_info_sec2 | blank3_name | blank3_name_sec1 | blank3_name_sec2 | blank4_info | blank4_info_sec1 | blank4_info_sec2 | blank4_name | blank4_name_sec1 | blank4_name_sec2 | blank5_info | blank5_info_sec1 | blank5_info_sec2 | blank5_name | blank5_name_sec1 | blank5_name_sec2 | blank6_info | blank6_info_sec1 | blank6_info_sec2 | blank6_name | blank6_name_sec1 | blank6_name_sec2 | blank7_info | blank7_info_sec1 | blank7_info_sec2 | blank7_name | blank7_name_sec1 | blank7_name_sec2 | caption | code1_info | code1_name | code2_info | code2_name | coor_pinpoint | coor_type | coordinates | coordinates_footnotes | demographics_type1 | demographics_type2 | demographics1_footnotes | demographics1_info1 | demographics1_info10 | demographics1_info2 | demographics1_info3 | demographics1_info4 | demographics1_info5 | demographics1_info6 | demographics1_info7 | demographics1_info8 | demographics1_info9 | demographics1_title1 | demographics1_title10 | demographics1_title2 | demographics1_title3 | demographics1_title4 | demographics1_title5 | demographics1_title6 | demographics1_title7 | demographics1_title8 | demographics1_title9 | demographics2_footnotes | demographics2_info1 | demographics2_info10 | demographics2_info2 | demographics2_info3 | demographics2_info4 | demographics2_info5 | demographics2_info6 | demographics2_info7 | demographics2_info8 | demographics2_info9 | demographics2_title1 | demographics2_title10 | demographics2_title2 | demographics2_title3 | demographics2_title4 | demographics2_title5 | demographics2_title6 | demographics2_title7 | demographics2_title8 | demographics2_title9 | dimensions_footnotes | dunam_link | elevation_footnotes | elevation_ft | elevation_link | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_max_rank | elevation_min_footnotes | elevation_min_ft | elevation_min_m | elevation_min_point | elevation_min_rank | elevation_point | embed | established_date | established_date1 | established_date2 | established_date3 | established_date4 | established_date5 | established_date6 | established_date7 | established_title | established_title1 | established_title2 | established_title3 | established_title4 | established_title5 | established_title6 | established_title7 | etymology | extinct_date | extinct_title | flag_alt | flag_border | flag_link | flag_size | footnotes | founder | geocode | governing_body | government_footnotes | government_type | government_blank1_title | government_blank1 | government_blank2_title | government_blank2 | government_blank2_title | government_blank3 | government_blank3_title | government_blank3 | government_blank4_title | government_blank4 | government_blank5_title | government_blank5 | government_blank6_title | government_blank6 | grid_name | grid_position | image_alt | image_blank_emblem | image_caption | image_flag | image_map | image_map1 | image_seal | image_shield | image_size | image_skyline | imagesize | iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | length_km | length_mi | map_alt | map_alt1 | map_caption | map_caption1 | mapsize | mapsize1 | module | motto | motto_link | mottoes | name | named_for | native_name | native_name_lang | nickname | nickname_link | nicknames | official_name | other_name | p1 | p10 | p11 | p12 | p13 | p14 | p15 | p16 | p17 | p18 | p19 | p2 | p20 | p21 | p22 | p23 | p24 | p25 | p26 | p27 | p28 | p29 | p3 | p30 | p31 | p32 | p33 | p34 | p35 | p36 | p37 | p38 | p39 | p4 | p40 | p41 | p42 | p43 | p44 | p45 | p46 | p47 | p48 | p49 | p5 | p50 | p6 | p7 | p8 | p9 | parts | parts_style | parts_type | pop_est_as_of | pop_est_footnotes | population | population_as_of | population_blank1 | population_blank1_footnotes | population_blank1_title | population_blank2 | population_blank2_footnotes | population_blank2_title | population_demonym | population_demonyms | population_density_blank1_km2 | population_density_blank1_sq_mi | population_density_blank2_km2 | population_density_blank2_sq_mi | population_density_km2 | population_density_metro_km2 | population_density_metro_sq_mi | population_density_rank | population_density_rural_km2 | population_density_rural_sq_mi | population_density_sq_mi | population_density_urban_km2 | population_density_urban_sq_mi | population_est | population_footnotes | population_metro | population_metro_footnotes | population_note | population_rank | population_rural | population_rural_footnotes | population_total | population_urban | population_urban_footnotes | postal_code | postal_code_type | postal2_code | postal2_code_type | pushpin_image | pushpin_label | pushpin_label_position | pushpin_map | pushpin_map_alt | pushpin_map_caption | pushpin_map_caption_notsmall | pushpin_map_narrow | pushpin_mapsize | pushpin_outside | pushpin_overlay | pushpin_relief | registration_plate | registration_plate_type | seal_alt | seal_link | seal_size | seal_type | seat | seat_type | seat1 | seat1_type | seat2 | seat2_type | settlement_type | shield_alt | shield_link | shield_size | short_description | subdivision_name | subdivision_name1 | subdivision_name2 | subdivision_name3 | subdivision_name4 | subdivision_name5 | subdivision_name6 | subdivision_type | subdivision_type1 | subdivision_type2 | subdivision_type3 | subdivision_type4 | subdivision_type5 | subdivision_type6 | timezone | timezone_DST | timezone_link | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | timezone3 | timezone3_DST | timezone3_location | timezone4 | timezone4_DST | timezone4_location | timezone5 | timezone5_DST | timezone5_location | total_type | translit_lang1 | translit_lang1_info | translit_lang1_info1 | translit_lang1_info2 | translit_lang1_info3 | translit_lang1_info4 | translit_lang1_info5 | translit_lang1_info6 | translit_lang1_type | translit_lang1_type1 | translit_lang1_type2 | translit_lang1_type3 | translit_lang1_type4 | translit_lang1_type5 | translit_lang1_type6 | translit_lang2 | translit_lang2_info | translit_lang2_info1 | translit_lang2_info2 | translit_lang2_info3 | translit_lang2_info4 | translit_lang2_info5 | translit_lang2_info6 | translit_lang2_type | translit_lang2_type1 | translit_lang2_type2 | translit_lang2_type3 | translit_lang2_type4 | translit_lang2_type5 | translit_lang2_type6 | type | unit_pref | utc_offset | utc_offset_DST | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | utc_offset3 | utc_offset3_DST | utc_offset4 | utc_offset4_DST | utc_offset5 | utc_offset5_DST | website | width_km | width_mi
}}<!--
-->{{#invoke:Check for clobbered parameters|check
| template = Infobox settlement
| cat = {{main other|Category:Pages using infobox settlement with conflicting parameters}}
| population; population_total
| image_size; imagesize
| image_alt; alt
| image_caption; caption
}}
{{#if:{{{embed|}}}|[[Category:Pages using infobox settlement with embed]]}}</includeonly>
<noinclude>
{{documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
ae4ca703c2f6cc6f64ead49793169b9ad95a3843
614
613
2023-10-17T21:44:41Z
LamayII
2
line break
wikitext
text/x-wiki
<includeonly>{{main other|{{#invoke:Settlement short description|main}}|}}{{Infobox
| child = {{yesno|{{{embed|}}}}}
| templatestyles = Infobox settlement/styles.css
| bodyclass = ib-settlement vcard
<!--** names, type, and transliterations ** -->
| above = <div class="fn org">{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}</div>
{{#if:{{{native_name|}}}|<div class="nickname ib-settlement-native" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</div>}}{{#if:{{{other_name|}}}|<div class="nickname ib-settlement-other-name">{{{other_name}}}</div>}}
| subheader = {{#if:{{{settlement_type|{{{type|}}}}}}|<div class="category">{{{settlement_type|{{{type}}}}}}</div>}}
| rowclass1 = mergedtoprow ib-settlement-official
| data1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
<!-- ***Transliteration language 1*** -->
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|{{{translit_lang1}}} transcription(s)}}
| rowclass3 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
| label3 = • {{{translit_lang1_type}}}
| data3 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}}}
| rowclass4 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
| label4 = • {{{translit_lang1_type1}}}
| data4 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}}}
| rowclass5 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
| label5 = • {{{translit_lang1_type2}}}
| data5 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}}}
| rowclass6 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
| label6 = • {{{translit_lang1_type3}}}
| data6 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}}}
| rowclass7 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
| label7 = • {{{translit_lang1_type4}}}
| data7 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}}}
| rowclass8 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
| label8 = • {{{translit_lang1_type5}}}
| data8 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}}}
| rowclass9 = mergedbottomrow
| label9 = • {{{translit_lang1_type6}}}
| data9 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}}}}}}
<!-- ***Transliteration language 2*** -->
| rowclass10 = mergedtoprow
| header10 = {{#if:{{{translit_lang2|}}}|{{{translit_lang2}}} transcription(s)}}
| rowclass11 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
| label11 = • {{{translit_lang2_type}}}
| data11 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}}}
| rowclass12 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
| label12 = • {{{translit_lang2_type1}}}
| data12 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}}}
| rowclass13 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
| label13 = • {{{translit_lang2_type2}}}
| data13 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}}}
| rowclass14 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
| label14 = • {{{translit_lang2_type3}}}
| data14 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}}}
| rowclass15 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
| label15 = • {{{translit_lang2_type4}}}
| data15 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}}}
| rowclass16 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
| label16 = • {{{translit_lang2_type5}}}
| data16 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}}}
| rowclass17 = mergedbottomrow
| label17 = • {{{translit_lang2_type6}}}
| data17 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}}}}}}
<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| rowclass18 = mergedtoprow
| data18 = {{#if:{{{image_skyline|}}}|<!--
-->{{#invoke:InfoboxImage|InfoboxImage<!--
-->|image={{{image_skyline|}}}<!--
-->|size={{if empty|{{{image_size|}}}|{{{imagesize|}}}}}|sizedefault=250px<!--
-->|alt={{if empty|{{{image_alt|}}}|{{{alt|}}}}}<!--
-->|title={{if empty|{{{image_caption|}}}|{{{caption|}}}|{{{image_alt|}}}|{{{alt|}}}}}}}<!--
-->{{#if:{{{image_caption|}}}{{{caption|}}}|<div class="ib-settlement-caption">{{if empty|{{{image_caption|}}}|{{{caption|}}}}}</div>}} }}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass19 = mergedtoprow
| class19 = maptable
| data19 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|125px|100x100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Flag of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Flag|link={{{flag_link|}}}|name={{{official_name}}}}}</div>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{seal_alt|}}}|title=Official seal of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Seal}}|link={{{seal_link|}}}|name={{{official_name}}}}}</div>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{shield_alt|}}}|title=Coat of arms of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Coat of arms|link={{{shield_link|}}}|name={{{official_name}}}}}</div>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}</div>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100x100px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption-link">{{{map_caption}}}</div>}}}}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{{map_caption}}}}}}}}}
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
}} }}
<!-- ***Etymology*** -->
| rowclass20 = mergedtoprow
| data20 = {{#if:{{{etymology|}}}|Etymology: {{{etymology}}} }}
<!-- ***Nickname*** -->
| rowclass21 = {{#if:{{{etymology|}}}|mergedrow|mergedtoprow}}
| data21 = {{#if:{{{nickname|}}}{{{nicknames|}}}|<!--
-->{{Pluralize from text|parse_links=1|{{if empty|{{{nickname|}}}|{{{nicknames|}}}{{force plural}}}}|<!--
-->link={{{nickname_link|}}}|singular=Nickname|likely=Nickname(s)|plural=Nicknames}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{nickname|}}}|{{{nicknames|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|parse_links=1|{{{nickname|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible nickname list]]}}}}}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}{{{mottoes|}}}|<!--
-->{{Pluralize from text|{{if empty|{{{motto|}}}|{{{mottoes|}}}{{force plural}}}}|<!--
-->link={{{motto_link|}}}|singular=Motto|likely=Motto(s)|plural=Mottoes}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{motto|}}}|{{{mottoes|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|{{{motto|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible motto list]]}}}}}}
<!-- ***Anthem*** -->
| rowclass23 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}{{{motto|}}}{{{mottoes|}}}|mergedrow|mergedtoprow}}
| data23 = {{#if:{{{anthem|}}}|{{#if:{{{anthem_link|}}}|[[{{{anthem_link|}}}|Anthem:]]|Anthem:}} {{{anthem}}}}}
<!-- ***Map*** -->
| rowclass24 = mergedtoprow
| data24 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption">{{{map_caption}}}</div>}}
}}}}
| rowclass25 = mergedrow
| data25 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<div class="ib-settlement-caption">{{{map_caption1}}}</div>}} }}
<!-- ***Pushpin Map*** -->
| rowclass26 = mergedtoprow
| data26 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{#if:{{{image_map|}}}||{{{map_caption}}}}}}}}}}}
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| rowclass27 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|{{#if:{{{grid_position|}}}|mergedrow|mergedbottomrow}}}}
| data27 = {{#if:{{{coordinates|}}}
|Coordinates{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})}}: {{#invoke:ISO 3166|geocoordinsert|nocat=true|1={{{coordinates|}}}|country={{{subdivision_name|}}}|subdivision1={{{subdivision_name1|}}}|subdivision2={{{subdivision_name2|}}}|subdivision3={{{subdivision_name3|}}}|type=city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{replace|{{{population_total}}}|,|}}|R}})}}}} }}{{{coordinates_footnotes|}}} }}
| rowclass28 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label28 = {{if empty|{{{grid_name|}}}|Grid position}}
| data28 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass29 = mergedtoprow
| label29 = {{{subdivision_type}}}
| data29 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass30 = mergedrow
| label30 = {{{subdivision_type1}}}
| data30 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass31 = mergedrow
| label31 = {{{subdivision_type2}}}
| data31 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type3}}}
| data32 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type4}}}
| data33 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type5}}}
| data34 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type6}}}
| data35 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass36 = mergedtoprow
| label36 = {{{established_title}}}
| data36 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass37 = mergedrow
| label37 = {{{established_title1}}}
| data37 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass38 = mergedrow
| label38 = {{{established_title2}}}
| data38 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass39 = mergedrow
| label39 = {{{established_title3}}}
| data39 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title4}}}
| data40 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title5}}}
| data41 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title6}}}
| data42 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title7}}}
| data43 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass44 = mergedrow
| label44 = {{{extinct_title}}}
| data44 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass45 = mergedrow
| label45 = Founded by
| data45 = {{{founder|}}}
| rowclass46 = mergedrow
| label46 = [[Namesake|Named for]]
| data46 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass47 = mergedtoprow
| label47 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Seat}}
| data47 = {{{seat|}}}
| rowclass48 = mergedrow
| label48 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Former seat}}
| data48 = {{{seat1|}}}
| rowclass49 = mergedrow
| label49 = {{#if:{{{seat2_type|}}}|{{{seat2_type}}}|Former seat}}
| data49 = {{{seat2|}}}
| rowclass51 = {{#if:{{{seat|}}}{{{seat1|}}}{{{seat2|}}}|mergedrow|mergedtoprow}}
| label51 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|Boroughs}}
| data51 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass52 = mergedtoprow
| header52 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Government<div class="ib-settlement-fn">{{{government_footnotes|}}}</div>}}
<!-- ***Government*** -->
| rowclass53 = mergedrow
| label53 = • Type
| data53 = {{{government_type|}}}
| rowclass54 = mergedrow
| label54 = • Body
| class54 = agent
| data54 = {{{governing_body|}}}
| rowclass55 = mergedrow
| label55 = • {{{leader_title}}}
| data55 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title1}}}
| data56 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title2}}}
| data57 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass58 = mergedrow
| label58 = • {{{leader_title3}}}
| data58 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass59 = mergedrow
| label59 = • {{{leader_title4}}}
| data59 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
| rowclass60 = mergedrow
| label60 = {{{government_blank1_title}}}
| data60 = {{#if:{{{government_blank1|}}}|{{{government_blank1|}}}}}
| rowclass61 = mergedrow
| label61 = {{{government_blank2_title}}}
| data61 = {{#if:{{{government_blank2|}}}|{{{government_blank2|}}}}}
| rowclass62 = mergedrow
| label62 = {{{government_blank3_title}}}
| data62 = {{#if:{{{government_blank3|}}}|{{{government_blank3|}}}}}
| rowclass63 = mergedrow
| label63 = {{{government_blank4_title}}}
| data63 = {{#if:{{{government_blank4|}}}|{{{government_blank4|}}}}}
| rowclass64 = mergedrow
| label64 = {{{government_blank5_title}}}
| data64 = {{#if:{{{government_blank5|}}}|{{{government_blank5|}}}}}
| rowclass65 = mergedrow
| label65 = {{{government_blank6_title}}}
| data65 = {{#if:{{{government_blank6|}}}|{{{government_blank6|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass66 = mergedtoprow
| header66 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
}}
}}
| rowclass67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
}}
| data67 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass68 = mergedrow
| label68 = • Land
| data68 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass69 = mergedrow
| label69 = • Water
| data69 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}{{#ifeq:%|{{#invoke:string|sub|{{{area_water_percent|}}}|-1}}||%}}}}}}
| rowclass70 = mergedrow
| label70 = • Urban<div class="ib-settlement-fn">{{{area_urban_footnotes|}}}</div>
| data70 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass71 = mergedrow
| label71 = • Rural<div class="ib-settlement-fn">{{{area_rural_footnotes|}}}</div>
| data71 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass72 = mergedrow
| label72 = • Metro<div class="ib-settlement-fn">{{{area_metro_footnotes|}}}</div>
| data72 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass73 = mergedrow
| label73 = • Rank
| data73 = {{{area_rank|}}}
| rowclass74 = mergedrow
| label74 = • {{{area_blank1_title}}}
| data74 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass75 = mergedrow
| label75 = • {{{area_blank2_title}}}
| data75 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass76 = mergedrow
| label76 =
| data76 = {{{area_note|}}}
<!-- ***Dimensions*** -->
| rowclass77 = mergedtoprow
| header77 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<div class="ib-settlement-fn">{{{dimensions_footnotes|}}}</div>}}
| rowclass78 = mergedrow
| label78 = • Length
| data78 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass79 = mergedrow
| label79 = • Width
| data79 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass80 = mergedtoprow
| label80 = {{#if:{{{elevation_link|}}}|[[{{{elevation_link|}}}|Elevation]]|Elevation}}<div class="ib-settlement-fn">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</div>
| data80 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass81 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}|mergedrow|mergedtoprow}}
| label81 = Highest elevation<div class="ib-settlement-fn">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</div>
| data81 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass82 = mergedrow
| label82 = • Rank
| data82 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass83 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label83 = Lowest elevation<div class="ib-settlement-fn">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</div>
| data83 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass84 = mergedrow
| label84 = • Rank
| data84 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass85 = mergedtoprow
| label85 = Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
| data85 = {{fix comma category|{{#if:{{{population|}}}
| {{formatnum:{{replace|{{{population}}}|,|}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{replace|{{{population_total}}}|,|}}}}
}}
}}
}}}}
| rowclass86 = mergedtoprow
| header86 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
}}
}}
}}
| rowclass87 = mergedrow
| label87 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
| data87 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{fix comma category|{{formatnum:{{replace|{{{population_total}}}|,|}}}}}}
}}
}}
}}
| rowclass88 = mergedrow
| label88 = • Estimate <div class="ib-settlement-fn">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</div>
| data88 = {{#if:{{{population_est|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_est}}}|,|}}}}}} }}
<!-- ***Population rank*** -->
| rowclass89 = mergedrow
| label89 = • Rank
| data89 = {{{population_rank|}}}
| rowclass90 = mergedrow
| label90 = • Density
| data90 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass91 = mergedrow
| label91 = • Rank
| data91 = {{{population_density_rank|}}}
| rowclass92 = mergedrow
| label92 = • [[Urban area|Urban]]<div class="ib-settlement-fn">{{{population_urban_footnotes|}}}</div>
| data92 = {{#if:{{{population_urban|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_urban}}}|,|}}}}}} }}
| rowclass93 = mergedrow
| label93 = • Urban density
| data93 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass94 = mergedrow
| label94 = • [[Rural area|Rural]]<div class="ib-settlement-fn">{{{population_rural_footnotes|}}}</div>
| data94 = {{#if:{{{population_rural|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_rural}}}|,|}}}}}}}}
| rowclass95 = mergedrow
| label95 = • Rural density
| data95 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass96 = mergedrow
| label96 = • [[Metropolitan area|Metro]]<div class="ib-settlement-fn">{{{population_metro_footnotes|}}}</div>
| data96 = {{#if:{{{population_metro|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_metro}}}|,|}}}}}} }}
| rowclass97 = mergedrow
| label97 = • Metro density
| data97 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass98 = mergedrow
| label98 = • {{{population_blank1_title|}}}<div class="ib-settlement-fn">{{{population_blank1_footnotes|}}}</div>
| data98 = {{#if:{{{population_blank1|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank1}}}|,|}}}}}}}}
| rowclass99 = mergedrow
| label99 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data99 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass100 = mergedrow
| label100 = • {{{population_blank2_title|}}}<div class="ib-settlement-fn">{{{population_blank2_footnotes|}}}</div>
| data100 = {{#if:{{{population_blank2|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank2}}}|,|}}}}}}}}
| rowclass101 = mergedrow
| label101 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data101 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass102 = mergedrow
| label102 =
| data102 = {{{population_note|}}}
| rowclass103 = mergedtoprow
| label103 = {{Pluralize from text|{{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}{{force plural}}}}|<!--
-->link=Demonym|singular=Demonym|likely=Demonym(s)|plural=Demonyms}}
| data103 = {{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}}}{{Main other|{{Pluralize from text|{{{population_demonym|}}}|likely=[[Category:Pages using infobox settlement with possible demonym list]]}}}}
<!-- ***Demographics 1*** -->
| rowclass104 = mergedtoprow
| header104 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<div class="ib-settlement-fn">{{{demographics1_footnotes|}}}</div>}}
| rowclass105 = mergedrow
| label105 = • {{{demographics1_title1}}}
| data105 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass106 = mergedrow
| label106 = • {{{demographics1_title2}}}
| data106 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass107 = mergedrow
| label107 = • {{{demographics1_title3}}}
| data107 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics1_title4}}}
| data108 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics1_title5}}}
| data109 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics1_title6}}}
| data110 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics1_title7}}}
| data111 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
| rowclass112 = mergedrow
| label112 = • {{{demographics1_title8}}}
| data112 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title8|}}}|{{{demographics1_info8|}}}}}}}
| rowclass113 = mergedrow
| label113 = • {{{demographics1_title9}}}
| data113 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title9|}}}|{{{demographics1_info9|}}}}}}}
| rowclass114 = mergedrow
| label114 = • {{{demographics1_title10}}}
| data114 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title10|}}}|{{{demographics1_info10|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass115 = mergedtoprow
| header115 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<div class="ib-settlement-fn">{{{demographics2_footnotes|}}}</div>}}
| rowclass116 = mergedrow
| label116 = • {{{demographics2_title1}}}
| data116 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass117 = mergedrow
| label117 = • {{{demographics2_title2}}}
| data117 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass118 = mergedrow
| label118 = • {{{demographics2_title3}}}
| data118 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass119 = mergedrow
| label119 = • {{{demographics2_title4}}}
| data119 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass120 = mergedrow
| label120 = • {{{demographics2_title5}}}
| data120 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass121 = mergedrow
| label121 = • {{{demographics2_title6}}}
| data121 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass122 = mergedrow
| label122 = • {{{demographics2_title7}}}
| data122 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
| rowclass123 = mergedrow
| label123 = • {{{demographics2_title8}}}
| data123 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title8|}}}|{{{demographics2_info8|}}}}}}}
| rowclass124 = mergedrow
| label124 = • {{{demographics2_title9}}}
| data124 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title9|}}}|{{{demographics2_info9|}}}}}}}
| rowclass125 = mergedrow
| label125 = • {{{demographics2_title10}}}
| data125 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title10|}}}|{{{demographics2_info10|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass126 = mergedtoprow
| header126 = {{#if:{{{timezone1_location|}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}|}}
| rowclass127 = {{#if:{{{timezone1_location|}}}|mergedrow|mergedtoprow}}
| label127 = {{#if:{{{timezone1_location|}}}|{{{timezone1_location}}}|{{#if:{{{timezone2_location|}}}|{{{timezone2_location}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}}}}}
| data127 = {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}
|[[UTC{{{utc_offset1|{{{utc_offset}}}}}}]] {{#if:{{{timezone1|{{{timezone|}}}}}}|({{{timezone1|{{{timezone}}}}}})}}
|{{{timezone1|{{{timezone|}}}}}}
}}
| rowclass128 = mergedrow
| label128 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data128 = {{#if:{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}
|[[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]] {{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|({{{timezone1_DST|{{{timezone_DST}}}}}})}}
|{{{timezone1_DST|{{{timezone_DST|}}}}}}
}}
| rowclass129 = mergedrow
| label129 = {{#if:{{{timezone2_location|}}}| {{{timezone2_location|}}}|<nowiki />}}
| data129 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}
|[[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]] {{#if:{{{timezone2|}}}|({{{timezone2}}})}}
|{{{timezone2|}}}
}}
}}
| rowclass130 = mergedrow
| label130 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data130 = {{#if:{{{utc_offset2_DST|}}}|[[UTC{{{utc_offset2_DST|}}}]] {{#if:{{{timezone2_DST|}}}|({{{timezone2_DST|}}})}}
|{{{timezone2_DST|}}}
}}
| rowclass131 = mergedrow
| label131 = {{#if:{{{timezone3_location|}}}| {{{timezone3_location|}}}|<nowiki />}}
| data131 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset3|{{{utc_offset3|}}} }}}
|[[UTC{{{utc_offset3|{{{utc_offset3}}}}}}]] {{#if:{{{timezone3|}}}|({{{timezone3}}})}}
|{{{timezone3|}}}
}}
}}
| rowclass132 = mergedrow
| label132 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data132 = {{#if:{{{utc_offset3_DST|}}}|[[UTC{{{utc_offset3_DST|}}}]] {{#if:{{{timezone3_DST|}}}|({{{timezone3_DST|}}})}}
|{{{timezone3_DST|}}}
}}
| rowclass133 = mergedrow
| label133 = {{#if:{{{timezone4_location|}}}| {{{timezone4_location|}}}|<nowiki />}}
| data133 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset4|{{{utc_offset4|}}} }}}
|[[UTC{{{utc_offset4|{{{utc_offset4}}}}}}]] {{#if:{{{timezone4|}}}|({{{timezone4}}})}}
|{{{timezone4|}}}
}}
}}
| rowclass134 = mergedrow
| label134 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data134 = {{#if:{{{utc_offset4_DST|}}}|[[UTC{{{utc_offset4_DST|}}}]] {{#if:{{{timezone4_DST|}}}|({{{timezone4_DST|}}})}}
|{{{timezone4_DST|}}}
}}
| rowclass135 = mergedrow
| label135 = {{#if:{{{timezone5_location|}}}| {{{timezone5_location|}}}|<nowiki />}}
| data135 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset5|{{{utc_offset5|}}} }}}
|[[UTC{{{utc_offset5|{{{utc_offset5}}}}}}]] {{#if:{{{timezone5|}}}|({{{timezone5}}})}}
|{{{timezone5|}}}
}}
}}
| rowclass136 = mergedrow
| label136 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data136 = {{#if:{{{utc_offset5_DST|}}}|[[UTC{{{utc_offset5_DST|}}}]] {{#if:{{{timezone5_DST|}}}|({{{timezone5_DST|}}})}}
|{{{timezone5_DST|}}}
}}
<!-- ***Postal Code(s)*** -->
| rowclass137 = mergedtoprow
| label137 = {{{postal_code_type}}}
| class137 = adr
| data137 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<div class="postal-code">{{{postal_code}}}</div>}}}}
| rowclass138 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}|mergedbottomrow|mergedtoprow}}
| label138 = {{{postal2_code_type}}}
| class138 = adr
| data138 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<div class="postal-code">{{{postal2_code}}}</div>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass139 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}|mergedrow|mergedtoprow}}
| label139 = {{if empty|{{{area_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{if empty|{{{area_code|}}}|{{{area_codes|}}}{{force plural}}}}|<!--
-->link=Telephone numbering plan|singular=Area code|likely=Area code(s)|plural=Area codes}}}}
| data139 = {{if empty|{{{area_code|}}}|{{{area_codes|}}}}}{{#if:{{{area_code_type|}}}||{{Main other|{{Pluralize from text|any_comma=1|parse_links=1|{{{area_code|}}}|||[[Category:Pages using infobox settlement with possible area code list]]}}}}}}
<!-- Geocode-->
| rowclass140 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label140 = [[Geocode]]
| class140 = nickname
| data140 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass141 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label141 = [[ISO 3166|ISO 3166 code]]
| class141 = nickname
| data141 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass142 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label142 = {{#if:{{{registration_plate_type|}}}|{{{registration_plate_type}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data142 = {{{registration_plate|}}}
<!-- Other codes -->
| rowclass143 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label143 = {{{code1_name|}}}
| class143 = nickname
| data143 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass144 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label144 = {{{code2_name|}}}
| class144 = nickname
| data144 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass145 = mergedtoprow
| label145 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data145 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass146 = mergedrow
| label146 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data146 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass147 = mergedrow
| label147 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data147 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass148 = mergedrow
| label148 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data148 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass149 = mergedrow
| label149 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data149 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass150 = mergedrow
| label150 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data150 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass151 = mergedrow
| label151 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data151 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass152 = mergedrow
| label152 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data152 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass153 = mergedtoprow
| label153 = {{{blank_name_sec2}}}
| data153 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass154 = mergedrow
| label154 = {{{blank1_name_sec2}}}
| data154 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass155 = mergedrow
| label155 = {{{blank2_name_sec2}}}
| data155 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass156 = mergedrow
| label156 = {{{blank3_name_sec2}}}
| data156 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass157 = mergedrow
| label157 = {{{blank4_name_sec2}}}
| data157 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass158 = mergedrow
| label158 = {{{blank5_name_sec2}}}
| data158 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass159 = mergedrow
| label159 = {{{blank6_name_sec2}}}
| data159 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass160 = mergedrow
| label160 = {{{blank7_name_sec2}}}
| data160 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass161 = mergedtoprow
| label161 = Website
| data161 = {{#if:{{{website|}}}|{{{website}}}}}
| class162 = maptable
| data162 = {{#if:{{{module|}}}|{{{module}}}}}
<!-- ***Footnotes*** -->
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!-- Check for unknowns
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox settlement with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox settlement]] with unknown parameter "_VALUE_"|ignoreblank=y
| alt | anthem | anthem_link | area_blank1_acre | area_blank1_dunam | area_blank1_ha | area_blank1_km2 | area_blank1_sq_mi | area_blank1_title | area_blank2_acre | area_blank2_dunam | area_blank2_ha | area_blank2_km2 | area_blank2_sq_mi | area_blank2_title | area_code | area_code_type | area_codes | area_footnotes | area_land_acre | area_land_dunam | area_land_ha | area_land_km2 | area_land_sq_mi | area_metro_acre | area_metro_dunam | area_metro_footnotes | area_metro_ha | area_metro_km2 | area_metro_sq_mi | area_note | area_rank | area_rural_acre | area_rural_dunam | area_rural_footnotes | area_rural_ha | area_rural_km2 | area_rural_sq_mi | area_total_acre | area_total_dunam | area_total_ha | area_total_km2 | area_total_sq_mi | area_urban_acre | area_urban_dunam | area_urban_footnotes | area_urban_ha | area_urban_km2 | area_urban_sq_mi | area_water_acre | area_water_dunam | area_water_ha | area_water_km2 | area_water_percent | area_water_sq_mi | blank_emblem_alt | blank_emblem_link | blank_emblem_size | blank_emblem_type | blank_info | blank_info_sec1 | blank_info_sec2 | blank_name | blank_name_sec1 | blank_name_sec2 | blank1_info | blank1_info_sec1 | blank1_info_sec2 | blank1_name | blank1_name_sec1 | blank1_name_sec2 | blank2_info | blank2_info_sec1 | blank2_info_sec2 | blank2_name | blank2_name_sec1 | blank2_name_sec2 | blank3_info | blank3_info_sec1 | blank3_info_sec2 | blank3_name | blank3_name_sec1 | blank3_name_sec2 | blank4_info | blank4_info_sec1 | blank4_info_sec2 | blank4_name | blank4_name_sec1 | blank4_name_sec2 | blank5_info | blank5_info_sec1 | blank5_info_sec2 | blank5_name | blank5_name_sec1 | blank5_name_sec2 | blank6_info | blank6_info_sec1 | blank6_info_sec2 | blank6_name | blank6_name_sec1 | blank6_name_sec2 | blank7_info | blank7_info_sec1 | blank7_info_sec2 | blank7_name | blank7_name_sec1 | blank7_name_sec2 | caption | code1_info | code1_name | code2_info | code2_name | coor_pinpoint | coor_type | coordinates | coordinates_footnotes | demographics_type1 | demographics_type2 | demographics1_footnotes | demographics1_info1 | demographics1_info10 | demographics1_info2 | demographics1_info3 | demographics1_info4 | demographics1_info5 | demographics1_info6 | demographics1_info7 | demographics1_info8 | demographics1_info9 | demographics1_title1 | demographics1_title10 | demographics1_title2 | demographics1_title3 | demographics1_title4 | demographics1_title5 | demographics1_title6 | demographics1_title7 | demographics1_title8 | demographics1_title9 | demographics2_footnotes | demographics2_info1 | demographics2_info10 | demographics2_info2 | demographics2_info3 | demographics2_info4 | demographics2_info5 | demographics2_info6 | demographics2_info7 | demographics2_info8 | demographics2_info9 | demographics2_title1 | demographics2_title10 | demographics2_title2 | demographics2_title3 | demographics2_title4 | demographics2_title5 | demographics2_title6 | demographics2_title7 | demographics2_title8 | demographics2_title9 | dimensions_footnotes | dunam_link | elevation_footnotes | elevation_ft | elevation_link | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_max_rank | elevation_min_footnotes | elevation_min_ft | elevation_min_m | elevation_min_point | elevation_min_rank | elevation_point | embed | established_date | established_date1 | established_date2 | established_date3 | established_date4 | established_date5 | established_date6 | established_date7 | established_title | established_title1 | established_title2 | established_title3 | established_title4 | established_title5 | established_title6 | established_title7 | etymology | extinct_date | extinct_title | flag_alt | flag_border | flag_link | flag_size | footnotes | founder | geocode | governing_body | government_footnotes | government_type | government_blank1_title | government_blank1 | government_blank2_title | government_blank2 | government_blank2_title | government_blank3 | government_blank3_title | government_blank3 | government_blank4_title | government_blank4 | government_blank5_title | government_blank5 | government_blank6_title | government_blank6 | grid_name | grid_position | image_alt | image_blank_emblem | image_caption | image_flag | image_map | image_map1 | image_seal | image_shield | image_size | image_skyline | imagesize | iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | length_km | length_mi | map_alt | map_alt1 | map_caption | map_caption1 | mapsize | mapsize1 | module | motto | motto_link | mottoes | name | named_for | native_name | native_name_lang | nickname | nickname_link | nicknames | official_name | other_name | p1 | p10 | p11 | p12 | p13 | p14 | p15 | p16 | p17 | p18 | p19 | p2 | p20 | p21 | p22 | p23 | p24 | p25 | p26 | p27 | p28 | p29 | p3 | p30 | p31 | p32 | p33 | p34 | p35 | p36 | p37 | p38 | p39 | p4 | p40 | p41 | p42 | p43 | p44 | p45 | p46 | p47 | p48 | p49 | p5 | p50 | p6 | p7 | p8 | p9 | parts | parts_style | parts_type | pop_est_as_of | pop_est_footnotes | population | population_as_of | population_blank1 | population_blank1_footnotes | population_blank1_title | population_blank2 | population_blank2_footnotes | population_blank2_title | population_demonym | population_demonyms | population_density_blank1_km2 | population_density_blank1_sq_mi | population_density_blank2_km2 | population_density_blank2_sq_mi | population_density_km2 | population_density_metro_km2 | population_density_metro_sq_mi | population_density_rank | population_density_rural_km2 | population_density_rural_sq_mi | population_density_sq_mi | population_density_urban_km2 | population_density_urban_sq_mi | population_est | population_footnotes | population_metro | population_metro_footnotes | population_note | population_rank | population_rural | population_rural_footnotes | population_total | population_urban | population_urban_footnotes | postal_code | postal_code_type | postal2_code | postal2_code_type | pushpin_image | pushpin_label | pushpin_label_position | pushpin_map | pushpin_map_alt | pushpin_map_caption | pushpin_map_caption_notsmall | pushpin_map_narrow | pushpin_mapsize | pushpin_outside | pushpin_overlay | pushpin_relief | registration_plate | registration_plate_type | seal_alt | seal_link | seal_size | seal_type | seat | seat_type | seat1 | seat1_type | seat2 | seat2_type | settlement_type | shield_alt | shield_link | shield_size | short_description | subdivision_name | subdivision_name1 | subdivision_name2 | subdivision_name3 | subdivision_name4 | subdivision_name5 | subdivision_name6 | subdivision_type | subdivision_type1 | subdivision_type2 | subdivision_type3 | subdivision_type4 | subdivision_type5 | subdivision_type6 | timezone | timezone_DST | timezone_link | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | timezone3 | timezone3_DST | timezone3_location | timezone4 | timezone4_DST | timezone4_location | timezone5 | timezone5_DST | timezone5_location | total_type | translit_lang1 | translit_lang1_info | translit_lang1_info1 | translit_lang1_info2 | translit_lang1_info3 | translit_lang1_info4 | translit_lang1_info5 | translit_lang1_info6 | translit_lang1_type | translit_lang1_type1 | translit_lang1_type2 | translit_lang1_type3 | translit_lang1_type4 | translit_lang1_type5 | translit_lang1_type6 | translit_lang2 | translit_lang2_info | translit_lang2_info1 | translit_lang2_info2 | translit_lang2_info3 | translit_lang2_info4 | translit_lang2_info5 | translit_lang2_info6 | translit_lang2_type | translit_lang2_type1 | translit_lang2_type2 | translit_lang2_type3 | translit_lang2_type4 | translit_lang2_type5 | translit_lang2_type6 | type | unit_pref | utc_offset | utc_offset_DST | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | utc_offset3 | utc_offset3_DST | utc_offset4 | utc_offset4_DST | utc_offset5 | utc_offset5_DST | website | width_km | width_mi
}}<!--
-->{{#invoke:Check for clobbered parameters|check
| template = Infobox settlement
| cat = {{main other|Category:Pages using infobox settlement with conflicting parameters}}
| population; population_total
| image_size; imagesize
| image_alt; alt
| image_caption; caption
}}{{#if:{{{embed|}}}|[[Category:Pages using infobox settlement with embed]]}}</includeonly>
<noinclude>
{{documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
ba7272edeabcc69e8042c9057b84101c6611ff15
File:SMState Seal.png
6
249
606
2023-10-17T21:26:22Z
LamayII
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Main Page
0
1
608
2
2023-10-17T21:35:22Z
LamayII
2
Infobox
wikitext
text/x-wiki
{{Infobox state|name=State of Santa Modesta|official_name=State of Santa Modesta|anthem=''Santa Modesta Dreamin'''|image_flag=SM_State_Flag.png|image_seal=SMState_Seal.png|seal_alt=Seal of Santa Modesta|AdmittanceDate=1854|Governor=charolotte_n|Lieutenant Governor=VisenyaRegime|Legislature=Santa Modesta Senate Assembly}}
[[Santa Modesta]] is a state situated along the pacific seaboard of the Union. During the height of westward expansion, Anglo-American settlers established themselves within the present Mexican colonies. By 1846, the general populous of English inhabitants grew in sizes that eventually rivaled their Mexican neighbors. In 1848, the Santa Modesta Gold Rush had begun, which eventually lead settlers, backed by American soldiers making the decision to spearhead a rebellion against the Mexican government and inhabitants, effectively annexing the territory by 1850. It wasn’t until 1854 the territory officially sought out statehood, and successfully joined the Union in 1855, becoming the 31st state of the nation. Today, Santa Modesta is considered to be referred to as “the Golden State” by westerners, due to it’s diverse, industrialized, and prosperous background.
== Government & Politics==
The '''Government of Santa Modesta''' was established by the [[Constitution of the State of Santa Modesta|Santa Modesta Constitution]]. Santa Modesta uses the separation of powers system to structure its government. It is composed of three branches: the executive, consisting of the Governor of Santa Modesta, and the other constitutionally elected and appointed officers and offices; the legislative, consisting of the Santa Modesta State Legislature, which includes the Santa Modesta State Assembly and the Santa Modesta State Senate; and the judicial, consisting of the Supreme Court of Santa Modesta and lower courts of Los Alameda County. There is also departmental government, overseeing the day-to-day operations of the county, cities, special districts, departments, and school districts, as well as government entities and offices that operate independently on a constitutional, statutory, or common law basis. The state also allows direct participation of the electorate by initiative, referendum, recall and ratification.
3b37d5ce4eecf6bfd8722084aa8f88587f96efb2
616
608
2023-10-17T21:46:36Z
LamayII
2
Changed name of infobox
wikitext
text/x-wiki
{{Infobox state|name=Santa Modesta|official_name=State of Santa Modesta|anthem=''Santa Modesta Dreamin'''|image_flag=SM_State_Flag.png|image_seal=SMState_Seal.png|seal_alt=Seal of Santa Modesta|AdmittanceDate=1854|Governor=charolotte_n|Lieutenant Governor=VisenyaRegime|Legislature=Santa Modesta Senate Assembly}}
[[Santa Modesta]] is a state situated along the pacific seaboard of the Union. During the height of westward expansion, Anglo-American settlers established themselves within the present Mexican colonies. By 1846, the general populous of English inhabitants grew in sizes that eventually rivaled their Mexican neighbors. In 1848, the Santa Modesta Gold Rush had begun, which eventually lead settlers, backed by American soldiers making the decision to spearhead a rebellion against the Mexican government and inhabitants, effectively annexing the territory by 1850. It wasn’t until 1854 the territory officially sought out statehood, and successfully joined the Union in 1855, becoming the 31st state of the nation. Today, Santa Modesta is considered to be referred to as “the Golden State” by westerners, due to it’s diverse, industrialized, and prosperous background.
== Government & Politics==
The '''Government of Santa Modesta''' was established by the [[Constitution of the State of Santa Modesta|Santa Modesta Constitution]]. Santa Modesta uses the separation of powers system to structure its government. It is composed of three branches: the executive, consisting of the Governor of Santa Modesta, and the other constitutionally elected and appointed officers and offices; the legislative, consisting of the Santa Modesta State Legislature, which includes the Santa Modesta State Assembly and the Santa Modesta State Senate; and the judicial, consisting of the Supreme Court of Santa Modesta and lower courts of Los Alameda County. There is also departmental government, overseeing the day-to-day operations of the county, cities, special districts, departments, and school districts, as well as government entities and offices that operate independently on a constitutional, statutory, or common law basis. The state also allows direct participation of the electorate by initiative, referendum, recall and ratification.
b23300f99e4e1704d2a007419432419664b60366
Santa Modesta
0
250
610
2023-10-17T21:38:07Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
#REDIRECT [[Main_Page]]
f84835069b21a3cdfd413b302965d01449ae7b8f
File:LASD Logo.png
6
252
617
2023-10-17T21:52:54Z
LamayII
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:SMHP Badge.png
6
253
618
2023-10-17T22:16:55Z
LamayII
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:SMHP Logo.png
6
254
619
2023-10-17T22:24:46Z
LamayII
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Santa Modesta Highway Patrol
0
255
620
2023-10-17T22:25:51Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
{{Infobox law enforcement agency|agencyname=Santa Modesta Highway Patrol|badge=File:SMHP_Badge.png|badgecaption=Badge|logocaption=Flag|motto=''”Safety, Service, & Security”''|formedyear=1929|budget=~> 100 Employees|legaljuris=State-wide law enforcement|governingbody=[[Department of Justice]]|chief1name=Catonius|chief1position=Commissioner|chief2position=Deputy Commissioner|chief2name=Yankaldo|logo=SMHP_Logo.png}}
The '''Santa Modesta Highway Patrol''' ('''SMHP''') is a state law enforcement agency of the state of Santa Modesta. The SMHP has primary patrol jurisdiction over all Santa Modesta highways and roads and streets outside city limits, and can exercise law enforcement powers anywhere within the state. The Santa Modesta Highway Patrol can assist local and county agencies and can patrol major city streets along with local and county law enforcement, state and interstate highways, and is the primary law enforcement agency in rural parts of the state.
==History==
Originally residing as a branch of the Division of Motor Vehicles in the Department of Public Works, the '''Santa Modesta Highway Patrol''' was established in 1929, subsequently becoming a separate department with its legislation signed in 1947. The SMHP gradually increased its responsibilities in patrolling jurisdictions over Santa Modesta highways, streets, and roads outside of municipal limits, providing protections to state buildings and facilities, and most notably providing assistance in investigations into motor vehicle related incidents within the state.
1cd6438cb547478d6c86a0140a88a7b1bf3df2bb
Department of Justice
0
256
621
2023-10-17T22:28:23Z
LamayII
2
Created page with "''Placeholder''"
wikitext
text/x-wiki
''Placeholder''
6bd72f77e7d48386d8ee5570d9c12acc63f00c10
Santa Modesta Highway Patrol
0
255
622
620
2023-10-17T22:29:11Z
LamayII
2
Added link
wikitext
text/x-wiki
{{Infobox law enforcement agency|agencyname=Santa Modesta Highway Patrol|badge=File:SMHP_Badge.png|badgecaption=Badge|logocaption=Flag|motto=''”Safety, Service, & Security”''|formedyear=1929|budget=~> 100 Employees|legaljuris=State-wide law enforcement|governingbody=[[Department of Justice]]|chief1name=Catonius|chief1position=Commissioner|chief2position=Deputy Commissioner|chief2name=Yankaldo|logo=SMHP_Logo.png}}
The '''Santa Modesta Highway Patrol''' ('''SMHP''') is a state law enforcement agency of the state of [[Santa Modesta]]. The SMHP has primary patrol jurisdiction over all Santa Modesta highways and roads and streets outside city limits, and can exercise law enforcement powers anywhere within the state. The Santa Modesta Highway Patrol can assist local and county agencies and can patrol major city streets along with local and county law enforcement, state and interstate highways, and is the primary law enforcement agency in rural parts of the state.
==History==
Originally residing as a branch of the Division of Motor Vehicles in the Department of Public Works, the '''Santa Modesta Highway Patrol''' was established in 1929, subsequently becoming a separate department with its legislation signed in 1947. The SMHP gradually increased its responsibilities in patrolling jurisdictions over Santa Modesta highways, streets, and roads outside of municipal limits, providing protections to state buildings and facilities, and most notably providing assistance in investigations into motor vehicle related incidents within the state.
1ba0e2cbc33bfd86cb4fbe536b1226e48f05d47f
Template:Infobox military unit
10
257
624
623
2023-10-17T23:33:33Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_military_unit]]
wikitext
text/x-wiki
<includeonly>{{Infobox
| bodystyle = {{WPMILHIST Infobox style|main_box_raw}}
| abovestyle = {{WPMILHIST Infobox style|header_raw}}
| subheaderstyle = {{WPMILHIST Infobox style|sub_header_raw}}
| above = {{{unit_name|{{PAGENAMEBASE}}}}}
| subheader = {{{native_name|}}}
| imagestyle = {{WPMILHIST Infobox style|image_box_raw}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|}}}|sizedefault=frameless|upright=1|alt={{{alt|}}}}}
| caption = {{{caption|}}}
| headerstyle = {{WPMILHIST Infobox style|header_raw}}
| labelstyle = padding-right: 1em;
| label1 = {{#if:{{{start_date|}}}|{{#if:{{{end_date|}}}|Active|Founded}}|Active}}
| data1 = {{#if:{{{start_date|}}}|{{#if:{{{end_date|}}}|{{{start_date}}}–{{{end_date}}}|{{{start_date}}}}}|{{{dates|}}}}}
| label2 = Disbanded
| data2 = {{{disbanded|}}}
| label3 = {{#if:{{{country|}}}|Country|Countries}}
| data3 = {{#if:{{{country|}}}|{{{country}}}|{{{countries|}}}}}
| label4 = Allegiance
| data4 = {{{allegiance|}}}
| label5 = Branch
| data5 = {{{branch|}}}
| label6 = Type
| data6 = {{{type|}}}
| label7 = Role
| data7 = {{{role|}}}{{{specialization|}}}
| label8 = Size
| data8 = {{{size|}}}
| label9 = Part of
| data9 = {{{command_structure|}}}
| label10 = {{#if:{{{garrison_label|}}}|{{{garrison_label|}}}|Garrison/HQ}}
| data10 = {{{garrison|}}}
| label11 = Nickname(s)
| data11 = {{{nickname|}}}
| label12 = Patron
| data12 = {{{patron|}}}
| label13 = Motto(s)
| data13 = {{{motto|}}}
| label14 = {{if empty|{{{colors_label|}}}|{{{colours_label|}}}|{{#if:{{{colours|}}}|Colours|Colors}}}}
| data14 = {{#if:{{{colours|}}}|{{{colours|}}}|{{{colors|}}}}}
| label15 = March
| data15 = {{{march|}}}
| label16 = Mascot(s)
| data16 = {{{mascot|}}}
| label17 = Anniversaries
| data17 = {{{anniversaries|}}}
| label18 = {{#if:{{{equipment_label|}}}|{{{equipment_label|}}}|Equipment}}
| data18 = {{{equipment|}}}
| label19 = {{#if:{{{battles_label|}}}|{{{battles_label|}}}|Engagements}}
| data19 = {{{battles|}}}
| label20 = Decorations
| data20 = {{{decorations|}}}
| label21 = {{#if:{{{battle_honours_label|}}}|{{{battle_honours_label|}}}|[[Battle honour|Battle honour]]s}}
| data21 = {{{battle_honours|}}}
| label22 = Flying hours
| data22 = {{{flying_hours|}}}
| label23 = Website
| data23 = {{{website|}}}
| header24 = {{#if:{{{commander1|}}}{{{commander2|}}}{{{commander3|}}}{{{current_commander|}}}{{{ceremonial_chief|}}}{{{colonel_of_the_regiment|}}}{{{notable_commanders|}}} | Commanders }}
| label25 = {{#if:{{{commander1_label|}}}|{{{commander1_label|}}}|{{#if:{{{current_commander_label|}}}|{{{current_commander_label|}}}|Current<br>commander}}}}
| data25 = {{#if:{{{commander1|}}}|{{{commander1|}}}|{{{current_commander|}}}}}
| label26 = {{#if:{{{commander2_label|}}}|{{{commander2_label|}}}|{{#if:{{{ceremonial_chief_label|}}}|{{{ceremonial_chief_label|}}}|Ceremonial chief}}}}
| data26 = {{#if:{{{commander2|}}}|{{{commander2|}}}|{{{ceremonial_chief|}}}}}
| label27 = {{#if:{{{commander3_label|}}}|{{{commander3_label|}}}|{{#if:{{{colonel_of_the_regiment_label|}}}|{{{colonel_of_the_regiment_label|}}}|Colonel of<br>the Regiment}}}}
| data27 = {{#if:{{{commander3|}}}|{{{commander3|}}}|{{{colonel_of_the_regiment|}}}}}
| label28 = {{#if:{{{commander4_label|}}}|{{{commander4_label|}}}|{{#if:{{{command_sergeant_major_label|}}}|{{{command_sergeant_major_label|}}}|Command Sergeant Major}}}}
| data28 = {{#if:{{{commander4|}}}|{{{commander4|}}}|{{{command_sergeant_major|}}}}}
| label29 = {{{commander5_label|Commander}}}
| data29 = {{{commander5|}}}
| label30 = {{{commander6_label|Commander}}}
| data30 = {{{commander6|}}}
| label31 = {{{commander7_label|Commander}}}
| data31 = {{{commander7|}}}
| label32 = {{{commander8_label|Commander}}}
| data32 = {{{commander8|}}}
| label33 = {{{commander9_label|Commander}}}
| data33 = {{{commander9|}}}
| label34 = Notable<br>commanders
| data34 = {{{notable_commanders|}}}
| header35 = {{#if:{{{identification_symbol|}}}{{{identification_symbol_2|}}} | Insignia }}
| header36 = {{#ifeq: {{{identification_symbol_label|}}} | none | {{{identification_symbol|}}} | }}
| label36 = {{#if:{{{identification_symbol_label|}}}|{{{identification_symbol_label|}}}|Identification<br>symbol}}
| data36 = {{#ifeq: {{{identification_symbol_label|}}} | none | | {{{identification_symbol|}}} }}
| label37 = {{#if:{{{identification_symbol_2_label|}}}|{{{identification_symbol_2_label|}}}|Identification<br>symbol}}
| data37 = {{{identification_symbol_2|}}}
| label38 = {{#if:{{{identification_symbol_3_label|}}}|{{{identification_symbol_3_label|}}}|Identification<br>symbol}}
| data38 = {{{identification_symbol_3|}}}
| label39 = {{#if:{{{identification_symbol_4_label|}}}|{{{identification_symbol_4_label|}}}|Identification<br>symbol}}
| data39 = {{{identification_symbol_4|}}}
| label40 = {{#if:{{{identification_symbol_5_label|}}}|{{{identification_symbol_5_label|}}}|Identification<br>symbol}}
| data40 = {{{identification_symbol_5|}}}
| label41 = {{#if:{{{identification_symbol_6_label|}}}|{{{identification_symbol_6_label|}}}|Identification<br>symbol}}
| data41 = {{{identification_symbol_6|}}}
| header42 = {{#if:{{{aircraft_attack|}}}{{{aircraft_bomber|}}}{{{aircraft_electronic|}}}{{{aircraft_fighter|}}}{{{aircraft_interceptor|}}}{{{aircraft_patrol|}}}{{{aircraft_recon|}}}{{{aircraft_trainer|}}}{{{aircraft_transport|}}}{{{aircraft_tanker|}}}{{{aircraft_helicopter|}}}{{{aircraft_helicopter_attack|}}}{{{aircraft_helicopter_cargo|}}}{{{aircraft_helicopter_multirole|}}}{{{aircraft_helicopter_observation|}}}{{{aircraft_helicopter_trainer|}}}{{{aircraft_helicopter_utility|}}}{{{aircraft_general|}}} | Aircraft flown }}
| label43 = [[Attack aircraft|Attack]]
| data43 = {{{aircraft_attack|}}}
| label44 = [[Bomber]]
| data44 = {{{aircraft_bomber|}}}
| label45 = [[Electronic warfare|Electronic<br>warfare]]
| data45 = {{{aircraft_electronic|}}}
| label46 = [[Fighter aircraft|Fighter]]
| data46 = {{{aircraft_fighter|}}}
| label47 = [[Helicopter]]
| data47 = {{{aircraft_helicopter|}}}
| label48 = [[Attack helicopter]]
| data48 = {{{aircraft_helicopter_attack|}}}
| label49 = [[Cargo helicopter]]
| data49 = {{{aircraft_helicopter_cargo|}}}
| label50 = [[Multirole helicopter]]
| data50 = {{{aircraft_helicopter_multirole|}}}
| label51 = [[Observation helicopter]]
| data51 = {{{aircraft_helicopter_observation|}}}
| label52 = [[Trainer helicopter]]
| data52 = {{{aircraft_helicopter_trainer|}}}
| label53 = [[Utility helicopter]]
| data53 = {{{aircraft_helicopter_utility|}}}
| label54 = [[Interceptor aircraft|Interceptor]]
| data54 = {{{aircraft_interceptor|}}}
| label55 = [[Patrol aircraft|Patrol]]
| data55 = {{{aircraft_patrol|}}}
| label56 = [[Surveillance aircraft|Reconnaissance]]
| data56 = {{{aircraft_recon|}}}
| label57 = [[Trainer (aircraft)|Trainer]]
| data57 = {{{aircraft_trainer|}}}
| label58 = [[Cargo aircraft|Transport]]
| data58 = {{{aircraft_transport|}}}
| label59 = [[Aerial refueling|Tanker]]
| data59 = {{{aircraft_tanker|}}}
| data60 = {{{aircraft_general|}}}
| data61 = {{{misc|{{{module|}}}}}}
}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox military unit with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox military unit]] with unknown parameter "_VALUE_"|ignoreblank=y| aircraft_attack | aircraft_bomber | aircraft_electronic | aircraft_fighter | aircraft_general | aircraft_helicopter | aircraft_helicopter_attack | aircraft_helicopter_cargo | aircraft_helicopter_multirole | aircraft_helicopter_observation | aircraft_helicopter_trainer | aircraft_helicopter_utility | aircraft_interceptor | aircraft_patrol | aircraft_recon | aircraft_tanker | aircraft_trainer | aircraft_transport | allegiance | alt | anniversaries | battle_honours | battle_honours_label | battles | battles_label | branch | caption | ceremonial_chief | ceremonial_chief_label | colonel_of_the_regiment | colonel_of_the_regiment_label | colors | colors_label | colours | colours_label | command_sergeant_major | command_sergeant_major_label | command_structure | commander1 | commander1_label | commander2 | commander2_label | commander3 | commander3_label | commander4 | commander4_label | commander5 | commander5_label | commander6 | commander6_label | commander7 | commander7_label | commander8 | commander8_label | commander9 | commander9_label | countries | country | current_commander | current_commander_label | dates | decorations | disbanded | end_date | equipment | equipment_label | flying_hours | garrison | garrison_label | identification_symbol | identification_symbol_2 | identification_symbol_2_label | identification_symbol_3 | identification_symbol_3_label | identification_symbol_4 | identification_symbol_4_label | identification_symbol_5 | identification_symbol_5_label | identification_symbol_6 | identification_symbol_6_label | identification_symbol_label | image | image_size | march | mascot | misc | module | motto | native_name | nickname | notable_commanders | patron | role | size | specialization | start_date | type | unit_name | website }}<includeonly>{{short description|Military unit|2=noreplace}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
01758240c8ad335ee4eb92e9c72c53739871bb39
Template:Yesno-yes
10
258
626
625
2023-10-17T23:33:36Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Yesno-yes]]
wikitext
text/x-wiki
{{SAFESUBST:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|yes}}}|¬={{{¬|yes}}}|def={{{def|yes}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1644b79058ef2cece539a411edc164d98bb11ebe
Template:Hlist
10
259
628
627
2023-10-17T23:33:38Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Hlist]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|horizontal}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
9e3824c2e3c0e0dbef2f37556ac0b994987fecf9
Template:Military navigation
10
260
630
629
2023-10-17T23:33:48Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Military_navigation]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Military navigation|main}}</includeonly><noinclude>
{{Documentation|Wikipedia:WikiProject Military history/Military navigation}}
{{Sandbox other||
[[Category:Navigational box wrapper templates]]
[[Category:Military navigational boxes| ]]
}}</noinclude>
10eb2cd55540aab60dd8603c113e21995e9bb545
Template:WPMILHIST Infobox style
10
261
632
631
2023-10-17T23:33:49Z
LamayII
2
1 revision imported from [[:wikipedia:Template:WPMILHIST_Infobox_style]]
wikitext
text/x-wiki
<includeonly>{{#switch:{{{1|}}}
|main_box=class="{{#if:{{{2|}}}|infobox {{{2}}}|infobox}}" style="{{#invoke:Data|Module:WPMILHIST Infobox style|main_box_raw}}"
|{{#invoke:Data|Module:WPMILHIST Infobox style|{{{1|}}}}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
b117547056afc703e2f1371497b0a53fa5a22751
Module:Data
828
262
634
633
2023-10-17T23:33:49Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Data]]
Scribunto
text/plain
local mt = {}
function mt.__index(t, k)
return function(frame)
local data = mw.loadData(k)
local i = 1
for _,v in ipairs(frame.args) do
local ty = type(data)
if ty ~= 'table' then
local args = {}
for j = 1, i - 1 do
args[j] = frame.args[j]
end
if frame.args.softfail then
return '<span class="error">[[Category:Pages with failed Module:Data lookups]]Error: Tried to read index "' .. mw.text.nowiki(v) .. '" of mw.loadData("' .. mw.text.nowiki(k) .. '").' .. mw.text.nowiki(table.concat(args, '.')) .. ', which is a ' .. ty .. '</span>'
else
error('Tried to read index "' .. v .. '" of mw.loadData("' .. k .. '").' .. table.concat(args, '.') .. ', which is a ' .. ty)
end
end
data = data[v]
i = i + 1
end
return data
end
end
return setmetatable({}, mt)
654c5ba2e0c73e7415457ca7a67fe0dfacfdba3b
Module:Military navigation
828
263
636
635
2023-10-17T23:33:50Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Military_navigation]]
Scribunto
text/plain
local p = { }
local Navbox = require('Module:Navbox')
local Styles = require('Module:WPMILHIST Infobox style')
local function isblank(s)
return (not s) or s == ''
end
local function isnotblank(s)
return s and s ~= ''
end
function p.main(frame)
local args = { }
local pargs = frame:getParent().args
local sargs = {}
local tcats = ''
-- process bodystyle and titlestyle
if (pargs['style'] or '') == 'wide' then
args['titlestyle'] = Styles['nav_box_wide_header']
args['bodystyle'] = Styles['nav_box_wide']
else
args['titlestyle'] = Styles['nav_box_header']
if (pargs['border'] or '') == 'child' or
(pargs['border'] or '') == 'subgroup' then
args['bodystyle'] = Styles['nav_box_child']
tcats = tcats .. '[[Category:Pages using military navigation subgroups without wide style]]'
else
args['bodystyle'] = Styles['nav_box']
end
end
sargs['titlestyle'] = 1
sargs['bodystyle'] = 1
-- process groupstyle, abovestyle, belowstyle
args['groupstyle'] = Styles['nav_box_label'] .. (pargs['groupstyle'] or '')
sargs['groupstyle'] = 1
args['abovestyle'] = Styles['nav_box_label'] .. (pargs['abovestyle'] or '')
sargs['abovestyle'] = 1
args['belowstyle'] = Styles['nav_box_label'] .. (pargs['belowstyle'] or '')
sargs['belowstyle'] = 1
-- process oddstyle, evenstyle
args['oddstyle'] = isnotblank(pargs['odd_color'])
and ('background:' .. pargs['odd_color']) or nil
sargs['oddstyle'] = 1
args['evenstyle'] = isnotblank(pargs['even_color'])
and ('background:' .. pargs['even_color']) or nil
sargs['evenstyle'] = 1
-- process name and rawname
args['name'] = (isnotblank(pargs['name']) and pargs['name']) or pargs['rawname']
if isblank(args['name']) then args['navbar'] = 'plain' end
sargs['name'] = 1
sargs['rawname'] = 1
-- copy the remaining args
for k, v in pairs(pargs) do
if v and v ~= '' and sargs[k] == nil then
args[k] = v
end
end
-- add allow wrap
if args['title'] and (pargs['style'] or '') ~= 'wide' then
if not mw.ustring.match(args['title'], '<span class="wrap">') then
-- probably a more efficient way to match 15 or more characters
local m = '[^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|]'
m = m .. m .. m
args['title'] = mw.ustring.gsub(args['title'],
'%[%[(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%1</span>]]')
args['title'] = mw.ustring.gsub(args['title'],
'%[%[([^%[%]<>|]*)|(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%2</span>]]')
end
end
-- add navbox-vertical for non-wide format
if (pargs['style'] or '') ~= 'wide' then
args['bodyclass'] = 'navbox-vertical' .. (args['bodyclass'] and (' ' .. args['bodyclass']) or '')
end
return tcats .. Navbox._navbox(args)
end
return p
26dd1b8952c65fbc4d05e418e8d7c3daed93fa49
Module:WPMILHIST Infobox style
828
264
638
637
2023-10-17T23:33:50Z
LamayII
2
1 revision imported from [[:wikipedia:Module:WPMILHIST_Infobox_style]]
Scribunto
text/plain
local retval = {
main_box_raw_auto_width = 'border-spacing:2px;',
header_raw = 'background-color:#C3D6EF;text-align:center;vertical-align:middle;font-size:110%;',
sub_header_raw = 'background-color:#DCDCDC;text-align:center;vertical-align:middle;',
header_color = 'background-color:#C3D6EF;',
nav_box = 'margin:0;float:right;clear:right;width:25.5em;margin-bottom:0.5em;margin-left:1em;',
nav_box_child = 'margin:0;float:right;clear:right;width:25em;margin-bottom:0.5em;',
nav_box_wide = '',
nav_box_header = 'background-color:#C3D6EF;',
nav_box_wide_header = 'background-color:#C3D6EF;',
nav_box_label = 'background-color:#DCDCDC;',
image_box_raw = 'text-align:center;border-bottom:1px solid #aaa;line-height:1.5em;',
image_box_plain_raw = 'text-align:center;line-height:1.5em;',
internal_border = '1px dotted #aaa;',
section_border = '1px solid #aaa;'
}
retval.main_box_raw = 'width:25.5em;' .. retval.main_box_raw_auto_width
retval.header_bar = 'style="' .. retval.header_raw .. '"'
retval.sub_header_bar = 'style="' .. retval.sub_header_raw .. '"'
retval.image_box = 'style="' .. retval.image_box_raw .. '"'
retval.image_box_plain = 'style="' .. retval.image_box_plain_raw .. '"'
return retval
0f9ea47bc17e40cdabbae6de54f63e40ae502f8e
Template:Large
10
265
640
639
2023-10-17T23:33:51Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Large]]
wikitext
text/x-wiki
<span style="font-size:120%">{{{1}}}</span><noinclude>
{{Documentation}}
</noinclude>
8ba6ec8c3178e22dc1f05aa239df8a2b052be668
Template:Infobox service record
10
266
642
641
2023-10-17T23:33:55Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_service_record]]
wikitext
text/x-wiki
<noinclude>{{Being deleted|2022 April 30|Template:Infobox ship begin|merge= Template:Infobox ship}}</noinclude><includeonly>{{#switch:{{#ifeq:{{{is_ship|}}}|yes|1|0}}{{#ifeq:{{{is_multi|}}}|yes|1|0}}|
|00 = <table {{WPMILHIST Infobox style|main_box}}><!-- standalone -->
|#default = }}<!-- not standalone (in a primary infobox)
-->{{#ifeq:{{{is_ship|}}}|yes|<tr><!-- here for ship -->
<th colspan="2" {{WPMILHIST Infobox style|header_bar}}>{{#if:{{{label|}}}|{{{label|}}}|Service record}}</th>
</tr>
{{#if:{{{partof|}}}|<tr><td>Part of:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{partof}}}}}</td></tr>
}}{{#if:{{{codes|}}}|<tr><td>Identification codes:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{codes}}}}}</td></tr>
}}{{#if:{{{commanders|}}}|<tr><td>Commanders:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{commanders}}}}}</td></tr>
}}{{#if:{{{operations|}}}|<tr><td>Operations:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{operations}}}}}</td></tr>
}}{{#if:{{{victories|}}}|<tr><td>Victories:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{victories}}}}}</td></tr>
}}{{#if:{{{awards|}}}|<tr><td>Awards:</td><td>
{{#invoke:WPSHIPS utilities|unbulleted_list|{{{awards}}}}}</td></tr>
}}|<tr><!-- here for non-ship -->
<th colspan="2" {{WPMILHIST Infobox style|header_bar}}>{{#if:{{{label|}}}|{{{label|}}}|Service record}}</th>
</tr>
{{#if:{{{partof|}}}|<tr><th style="padding-right: 1em;">Part of</th><td>
{{{partof}}}</td></tr>
}}{{#if:{{{codes|}}}|<tr><th style="padding-right: 1em;">Identification codes</th><td>
{{{codes}}}</td></tr>
}}{{#if:{{{commanders|}}}|<tr><th style="padding-right: 1em;">Commanders</th><td>
{{{commanders}}}</td></tr>
}}{{#if:{{{operations|}}}|<tr><th style="padding-right: 1em;">Operations</th><td>
{{{operations}}}</td></tr>
}}{{#if:{{{victories|}}}|<tr><th style="padding-right: 1em;">Victories</th><td>
{{{victories}}}</td></tr>
}}{{#if:{{{awards|}}}|<tr><th style="padding-right: 1em;">Awards</th><td>
{{{awards}}}</td></tr>
}}}}{{#switch:{{#ifeq:{{{is_ship|}}}|yes|1|0}}{{#ifeq:{{{is_multi|}}}|yes|1|0}}|
|00 = </table>
|#default = }}</includeonly><noinclude>
{{convert to use Infobox}}
{{documentation}}
</noinclude>
f7f64fe650c609522ae5737c494edc577cf855e4
Template:Infobox command structure
10
267
644
643
2023-10-17T23:33:57Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_command_structure]]
wikitext
text/x-wiki
<includeonly>{{military navigation
|raw_name = {{{raw_name|}}}
|title = {{{name|{{PAGENAMEBASE}}}}} {{#if:{{{date|}}}|({{{date}}})}}
|bodyclass= {{{bodyclass|}}}
|group1 = {{#if:{{{parent|}}}|Parent unit}}
|list1 = {{#if:{{{parent|}}}|{{{parent}}}}}
|group2 = {{#if:{{{subordinate|}}}|Components}}
|list2 = {{#if:{{{subordinate|}}}|{{{subordinate}}}}}
}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox command structure with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox command structure]] with unknown parameter "_VALUE_"|ignoreblank=y| bodyclass | date | name | parent | raw_name | subordinate }}<noinclude>
{{documentation}}
</noinclude>
0222856a8bdc4a20c67c6fd07070c8fda0e927a2
Template:Microformat message
10
268
646
645
2023-10-17T23:33:57Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Microformat_message]]
wikitext
text/x-wiki
The [[Help:HTML in wikitext|HTML mark-up]] produced by this template includes {{#if:{{{type|}}} |{{{type}}} |an [[{{{format}}} microformat]]}} that makes {{{data}}} readily [[Parsing|parsable]] by computer programs. This aids tasks such as the cataloguing of articles and maintenance of databases. For more information about the use of microformats on Wikipedia, please visit [[Wikipedia:WikiProject Microformats|the Microformat WikiProject]].<!--
-->{{#if:{{{subtemplates<includeonly>|</includeonly>}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{large|Subtemplates}}
{{{subtemplates}}}
'''''Please do not remove instances of these subtemplates.'''''
</div>}}<!--
-->{{#if:{{{subsection1|}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;"><!--(newline in case subsection begins with heading:)-->
{{{subsection1}}}
</div>}}<!--
-->{{#if:{{{1<includeonly>|</includeonly>}}} <!--(i.e. if at least one unnamed parameter supplied:)-->
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{large|Classes used}}
The [[HTML attribute|HTML class]]es of this microformat include:
: {{hlist
|item_style=font-size:110%;{{{itemstyle|}}}
|{{{1}}} |{{{2<includeonly>|</includeonly>}}} |{{{3|<noinclude>{{nobold|……}}</noinclude>}}}
|{{{4|}}} |{{{5|}}} |{{{6|}}} |{{{7|}}} |{{{8|}}} |{{{9|}}} |{{{10|}}} |{{{11|}}} |{{{12|}}} |{{{13|}}} |{{{14|}}} |{{{15|}}} |{{{16|}}} |{{{17|}}} |{{{18|}}} |{{{19|}}} |{{{20|}}}
}} </div>
{{longitem|style=line-height:1.3em|'''''Please do not rename or remove these classes{{#if:{{{nocollapse<includeonly>|</includeonly>}}} |<br/>nor collapse nested elements which use them}}.'''''}}<!--
-->}}<!--(end #if:[1])--><noinclude>
{{Documentation}}
</noinclude>
25d8c54d56c1c64f1b98e6c8b2a50054e6a9deb5
Template:UF-hcard-org
10
269
648
647
2023-10-17T23:33:59Z
LamayII
2
1 revision imported from [[:wikipedia:Template:UF-hcard-org]]
wikitext
text/x-wiki
{{Microformat message
| format = hCard
| data = an organization's details
| subtemplates =
* Use {{#ifeq:{{yesno-yes|{{{age|}}}}}|yes|{{tl|Start date and age}}|{{tl|Start date}}}} for the date on which an organisation was "established", "founded", "opened" or otherwise started, [[Wikipedia:WikiProject Microformats/dates|unless that date is before 1583 CE]].
* Use {{tl|URL}} for an organisation's URL.
|adr |agent |category |country-name |extended-address |fn |geo |label |latitude |locality |longitude |nickname |note |org |region |street-address |url |vcard
| nocollapse = on
}}<includeonly>{{sandbox other||
[[Category:Templates generating hCards]]
}}</includeonly><noinclude>
{{Documentation |content={{Microformat message templates}}}}
[[Category:Microformat (uF) message templates]]
[[Category:Templates generating hCards| ]]
</noinclude>
631bc99cd046167681b6eb518559d92fc65a4920
Template:Command structure/doc
10
270
650
649
2023-10-17T23:33:59Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Command_structure/doc]]
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox command structure/doc]]
72133518cc1e5fc21c0f32cd8a42ae6c98d84e28
Template:Infobox command structure/doc
10
271
652
651
2023-10-17T23:34:00Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_command_structure/doc]]
wikitext
text/x-wiki
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
{{#ifeq:{{{noheader|}}}|yes||{{Documentation subpage}}
==Usage==
}}
==== Command structure box ====
{{Infobox command structure
| bodyclass = plainlist
| name = 12th Infantry Division
| date = 1941–1943
| parent = [[XVII Corps (United Kingdom)|XVII Corps]]
| subordinate =
* 17th Mechanized Regiment
* 51st Light Infantry Regiment
* 53rd Infantry Regiment
* 107th Artillery Brigade
}}
A command structure box may be used to summarize information about an individual military unit's parent and subordinate units; it should generally be used in conjunction with {{tlx|Infobox military unit}}. If needed, multiple boxes may be used to show the unit's command structure during different periods.
The box should be added using the {{tlx|Infobox command structure}} template, as shown below:
<div style="width:350px;background:#dddddd;border: 1px solid black;"><syntaxhighlight lang="wikitext" style="overflow:auto; margin:0.5em">
{{Infobox command structure
| name =
| date =
| parent =
| subordinate =
}}
</syntaxhighlight></div>
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
* '''name''' – the name of the unit or formation.
* '''date''' – ''optional'' – the dates during which the given structure was in place.
* '''parent''' – ''optional'' – the unit's parent unit.
* '''subordinate''' – ''optional'' – the unit's subordinate units. <noinclude>[[Category:WikiProject Military history template instructions|Command structure box]]</noinclude>
<includeonly>{{Sandbox other||
{{#ifeq:{{{noheader|}}}|yes||
[[Category:Military auxiliary infobox templates|Command structure]]
}}}}</includeonly>
2651b99c1bdf7a14acb98cc60f6372038868fa29
Template:Infobox military unit/doc
10
272
654
653
2023-10-17T23:34:03Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_military_unit/doc]]
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) -->
{{High-use}}
{{auto short description}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
== Usage ==
=== Military unit infobox ===
A military unit infobox may be used to summarize information about an individual military unit or formation, such as a regiment or division.
The infobox should be added using the {{tlx|Infobox military unit}} template, as shown below:
{{Parameter names example
| unit_name
| native_name
| image
| image_size
| alt
| caption
| dates = {{unbulleted list|{{{dates}}}|''or:'' {{{start_date}}}–{{{end_date}}}}}
| <!-- start_date -->
| <!-- end_date -->
| disbanded
| country = {{unbulleted list|{{{country}}}|''or:'' {{{countries}}}}}
| <!-- countries -->
| allegiance
| branch
| type
| role
| specialization
| size
| command_structure
| garrison
| <!-- garrison_label -->
| nickname
| patron
| motto
| colors
| <!-- colors_label -->
| march
| mascot
| anniversaries
| equipment
| <!-- equipment_label -->
| battles
| <!-- battles_label -->
| decorations
| battle_honours
| <!-- battle_honours_label -->
| flying_hours
| website
|
| current_commander
| commander1 = {{unbulleted list|{{{current_commander}}}|''or:'' {{{commander1}}}}}
| <!-- commander1_label -->
| <!-- current_commander_label -->
|
| ceremonial_chief
| commander2 = {{unbulleted list|{{{ceremonial_chief}}}|''or:'' {{{commander2}}}}}
| <!-- commander2_label -->
| <!-- ceremonial_chief_label -->
|
| commander3 = {{unbulleted list|{{{colonel_of_the_regiment}}}|''or:'' {{{commander3}}}}}
| <!-- commander3_label -->
| <!-- colonel_of_the_regiment_label -->
|
| commander4 = {{unbulleted list|{{{command_sergeant_major}}}|''or:'' {{{commander4}}}}}
| command_sergeant_major
| <!-- commander4_label -->
| <!-- command_sergeant_major_label -->
|
| commander5
| <!-- commander5_label -->
| commander6
| <!-- commander6_label -->
| commander7
| <!-- commander7_label -->
| commander8
| <!-- commander8_label -->
| commander9
| <!-- commander9_label -->
| notable_commanders
|
| identification_symbol
| <!-- identification_symbol_label -->
| identification_symbol_2
| <!-- identification_symbol_2_label -->
| identification_symbol_3
| <!-- identification_symbol_3_label -->
| identification_symbol_4
| <!-- identification_symbol_4_label -->
| identification_symbol_5
| <!-- identification_symbol_5_label -->
| identification_symbol_6
| <!-- identification_symbol_6_label -->
|
| aircraft_attack
| aircraft_bomber
| aircraft_electronic
| aircraft_fighter
| aircraft_helicopter
| aircraft_helicopter_attack
| aircraft_helicopter_cargo
| aircraft_helicopter_multirole
| aircraft_helicopter_observation
| aircraft_helicopter_trainer
| aircraft_helicopter_utility
| aircraft_interceptor
| aircraft_patrol
| aircraft_recon
| aircraft_trainer
| aircraft_transport
| aircraft_tanker
| aircraft_general
}}
<div style="width:400px;background:#dddddd;border: 1px solid black;"><syntaxhighlight lang="wikitext" style="overflow:auto; margin:0.5em">
{{Infobox military unit
| unit_name =
| native_name =
| image =
| image_size =
| alt =
| caption =
| dates = <!-- or | start_date = | end_date = -->
| disbanded =
| country = <!-- or | countries = -->
| allegiance =
| branch =
| type =
| role = <!-- or | specialization = -->
| size =
| command_structure =
| garrison =
| garrison_label =
| nickname =
| patron =
| motto =
| colors = <!-- or | colours = -->
| colors_label = <!-- or | colours_label = -->
| march =
| mascot =
| anniversaries =
| equipment =
| equipment_label =
| battles =
| battles_label =
| decorations =
| battle_honours =
| battle_honours_label =
| flying_hours =
| website =
<!-- Commanders -->
| current_commander =
| commander1 =
| commander1_label =
| commander2 =
| commander2_label =
| commander3 =
| commander3_label =
| commander4 =
| commander4_label =
| commander5 =
| commander5_label =
| commander6 =
| commander6_label =
| commander7 =
| commander7_label =
| commander8 =
| commander8_label =
| commander9 =
| commander9_label =
| notable_commanders =
<!-- Insignia -->
| identification_symbol =
| identification_symbol_label =
| identification_symbol_2 =
| identification_symbol_2_label =
| identification_symbol_3 =
| identification_symbol_3_label =
| identification_symbol_4 =
| identification_symbol_4_label =
| identification_symbol_5 =
| identification_symbol_5_label =
| identification_symbol_6 =
| identification_symbol_6_label =
<!-- Aircraft -->
| aircraft_attack =
| aircraft_bomber =
| aircraft_electronic =
| aircraft_fighter =
| aircraft_helicopter =
| aircraft_helicopter_attack =
| aircraft_helicopter_cargo =
| aircraft_helicopter_multirole =
| aircraft_helicopter_observation =
| aircraft_helicopter_trainer =
| aircraft_helicopter_utility =
| aircraft_interceptor =
| aircraft_patrol =
| aircraft_recon =
| aircraft_trainer =
| aircraft_transport =
| aircraft_tanker =
| aircraft_general =
}}
</syntaxhighlight></div>
{{clear}}
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
* '''unit_name''' – The formal name of the unit in English.
* '''native_name''' – ''optional'' – The formal name of the unit in the local language, if different from '''unit_name''', and if not English. This will display under the unit_name.
* '''image''' – ''optional'' – An image of the unit insignia ([[cap badge]]s, [[tartan]] or [[Colours, standards and guidons|colours]]), if available; other images may be used if this cannot be obtained. The image should be given in the form <code>Example.jpg</code>.
* '''image_size''' – ''optional'' – Used to override the default image width of 200 pixels. It should be written as <code>200px</code>.
* '''alt''' – ''optional'' – Alternative text for visually impaired users, see [[WP:ALT]].
* '''caption''' – ''optional'' – The text to be placed below the image.
* '''dates''' – The period (usually in years) when the unit was active; alternately, the dates may be indicated by using one—or both—of the separate '''start_date''' and '''end_date''' parameters.
* '''country''' – ''optional'' – If the unit is part of the armed forces of a sovereign state, the name of that state.
* '''allegiance''' – ''optional'' – Used to indicate the allegiance of units which are not part of the regular armed forces of a sovereign state; can usually be omitted otherwise. In the case of National Guard or Naval Militia units, the State of origin should be indicated.
* '''branch''' – ''optional'' – The service branch, in militaries that have them; typically army, navy, air force, etc.
* '''type''' – ''optional'' – The general type of unit, e.g., cavalry, infantry, artillery, etc. More specific types (airborne infantry, light cavalry, etc.) may be given as appropriate.
* '''role''' – ''optional'' – Typical strategic or tactical use of unit, e.g., shock troop, special operations, mechanized infantry, ceremonial guard, etc.
* '''size''' – ''optional'' – The size of the unit; this may include both average and lifetime figures, and should indicate equipment (planes, tanks, cannon, etc.) where applicable. For U.S. units, this should only include Organic elements, not Assigned or Attached elements.
* '''command_structure''' – ''optional'' – The larger unit(s) of which the unit is a part. This should not be used to provide an exhaustive history of the unit, which is more appropriate in the article itself, for units existing over a long period. For complicated cases, using the [[#Command structure box|auxiliary command structure box]] may be appropriate.
* '''garrison''' – ''optional'' – Location of the unit's home base; this is generally applicable only to units in existence.
* '''garrison_label''' – ''optional'' – The label to use for the garrison field (above).
* '''nickname''' – ''optional'' – Any commonly-used nicknames for the unit.
* '''patron''' – ''optional'' – The patron the unit was named after; this is only applicable in armed forces where units are named after individuals.
* '''motto''' – ''optional'' – The official unit motto (with translation, if necessary).
* '''colors''' – ''optional'' – The unit colors; this may refer to either the actual colors used on the uniform, or to the [[Colours, standards and guidons|colours]] of the unit.
* '''colors_label''' – ''optional'' – the label to use for the colors field (above).
* '''march''' – ''optional'' – The tune(s) commonly or officially played when the unit ceremonially marches; there may be several.
* '''mascot''' – ''optional'' – Any official or unofficial animal or character maintained by the unit.
* '''equipment''' – ''optional'' – For units strongly associated with specific equipment or vehicles, such as tanks, artillery, or aircraft, a ''brief'' list of the notable types used by the unit; if the number of entries is large, it is recommended that this field not be used, and that the full list be given in the article text instead.
* '''equipment_label''' – ''optional'' – The label to use for the equipment field (above).
* '''battles''' – ''optional'' – Any notable engagements in which the unit participated. The decision of what constitutes a notable engagement is left to the editors of the specific article.
* '''battles_label''' – ''optional'' – The label to use for the battles field (above); this defaults to "Engagements" if left blank.
* '''anniversaries''' – ''optional'' – Any anniversaries that a unit celebrates.
* '''decorations''' – ''optional'' – Any decorations (such as the [[Presidential Unit Citation (United States)|Presidential Unit Citation]]) that the unit as a whole has received.
* '''battle_honours''' – ''optional'' – For units in countries that award some type of formal [[battle honour]]s, the battle honours that the unit has received; while this may have some overlap with the ''battles'' field above, the two are not necessarily equivalent.
* '''battle_honours_label''' – ''optional'' – The label to use for the battle_honours field (above); this defaults to "[[Battle honour]]s" if left blank.
* '''disbanded''' – ''optional'' – For units that have been disbanded, the dates and any other relevant notes regarding the disbanding.
* '''flying_hours''' – ''optional'' – If the formation is an aerial one, the total hours flown.
* '''website''' – ''optional'' – The official website of the formation, if any.
Commander parameters:
The infobox allows for up to three current commanders to be specified; the exact roles or titles of these individuals should be specified via the corresponding label parameters.
* '''commander1''' – ''optional'' – A current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander1_label''' – ''optional'' – The label to use for the field above; for historical reasons, this defaults to "Current commander" if left blank.
* '''commander2''' – ''optional'' – A second current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander2_label''' – ''optional'' – The label to use for the field above; for historical reasons, this defaults to "Ceremonial chief" if left blank.
* '''commander3''' – ''optional'' – A third current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander3_label''' – ''optional'' – The label to use for the field above; for historical reasons, this defaults to "Colonel of the Regiment" if left blank.
* '''commander4''' – ''optional'' – A fourth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander4_label''' – ''optional'' – The label to use for the field above; for historical reasons, this defaults to "Command Sergeant Major" if left blank.
* '''commander5''' – ''optional'' – A fifth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander5_label''' – ''optional'' – The label to use for the field above; defaults to "Commander".
* '''commander6''' – ''optional'' – A sixth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander6_label''' – ''optional'' – The label to use for the field above; defaults to "Commander".
* '''commander7''' – ''optional'' – A seventh current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander7_label''' – ''optional'' – The label to use for the field above; defaults to "Commander".
* '''commander8''' – ''optional'' – An eighth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander8_label''' – ''optional'' – The label to use for the field above; defaults to "Commander".
* '''commander9''' – ''optional'' – A ninth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.
* '''commander9_label''' – ''optional'' – The label to use for the field above; defaults to "Commander".
* '''notable_commanders''' – ''optional'' – Any notable former commanders of the unit; judgement of notability is left to individual article editors.
Insignia parameters:
* '''identification_symbol''' – ''optional'' – The unit's identification symbol (such as a [[tartan]], tactical identification patch or [[morale patch]]).
* '''identification_symbol_label''' – ''optional'' – The label to use for the identification symbol field (above).
* '''identification_symbol_2''' – ''optional'' – Another identification symbol.
* '''identification_symbol_2_label''' – ''optional'' – The label to use for the second identification symbol field (above).
* '''identification_symbol_3''' – ''optional'' – Another identification symbol.
* '''identification_symbol_3_label''' – ''optional'' – The label to use for the third identification symbol field (above).
* '''identification_symbol_4''' – ''optional'' – Another identification symbol.
* '''identification_symbol_4_label''' – ''optional'' – The label to use for the fourth identification symbol field (above).
* '''identification_symbol_5''' – ''optional'' – Another identification symbol.
* '''identification_symbol_5_label''' – ''optional'' – The label to use for the fifth identification symbol field (above).
* '''identification_symbol_6''' – ''optional'' – Another identification symbol.
* '''identification_symbol_6_label''' – ''optional'' – The label to use for the sixth identification symbol field (above).
Aircraft parameters:
* '''aircraft_attack''' – ''optional'' – For aviation units, the attack aircraft flown by the unit.
* '''aircraft_bomber''' – ''optional'' – For aviation units, the bomber aircraft flown by the unit.
* '''aircraft_electronic''' – ''optional'' – For aviation units, the electronic warfare aircraft flown by the unit.
* '''aircraft_fighter''' – ''optional'' – For aviation units, the fighter aircraft flown by the unit.
* '''aircraft_helicopter''' – ''optional'' – For aviation units, the helicopter aircraft flown by the unit.
* '''aircraft_helicopter_attack''' – ''optional'' – For aviation units, the attack helicopter aircraft flown by the unit.
* '''aircraft_helicopter_cargo''' – ''optional'' – For aviation units, the cargo helicopter aircraft flown by the unit.
* '''aircraft_helicopter_multirole''' – ''optional'' – For aviation units, the multirole helicopter aircraft flown by the unit.
* '''aircraft_helicopter_observation''' – ''optional'' – For aviation units, the observation helicopter aircraft flown by the unit.
* '''aircraft_helicopter_trainer''' – ''optional'' – For aviation units, the trainer helicopter aircraft flown by the unit.
* '''aircraft_helicopter_utility''' – ''optional'' – For aviation units, the utility helicopter aircraft flown by the unit.
* '''aircraft_interceptor''' – ''optional'' – For aviation units, the interceptor aircraft flown by the unit.
* '''aircraft_patrol''' – ''optional'' – For aviation units, the patrol aircraft flown by the unit.
* '''aircraft_recon''' – ''optional'' – For aviation units, the reconnaissance aircraft flown by the unit.
* '''aircraft_trainer''' – ''optional'' – For aviation units, the trainer aircraft flown by the unit.
* '''aircraft_transport''' – ''optional'' – For aviation units, the transport aircraft flown by the unit.
* '''aircraft_tanker''' – ''optional'' – For aviation units, the aerial refueling aircraft flown by the unit.
* '''aircraft_general''' – ''optional'' – For aviation units, where aircraft used do not fit well into the above categories.
Note that the various <code>xyz_label</code> fields above are intended for overriding the default labels on these fields as needed for particular countries or services; in most cases, however, the default value is sufficient, and the fields need not be included.
{{Command structure/doc|noheader=yes}}
{{Service record/doc|noheader=yes}}
== Example ==
{{Infobox military unit
| unit_name = 502nd Parachute Infantry Regiment
| image = 502 Parachute Infantry Regiment COA.PNG
| caption = 502d PIR Coat of Arms
| nickname = "Five-Oh-Deuce" or "The Deuce"
| motto = ''Strike''
| colors =
| march =
| ceremonial_chief =
| type = [[Parachute infantry]]
| branch = [[United States Army|Army]]
| dates = 1942–present
| country = United States
| allegiance =
| command_structure = [[101st Airborne Division]]
| size =
| specialization =
| current_commander =
| garrison = [[Fort Campbell]]
| garrison_label =
| battles = World War II
*[[Western Front (World War II)|European War]]
*[[Invasion of Normandy|Battle of Normandy]]
*[[Operation Market Garden]]
*[[Battle of the Bulge]]
[[War on Terrorism]]
*[[Iraq War]]
**[[Operation Iraqi Freedom]]
| notable_commanders = {{unbulleted list|[[George V. H. Moseley, Jr.]]|[[John H. Michaelis]]}}
| anniversaries =
| decorations = {{unbulleted list|[[Presidential Unit Citation (United States)|Presidential Unit Citation]] (5)|[[Valorous Unit Award]] (5)|[[Croix de Guerre]]}}
}}
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Infobox military unit
| unit_name = 502nd Parachute Infantry Regiment
| image = 502 Parachute Infantry Regiment COA.PNG
| caption = 502d PIR Coat of Arms
| nickname = "Five-Oh-Deuce" or "The Deuce"
| motto = ''Strike''
| colors =
| march =
| ceremonial_chief =
| type = [[Parachute infantry]]
| branch = [[United States Army|Army]]
| dates = 1942–present
| country = United States
| allegiance =
| command_structure = [[101st Airborne Division]]
| size =
| specialization =
| current_commander =
| garrison = [[Fort Campbell]]
| garrison_label =
| battles = World War II
*[[Western Front (World War II)|European War]]
*[[Invasion of Normandy|Battle of Normandy]]
*[[Operation Market Garden]]
*[[Battle of the Bulge]]
[[War on Terrorism]]
*[[Iraq War]]
**[[Operation Iraqi Freedom]]
| notable_commanders = {{unbulleted list|[[George V. H. Moseley, Jr.]]|[[John H. Michaelis]]}}
| anniversaries =
| decorations = {{unbulleted list|[[Presidential Unit Citation (United States)|Presidential Unit Citation]] (5)|[[Valorous Unit Award]] (5)|[[Croix de Guerre]]}}
}}
</syntaxhighlight>
{{clear}}
== Microformat ==
{{UF-hcard-org}}
== TemplateData ==
{{collapse top|[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": "A military unit infobox may be used to summarize information about an individual military unit or formation, such as a regiment or division.",
"format": "{{_\n| _____________________________ = _\n}}\n",
"params": {
"unit_name": {
"type": "line",
"required": true,
"label": "Unit Name",
"description": "The formal name of the unit."
},
"image": {
"type": "wiki-file-name",
"label": "Unit Insignia Image",
"description": "An image of the unit insignia (cap badges, tartan or colours), if available; other images may be used if this cannot be obtained. The image must be given in the form Example.jpg."
},
"image_size": {
"type": "string",
"label": "Image size",
"description": "Used to override the default image width of 200 pixels. It should be written as 200px."
},
"alt": {
"type": "string",
"label": "Alternative text for image",
"description": "Alternative text for visually impaired users, see WP:ALT."
},
"caption": {
"type": "string",
"label": "Caption",
"description": "The text to be placed below the image."
},
"dates": {
"type": "string",
"required": true,
"label": "Time Period Active",
"description": "The period (usually in years) when the unit was active; alternately, the dates may be indicated by using one—or both—of the separate Start Date and End Date parameters.",
"aliases": [
"start_date",
"end_date"
]
},
"country": {
"type": "string/line",
"label": "Country",
"description": "If the unit is part of the armed forces of a sovereign state, the name of that state."
},
"allegiance": {
"type": "string/line",
"label": "Allegiance",
"description": "Used to indicate the allegiance of units which are not part of the regular armed forces of a sovereign state; can usually be omitted otherwise. In the case of National Guard or Naval Militia units, the State of origin should be indicated."
},
"branch": {
"type": "string/line",
"label": "Branch",
"description": "The service branch, in militaries that have them; typically army, navy, air force, etc."
},
"type": {
"type": "string",
"label": "Type",
"description": "The general type of unit, e.g., cavalry, infantry, artillery, etc. More specific types (airborne infantry, light cavalry, etc.) may be given as appropriate."
},
"role": {
"type": "string",
"label": "Role",
"description": "Typical strategic or tactical use of unit, e.g., shock troop, special operations, mechanized infantry, ceremonial guard, etc.",
"aliases": [
"specialization"
]
},
"size": {
"type": "string",
"label": "Size",
"description": "The size of the unit; this may include both average and lifetime figures, and should indicate equipment (planes, tanks, cannon, etc.) where applicable. For U.S. units, this should only include Organic elements, not Assigned or Attached elements."
},
"command_structure": {
"type": "string",
"label": "Command Structure",
"description": "The larger unit(s) of which the unit is a part. This should not be used to provide an exhaustive history of the unit, which is more appropriate in the article itself, for units existing over a long period. For complicated cases, using the auxiliary command structure box may be appropriate."
},
"garrison": {
"type": "string/line",
"label": "Garrison",
"description": "Location of the unit's home base; this is generally applicable only to units in existence."
},
"garrison_label": {
"type": "line",
"label": "Garrison Label",
"description": "The label to use for the Garrison field."
},
"nickname": {
"type": "string",
"label": "Nickname(s)",
"description": "Any commonly-used nicknames for the unit."
},
"patron": {
"type": "line",
"label": "Patron",
"description": "The patron the unit was named after; this is only applicable in armed forces where units are named after individuals."
},
"motto": {
"type": "content",
"label": "Motto",
"description": "The official unit motto (with translation, if necessary)."
},
"colors": {
"type": "string",
"label": "Colors",
"description": "The unit colors; this may refer to either the actual colors used on the uniform, or to the colours of the unit.",
"aliases": [
"colours"
]
},
"colors_label": {
"type": "line",
"label": "Colors Label",
"description": "The label to use for the Colors field.",
"aliases": [
"colours_label"
]
},
"march": {
"type": "string",
"label": "March(es)",
"description": "The tune(s) commonly or officially played when the unit ceremonially marches; there may be several."
},
"mascot": {
"type": "string",
"label": "Mascot",
"description": "Any official or unofficial animal or character maintained by the unit."
},
"equipment": {
"type": "string",
"label": "Equipment",
"description": "For units strongly associated with specific equipment or vehicles, such as tanks, artillery, or aircraft, a brief list of the notable types used by the unit; if the number of entries is large, it is recommended that this field not be used, and that the full list be given in the article text instead."
},
"equipment_label": {
"type": "line",
"label": "Equipment Label",
"description": "The label to use for the Equipment field."
},
"battles": {
"type": "string",
"label": "Battles",
"description": "Any notable engagements in which the unit participated. The decision of what constitutes a notable engagement is left to the editors of the specific article."
},
"battles_label": {
"type": "line",
"label": "Battles Label",
"description": "The label to use for the Battles field; this defaults to \"Engagements\" if left blank."
},
"anniversaries": {
"type": "string",
"label": "Anniversaries",
"description": "Any anniversaries that a unit celebrates."
},
"decorations": {
"type": "string",
"label": "Decorations",
"description": "Any decorations (such as the Presidential Unit Citation) that the unit as a whole has received."
},
"battle_honours": {
"type": "string",
"label": "Battle Honours",
"description": "For units in countries that award some type of formal battle honours, the battle honours that the unit has received; while this may have some overlap with the battles field above, the two are not necessarily equivalent."
},
"battle_honours_label": {
"type": "line",
"label": "Battle Honours Label",
"description": "The label to use for the Battle Honours field; this defaults to \"Battle honours\" if left blank.",
"example": "Accolades"
},
"disbanded": {
"type": "date",
"label": "Disbanded Date",
"description": "For units that have been disbanded, the dates and any other relevant notes regarding the disbanding."
},
"flying_hours": {
"type": "line",
"label": "Flying Hours",
"description": "If the formation is an aerial one, the total hours flown."
},
"website": {
"type": "url",
"label": "Website",
"description": "The official website of the formation, if any."
},
"commander1": {
"type": "string",
"label": "Commander 1",
"description": "A current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.",
"aliases": [
"current_commander"
]
},
"commander1_label": {
"type": "line",
"label": "Commander 1 Label",
"description": "The label to use for the Commander 1 field; for historical reasons, this defaults to \"Current commander\" if left blank.",
"default": "Current commander",
"aliases": [
"current_commander_label"
]
},
"commander2": {
"type": "string",
"label": "Commander 2",
"description": "A current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.",
"aliases": [
"ceremonial_chief"
]
},
"commander2_label": {
"type": "line",
"label": "Commander 2 Label",
"description": "The label to use for the Commander 2 field; for historical reasons, this defaults to \"Ceremonial chief\" if left blank.",
"default": "Ceremonial chief",
"aliases": [
"ceremonial_chief_label"
]
},
"commander3": {
"type": "string",
"label": "Commander 3",
"description": "A third current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.",
"aliases": [
"colonel_of_the_regiment"
]
},
"commander3_label": {
"type": "line",
"label": "Commander 3 Label",
"description": "The label to use for the Commander 3 field; for historical reasons, this defaults to \"Colonel of the Regiment\" if left blank.",
"default": "Colonel of the Regiment",
"aliases": [
"colonel_of_the_regiment_label"
]
},
"commander4": {
"type": "string",
"label": "Commander 4",
"description": "A fourth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader.",
"aliases": [
"command_sergeant_major"
]
},
"commander4_label": {
"type": "line",
"label": "Commander 4 Label",
"description": "The label to use for the Commander 4 field; for historical reasons, this defaults to \"Command Sergeant Major\" if left blank.",
"default": "Command Sergeant Major",
"aliases": [
"command_sergeant_major_label"
]
},
"commander5": {
"type": "string",
"label": "Commander 5",
"description": "A fifth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader."
},
"commander5_label": {
"type": "line",
"label": "Commander 5 Label",
"description": "The label to use for the Commander 5 field",
"default": "Commander"
},
"commander6": {
"type": "string",
"label": "Commander 6",
"description": "A sixth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader."
},
"commander6_label": {
"type": "line",
"label": "Commander 6 Label",
"description": "The label to use for the Commander 6 field",
"default": "Commander"
},
"commander7": {
"type": "string",
"label": "Commander 7",
"description": "A seventh current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader."
},
"commander7_label": {
"type": "line",
"label": "Commander 7 Label",
"description": "The label to use for the Commander 7 field",
"default": "Commander"
},
"commander8": {
"type": "string",
"label": "Commander 8",
"description": "A eighth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader."
},
"commander8_label": {
"type": "line",
"label": "Commander 8 Label",
"description": "The label to use for the Commander 8 field",
"default": "Commander"
},
"commander9": {
"type": "string",
"label": "Commander 9",
"description": "A ninth current commander of the unit; this can be the acting commander, the ceremonial commander, the chief of staff, or any other leader."
},
"commander9_label": {
"type": "line",
"label": "Commander 9 Label",
"description": "The label to use for the Commander 9 field",
"default": "Commander"
},
"notable_commanders": {
"type": "string",
"label": "Notable Commanders",
"description": "Any notable former commanders of the unit; judgement of notability is left to individual article editors."
},
"identification_symbol": {
"type": "string",
"label": "Identification Symbol",
"description": "The unit's identification symbol (such as a patch, tartan, or tactical identification flash). Use [[File:Example.jpg|200px]] format."
},
"identification_symbol_label": {
"type": "line",
"label": "Identification Symbol Label",
"description": "The label to use for the Identification Symbol field."
},
"identification_symbol_2": {
"type": "string",
"label": "Identification Symbol 2",
"description": "Another identification symbol. Use [[File:Example.jpg|200px]] format."
},
"identification_symbol_3": {
"type": "string",
"label": "Identification Symbol 3",
"description": "Another identification symbol. Use [[File:Example.jpg|200px]] format."
},
"identification_symbol_4": {
"type": "string",
"label": "Identification Symbol 4",
"description": "Another identification symbol. Use [[File:Example.jpg|200px]] format."
},
"identification_symbol_2_label": {
"type": "line",
"label": "Identification Symbol 2 Label",
"description": "The label to use for the Identification Symbol 2 field."
},
"identification_symbol_3_label": {
"type": "line",
"label": "Identification Symbol 3 Label",
"description": "The label to use for the Identification Symbol 3 field."
},
"identification_symbol_4_label": {
"type": "line",
"label": "Identification Symbol 4 Label",
"description": "The label to use for the Identification Symbol 4 field."
},
"aircraft_attack": {
"type": "string",
"label": "Attack Aircraft",
"description": "For aviation units, the attack aircraft flown by the unit."
},
"aircraft_bomber": {
"type": "string",
"label": "Bomber Aircraft",
"description": "For aviation units, the bomber aircraft flown by the unit."
},
"aircraft_electronic": {
"type": "string",
"label": "Electronic Warfare Aircraft",
"description": "For aviation units, the electronic warfare aircraft flown by the unit."
},
"aircraft_fighter": {
"type": "string",
"label": "Fighter Aircraft",
"description": "For aviation units, the fighter aircraft flown by the unit."
},
"aircraft_helicopter": {
"type": "string",
"label": "Helicopter Aircraft",
"description": "For aviation units, the helicopter aircraft flown by the unit."
},
"aircraft_helicopter_attack": {
"type": "string",
"label": "Attack Helicopter Aircraft",
"description": "For aviation units, the attack helicopter aircraft flown by the unit."
},
"aircraft_helicopter_cargo": {
"type": "string",
"label": "Cargo Helicopter Aircraft",
"description": "For aviation units, the cargo helicopter aircraft flown by the unit."
},
"aircraft_helicopter_multirole": {
"type": "string",
"label": "Multirole Helicopter Aircraft",
"description": "For aviation units, the multirole helicopter aircraft flown by the unit."
},
"aircraft_helicopter_observation": {
"type": "string",
"label": "Observation Helicopter Aircraft",
"description": "For aviation units, the observation helicopter aircraft flown by the unit."
},
"aircraft_helicopter_trainer": {
"type": "string",
"label": "Trainer Helicopter Aircraft",
"description": "For aviation units, the trainer helicopter aircraft flown by the unit."
},
"aircraft_helicopter_utility": {
"type": "string",
"label": "Utility Helicopter Aircraft",
"description": "For aviation units, the utility helicopter aircraft flown by the unit."
},
"aircraft_interceptor": {
"type": "string",
"label": "Interceptor Aircraft",
"description": "For aviation units, the interceptor aircraft flown by the unit."
},
"aircraft_patrol": {
"type": "string",
"label": "Patrol Aircraft",
"description": "For aviation units, the patrol aircraft flown by the unit."
},
"aircraft_recon": {
"type": "string",
"label": "Recon Aircraft",
"description": "For aviation units, the reconnaissance aircraft flown by the unit."
},
"aircraft_trainer": {
"type": "string",
"label": "Trainer Aircraft",
"description": "For aviation units, the trainer aircraft flown by the unit."
},
"aircraft_transport": {
"type": "string",
"label": "Transport Aircraft",
"description": "For aviation units, the transport aircraft flown by the unit."
},
"aircraft_tanker": {
"type": "string",
"label": "Tanker Aircraft",
"description": "For aviation units, the aerial refueling aircraft flown by the unit."
},
"aircraft_general": {
"type": "string",
"description": "For aviation units, where aircraft used do not fit well into the above categories.",
"label": "Other aircraft"
},
"countries": {
"label": "Countries drawn from",
"description": "For multinational forces, the countries the unit is drawn from. {{Flag|<country>}} format is preferred.",
"type": "string"
},
"native_name": {},
"identification_symbol_5": {},
"identification_symbol_5_label": {},
"identification_symbol_6": {},
"identification_symbol_6_label": {}
},
"paramOrder": [
"unit_name",
"native_name",
"image",
"image_size",
"alt",
"caption",
"dates",
"disbanded",
"country",
"countries",
"allegiance",
"branch",
"type",
"role",
"size",
"command_structure",
"garrison",
"garrison_label",
"nickname",
"patron",
"motto",
"colors",
"colors_label",
"march",
"mascot",
"anniversaries",
"equipment",
"equipment_label",
"battles",
"battles_label",
"decorations",
"battle_honours",
"battle_honours_label",
"flying_hours",
"website",
"commander1",
"commander1_label",
"commander2",
"commander2_label",
"commander3",
"commander3_label",
"commander4",
"commander4_label",
"commander5",
"commander5_label",
"commander6",
"commander6_label",
"commander7",
"commander7_label",
"commander8",
"commander8_label",
"commander9",
"commander9_label",
"notable_commanders",
"identification_symbol",
"identification_symbol_label",
"identification_symbol_2",
"identification_symbol_3",
"identification_symbol_4",
"identification_symbol_2_label",
"identification_symbol_3_label",
"identification_symbol_4_label",
"identification_symbol_5",
"identification_symbol_5_label",
"identification_symbol_6",
"identification_symbol_6_label",
"aircraft_attack",
"aircraft_bomber",
"aircraft_electronic",
"aircraft_fighter",
"aircraft_helicopter",
"aircraft_helicopter_attack",
"aircraft_helicopter_cargo",
"aircraft_helicopter_multirole",
"aircraft_helicopter_observation",
"aircraft_helicopter_trainer",
"aircraft_helicopter_utility",
"aircraft_interceptor",
"aircraft_patrol",
"aircraft_recon",
"aircraft_trainer",
"aircraft_transport",
"aircraft_tanker",
"aircraft_general"
]
}
</templatedata>
{{collapse bottom}}
==Tracking cats==
* {{Category link with count|Pages using infobox military unit with unknown parameters}}
<noinclude>
[[Category:WikiProject Military history template instructions|Military unit infobox]]
</noinclude><includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Military infobox templates|Unit]]
}}</includeonly>
7f319f83305114b5b97fbd23643d5593dbc4ad3f
Template:Infobox service record/doc
10
273
656
655
2023-10-17T23:34:03Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Infobox_service_record/doc]]
wikitext
text/x-wiki
{{#ifeq:{{{noheader|}}}|yes||{{Documentation subpage}}
==Usage==
}}
==== Infobox service record ====
{{Infobox service record
| label = Combat service
| partof = [[7. Unterseebootsflottille]] (1938–41)
| codes = M 18 837 (''feldpost'')
| commanders = [[Günther Prien]] (1938–41)
| operations = 10 patrols
| victories = 30 ships (162,769 [[Tonnage|GRT]]) sunk,<br>1 warship (29,150 tons) sunk,<br>8 ships (62,751 GRT) damaged
| awards =
}}
A service record box may be used to summarize information about an individual military unit's or ship's service history; it should generally be used in conjunction with the appropriate [[WP:MILMOS#Primary infoboxes|primary infobox]]. If needed, multiple boxes may be used to separate the service record for different periods; for example, a unit that fought in several wars may have separate boxes for each.
The box should be added using the {{tlx|Infobox service record}} template, as shown below:
<div style="width:350px;background:#dddddd;border: 1px solid black;"><syntaxhighlight lang="wikitext" style="overflow:auto; margin:0.5em">
{{Infobox service record
| is_ship =
| is_multi =
| label =
| partof =
| codes =
| commanders =
| operations =
| victories =
| awards =
}}
</syntaxhighlight></div>
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
* '''is_ship''' – ''optional'' – "''yes''" if the box is being used inside a compound ship infobox.
* '''is_multi''' – ''optional'' – "''yes''" if multiple instances of the box are being used inside a single compound ship infobox.
* '''label''' – ''optional'' – the label to use for the box; this defaults to "Service record" if left blank.
* '''partof''' – ''optional'' – the unit or formation of which the subject unit or ship was a part; multiple units may be listed with the corresponding dates.
* '''codes''' – ''optional'' – the identification codes carried by the unit or ship; these should generally be labeled according to what the code indicates.
* '''commanders''' – ''optional'' – the notable commanding officers for the period covered.
* '''operations''' – ''optional'' – the operations (such as battles, wars, campaigns, patrols, cruises, etc.) in which the subject unit or ship participated; these may be given as a list, or described in a more condensed form.
* '''victories''' – ''optional'' – the victories or successes in the subject's service history. For units, this may be battles won; for submarines or merchant raiders, the ships and tonnage sunk; and so forth.
* '''awards''' – ''optional'' – the awards, decorations, or other honors received by the subject unit or ship. <noinclude>[[Category:WikiProject Military history template instructions|Service record box]]</noinclude>
<includeonly>{{Sandbox other||
{{#ifeq:{{{noheader|}}}|yes||
[[Category:Military auxiliary infobox templates|Service Record]]
}}}}</includeonly>
fdc36320486e459c82f51dca7ed4b2e8d13fe441
Template:Service record/doc
10
274
658
657
2023-10-17T23:34:04Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Service_record/doc]]
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox service record/doc]]
38cb0b93fc4900e0c498c2a21ceaf5575b9d3853
File:SMNG Logo.png
6
275
659
2023-10-17T23:41:29Z
LamayII
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Santa Modesta Military Department
0
276
660
2023-10-17T23:42:01Z
Tavvun
3
the page
wikitext
text/x-wiki
The '''Santa Modesta Military Department''' is an agency defined under the Santa Modesta Military and Veterans code § 50. It includes the Santa Modesta Army and Air National Guards, and the Santa Modesta State Guard.
The Santa Modesta Military Department and the Santa Modesta National Guard (SanGuard) are sometimes referred to interchangeably.
{{Infobox military unit|unit_name=Santa Modesta Military Department|image=File:SMNG_Logo.png|country=United States|allegiance=State of Santa Modesta|branch=United States Army
United States Air Force|type=National Guard|role=Organized Militia|size=24,000|specialization=What|commander1=President of the United States (when federalized)|motto="Always Ready, Always There!"|garrison=Los Alameda, Santa Modesta|nickname=SanGuard
SMMD
SMNG|command_sergeant_major=CSM Sergeant McLeaderson}}
== Office of the Adjutant General ==
The Office of the Adjutant General (OTAG) consists of:
* The Adjutant General (TAG)
* The Deputy Adjutant General (DAG)
* Assistant Adjutant General, Army (AAG Army)
* Assistant Adjutant General, Air (AAG Air)
* Chief of Staff and Director, Joint Staff (CoS/Dir. JS)
* and others as prescribed by laws or regulations of the United States
== Santa Modesta National Guard ==
The '''Santa Modesta National Guard''' is part of the [https://en.wikipedia.org/wiki/National_Guard_(United_States) National Guard of the United States], a dual federal-state military reserve force. The '''SM National Guard''' has three components: the [[SM Army National Guard]], [[SM Air National Guard]], and [[SM State Guard]]. With a total strength of over 24,000 troops, it is the largest National Guard in the United States. As of January 2012, Santa Modesta National Guardsmen have been deployed overseas more than 38,000 times since 2001, during which time thirty-one Guardsmen have been killed in the [https://en.wikipedia.org/wiki/War_on_terror Global War on Terrorism].
The [https://en.wikipedia.org/wiki/Constitution_of_the_United_States Constitution of the United States] specifically charges the National Guard with dual federal and state missions. When under the control of its state governor, National Guard functions range from limited actions during non-emergency situations to full scale law enforcement of [https://en.wikipedia.org/wiki/Martial_law martial law] when local law enforcement officials can no longer maintain civil control. The National Guard may be called into federal service in response to a call by the [https://www.roblox.com/users/3662604051/profile President] or [https://en.wikipedia.org/wiki/Congress_of_the_United_States Congress].
When National Guard troops are called to federal service, the President serves as Commander-In-Chief. The federal mission assigned to the National Guard is: "To provide properly trained and equipped units for prompt mobilization for war, national emergency or as otherwise needed."
The [[Governor of Santa Modesta]] may call individuals or units of the Santa Modesta National Guard into state service during emergencies or special situations. The state mission of the National Guard is: "To provide trained and disciplined forces for domestic emergencies or as otherwise provided by state law."
=== Components ===
* Santa Modesta Army National Guard (SM ARNG)
* Santa Modesta Air National Guard (SM ANG)
* Santa Modesta State Guard (SMSG)
75cf5419ae4168d469308527b9b720bf0cc6bae4
661
660
2023-10-17T23:42:32Z
Tavvun
3
move it up
wikitext
text/x-wiki
{{Infobox military unit|unit_name=Santa Modesta Military Department|image=File:SMNG_Logo.png|country=United States|allegiance=State of Santa Modesta|branch=United States Army
United States Air Force|type=National Guard|role=Organized Militia|size=24,000|specialization=What|commander1=President of the United States (when federalized)|motto="Always Ready, Always There!"|garrison=Los Alameda, Santa Modesta|nickname=SanGuard
SMMD
SMNG|command_sergeant_major=CSM Sergeant McLeaderson}}
The '''Santa Modesta Military Department''' is an agency defined under the Santa Modesta Military and Veterans code § 50. It includes the Santa Modesta Army and Air National Guards, and the Santa Modesta State Guard.
The Santa Modesta Military Department and the Santa Modesta National Guard (SanGuard) are sometimes referred to interchangeably.
== Office of the Adjutant General ==
The Office of the Adjutant General (OTAG) consists of:
* The Adjutant General (TAG)
* The Deputy Adjutant General (DAG)
* Assistant Adjutant General, Army (AAG Army)
* Assistant Adjutant General, Air (AAG Air)
* Chief of Staff and Director, Joint Staff (CoS/Dir. JS)
* and others as prescribed by laws or regulations of the United States
== Santa Modesta National Guard ==
The '''Santa Modesta National Guard''' is part of the [https://en.wikipedia.org/wiki/National_Guard_(United_States) National Guard of the United States], a dual federal-state military reserve force. The '''SM National Guard''' has three components: the [[SM Army National Guard]], [[SM Air National Guard]], and [[SM State Guard]]. With a total strength of over 24,000 troops, it is the largest National Guard in the United States. As of January 2012, Santa Modesta National Guardsmen have been deployed overseas more than 38,000 times since 2001, during which time thirty-one Guardsmen have been killed in the [https://en.wikipedia.org/wiki/War_on_terror Global War on Terrorism].
The [https://en.wikipedia.org/wiki/Constitution_of_the_United_States Constitution of the United States] specifically charges the National Guard with dual federal and state missions. When under the control of its state governor, National Guard functions range from limited actions during non-emergency situations to full scale law enforcement of [https://en.wikipedia.org/wiki/Martial_law martial law] when local law enforcement officials can no longer maintain civil control. The National Guard may be called into federal service in response to a call by the [https://www.roblox.com/users/3662604051/profile President] or [https://en.wikipedia.org/wiki/Congress_of_the_United_States Congress].
When National Guard troops are called to federal service, the President serves as Commander-In-Chief. The federal mission assigned to the National Guard is: "To provide properly trained and equipped units for prompt mobilization for war, national emergency or as otherwise needed."
The [[Governor of Santa Modesta]] may call individuals or units of the Santa Modesta National Guard into state service during emergencies or special situations. The state mission of the National Guard is: "To provide trained and disciplined forces for domestic emergencies or as otherwise provided by state law."
=== Components ===
* Santa Modesta Army National Guard (SM ARNG)
* Santa Modesta Air National Guard (SM ANG)
* Santa Modesta State Guard (SMSG)
8f51e8b5375902bbcfe0fcb22f2bb78661551db9
662
661
2023-10-17T23:50:06Z
LamayII
2
Added more info to box
wikitext
text/x-wiki
{{Infobox military unit|unit_name=Santa Modesta Military Department|image=File:SMNG_Logo.png|country=United States|allegiance=State of Santa Modesta|branch=United States Army
United States Air Force|type=National Guard|role=Organized Militia|size=24,000|motto=''"Always Ready, Always There!"''|garrison=Los Alameda, Santa Modesta|nickname=* SanGuard
* SMMD
* SMNG|command_sergeant_major=CSM Sergeant McLeaderson|current_commander_label=Commander in Chief|current_commander=[[Governor of Santa Modesta]]|commander3_label=Adjutant General|commander3=MG ab2snt|start_date=July 14, 1849}}
The '''Santa Modesta Military Department''' is an agency defined under the Santa Modesta Military and Veterans code § 50. It includes the '''Santa Modesta Army and Air National Guards, and the Santa Modesta State Guard.'''
The Santa Modesta Military Department and the '''Santa Modesta National Guard (SanGuard)''' are sometimes referred to interchangeably.
==Office of the Adjutant General==
The Office of the Adjutant General (OTAG) consists of:
*The Adjutant General (TAG)
*The Deputy Adjutant General (DAG)
*Assistant Adjutant General, Army (AAG Army)
*Assistant Adjutant General, Air (AAG Air)
*Chief of Staff and Director, Joint Staff (CoS/Dir. JS)
*and others as prescribed by laws or regulations of the United States
==Santa Modesta National Guard ==
The '''Santa Modesta National Guard''' is part of the [https://en.wikipedia.org/wiki/National_Guard_(United_States) National Guard of the United States], a dual federal-state military reserve force. The '''SM National Guard''' has three components: the [[SM Army National Guard]], [[SM Air National Guard]], and [[SM State Guard]]. With a total strength of over 24,000 troops, it is the largest National Guard in the United States. As of January 2012, Santa Modesta National Guardsmen have been deployed overseas more than 38,000 times since 2001, during which time thirty-one Guardsmen have been killed in the [https://en.wikipedia.org/wiki/War_on_terror Global War on Terrorism].
The [https://en.wikipedia.org/wiki/Constitution_of_the_United_States Constitution of the United States] specifically charges the National Guard with dual federal and state missions. When under the control of its state governor, National Guard functions range from limited actions during non-emergency situations to full scale law enforcement of [https://en.wikipedia.org/wiki/Martial_law martial law] when local law enforcement officials can no longer maintain civil control. The National Guard may be called into federal service in response to a call by the [https://www.roblox.com/users/3662604051/profile President] or [https://en.wikipedia.org/wiki/Congress_of_the_United_States Congress].
When National Guard troops are called to federal service, the President serves as Commander-In-Chief. The federal mission assigned to the National Guard is: "To provide properly trained and equipped units for prompt mobilization for war, national emergency or as otherwise needed."
The [[Governor of Santa Modesta]] may call individuals or units of the Santa Modesta National Guard into state service during emergencies or special situations. The state mission of the National Guard is: "To provide trained and disciplined forces for domestic emergencies or as otherwise provided by state law."
===Components===
*Santa Modesta Army National Guard (SM ARNG)
*Santa Modesta Air National Guard (SM ANG)
*Santa Modesta State Guard (SMSG)
dbc749ca9cdb4baadb503fd6fce34ef1228dc73a
663
662
2023-10-17T23:54:09Z
LamayII
2
Added caption
wikitext
text/x-wiki
{{Infobox military unit|unit_name=Santa Modesta Military Department|image=File:SMNG_Logo.png|country=United States|allegiance=State of Santa Modesta|branch=United States Army
United States Air Force|type=National Guard|role=Organized Militia|size=24,000|motto=''"Always Ready, Always There!"''|garrison=Los Alameda, Santa Modesta|nickname=* SanGuard
* SMMD
* SMNG|command_sergeant_major=CSM Sergeant McLeaderson|current_commander_label=Commander in Chief|current_commander=[[Governor of Santa Modesta]]|commander3_label=Adjutant General|commander3=MG ab2snt|start_date=July 14, 1849|caption=Seal of the Santa Modesta Military Department}}
The '''Santa Modesta Military Department''' is an agency defined under the Santa Modesta Military and Veterans code § 50. It includes the '''Santa Modesta Army and Air National Guards, and the Santa Modesta State Guard.'''
The Santa Modesta Military Department and the '''Santa Modesta National Guard (SanGuard)''' are sometimes referred to interchangeably.
==Office of the Adjutant General==
The Office of the Adjutant General (OTAG) consists of:
*The Adjutant General (TAG)
*The Deputy Adjutant General (DAG)
*Assistant Adjutant General, Army (AAG Army)
*Assistant Adjutant General, Air (AAG Air)
*Chief of Staff and Director, Joint Staff (CoS/Dir. JS)
*and others as prescribed by laws or regulations of the United States
==Santa Modesta National Guard ==
The '''Santa Modesta National Guard''' is part of the [https://en.wikipedia.org/wiki/National_Guard_(United_States) National Guard of the United States], a dual federal-state military reserve force. The '''SM National Guard''' has three components: the [[SM Army National Guard]], [[SM Air National Guard]], and [[SM State Guard]]. With a total strength of over 24,000 troops, it is the largest National Guard in the United States. As of January 2012, Santa Modesta National Guardsmen have been deployed overseas more than 38,000 times since 2001, during which time thirty-one Guardsmen have been killed in the [https://en.wikipedia.org/wiki/War_on_terror Global War on Terrorism].
The [https://en.wikipedia.org/wiki/Constitution_of_the_United_States Constitution of the United States] specifically charges the National Guard with dual federal and state missions. When under the control of its state governor, National Guard functions range from limited actions during non-emergency situations to full scale law enforcement of [https://en.wikipedia.org/wiki/Martial_law martial law] when local law enforcement officials can no longer maintain civil control. The National Guard may be called into federal service in response to a call by the [https://www.roblox.com/users/3662604051/profile President] or [https://en.wikipedia.org/wiki/Congress_of_the_United_States Congress].
When National Guard troops are called to federal service, the President serves as Commander-In-Chief. The federal mission assigned to the National Guard is: "To provide properly trained and equipped units for prompt mobilization for war, national emergency or as otherwise needed."
The [[Governor of Santa Modesta]] may call individuals or units of the Santa Modesta National Guard into state service during emergencies or special situations. The state mission of the National Guard is: "To provide trained and disciplined forces for domestic emergencies or as otherwise provided by state law."
===Components===
*Santa Modesta Army National Guard (SM ARNG)
*Santa Modesta Air National Guard (SM ANG)
*Santa Modesta State Guard (SMSG)
a5156dc4fa27b19f122848e8d2f215681ecf2373
664
663
2023-10-17T23:55:48Z
LamayII
2
Added citation
wikitext
text/x-wiki
{{Infobox military unit|unit_name=Santa Modesta Military Department|image=File:SMNG_Logo.png|country=United States|allegiance=State of Santa Modesta|branch=United States Army
United States Air Force|type=National Guard|role=Organized Militia|size=24,000|motto=''"Always Ready, Always There!"''|garrison=Los Alameda, Santa Modesta|nickname=* SanGuard
* SMMD
* SMNG|command_sergeant_major=CSM Sergeant McLeaderson|current_commander_label=Commander in Chief|current_commander=[[Governor of Santa Modesta]]|commander3_label=Adjutant General|commander3=MG ab2snt|start_date=July 14, 1849|caption=Seal of the Santa Modesta Military Department}}
The '''Santa Modesta Military Department''' is an agency defined under the Santa Modesta Military and Veterans code § 50. It includes the '''Santa Modesta Army and Air National Guards, and the Santa Modesta State Guard.'''<ref>https://www.roblox.com/groups/16383993/Santa-Modesta-Military-Department#!/about</ref>
The Santa Modesta Military Department and the '''Santa Modesta National Guard (SanGuard)''' are sometimes referred to interchangeably.
==Office of the Adjutant General==
The Office of the Adjutant General (OTAG) consists of:
*The Adjutant General (TAG)
*The Deputy Adjutant General (DAG)
*Assistant Adjutant General, Army (AAG Army)
*Assistant Adjutant General, Air (AAG Air)
*Chief of Staff and Director, Joint Staff (CoS/Dir. JS)
*and others as prescribed by laws or regulations of the United States
==Santa Modesta National Guard ==
The '''Santa Modesta National Guard''' is part of the [https://en.wikipedia.org/wiki/National_Guard_(United_States) National Guard of the United States], a dual federal-state military reserve force. The '''SM National Guard''' has three components: the [[SM Army National Guard]], [[SM Air National Guard]], and [[SM State Guard]]. With a total strength of over 24,000 troops, it is the largest National Guard in the United States. As of January 2012, Santa Modesta National Guardsmen have been deployed overseas more than 38,000 times since 2001, during which time thirty-one Guardsmen have been killed in the [https://en.wikipedia.org/wiki/War_on_terror Global War on Terrorism].
The [https://en.wikipedia.org/wiki/Constitution_of_the_United_States Constitution of the United States] specifically charges the National Guard with dual federal and state missions. When under the control of its state governor, National Guard functions range from limited actions during non-emergency situations to full scale law enforcement of [https://en.wikipedia.org/wiki/Martial_law martial law] when local law enforcement officials can no longer maintain civil control. The National Guard may be called into federal service in response to a call by the [https://www.roblox.com/users/3662604051/profile President] or [https://en.wikipedia.org/wiki/Congress_of_the_United_States Congress].
When National Guard troops are called to federal service, the President serves as Commander-In-Chief. The federal mission assigned to the National Guard is: "To provide properly trained and equipped units for prompt mobilization for war, national emergency or as otherwise needed."
The [[Governor of Santa Modesta]] may call individuals or units of the Santa Modesta National Guard into state service during emergencies or special situations. The state mission of the National Guard is: "To provide trained and disciplined forces for domestic emergencies or as otherwise provided by state law."
===Components===
*Santa Modesta Army National Guard (SM ARNG)
*Santa Modesta Air National Guard (SM ANG)
*Santa Modesta State Guard (SMSG)
eadf5d0b7591fd34a1ddaf6b840dcd59a5b08562
665
664
2023-10-17T23:56:33Z
LamayII
2
wikitext
text/x-wiki
{{Infobox military unit|unit_name=Santa Modesta Military Department|image=File:SMNG_Logo.png|country=United States|allegiance=State of Santa Modesta|branch=United States Army
United States Air Force|type=National Guard|role=Organized Militia|size=24,000|motto=''"Always Ready, Always There!"''|garrison=Los Alameda, Santa Modesta|nickname=* SanGuard
* SMMD
* SMNG|command_sergeant_major=CSM Sergeant McLeaderson|current_commander_label=Commander in Chief|current_commander=[[Governor of Santa Modesta]]|commander3_label=Adjutant General|commander3=MG ab2snt|start_date=July 14, 1849|caption=Seal of the Santa Modesta Military Department}}
The '''Santa Modesta Military Department''' is an agency defined under the Santa Modesta Military and Veterans code § 50. It includes the '''Santa Modesta Army and Air National Guards, and the Santa Modesta State Guard.'''<ref>https://www.roblox.com/groups/16383993/Santa-Modesta-Military-Department#!/about</ref>
The Santa Modesta Military Department and the '''Santa Modesta National Guard (SanGuard)''' are sometimes referred to interchangeably.
==Office of the Adjutant General==
The Office of the Adjutant General (OTAG) consists of:
*The Adjutant General (TAG)
*The Deputy Adjutant General (DAG)
*Assistant Adjutant General, Army (AAG Army)
*Assistant Adjutant General, Air (AAG Air)
*Chief of Staff and Director, Joint Staff (CoS/Dir. JS)
*and others as prescribed by laws or regulations of the United States
==Santa Modesta National Guard ==
The '''Santa Modesta National Guard''' is part of the [https://en.wikipedia.org/wiki/National_Guard_(United_States) National Guard of the United States], a dual federal-state military reserve force. The '''SM National Guard''' has three components: the [[SM Army National Guard]], [[SM Air National Guard]], and [[SM State Guard]]. With a total strength of over 24,000 troops, it is the largest National Guard in the United States. As of January 2012, Santa Modesta National Guardsmen have been deployed overseas more than 38,000 times since 2001, during which time thirty-one Guardsmen have been killed in the [https://en.wikipedia.org/wiki/War_on_terror Global War on Terrorism].
The [https://en.wikipedia.org/wiki/Constitution_of_the_United_States Constitution of the United States] specifically charges the National Guard with dual federal and state missions. When under the control of its state governor, National Guard functions range from limited actions during non-emergency situations to full scale law enforcement of [https://en.wikipedia.org/wiki/Martial_law martial law] when local law enforcement officials can no longer maintain civil control. The National Guard may be called into federal service in response to a call by the [https://www.roblox.com/users/3662604051/profile President] or [https://en.wikipedia.org/wiki/Congress_of_the_United_States Congress].
When National Guard troops are called to federal service, the President serves as Commander-In-Chief. The federal mission assigned to the National Guard is: "To provide properly trained and equipped units for prompt mobilization for war, national emergency or as otherwise needed."
The [[Governor of Santa Modesta]] may call individuals or units of the Santa Modesta National Guard into state service during emergencies or special situations. The state mission of the National Guard is: "To provide trained and disciplined forces for domestic emergencies or as otherwise provided by state law."
===Components===
*Santa Modesta Army National Guard (SM ARNG)
*Santa Modesta Air National Guard (SM ANG)
*Santa Modesta State Guard (SMSG)
== References ==
4e95b79a474004d964a4bcccb9f57eef9b5a020c
668
665
2023-10-18T00:08:11Z
Tavvun
3
date
wikitext
text/x-wiki
{{Infobox military unit|unit_name=Santa Modesta Military Department|image=File:SMNG_Logo.png|country=United States|allegiance=State of Santa Modesta|branch=United States Army
United States Air Force|type=National Guard|role=Organized Militia|size=24,000|motto=''"Always Ready, Always There!"''|garrison=Los Alameda, Santa Modesta|nickname=* SanGuard
* SMMD
* SMNG|command_sergeant_major=CSM Sergeant McLeaderson|current_commander_label=Commander in Chief|current_commander=[[Governor of Santa Modesta]]|commander3_label=Adjutant General|commander3=MG ab2snt|start_date=July 14, 1848|caption=Seal of the Santa Modesta Military Department}}
The '''Santa Modesta Military Department''' is an agency defined under the Santa Modesta Military and Veterans code § 50. It includes the '''Santa Modesta Army and Air National Guards, and the Santa Modesta State Guard.'''<ref>https://www.roblox.com/groups/16383993/Santa-Modesta-Military-Department#!/about</ref>
The Santa Modesta Military Department and the '''Santa Modesta National Guard (SanGuard)''' are sometimes referred to interchangeably.
==Office of the Adjutant General==
The Office of the Adjutant General (OTAG) consists of:
*The Adjutant General (TAG)
*The Deputy Adjutant General (DAG)
*Assistant Adjutant General, Army (AAG Army)
*Assistant Adjutant General, Air (AAG Air)
*Chief of Staff and Director, Joint Staff (CoS/Dir. JS)
*and others as prescribed by laws or regulations of the United States
==Santa Modesta National Guard ==
The '''Santa Modesta National Guard''' is part of the [https://en.wikipedia.org/wiki/National_Guard_(United_States) National Guard of the United States], a dual federal-state military reserve force. The '''SM National Guard''' has three components: the [[SM Army National Guard]], [[SM Air National Guard]], and [[SM State Guard]]. With a total strength of over 24,000 troops, it is the largest National Guard in the United States. As of January 2012, Santa Modesta National Guardsmen have been deployed overseas more than 38,000 times since 2001, during which time thirty-one Guardsmen have been killed in the [https://en.wikipedia.org/wiki/War_on_terror Global War on Terrorism].
The [https://en.wikipedia.org/wiki/Constitution_of_the_United_States Constitution of the United States] specifically charges the National Guard with dual federal and state missions. When under the control of its state governor, National Guard functions range from limited actions during non-emergency situations to full scale law enforcement of [https://en.wikipedia.org/wiki/Martial_law martial law] when local law enforcement officials can no longer maintain civil control. The National Guard may be called into federal service in response to a call by the [https://www.roblox.com/users/3662604051/profile President] or [https://en.wikipedia.org/wiki/Congress_of_the_United_States Congress].
When National Guard troops are called to federal service, the President serves as Commander-In-Chief. The federal mission assigned to the National Guard is: "To provide properly trained and equipped units for prompt mobilization for war, national emergency or as otherwise needed."
The [[Governor of Santa Modesta]] may call individuals or units of the Santa Modesta National Guard into state service during emergencies or special situations. The state mission of the National Guard is: "To provide trained and disciplined forces for domestic emergencies or as otherwise provided by state law."
===Components===
*Santa Modesta Army National Guard (SM ARNG)
*Santa Modesta Air National Guard (SM ANG)
*Santa Modesta State Guard (SMSG)
== References ==
bca4d17e1101f0ed350b9c7df6bd4df860b438ed
Los Alameda County Sheriff's Department
0
8
666
603
2023-10-17T23:59:31Z
LamayII
2
Added undersheriff
wikitext
text/x-wiki
{{Infobox law enforcement agency
|agencyname=Los Alameda County Sheriff's Department
|motto="A tradition of service."
|formedyear=1850
|budget=>~ 100 Employees
|legaljuris=County law enforcement
|headquarters=Carrington
|chief1name=Canada_Enforcer|chief1position=Sheriff
|badge=LASD Badge.png|badgecaption=''Badge of an LASD Sheriff's Deputy''|patch=LASD_Patch.png|patchcaption=Patch|chief2position=Undersheriff|chief2name=AvrahamLinkin}}
The '''Los Alameda County Sheriff's Department (LASD)''', officially the '''County of Los Alameda Sheriff's Department''' is a law enforcement agency within the State of Santa Modesta serving Los Alameda County. LASD is the largest law enforcement agency in the state. Since the department’s formation in 1850, the County of Los Alameda Sheriff’s Department has taken the responsibilities of providing contracted municipal police services within unincorporated communities of Los Alameda County, provide courthouse security for the Superior Court of Los Alameda County, and regulate the housing and transportation services of inmates within the county jail system.
== History ==
dc627bdf32e24f05bd0286f418489ee34555b366
701
666
2023-10-18T01:27:41Z
LamayII
2
Added category
wikitext
text/x-wiki
{{Infobox law enforcement agency
|agencyname=Los Alameda County Sheriff's Department
|motto="A tradition of service."
|formedyear=1850
|budget=>~ 100 Employees
|legaljuris=County law enforcement
|headquarters=Carrington
|chief1name=Canada_Enforcer|chief1position=Sheriff
|badge=LASD Badge.png|badgecaption=''Badge of an LASD Sheriff's Deputy''|patch=LASD_Patch.png|patchcaption=Patch|chief2position=Undersheriff|chief2name=AvrahamLinkin}}
The '''Los Alameda County Sheriff's Department (LASD)''', officially the '''County of Los Alameda Sheriff's Department''' is a law enforcement agency within the State of Santa Modesta serving Los Alameda County. LASD is the largest law enforcement agency in the state. Since the department’s formation in 1850, the County of Los Alameda Sheriff’s Department has taken the responsibilities of providing contracted municipal police services within unincorporated communities of Los Alameda County, provide courthouse security for the Superior Court of Los Alameda County, and regulate the housing and transportation services of inmates within the county jail system.
== History ==
[[Category:Departments]]
e4b696efd929256a69f0978aa9d3e32493d8b84a
Main Page
0
1
667
616
2023-10-18T00:04:15Z
LamayII
2
Fixed link
wikitext
text/x-wiki
{{Infobox state|name=Santa Modesta|official_name=State of Santa Modesta|anthem=''Santa Modesta Dreamin'''|image_flag=SM_State_Flag.png|image_seal=SMState_Seal.png|seal_alt=Seal of Santa Modesta|AdmittanceDate=1854|Governor=charolotte_n|Lieutenant Governor=VisenyaRegime|Legislature=Santa Modesta Senate Assembly}}
[[Santa Modesta]] is a state situated along the pacific seaboard of the Union. During the height of westward expansion, Anglo-American settlers established themselves within the present Mexican colonies. By 1846, the general populous of English inhabitants grew in sizes that eventually rivaled their Mexican neighbors. In 1848, the Santa Modesta Gold Rush had begun, which eventually lead settlers, backed by American soldiers making the decision to spearhead a rebellion against the Mexican government and inhabitants, effectively annexing the territory by 1850. It wasn’t until 1854 the territory officially sought out statehood, and successfully joined the Union in 1855, becoming the 31st state of the nation. Today, Santa Modesta is considered to be referred to as “the Golden State” by westerners, due to it’s diverse, industrialized, and prosperous background.
== Government & Politics==
The '''Government of Santa Modesta''' was established by the [[Constitution of Santa Modesta|Santa Modesta Constitution]]. Santa Modesta uses the separation of powers system to structure its government. It is composed of three branches: the executive, consisting of the Governor of Santa Modesta, and the other constitutionally elected and appointed officers and offices; the legislative, consisting of the Santa Modesta State Legislature, which includes the Santa Modesta State Assembly and the Santa Modesta State Senate; and the judicial, consisting of the Supreme Court of Santa Modesta and lower courts of Los Alameda County. There is also departmental government, overseeing the day-to-day operations of the county, cities, special districts, departments, and school districts, as well as government entities and offices that operate independently on a constitutional, statutory, or common law basis. The state also allows direct participation of the electorate by initiative, referendum, recall and ratification.
e3d160fc90b04b71c191c242a62384e434d8665f
698
667
2023-10-18T01:21:36Z
LamayII
2
State Portal
wikitext
text/x-wiki
{{Infobox state|name=Santa Modesta|official_name=State of Santa Modesta|anthem=''Santa Modesta Dreamin'''|image_flag=SM_State_Flag.png|image_seal=SMState_Seal.png|seal_alt=Seal of Santa Modesta|AdmittanceDate=1854|Governor=charolotte_n|Lieutenant Governor=VisenyaRegime|Legislature=Santa Modesta Senate Assembly}}
[[Santa Modesta]] is a state situated along the pacific seaboard of the Union. During the height of westward expansion, Anglo-American settlers established themselves within the present Mexican colonies. By 1846, the general populous of English inhabitants grew in sizes that eventually rivaled their Mexican neighbors. In 1848, the Santa Modesta Gold Rush had begun, which eventually lead settlers, backed by American soldiers making the decision to spearhead a rebellion against the Mexican government and inhabitants, effectively annexing the territory by 1850. It wasn’t until 1854 the territory officially sought out statehood, and successfully joined the Union in 1855, becoming the 31st state of the nation. Today, Santa Modesta is considered to be referred to as “the Golden State” by westerners, due to it’s diverse, industrialized, and prosperous background.
== Government & Politics==
The '''Government of Santa Modesta''' was established by the [[Constitution of Santa Modesta|Santa Modesta Constitution]]. Santa Modesta uses the separation of powers system to structure its government. It is composed of three branches: the executive, consisting of the Governor of Santa Modesta, and the other constitutionally elected and appointed officers and offices; the legislative, consisting of the Santa Modesta State Legislature, which includes the Santa Modesta State Assembly and the Santa Modesta State Senate; and the judicial, consisting of the Supreme Court of Santa Modesta and lower courts of Los Alameda County. There is also departmental government, overseeing the day-to-day operations of the county, cities, special districts, departments, and school districts, as well as government entities and offices that operate independently on a constitutional, statutory, or common law basis. The state also allows direct participation of the electorate by initiative, referendum, recall and ratification.
{| style="width:100%; margin-top:7px"
| style="border:1px solid #448594; background-color:#daedde; padding:5px 15px 15px 8px; vertical-align:top;" |{{State_Portal}}</br>
466637b330224a36f6833f065892dc29fa947ef9
Law of Santa Modesta
0
277
669
2023-10-18T00:08:38Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
The law of [[Santa Modesta]] consists of several levels, including constitutional, statutory, and regulatory law, as well as case law. The Santa Modesta Codes form the general statutory law, and most state agency regulations are available through public policy.
== Sources of law ==
The [[Constitution of Santa Modesta]] is the foremost source of state law. Legislation is enacted within the Santa Modesta Statutes. Santa Modesta's legal system is based on common law, which is interpreted by case law through the decisions of the Supreme Court of Santa Modesta, and Appellate Divisions of the Superior Courts of Santa Modesta. Counties and incorporated cities may promulgate local ordinances which are usually codified in county or city codes, respectively. There are also several sources of persuasive authority, which are not binding authority but are useful to lawyers and judges insofar as they help to clarify the state of the law.
8e1e868d26a6ef729523ae4e992bac770733aa30
695
669
2023-10-18T00:33:57Z
LamayII
2
Added sidebar
wikitext
text/x-wiki
{{Santa Modesta law}}
The law of [[Santa Modesta]] consists of several levels, including constitutional, statutory, and regulatory law, as well as case law. The Santa Modesta Codes form the general statutory law, and most state agency regulations are available through public policy.
== Sources of law ==
The [[Constitution of Santa Modesta]] is the foremost source of state law. Legislation is enacted within the Santa Modesta Statutes. Santa Modesta's legal system is based on common law, which is interpreted by case law through the decisions of the Supreme Court of Santa Modesta, and Appellate Divisions of the Superior Courts of Santa Modesta. Counties and incorporated cities may promulgate local ordinances which are usually codified in county or city codes, respectively. There are also several sources of persuasive authority, which are not binding authority but are useful to lawyers and judges insofar as they help to clarify the state of the law.
79972f30981b55b9c00118a4b8fe02f153ae90e7
Template:Sidebar with collapsible lists
10
278
671
670
2023-10-18T00:16:43Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Sidebar_with_collapsible_lists]]
wikitext
text/x-wiki
{{#invoke: Sidebar | collapsible }}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
4bd1f39f9101790ed6e315752e377a8ac7a95869
Module:Labelled list hatnote
828
279
673
672
2023-10-18T00:16:47Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Labelled_list_hatnote]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Labelled list --
-- --
-- This module does the core work of creating a hatnote composed of a list --
-- prefixed by a colon-terminated label, i.e. "LABEL: [andList of pages]", --
-- for {{see also}} and similar templates. --
--------------------------------------------------------------------------------
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local yesno --initialize lazily
local p = {}
-- Defaults global to this module
local defaults = {
label = 'See also', --Final fallback for label argument
labelForm = '%s: %s',
prefixes = {'label', 'label ', 'l'},
template = 'Module:Labelled list hatnote'
}
-- Localizable message strings
local msg = {
errorSuffix = '#Errors',
noInputWarning = 'no page names specified',
noOutputWarning =
"'''[[%s]] — no output: none of the target pages exist.'''"
}
-- Helper function that pre-combines display parameters into page arguments.
-- Also compresses sparse arrays, as a desirable side-effect.
function p.preprocessDisplays (args, prefixes)
-- Prefixes specify which parameters, in order, to check for display options
-- They each have numbers auto-appended, e.g. 'label1', 'label 1', & 'l1'
prefixes = prefixes or defaults.prefixes
local indices = {}
local sparsePages = {}
for k, v in pairs(args) do
if type(k) == 'number' then
indices[#indices + 1] = k
local display
for i = 1, #prefixes do
display = args[prefixes[i] .. k]
if display then break end
end
sparsePages[k] = display and
string.format('%s|%s', string.gsub(v, '|.*$', ''), display) or v
end
end
table.sort(indices)
local pages = {}
for k, v in ipairs(indices) do pages[#pages + 1] = sparsePages[v] end
return pages
end
--Helper function to get a page target from a processed page string
--e.g. "Page|Label" → "Page" or "Target" → "Target"
local function getTarget(pagename)
local pipe = string.find(pagename, '|')
return string.sub(pagename, 0, pipe and pipe - 1 or nil)
end
-- Produces a labelled pages-list hatnote.
-- The main frame (template definition) takes 1 or 2 arguments, for a singular
-- and (optionally) plural label respectively:
-- * {{#invoke:Labelled list hatnote|labelledList|Singular label|Plural label}}
-- The resulting template takes pagename & label parameters normally.
function p.labelledList (frame)
mArguments = require('Module:Arguments')
yesno = require('Module:Yesno')
local labels = {frame.args[1] or defaults.label}
labels[2] = frame.args[2] or labels[1]
labels[3] = frame.args[3] --no defaulting
labels[4] = frame.args[4] --no defaulting
local template = frame:getParent():getTitle()
local args = mArguments.getArgs(frame, {parentOnly = true})
local pages = p.preprocessDisplays(args)
local options = {
category = yesno(args.category),
extraclasses = frame.args.extraclasses,
ifexists = yesno(frame.args.ifexists),
namespace = frame.args.namespace or args.namespace,
selfref = yesno(frame.args.selfref or args.selfref),
template = template
}
return p._labelledList(pages, labels, options)
end
function p._labelledList (pages, labels, options)
if options.ifexists then
for k = #pages, 1, -1 do --iterate backwards to allow smooth removals
local v = pages[k]
local title = mw.title.new(getTarget(v), namespace)
if (v == '') or title == nil or not title.exists then
table.remove(pages, k)
end
end
end
labels = labels or {}
label = (#pages == 1 and labels[1] or labels[2]) or defaults.label
for k, v in pairs(pages) do
if mHatnote.findNamespaceId(v) ~= 0 then
label =
(
#pages == 1 and
(labels[3] or labels[1] or defaults.label) or
(labels[4] or labels[2] or defaults.label)
) or defaults.label
end
end
if #pages == 0 then
if options.ifexists then
mw.addWarning(
string.format(
msg.noOutputWarning, options.template or defaults.template
)
)
return ''
else
return mHatnote.makeWikitextError(
msg.noInputWarning,
(options.template or defaults.template) .. msg.errorSuffix,
options.category
)
end
end
local text = string.format(
options.labelForm or defaults.labelForm,
label,
mHatlist.andList(pages, true)
)
local hnOptions = {
extraclasses = options.extraclasses,
selfref = options.selfref
}
return mHatnote._hatnote(text, hnOptions)
end
return p
b7a8ba27cf6195e6427701b94e8d2acad3c40a21
Template:Further
10
280
675
674
2023-10-18T00:16:49Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Further]]
wikitext
text/x-wiki
<includeonly>{{#invoke:labelled list hatnote|labelledList|Further information{{#if:{{{topic|}}}| on {{{topic|}}}}}}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
dd29c6dfb3894a2dc3f20144a654b7012c9a9214
Template:Trim
10
281
677
676
2023-10-18T00:16:50Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Trim]]
wikitext
text/x-wiki
<includeonly>{{safesubst:#if:1|{{{1|}}}}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
3d29fbfff9683523147db6e1f55c0e17ed30863b
Template:Diff
10
282
679
678
2023-10-18T00:16:50Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Diff]]
wikitext
text/x-wiki
<span class="plainlinks">[{{#if:{{{title|{{{page|{{{1|}}}}}}}}}
|{{fullurl:{{{title|{{{page|{{{1}}}}}}}}}|{{#if:{{{diff|{{{2|}}}}}}
|diff={{trim|{{{diff|{{{2}}}}}}}}&
}}oldid={{trim|{{{oldid|{{{3|}}}}}}}}}}
|{{SERVER}}{{SCRIPTPATH}}/index.php?title={{#if:{{{diff|{{{2|}}}}}}
|&diff={{trim|{{{diff|{{{2}}}}}}}}
}}&oldid={{trim|{{{oldid|{{{3|}}}}}}}}
}}{{#ifeq:{{{diffonly|}}}|yes|&diffonly=1}} {{{label|{{{4|}}}}}}]</span><noinclude>
{{documentation}}
</noinclude>
32a6320b7d9c2652396a60306875ca9c97d3273e
Template:T
10
283
681
680
2023-10-18T00:16:52Z
LamayII
2
1 revision imported from [[:wikipedia:Template:T]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
{{Rcat shell|
{{R from template shortcut}}
}}
<!-- Used as Template:tl throughout English Wikipedia; demo template referenced only on meta -->
bb10dbc83695404528dbc095ea267429142c7f05
Template:Italics correction
10
284
683
682
2023-10-18T00:16:52Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Italics_correction]]
wikitext
text/x-wiki
<span style="padding-right:0.15em;">{{{1}}}</span><noinclude>
{{Documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKI LINK ON THE DOCUMENTATION PAGE. -->
</noinclude>
e03ce33da89b58bc1b12b6ecfe93700d98be1ab5
Template:Template display
10
285
685
684
2023-10-18T00:16:54Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Template_display]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Message box|ombox|type=notice
|image={{#switch:{{{1}}}|adaptive=[[File:Different devices simple.svg|65x65px|link=|alt=]]|nomobile=[[File:Handheld devices no.svg|55px|link=|alt=]]|nodesktop=[[File:Desktop devices no.svg|55px|link=|alt=]]}}
|text={{#switch:{{{1}}}
| adaptive = This template is [[Adaptive web design|responsive]] and <strong>displays differently in mobile and desktop view</strong>. Read the documentation for an explanation of the differences and why they exist.
| nomobile = This template does ''not'' display in the mobile view of Wikipedia; it is <strong>desktop only</strong>. Read the documentation for an explanation.
| nodesktop = This template does ''not'' display in the desktop view of Wikipedia; it is <strong>mobile only</strong>. Read the documentation for an explanation.
| nomobilesidebar = This template does ''not'' display in the mobile view of Wikipedia; it is <strong>desktop only</strong>. Read the [[Template:Sidebar/doc|parent documentation]] for an explanation.
| badmobile = This template contains coding that is not compatible with [[Help:Mobile access|mobile versions of Wikipedia]], causing display and [[Wikipedia:Manual of Style/Accessibility|accessibility problems]]. Read the documentation for an explanation.
| vector2022 = This template does not work properly in the [[Wikipedia:Vector 2022|Vector 2022]] skin. Read the documentation for an explanation.
| #default = {{{1}}}
}}}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
64120ce3ee6e8e7eef9ec22c8910cc845ef2381b
Module:Transclusion count/data/S
828
286
687
686
2023-10-18T00:16:54Z
LamayII
2
1 revision imported from [[:wikipedia:Module:Transclusion_count/data/S]]
Scribunto
text/plain
return {
["S"] = 3500,
["S-aca"] = 6400,
["S-ach"] = 16000,
["S-aft"] = 218000,
["S-aft/check"] = 218000,
["S-aft/filter"] = 218000,
["S-bef"] = 223000,
["S-bef/check"] = 223000,
["S-bef/filter"] = 223000,
["S-break"] = 5100,
["S-civ"] = 2600,
["S-dip"] = 5300,
["S-end"] = 246000,
["S-gov"] = 7900,
["S-hon"] = 3800,
["S-hou"] = 9500,
["S-inc"] = 13000,
["S-legal"] = 9400,
["S-mil"] = 12000,
["S-new"] = 16000,
["S-non"] = 10000,
["S-npo"] = 4100,
["S-off"] = 41000,
["S-par"] = 50000,
["S-par/en"] = 3300,
["S-par/gb"] = 3300,
["S-par/uk"] = 12000,
["S-par/us-hs"] = 11000,
["S-par/us-sen"] = 2000,
["S-ppo"] = 13000,
["S-prec"] = 3200,
["S-rail"] = 6400,
["S-rail-start"] = 6200,
["S-rail/lines"] = 6400,
["S-reg"] = 20000,
["S-rel"] = 18000,
["S-roy"] = 2700,
["S-s"] = 3600,
["S-sports"] = 10000,
["S-start"] = 240000,
["S-ttl"] = 230000,
["S-ttl/check"] = 230000,
["S-vac"] = 6500,
["SCO"] = 3700,
["SDcat"] = 5480000,
["SECOND"] = 2300,
["SGP"] = 2600,
["SIA"] = 2600,
["SIPA"] = 2600,
["SLO"] = 4300,
["SMS"] = 7200,
["SMU"] = 2100,
["SPI_archive_notice"] = 71000,
["SPIarchive_notice"] = 71000,
["SPIcat"] = 3800,
["SPIclose"] = 3300,
["SPIpriorcases"] = 66000,
["SR/Olympics_profile"] = 3100,
["SRB"] = 3700,
["SS"] = 20000,
["SSPa"] = 2600,
["STN"] = 13000,
["SUBJECTSPACE_formatted"] = 43000,
["SUI"] = 8500,
["SVG"] = 3200,
["SVG-Logo"] = 17000,
["SVG-Res"] = 15000,
["SVG-logo"] = 3000,
["SVG_logo"] = 2000,
["SVK"] = 5900,
["SVN"] = 5200,
["SWE"] = 12000,
["Sandbox_other"] = 237000,
["Saturday"] = 2700,
["Saved_book"] = 52000,
["Sc"] = 3300,
["Scholia"] = 2800,
["School_block"] = 13000,
["School_disambiguation"] = 3400,
["Schoolblock"] = 6700,
["Schooldis"] = 2700,
["Schoolip"] = 10000,
["Scientist_icon"] = 15000,
["Scientist_icon2"] = 15000,
["Sclass"] = 31000,
["Sclass2"] = 10000,
["Screen_reader-only"] = 61000,
["Screen_reader-only/styles.css"] = 61000,
["Script"] = 6000,
["Script/Arabic"] = 2400,
["Script/Hebrew"] = 4700,
["Script/Nastaliq"] = 14000,
["Script/doc/id-unk"] = 3000,
["Script/doc/id-unk/core"] = 3000,
["Script/doc/id-unk/is-iso-alpha4"] = 2800,
["Script/doc/id-unk/name-to-alpha4"] = 3000,
["Script/styles.css"] = 3100,
["Script/styles_arabic.css"] = 2400,
["Script/styles_hebrew.css"] = 4700,
["Sdash"] = 3100,
["Search_box"] = 52000,
["Search_link"] = 16000,
["Section_link"] = 59000,
["Section_sizes"] = 2500,
["See"] = 10000,
["See_also"] = 184000,
["Seealso"] = 6600,
["Select_skin"] = 4300,
["Selected_article"] = 2700,
["Selected_picture"] = 2500,
["Self"] = 48000,
["Self-published_inline"] = 3900,
["Self-published_source"] = 6600,
["Self-reference"] = 2400,
["Self-reference_tool"] = 5400,
["Self/migration"] = 33000,
["Self2"] = 2100,
["Sent_off"] = 13000,
["Sentoff"] = 4400,
["Separated_entries"] = 182000,
["Sequence"] = 3500,
["Serial_killer_opentask"] = 3600,
["Series_overview"] = 7900,
["Serif"] = 2800,
["Set_category"] = 35000,
["Set_index_article"] = 5800,
["Sets_taxobox_colour"] = 89000,
["Sfn"] = 155000,
["SfnRef"] = 134000,
["Sfnm"] = 3600,
["Sfnp"] = 18000,
["Sfnref"] = 11000,
["Sfrac"] = 4200,
["Sfrac/styles.css"] = 4300,
["SharedIPEDU"] = 3200,
["Shared_IP"] = 11000,
["Shared_IP_advice"] = 16000,
["Shared_IP_corp"] = 5100,
["Shared_IP_edu"] = 133000,
["Shared_IP_gov"] = 3000,
["Sharedip"] = 3300,
["Sharedipedu"] = 3600,
["Sherdog"] = 2600,
["Ship"] = 85000,
["Ship/maintenancecategory"] = 85000,
["Ship_index"] = 7000,
["Shipboxflag"] = 20000,
["Shipboxflag/core"] = 20000,
["Shipwrecks_navbox_footer"] = 10000,
["Shipwrecks_navbox_footer/link"] = 10000,
["Short_description"] = 5590000,
["Short_description/lowercasecheck"] = 5590000,
["Short_pages_monitor"] = 10000,
["Short_pages_monitor/maximum_length"] = 10000,
["Shortcut"] = 20000,
["Should_be_SVG"] = 9000,
["Show_button"] = 2150000,
["Sic"] = 33000,
["Sica"] = 3100,
["Side_box"] = 1130000,
["Sidebar"] = 257000,
["Sidebar_games_events"] = 37000,
["Sidebar_person"] = 2300,
["Sidebar_person/styles.css"] = 2300,
["Sidebar_with_collapsible_lists"] = 93000,
["Sigfig"] = 3800,
["Significant_figures"] = 5100,
["Significant_figures/rnd"] = 4700,
["Signpost-subscription"] = 2100,
["Sildb_prim"] = 2000,
["Silver02"] = 16000,
["Silver2"] = 49000,
["Silver_medal"] = 5600,
["Similar_names"] = 2200,
["Single+double"] = 6900,
["Single+space"] = 14000,
["Single-innings_cricket_match"] = 3300,
["Single_chart"] = 37000,
["Single_chart/chartnote"] = 37000,
["Single_namespace"] = 204000,
["Singlechart"] = 19000,
["Singles"] = 42000,
["Sister-inline"] = 190000,
["Sister_project"] = 1040000,
["Sister_project_links"] = 11000,
["Sisterlinks"] = 2400,
["Skip_to_talk"] = 12000,
["Skip_to_talk/styles.css"] = 12000,
["Sky"] = 2700,
["Sky/styles.css"] = 2700,
["Slink"] = 14000,
["Small"] = 602000,
["Small_Solar_System_bodies"] = 3600,
["Smallcaps"] = 17000,
["Smallcaps/styles.css"] = 17000,
["Smallcaps_all"] = 3400,
["Smalldiv"] = 22000,
["Smaller"] = 73000,
["Smallsup"] = 21000,
["Smiley"] = 44000,
["Snd"] = 169000,
["Snds"] = 6400,
["Soccer_icon"] = 130000,
["Soccer_icon2"] = 130000,
["Soccer_icon4"] = 5100,
["Soccerbase"] = 13000,
["Soccerbase_season"] = 6800,
["Soccerway"] = 76000,
["Sock"] = 47000,
["Sock_list"] = 4400,
["Sockcat"] = 2000,
["Sockmaster"] = 9400,
["Sockpuppet"] = 240000,
["Sockpuppet/altmaster"] = 2200,
["Sockpuppet/categorise"] = 240000,
["SockpuppetCheckuser"] = 5500,
["Sockpuppet_category"] = 46000,
["Sockpuppet_category/confirmed"] = 24000,
["Sockpuppet_category/suspected"] = 22000,
["Sockpuppetcheckuser"] = 3600,
["Sockpuppeteer"] = 25000,
["Soft_redirect"] = 6100,
["Soft_redirect_protection"] = 8200,
["Softredirect"] = 3200,
["Solar_luminosity"] = 4500,
["Solar_mass"] = 5300,
["Solar_radius"] = 4300,
["Soldier_icon"] = 3900,
["Soldier_icon2"] = 3900,
["Song"] = 8300,
["Songs"] = 19000,
["Songs_category"] = 8400,
["Songs_category/core"] = 8400,
["Sort"] = 118000,
["Sortname"] = 53000,
["Source-attribution"] = 28000,
["Source_check"] = 964000,
["Sourcecheck"] = 964000,
["Sources"] = 2600,
["South_America_topic"] = 2500,
["Sp"] = 169000,
["Space"] = 55000,
["Space+double"] = 18000,
["Space+single"] = 13000,
["Spaced_en_dash"] = 201000,
["Spaced_en_dash_space"] = 6400,
["Spaced_ndash"] = 23000,
["Spaces"] = 2720000,
["Spain_metadata_Wikidata"] = 7500,
["Spamlink"] = 13000,
["Species_Latin_name_abbreviation_disambiguation"] = 2200,
["Species_list"] = 15000,
["Speciesbox"] = 293000,
["Speciesbox/getGenus"] = 293000,
["Speciesbox/getSpecies"] = 293000,
["Speciesbox/name"] = 293000,
["Speciesbox/parameterCheck"] = 293000,
["Speciesbox/trim"] = 293000,
["Specieslist"] = 5800,
["Split_article"] = 3600,
["Spnd"] = 4100,
["Spoken_Wikipedia"] = 2200,
["Sport_icon"] = 14000,
["Sport_icon2"] = 15000,
["SportsYearCatUSstate"] = 6500,
["SportsYearCatUSstate/core"] = 6500,
["Sports_links"] = 66000,
["Sports_reference"] = 7200,
["Squad_maintenance"] = 3500,
["Sronly"] = 59000,
["Srt"] = 5300,
["Stack"] = 25000,
["Stack/styles.css"] = 34000,
["Stack_begin"] = 9100,
["Stack_end"] = 9000,
["StaleIP"] = 3200,
["Standings_table_end"] = 54000,
["Standings_table_entry"] = 54000,
["Standings_table_entry/record"] = 54000,
["Standings_table_start"] = 54000,
["Standings_table_start/colheader"] = 54000,
["Standings_table_start/colspan"] = 54000,
["Standings_table_start/styles.css"] = 54000,
["Starbox_astrometry"] = 5100,
["Starbox_begin"] = 5300,
["Starbox_catalog"] = 5200,
["Starbox_character"] = 5100,
["Starbox_detail"] = 5000,
["Starbox_end"] = 5300,
["Starbox_image"] = 2900,
["Starbox_observe"] = 5100,
["Starbox_reference"] = 5200,
["Start-Class"] = 18000,
["Start-date"] = 3700,
["Start_and_end_dates"] = 3800,
["Start_box"] = 8000,
["Start_date"] = 437000,
["Start_date_and_age"] = 142000,
["Start_date_and_years_ago"] = 6500,
["Start_date_text"] = 3800,
["Start_of_course_timeline"] = 6200,
["Start_of_course_week"] = 6300,
["Start_tab"] = 5000,
["Startflatlist"] = 144000,
["Static_IP"] = 6000,
["Station"] = 7800,
["Station_link"] = 16000,
["Stdinchicite"] = 11000,
["Steady"] = 14000,
["Stl"] = 14000,
["Stn"] = 7300,
["Stn_art_lnk"] = 2000,
["Stnlnk"] = 30000,
["Storm_colour"] = 5200,
["Storm_path"] = 2100,
["StoryTeleplay"] = 3500,
["Str_endswith"] = 201000,
["Str_find"] = 115000,
["Str_index"] = 13000,
["Str_left"] = 910000,
["Str_len"] = 19000,
["Str_letter"] = 176000,
["Str_letter/trim"] = 20000,
["Str_number"] = 8000,
["Str_number/trim"] = 170000,
["Str_rep"] = 314000,
["Str_trim"] = 5300,
["Str_≠_len"] = 35000,
["Str_≥_len"] = 73000,
["Strfind_short"] = 226000,
["Strikethrough"] = 16000,
["String_split"] = 2900,
["Strip_tags"] = 38000,
["Strong"] = 866000,
["Structurae"] = 2100,
["Stub-Class"] = 17000,
["Stub_Category"] = 13000,
["Stub_category"] = 18000,
["Stub_documentation"] = 36000,
["Student_editor"] = 27000,
["Student_sandbox"] = 4500,
["Student_table_row"] = 5400,
["Students_table"] = 5400,
["Su"] = 9800,
["Su-census1989"] = 4500,
["Sub"] = 4200,
["Subinfobox_bodystyle"] = 36000,
["Subject_bar"] = 19000,
["Suboff"] = 6200,
["Subon"] = 6300,
["Subpage_other"] = 292000,
["Subscription"] = 4200,
["Subscription_required"] = 34000,
["Subsidebar_bodystyle"] = 6400,
["Subst_only"] = 4600,
["Substituted_comment"] = 19000,
["Succession_box"] = 118000,
["Succession_box/check"] = 118000,
["Succession_links"] = 164000,
["Summer_Olympics_by_year_category_navigation"] = 2400,
["Summer_Olympics_by_year_category_navigation/core"] = 2400,
["Sunday"] = 2700,
["Sup"] = 59000,
["Suppress_categories"] = 5300,
["Surname"] = 66000,
["Swiss_populations"] = 2400,
["Swiss_populations_NC"] = 3000,
["Swiss_populations_YM"] = 2300,
["Swiss_populations_ref"] = 2400,
["Switcher"] = 3100,
["Module:SDcat"] = 5480000,
["Module:SPI_archive_notice"] = 33000,
["Module:Science_redirect"] = 258000,
["Module:Science_redirect/conf"] = 258000,
["Module:Section_link"] = 59000,
["Module:Section_sizes"] = 3600,
["Module:See_also_if_exists"] = 73000,
["Module:Separated_entries"] = 2300000,
["Module:Series_overview"] = 7900,
["Module:Settlement_short_description"] = 712000,
["Module:Shortcut"] = 24000,
["Module:Shortcut/config"] = 24000,
["Module:Shortcut/styles.css"] = 24000,
["Module:Side_box"] = 1170000,
["Module:Side_box/styles.css"] = 1160000,
["Module:Sidebar"] = 340000,
["Module:Sidebar/configuration"] = 340000,
["Module:Sidebar/styles.css"] = 346000,
["Module:Sidebar_games_events"] = 37000,
["Module:Sidebar_games_events/styles.css"] = 37000,
["Module:Singles"] = 42000,
["Module:Sister_project_links"] = 15000,
["Module:Sister_project_links/bar/styles.css"] = 3500,
["Module:Sister_project_links/styles.css"] = 11000,
["Module:Sock_list"] = 4400,
["Module:Sort_title"] = 18000,
["Module:Sortkey"] = 200000,
["Module:Split_article"] = 3600,
["Module:Spoken_Wikipedia"] = 2200,
["Module:Spoken_Wikipedia/configuration"] = 2200,
["Module:Spoken_Wikipedia/styles.css"] = 2200,
["Module:Sports_career"] = 19000,
["Module:Sports_color"] = 68000,
["Module:Sports_color/baseball"] = 34000,
["Module:Sports_color/basketball"] = 22000,
["Module:Sports_color/ice_hockey"] = 3100,
["Module:Sports_rbr_table"] = 12000,
["Module:Sports_rbr_table/styles.css"] = 12000,
["Module:Sports_reference"] = 7200,
["Module:Sports_results"] = 15000,
["Module:Sports_results/styles.css"] = 9500,
["Module:Sports_table"] = 58000,
["Module:Sports_table/WDL"] = 51000,
["Module:Sports_table/WDL_OT"] = 2700,
["Module:Sports_table/WL"] = 4000,
["Module:Sports_table/WL_OT"] = 2000,
["Module:Sports_table/argcheck"] = 58000,
["Module:Sports_table/styles.css"] = 58000,
["Module:Sports_table/sub"] = 59000,
["Module:Sports_table/totalscheck"] = 42000,
["Module:Stock_tickers/NYSE"] = 2100,
["Module:Storm_categories"] = 5200,
["Module:Storm_categories/categories"] = 5200,
["Module:Storm_categories/colors"] = 5200,
["Module:Storm_categories/icons"] = 5200,
["Module:String"] = 11400000,
["Module:String2"] = 2300000,
["Module:Su"] = 12000,
["Module:Subject_bar"] = 19000,
["Module:Suppress_categories"] = 5300,
}
d06bcd4fb165f8dc98283433a02d1f8aa79aacc3
Template:Generic template demo
10
287
689
688
2023-10-18T00:16:58Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Generic_template_demo]]
wikitext
text/x-wiki
#REDIRECT [[Template:Parameter names example]]
{{R semiprotected}}
[[Category:Wikipedia utility templates]]
[[Category:Template namespace templates]]
[[Category:Documentation assistance templates]]
22f645541f749cfd0eeffdee734b51b284103400
Template:Sidebar with collapsible lists/doc
10
288
691
690
2023-10-18T00:16:59Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Sidebar_with_collapsible_lists/doc]]
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]). -->
{{High-use| 64996 }}
{{Template display|nomobile}}
{{Lua|Module:Sidebar}}
{{tl|Sidebar with collapsible lists}} is a version of {{tl|Sidebar}} which offers [[Help:Collapsing|collapsible]] lists in addition to Sidebar's ''content'' parameters.
== Usage ==
{{Generic template demo
|name={{PAGENAME}} |pretitle |title |image |above |heading1 |list1title |list1 |list2title |list2
|heading3={{{heading{{italics correction|''N''}}}}} |list3title={{{list{{italics correction|''N''}}title}}} |list3={{{list{{italics correction|''N''}}}}} |content4={{{content{{italics correction|''N''}}}}}
|below
}}
Parameters with infrequent use omitted.
<syntaxhighlight lang="wikitext">
{{Sidebar with collapsible lists
| name = {{subst:PAGENAME}}
| pretitle =
| title =
| image =
| templatestyles =
| expanded = {{{expanded|}}}
| heading1 =
| list1name =
| list1title =
| list1 =
| heading2 =
| list2name =
| list2title =
| list2 =
<!-- ...... -->
| headingN = <!-- Template:Sidebar's "headingN" and/or "contentN" parameters (where -->
| contentN = <!-- N is a number) may be used to include uncollapsible lists/content -->
<!-- ...... -->
| below =
}}
</syntaxhighlight>
== Parameters ==
{{further|Template:Sidebar#Parameters}}
This template takes all {{tl|sidebar}} parameters. In addition:
; {{para|list<sub>n</sub>title}}
: The displayed title of the collapsible list<sub>n</sub>.
; {{para|list<sub>n</sub>}}
: The contents of the collapsible list<sub>n</sub>.
; {{para|list<sub>n</sub>class}}
: A class can be added to target a specific list either with TemplateStyles or microformats. See [[Template:Sidebar#Classes]].
: In the context of TemplateStyles, specific list contents can be targeted like so: <code>.templateclass .listnclass .sidebar-list-title</code> for a specific list title and <code>.templateclass .listnclass .sidebar-list</code> for a specific list.
; {{para|expanded}} {{nobold|and}} {{para|list<sub>n</sub>name}}
: {{para|expanded}} is used to indicate which (if any) list named {{para|list<sub>n</sub>name}} is shown expanded when the template is first displayed; see {{tl|Collapsible lists option}}.
; {{para|centered list titles}}
: Set to anything (though {{para|centered list titles|y}} or {{para|centered list titles|yes}} are idiomatic) to make the sidebar list titles centered. This works around some not-great behavior in how centered text interacts with the collapsible toggle.
{{Sidebar with collapsible lists |list1={{{list1}}} without {{{list1title}}} |navbar=off}}
A {{para|list<sub>n</sub>}} without a {{para|list<sub>n</sub>title}} displays the default title ("List").
== Handling long links ==
{{further|Template:Sidebar#Handling long links}}
See [[Template:Sidebar#Handling long links]].
== TemplateStyles ==
The classes available for styling, besides those listed in [[Template:Sidebar#TemplateStyles]], are:
; <code>.sidebar-collapse</code>
: The top-level {{tl|sidebar with collapsible lists}} class.
; <code>.sidebar-list</code>
: The class is a container when either {{para|list<sub>n</sub>title}} or {{para|list<sub>n</sub>}} is provided in {{tl|sidebar with collapsible lists}}.
; <code>.sidebar-list-title</code>
: The class associated with a {{para|list<sub>n</sub>title}}. Every list title will have this class. Use the {{para|centered list titles}} to center text instead of adding CSS here.
; <code>.sidebar-list-content</code>
: The class associated with a {{para|list<sub>n</sub>}}. Every list content will have this class.
== Deprecated parameters ==
{{further|Template:Sidebar#Deprecated parameters}}
These parameters are deprecated for the same reason as the style parameters in {{t|Sidebar}} template.
; ''listtitlestyle'' {{nobold|and}} ''liststyle''
: These are the equivalent of, respectively, {{tl|Collapsible list}}'s ''titlestyle'' and ''liststyle'' parameters.
; ''listframestyle''
: Sets the framestyle (see {{tl|Collapsible list}}) for the lists.
; ''listNframestyle''
: Sets the framestyle for ''listN'', overriding ''listframestyle''.
; ''listNtitlestyle''
: Sets the titlestyle for ''listN'', overriding ''listtitlestyle'' above.
; ''listNstyle''
: Sets the liststyle for ''listN'', overriding ''liststyle'' above.
== See also ==
* {{diff|Template:Sidebar with collapsible lists|next|544062416|Last pre-Lua version}}
* {{tl|Collapsible list}}
* {{tl|Collapsible lists option}}
* {{tl|Navbox with collapsible groups}}
* {{tl|Sidebar}}
* [[Wikipedia:UBLIST]], for help in using unbulleted lists in fields.
<includeonly>{{#ifeq:{{PAGENAME}}|Sidebar with collapsible lists|
<!-- Categories go below this line, please; interwikis go to Wikidata, thank you! -->
[[Category:Sidebar meta-templates]]
[[Category:Collapse templates]]
}}</includeonly>
ad3358062eab0432c04637e90478fb08b0f09bd8
Template:Law sidebar style
10
289
693
692
2023-10-18T00:17:54Z
LamayII
2
1 revision imported from [[:wikipedia:Template:Law_sidebar_style]]
wikitext
text/x-wiki
{{#switch:{{{1|}}}
| title =
| heading = background:#aaddff; color:#000;
| above = font-weight:normal;
| below = padding:0.4em;border-top:1px #aaa solid;font-weight:normal;font-size:smaller;
}}<noinclude>
{{documentation
|content =
This auxiliary template is used by various [[:Category:Law templates|law-related templates]] to set [[Template:Sidebar|Sidebar]] coloring and padding style parameters.
== Example ==
<syntaxhighlight lang="wikitext">
{{Sidebar
| titlestyle = {{law sidebar style|title}}
| headingstyle = {{law sidebar style|heading}}
| abovestyle = {{law sidebar style|above}}
| belowstyle = {{law sidebar style|below}}
...
}}
</syntaxhighlight>
[[Category:Law templates|τ]]
}}<!--(end documentation)--></noinclude>
71bf873685fc3d691b81575c1520d763cdfdc300
Template:Santa Modesta law
10
290
694
2023-10-18T00:32:53Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
{{Sidebar with collapsible lists
| outertitle =
| title = [[Law of Santa Modesta|Santa Modesta law]]
|image = [[File:SMState_Seal.png|200px]]
|caption= Great Seal of Santa Modesta
| titlestyle = {{law sidebar style|title}}
| headingstyle = {{law sidebar style|heading}}
| listtitlestyle = {{law sidebar style|heading}}
| listclass = hlist
| bodyclass = hlist
| heading1 = [[Constitution of Santa Modesta|Constitution]]
|heading2=[[Santa Modesta Codes|Codes]]
|content2=
* [[Santa Modesta Civil Code|Civil]]
* [[Santa Modesta Code Procedure|Civil Procedure]]
* [[Santa Modesta Evidence Code|Evidence]]
* [[Santa Modesta Penal Code|Penal]]
* [[Santa Modesta Vehicle Code|Vehicle]]
|heading3=[[Courts of California|Courts of record]]
|content3=
* [[Supreme_Court_of_Santa_Modesta|Supreme Court]]
* [[Santa Modesta superior courts|Superior courts]]
|list6title=[[Santa Modesta Codified Statutes]]
|list6=
* [[Vehicle Code]]
* [[Penal Code]]
* [[Los Alameda County Ordinances]]
* [[Los Alameda Municipal Ordinances]]
|heading4=Acts of Congress
| content4 = [[Senate Assembly|Santa Modesta Senate Assembly]]
|list7title=[[Criminal law]]
|list7=
* [[Transient Nefariousness Defense Act of 1988]]
|list8title=[[Civil rights law]]
|list8=
* [[1996 Santa Modesta Proposition 209|Prop 209]] (public affirmative action ban)
* [[Santa Modesta Act to Save Lives|Act to Save Lives]]
* [[Santa Modesta_Art_Preservation_Act|Art Preservation Act]]
* [[Santa Modesta Celebrities Rights Act|Celebrities Rights Act]]
* [[Santa Modesta Fair Employment and Housing Act of 1959|Fair Employment and Housing Act]]
* [[Fair procedure]]
* [[Santa Modesta_Public_Records_Act|Public Records Act]]
* [[Santa Modesta Shield Law|Shield Law]]
* [[Pruneyard Shopping Center v. Robins|Free speech on privately owned property]]
* [[Unruh Civil Rights Act]]
}}
429881403166807039aaf306576e5a1238d3043f
Template:State Portal
10
291
696
2023-10-18T00:55:44Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
<h1 style="border-width:1px; border-style:solid; margin-top:3px; margin-bottom:0.5em; padding:0.2em 0.4em; font-size:120%; font-weight:bold; font-family:inherit; background:#cef2e0; border-color: #a3bfb1; text-align: center">State of Santa Modesta Portal</h1>
<h3>State Law</h3>
72647ddf0bdb8a7b252067ce5e0e4de3bb945dfc
697
696
2023-10-18T01:21:11Z
LamayII
2
Added new lists to the portal
wikitext
text/x-wiki
<h1 style="border-width:1px; border-style:solid; margin-top:3px; margin-bottom:0.5em; padding:0.2em 0.4em; font-size:120%; font-weight:bold; font-family:inherit; background:#cef2e0; border-color: #a3bfb1; text-align: center">State of Santa Modesta Portal</h1>
<h2>State Laws and Legal Portal</h2>
{| class="wikitable"
|-
! [[Law of Santa Modesta]]
|-
| [[https://docs.google.com/spreadsheets/d/1xeaCaITHKdoy8Bt3J55KvBTY3V5F5y-hreJHJiIZT4g/edit#gid=842715947| Santa Modesta State Index]]
|-
| [[State Penal Code]]
|-
|-
! Judicial Process
|-
| [[Case_Laws|List of Case Laws and Legal Precedent]]
|}
<h2>Department Portal</h2>
{| class="wikitable"
|-
! [[Departments|Departments and Agencies in Santa Modesta]]
|-
|-
! State Agencies
|-
| [[Santa Modesta Highway Patrol]]
|-
| [[Department Of Justice|Santa Modesta Department of Justice]]
|-
| [[Santa Modesta Military Department]]
|-
| [[Santa Modesta Bureau of Investigation]]
|-
| [[Santa Modesta Office of the Attorney General]]
|-
| [[Peace Officer Standards and Training Commission]]
|-
! Local Agencies
|-
|
===[[Los Alameda County]]===
|-
| [[Los Alameda County Sheriff's Department]]
|-
| [[Los Alameda County Fire Department]]
|-
| [[Los Alameda Police Department]]
|-
|}
a0bdc419b7c9b5cd7397b60ad434e24878eed8c0
Departments
0
292
699
2023-10-18T01:25:26Z
LamayII
2
redirect
wikitext
text/x-wiki
# REDIRECT Category:Departments
40ed20c7e7056f6e5810e087782943136482d5ec
700
699
2023-10-18T01:26:15Z
LamayII
2
redirectv2
wikitext
text/x-wiki
#REDIRECT [[Category:Departments]]
ab809054b7197b1df961d4966ec9578e34e2757b
Category:Departments
14
293
702
2023-10-18T01:30:22Z
LamayII
2
Created blank page
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Santa Modesta Highway Patrol
0
255
703
622
2023-10-18T01:31:44Z
LamayII
2
Added category
wikitext
text/x-wiki
{{Infobox law enforcement agency|agencyname=Santa Modesta Highway Patrol|badge=File:SMHP_Badge.png|badgecaption=Badge|logocaption=Flag|motto=''”Safety, Service, & Security”''|formedyear=1929|budget=~> 100 Employees|legaljuris=State-wide law enforcement|governingbody=[[Department of Justice]]|chief1name=Catonius|chief1position=Commissioner|chief2position=Deputy Commissioner|chief2name=Yankaldo|logo=SMHP_Logo.png}}
The '''Santa Modesta Highway Patrol''' ('''SMHP''') is a state law enforcement agency of the state of [[Santa Modesta]]. The SMHP has primary patrol jurisdiction over all Santa Modesta highways and roads and streets outside city limits, and can exercise law enforcement powers anywhere within the state. The Santa Modesta Highway Patrol can assist local and county agencies and can patrol major city streets along with local and county law enforcement, state and interstate highways, and is the primary law enforcement agency in rural parts of the state.
==History==
Originally residing as a branch of the Division of Motor Vehicles in the Department of Public Works, the '''Santa Modesta Highway Patrol''' was established in 1929, subsequently becoming a separate department with its legislation signed in 1947. The SMHP gradually increased its responsibilities in patrolling jurisdictions over Santa Modesta highways, streets, and roads outside of municipal limits, providing protections to state buildings and facilities, and most notably providing assistance in investigations into motor vehicle related incidents within the state.
[[Category:Departments]]
ca9137044b04610ed0fd6e7436b883bbe0e0aca4
Santa Modesta Military Department
0
276
704
668
2023-10-18T01:31:49Z
LamayII
2
Added category
wikitext
text/x-wiki
{{Infobox military unit|unit_name=Santa Modesta Military Department|image=File:SMNG_Logo.png|country=United States|allegiance=State of Santa Modesta|branch=United States Army
United States Air Force|type=National Guard|role=Organized Militia|size=24,000|motto=''"Always Ready, Always There!"''|garrison=Los Alameda, Santa Modesta|nickname=* SanGuard
* SMMD
* SMNG|command_sergeant_major=CSM Sergeant McLeaderson|current_commander_label=Commander in Chief|current_commander=[[Governor of Santa Modesta]]|commander3_label=Adjutant General|commander3=MG ab2snt|start_date=July 14, 1848|caption=Seal of the Santa Modesta Military Department}}
The '''Santa Modesta Military Department''' is an agency defined under the Santa Modesta Military and Veterans code § 50. It includes the '''Santa Modesta Army and Air National Guards, and the Santa Modesta State Guard.'''<ref>https://www.roblox.com/groups/16383993/Santa-Modesta-Military-Department#!/about</ref>
The Santa Modesta Military Department and the '''Santa Modesta National Guard (SanGuard)''' are sometimes referred to interchangeably.
==Office of the Adjutant General==
The Office of the Adjutant General (OTAG) consists of:
*The Adjutant General (TAG)
*The Deputy Adjutant General (DAG)
*Assistant Adjutant General, Army (AAG Army)
*Assistant Adjutant General, Air (AAG Air)
*Chief of Staff and Director, Joint Staff (CoS/Dir. JS)
*and others as prescribed by laws or regulations of the United States
==Santa Modesta National Guard ==
The '''Santa Modesta National Guard''' is part of the [https://en.wikipedia.org/wiki/National_Guard_(United_States) National Guard of the United States], a dual federal-state military reserve force. The '''SM National Guard''' has three components: the [[SM Army National Guard]], [[SM Air National Guard]], and [[SM State Guard]]. With a total strength of over 24,000 troops, it is the largest National Guard in the United States. As of January 2012, Santa Modesta National Guardsmen have been deployed overseas more than 38,000 times since 2001, during which time thirty-one Guardsmen have been killed in the [https://en.wikipedia.org/wiki/War_on_terror Global War on Terrorism].
The [https://en.wikipedia.org/wiki/Constitution_of_the_United_States Constitution of the United States] specifically charges the National Guard with dual federal and state missions. When under the control of its state governor, National Guard functions range from limited actions during non-emergency situations to full scale law enforcement of [https://en.wikipedia.org/wiki/Martial_law martial law] when local law enforcement officials can no longer maintain civil control. The National Guard may be called into federal service in response to a call by the [https://www.roblox.com/users/3662604051/profile President] or [https://en.wikipedia.org/wiki/Congress_of_the_United_States Congress].
When National Guard troops are called to federal service, the President serves as Commander-In-Chief. The federal mission assigned to the National Guard is: "To provide properly trained and equipped units for prompt mobilization for war, national emergency or as otherwise needed."
The [[Governor of Santa Modesta]] may call individuals or units of the Santa Modesta National Guard into state service during emergencies or special situations. The state mission of the National Guard is: "To provide trained and disciplined forces for domestic emergencies or as otherwise provided by state law."
===Components===
*Santa Modesta Army National Guard (SM ARNG)
*Santa Modesta Air National Guard (SM ANG)
*Santa Modesta State Guard (SMSG)
== References ==
<references />
[[Category:Departments]]
c8dca8b52136f6134b5485b95296cbbb0de6e8ba
Los Alameda Police Department
0
146
705
392
2023-10-18T01:31:55Z
LamayII
2
Added category
wikitext
text/x-wiki
{{Infobox law enforcement agency|agencyname=Los Alameda Police Department|abbreviation=LAPD|motto=''To Protect and To Serve''|formed=December 13, 1869|legaljuris=Municipal law enforcement|chief1name=Richard MacPherson Smith II|chief1position=Chief of Police|budget=>~ 100 Employees|badge=Lapd_badge.png}}
The '''Los Angeles Police Department''' ('''LAPD'''), officially known as the '''City of Los Angeles Police Department''', is the primary law enforcement agency of Los Angeles, California, United States. It is the largest municipal police department in the State of Santa Modesta.
== History ==
Following the rise of violence, gambling, and vice, the Los Alameda Rangers and Los Alameda City Guards proved insufficient in quelling unruly behavior within the municipality. By 1869, the two volunteer forces were amalgamated by the City Marshal, whom of which appointed six officers to serve under, eventually growing to become the first paid municipal police service in the city. To this day the department expands its resources and capabilities in serving all districts within the City of Los Alameda.
[[Category:Departments]]
894ad4009f986dda9c904cc0a80d000871a110a5
717
705
2023-10-18T17:24:49Z
LamayII
2
Fixed infobox; unspec lore
wikitext
text/x-wiki
{{Infobox law enforcement agency|agencyname=City of Los Alameda Police Department|abbreviation=LAPD|motto=''To Protect and To Serve''|formed=December 13, 1869|legaljuris=Municipal law enforcement|chief1name=Richard MacPherson Smith II|chief1position=Chief of Police|budget=>~ 100 Employees|badge=Lapd_badge.png|commonname=Los Alameda Police Department}}
The '''Los Alameda Police Department''' ('''LAPD'''), officially known as the '''City of Los Alameda Police Department''', is the primary law enforcement agency of Los Alameda, Santa Modesta. It is the largest municipal police department in the State of Santa Modesta.
== History ==
Following the rise of violence, gambling, and vice, the Los Alameda Rangers and Los Alameda City Guards proved insufficient in quelling unruly behavior within the municipality. By 1869, the two volunteer forces were amalgamated by the City Marshal, whom of which appointed six officers to serve under, eventually growing to become the first paid municipal police service in the city. To this day the department expands its resources and capabilities in serving all districts within the City of Los Alameda.
[[Category:Departments]]
c8cec32dafe7e9499eb654c785f76a22c7ad68f4
Penal Code ~ TITLE 2. OF OFFENSES AGAINST THE SOVEREIGNTY OF THE STATE
0
294
706
2023-10-18T04:19:25Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
{| class="wikitable"
!Citation
!
==='''TITLE 2. OF OFFENSES AGAINST THE SOVEREIGNTY OF THE STATE'''===
|-
|2 SM Stat. § 201
|(a) Treason against this state consists only in levying war against it, adhering to its enemies, or giving them aid and comfort, and can be committed only by persons owing allegiance to the state. The punishment of treason shall be death or 120 minutes imprisonment. The penalty shall be determined pursuant to Sections 190.3 and 190.4.
(b) Upon a trial for treason, the defendant cannot be convicted unless upon the testimony of two witnesses to the same overt act, or upon confession in open court; nor, except as provided in Sections 190.3 and 190.4, can evidence be admitted of an overt act not expressly charged in the indictment or information; nor can the defendant be convicted unless one or more overt acts be expressly alleged therein.
|-
|2 SM.Stat. § 202
|Misprision of treason is the knowledge and concealment of treason, without otherwise assenting to or participating in the crime. It is punishable by imprisonment pursuant to subdivision (h) of Section 1170.
|}
de1c9c723a9ca43da6cc5e142ac301e73475d18d
711
706
2023-10-18T04:39:51Z
LamayII
2
wikitext
text/x-wiki
''See [[Santa Modesta Penal Code|Penal Code]]''
{| class="wikitable"
!Citation
!
==='''TITLE 2. OF OFFENSES AGAINST THE SOVEREIGNTY OF THE STATE'''===
|-
|2 SM Stat. § 201
|(a) Treason against this state consists only in levying war against it, adhering to its enemies, or giving them aid and comfort, and can be committed only by persons owing allegiance to the state. The punishment of treason shall be death or 120 minutes imprisonment. The penalty shall be determined pursuant to Sections 190.3 and 190.4.
(b) Upon a trial for treason, the defendant cannot be convicted unless upon the testimony of two witnesses to the same overt act, or upon confession in open court; nor, except as provided in Sections 190.3 and 190.4, can evidence be admitted of an overt act not expressly charged in the indictment or information; nor can the defendant be convicted unless one or more overt acts be expressly alleged therein.
|-
|2 SM.Stat. § 202
|Misprision of treason is the knowledge and concealment of treason, without otherwise assenting to or participating in the crime. It is punishable by imprisonment pursuant to subdivision (h) of Section 1170.
|}
c32aea69c4056a475a2f954376c4240c8e639438
Santa Modesta Penal Code
0
295
707
2023-10-18T04:20:38Z
LamayII
2
Penal Code Test
wikitext
text/x-wiki
{{Santa Modesta law}}
The '''Penal Code of Santa Modesta''' defines criminal penalties for the commission of crimes within the State of Santa Modesta. The penal code forms the basis for the application of most criminal law, criminal procedure, penal institutions, and the execution of sentences, among other things.
== Titles & Penal Sections ==
=== '''TITLE 1. OF PERSONS LIABLE TO PUNISHMENT FOR CRIME''' ===
=== '''[[Penal Code ~ TITLE 2. OF OFFENSES AGAINST THE SOVEREIGNTY OF THE STATE|TITLE 2. OF OFFENSES AGAINST THE SOVEREIGNTY OF THE STATE]]''' ===
=== TITLE 3. OF CRIMES BY AND AGAINST THE EXECUTIVE POWER OF THE STATE ===
df51210920fe44664421ad323867d7785fcaf2ad
708
707
2023-10-18T04:24:11Z
LamayII
2
Added table and citation
wikitext
text/x-wiki
{{Santa Modesta law}}
The '''Penal Code of Santa Modesta''' defines criminal penalties for the commission of crimes within the State of Santa Modesta. The penal code forms the basis for the application of most criminal law, criminal procedure, penal institutions, and the execution of sentences, among other things.
== Titles & Penal Sections ==
{| class="wikitable"
|+
|'''Citation'''
|'''Title'''
|-
|2 SM.Stat 1.
|'''TITLE 1. OF PERSONS LIABLE TO PUNISHMENT FOR CRIME'''
|-
|2 SM.Stat 2.
|'''[[Penal Code ~ TITLE 2. OF OFFENSES AGAINST THE SOVEREIGNTY OF THE STATE|TITLE 2. OF OFFENSES AGAINST THE SOVEREIGNTY OF THE STATE]]'''
|-
|2 SM.Stat 3.
|'''TITLE 3. OF CRIMES BY AND AGAINST THE EXECUTIVE POWER OF THE STATE'''
|}
fe9c3992ae3a107a3e1f3c9516f5099cfe25b41d
713
708
2023-10-18T04:40:53Z
LamayII
2
Title 3
wikitext
text/x-wiki
{{Santa Modesta law}}
The '''Penal Code of Santa Modesta''' defines criminal penalties for the commission of crimes within the State of Santa Modesta. The penal code forms the basis for the application of most criminal law, criminal procedure, penal institutions, and the execution of sentences, among other things.
== Titles & Penal Sections ==
{| class="wikitable"
|+
|'''Citation'''
|'''Title'''
|-
|2 SM.Stat 1.
|'''TITLE 1. OF PERSONS LIABLE TO PUNISHMENT FOR CRIME'''
|-
|2 SM.Stat 2.
|'''[[Penal Code ~ TITLE 2. OF OFFENSES AGAINST THE SOVEREIGNTY OF THE STATE|TITLE 2. OF OFFENSES AGAINST THE SOVEREIGNTY OF THE STATE]]'''
|-
|2 SM.Stat 3.
|'''[[Penal Code ~ TITLE 3. OF CRIMES BY AND AGAINST THE EXECUTIVE POWER OF THE STATE|TITLE 3. OF CRIMES BY AND AGAINST THE EXECUTIVE POWER OF THE STATE]]'''
|}
ab50a83fb155d61d7b9fb85fd7632f6a8f1ab36e
Penal Code ~ TITLE 3. OF CRIMES BY AND AGAINST THE EXECUTIVE POWER OF THE STATE
0
296
709
2023-10-18T04:37:15Z
LamayII
2
Initial Commit
wikitext
text/x-wiki
{| class="wikitable"
!Citation
!
==='''TITLE 3. OF CRIMES BY AND AGAINST THE EXECUTIVE POWER OF THE STATE'''===
|-
|2 SM Stat. § 201
|
* (a) Every person who gives or offers any bribe to any executive officer in this state, with intent to influence him in respect to any act, decision, vote, opinion, or other proceeding as such officer, is disqualified from holding any office in this state.
|-
|2 SM.Stat. § 202
|
* (a) Every executive or ministerial officer, employee, or appointee of the State of Santa Modesta, or any county or city therein, or any political subdivision thereof, who knowingly asks, receives, or agrees to receive any emolument, gratuity, or reward, or any promise thereof excepting such as may be authorized by law for doing an official act, is guilty of a misdemeanor
|-
|2 SM.Stat. § 203
|
* (a) Every person who knowingly and willingly threatens the life of, or threatens serious bodily harm to, any elected public official, exempt appointee of the Governor, judge, or the staff of any elected public official, with the specific intent that the statement is to be taken as a threat, and the apparent ability to carry out that threat by any means, is guilty of a public offense, punishable as follows:
** (1) The offense is punishable by a fine not exceeding five thousand dollars ($5,000), or by imprisonment pursuant to subdivision (h) of Section 1170, or in a county jail not exceeding one year, or by both that fine and imprisonment.
|}
ecc3d06140f35a039014582636547250da08d85b
712
709
2023-10-18T04:40:01Z
LamayII
2
wikitext
text/x-wiki
''See [[Santa Modesta Penal Code|Penal Code]]''
{| class="wikitable"
!Citation
!
==='''TITLE 3. OF CRIMES BY AND AGAINST THE EXECUTIVE POWER OF THE STATE'''===
|-
|2 SM Stat. § 201
|
* (a) Every person who gives or offers any bribe to any executive officer in this state, with intent to influence him in respect to any act, decision, vote, opinion, or other proceeding as such officer, is disqualified from holding any office in this state.
|-
|2 SM.Stat. § 202
|
* (a) Every executive or ministerial officer, employee, or appointee of the State of Santa Modesta, or any county or city therein, or any political subdivision thereof, who knowingly asks, receives, or agrees to receive any emolument, gratuity, or reward, or any promise thereof excepting such as may be authorized by law for doing an official act, is guilty of a misdemeanor
|-
|2 SM.Stat. § 203
|
* (a) Every person who knowingly and willingly threatens the life of, or threatens serious bodily harm to, any elected public official, exempt appointee of the Governor, judge, or the staff of any elected public official, with the specific intent that the statement is to be taken as a threat, and the apparent ability to carry out that threat by any means, is guilty of a public offense, punishable as follows:
** (1) The offense is punishable by a fine not exceeding five thousand dollars ($5,000), or by imprisonment pursuant to subdivision (h) of Section 1170, or in a county jail not exceeding one year, or by both that fine and imprisonment.
|}
d072908792c0b48ce45a02a6ba761b56ff032051
Template:Santa Modesta law
10
290
710
694
2023-10-18T04:37:49Z
LamayII
2
wikitext
text/x-wiki
{{Sidebar with collapsible lists
| outertitle =
| title = [[Law of Santa Modesta|Santa Modesta law]]
|image = [[File:SMState_Seal.png|200px]]
|caption= Great Seal of Santa Modesta
| titlestyle = {{law sidebar style|title}}
| headingstyle = {{law sidebar style|heading}}
| listtitlestyle = {{law sidebar style|heading}}
| listclass = hlist
| bodyclass = hlist
| heading1 = [[Constitution of Santa Modesta|Constitution]]
|heading2=[[Santa Modesta Codes|Codes]]
|content2=
* [[Santa Modesta Civil Code|Civil]]
* [[Santa Modesta Code Procedure|Civil Procedure]]
* [[Santa Modesta Evidence Code|Evidence]]
* [[Santa Modesta Penal Code|Penal]]
* [[Santa Modesta Vehicle Code|Vehicle]]
|heading3=[[Courts of California|Courts of record]]
|content3=
* [[Supreme_Court_of_Santa_Modesta|Supreme Court]]
* [[Santa Modesta superior courts|Superior courts]]
|list6title=[[Santa Modesta Codified Statutes]]
|list6=
* [[Santa Modesta Vehicle Code|Vehicle Code]]
* [[Santa Modesta Penal Code|Penal Code]]
* [[Los Alameda County Ordinances]]
* [[Los Alameda Municipal Ordinances]]
|heading4=Acts of Congress
| content4 = [[Senate Assembly|Santa Modesta Senate Assembly]]
|list7title=[[Criminal law]]
|list7=
* [[Transient Nefariousness Defense Act of 1988]]
|list8title=[[Civil rights law]]
|list8=
* [[1996 Santa Modesta Proposition 209|Prop 209]] (public affirmative action ban)
* [[Santa Modesta Act to Save Lives|Act to Save Lives]]
* [[Santa Modesta_Art_Preservation_Act|Art Preservation Act]]
* [[Santa Modesta Celebrities Rights Act|Celebrities Rights Act]]
* [[Santa Modesta Fair Employment and Housing Act of 1959|Fair Employment and Housing Act]]
* [[Fair procedure]]
* [[Santa Modesta_Public_Records_Act|Public Records Act]]
* [[Santa Modesta Shield Law|Shield Law]]
* [[Pruneyard Shopping Center v. Robins|Free speech on privately owned property]]
* [[Unruh Civil Rights Act]]
}}
f5970ff3cdfb3efdadf49818d0f1611454ea8717
Template:State Portal
10
291
714
697
2023-10-18T16:51:23Z
LamayII
2
Penal Code link
wikitext
text/x-wiki
<h1 style="border-width:1px; border-style:solid; margin-top:3px; margin-bottom:0.5em; padding:0.2em 0.4em; font-size:120%; font-weight:bold; font-family:inherit; background:#cef2e0; border-color: #a3bfb1; text-align: center">State of Santa Modesta Portal</h1>
<h2>State Laws and Legal Portal</h2>
{| class="wikitable"
|-
! [[Law of Santa Modesta]]
|-
| [[https://docs.google.com/spreadsheets/d/1xeaCaITHKdoy8Bt3J55KvBTY3V5F5y-hreJHJiIZT4g/edit#gid=842715947| Santa Modesta State Index]]
|-
| [[Santa_Modesta_Penal_Code|State Penal Code]]
|-
|-
! Judicial Process
|-
| [[Case_Laws|List of Case Laws and Legal Precedent]]
|}
<h2>Department Portal</h2>
{| class="wikitable"
|-
! [[Departments|Departments and Agencies in Santa Modesta]]
|-
|-
! State Agencies
|-
| [[Santa Modesta Highway Patrol]]
|-
| [[Department Of Justice|Santa Modesta Department of Justice]]
|-
| [[Santa Modesta Military Department]]
|-
| [[Santa Modesta Bureau of Investigation]]
|-
| [[Santa Modesta Office of the Attorney General]]
|-
| [[Peace Officer Standards and Training Commission]]
|-
! Local Agencies
|-
|
===[[Los Alameda County]]===
|-
| [[Los Alameda County Sheriff's Department]]
|-
| [[Los Alameda County Fire Department]]
|-
| [[Los Alameda Police Department]]
|-
|}
2c741299bd71ee836c5fb1c7e622e1a2ab6c264c
Los Alameda County Sheriff's Department
0
8
715
701
2023-10-18T17:22:11Z
LamayII
2
Infobox changes
wikitext
text/x-wiki
{{Infobox law enforcement agency
|agencyname=County of Los Alameda Sheriff's Department
|motto="A tradition of service."
|formedyear=1850
|budget=>~ 100 Employees
|legaljuris=County law enforcement
|headquarters=Carrington
|chief1name=Canada_Enforcer|chief1position=Sheriff
|badge=LASD Badge.png|badgecaption=''Badge of an LASD Sheriff's Deputy''|patch=LASD_Patch.png|patchcaption=Patch|chief2position=Undersheriff|chief2name=AvrahamLinkin|airbases=LASD Aero Bureau, Carrington Smith Airport|police=yes|stations=28|commonname=Los Alameda County Sheriff's Department|abbreviation=LASD|aircraft1=Aerocopter ES480|aircraft1type=Helicopters|vehicles1=* LASD Novato
* LASD Convictor
* LASD CPIU Pioneer|vehicle1type=Department Vehicles|unittype=Specialized Units|unitname=* Operation Safe Streets (OSS)
* Special Enforcement Bureau (SEB)}}
The '''Los Alameda County Sheriff's Department (LASD)''', officially the '''County of Los Alameda Sheriff's Department''' is a law enforcement agency within the State of Santa Modesta serving Los Alameda County. LASD is the largest law enforcement agency in the state. Since the department’s formation in 1850, the County of Los Alameda Sheriff’s Department has taken the responsibilities of providing contracted municipal police services within unincorporated communities of Los Alameda County, provide courthouse security for the Superior Court of Los Alameda County, and regulate the housing and transportation services of inmates within the county jail system.
==History==
[[Category:Departments]]
7f5d386979639d6d2473c44888640ec13dd686c0
716
715
2023-10-18T17:23:18Z
LamayII
2
removed gen nature
wikitext
text/x-wiki
{{Infobox law enforcement agency
|agencyname=County of Los Alameda Sheriff's Department
|motto="A tradition of service."
|formedyear=1850
|budget=>~ 100 Employees
|legaljuris=County law enforcement
|headquarters=Carrington
|chief1name=Canada_Enforcer|chief1position=Sheriff
|badge=LASD Badge.png|badgecaption=''Badge of an LASD Sheriff's Deputy''|patch=LASD_Patch.png|patchcaption=Patch|chief2position=Undersheriff|chief2name=AvrahamLinkin|airbases=LASD Aero Bureau, Carrington Smith Airport|stations=28|commonname=Los Alameda County Sheriff's Department|abbreviation=LASD|aircraft1=Aerocopter ES480|aircraft1type=Helicopters|vehicles1=* LASD Novato
* LASD Convictor
* LASD CPIU Pioneer|vehicle1type=Department Vehicles|unittype=Specialized Units|unitname=* Operation Safe Streets (OSS)
* Special Enforcement Bureau (SEB)}}
The '''Los Alameda County Sheriff's Department (LASD)''', officially the '''County of Los Alameda Sheriff's Department''' is a law enforcement agency within the State of Santa Modesta serving Los Alameda County. LASD is the largest law enforcement agency in the state. Since the department’s formation in 1850, the County of Los Alameda Sheriff’s Department has taken the responsibilities of providing contracted municipal police services within unincorporated communities of Los Alameda County, provide courthouse security for the Superior Court of Los Alameda County, and regulate the housing and transportation services of inmates within the county jail system.
==History==
[[Category:Departments]]
bfe093cec7b50eb7356f1b84e6b829e3558f1444